@westpac/ui 0.16.0 → 0.18.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 +12 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/accordion.component.d.ts +2 -1
- package/dist/components/autocomplete/autocomplete.component.js +4 -2
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.js +1 -1
- package/dist/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.js +2 -1
- package/dist/components/badge/badge.component.js +3 -1
- package/dist/components/badge/badge.styles.js +1 -1
- package/dist/components/bottom-sheet/bottom-sheet.component.d.ts +1 -1
- package/dist/components/bottom-sheet/bottom-sheet.component.js +7 -2
- package/dist/components/bottom-sheet/bottom-sheet.types.d.ts +20 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.d.ts +1 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.js +26 -11
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.d.ts +47 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.js +20 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.d.ts +17 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.d.ts +1 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.js +8 -14
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.d.ts +11 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.js +17 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.d.ts +0 -5
- package/dist/components/button-group/button-group.component.js +58 -11
- package/dist/components/button-group/button-group.types.d.ts +9 -1
- package/dist/components/button-group/components/button-group-button/button-group-button.component.js +1 -2
- package/dist/components/checkbox-group/checkbox-group.component.js +61 -10
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +5 -1
- package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.js +1 -2
- package/dist/components/date-picker/date-picker.types.d.ts +1 -0
- package/dist/components/error-message/error-message.types.d.ts +3 -2
- package/dist/components/icon/components/x-icon.d.ts +2 -0
- package/dist/components/icon/components/x-icon.js +40 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/list/components/list-item/list-item.component.d.ts +1 -1
- package/dist/components/list/list.utils.d.ts +1 -1
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.component.js +4 -2
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.d.ts +10 -0
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.js +7 -2
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.js +7 -2
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.d.ts +43 -5
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.js +30 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.d.ts +1 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.js +21 -4
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.d.ts +47 -5
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.js +32 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.d.ts +16 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.d.ts +2 -1
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.js +11 -2
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.d.ts +18 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +16 -7
- package/dist/components/modal/components/modal-dialog/modal-dialog.types.d.ts +6 -0
- package/dist/components/popover/components/panel/panel.styles.js +2 -2
- package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js +1 -2
- package/dist/components/radio-group/radio-group.component.js +58 -11
- package/dist/components/radio-group/radio-group.types.d.ts +5 -1
- package/dist/components/repeater/repeater.component.js +4 -2
- package/dist/components/selector/components/selector-button-group/selector-button-group.component.js +9 -7
- package/dist/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.js +50 -1
- package/dist/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.js +1 -1
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js +58 -11
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.types.d.ts +5 -1
- package/dist/components/tabs/components/tabs-tab/tabs-tab.component.js +1 -1
- package/dist/components/tabs/tabs.component.d.ts +6 -2
- package/dist/components/tabs/tabs.component.js +7 -1
- package/dist/constants/message.d.ts +1 -0
- package/dist/constants/message.js +1 -0
- package/dist/css/westpac-ui.css +192 -100
- package/dist/css/westpac-ui.min.css +192 -100
- package/package.json +10 -10
- package/src/components/accordion/accordion.component.tsx +3 -3
- package/src/components/accordion/components/accordion-item/accordion-item.component.tsx +2 -2
- package/src/components/autocomplete/autocomplete.component.tsx +5 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.component.tsx +1 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.ts +1 -1
- package/src/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.tsx +4 -1
- package/src/components/badge/badge.component.tsx +2 -1
- package/src/components/badge/badge.styles.ts +1 -1
- package/src/components/bottom-sheet/bottom-sheet.component.tsx +20 -2
- package/src/components/bottom-sheet/bottom-sheet.types.ts +20 -0
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.tsx +33 -14
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.ts +16 -0
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.ts +17 -1
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.tsx +11 -26
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.ts +14 -0
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.ts +0 -5
- package/src/components/button-group/button-group.component.tsx +58 -11
- package/src/components/button-group/button-group.types.ts +9 -2
- package/src/components/button-group/components/button-group-button/button-group-button.component.tsx +1 -2
- package/src/components/checkbox-group/checkbox-group.component.tsx +62 -10
- package/src/components/checkbox-group/checkbox-group.types.ts +5 -1
- package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.tsx +1 -2
- package/src/components/date-picker/date-picker.types.ts +4 -0
- package/src/components/error-message/error-message.component.tsx +2 -2
- package/src/components/error-message/error-message.types.ts +2 -1
- package/src/components/icon/components/x-icon.tsx +37 -0
- package/src/components/icon/index.ts +1 -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 +7 -2
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.tsx +6 -2
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.ts +15 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.tsx +25 -4
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.ts +15 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.ts +16 -0
- package/src/components/modal/components/modal-dialog/modal-dialog.component.tsx +10 -3
- package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +14 -5
- package/src/components/modal/components/modal-dialog/modal-dialog.types.ts +7 -0
- package/src/components/pagination/pagination.component.tsx +6 -6
- package/src/components/popover/components/panel/panel.styles.ts +2 -2
- package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx +1 -2
- package/src/components/radio-group/radio-group.component.tsx +57 -13
- package/src/components/radio-group/radio-group.types.ts +5 -1
- package/src/components/repeater/repeater.component.tsx +2 -0
- package/src/components/selector/components/selector-button-group/selector-button-group.component.tsx +10 -7
- package/src/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.tsx +49 -0
- package/src/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.tsx +1 -1
- package/src/components/selector/components/selector-radio-group/selector-radio-group.component.tsx +58 -11
- package/src/components/selector/components/selector-radio-group/selector-radio-group.types.ts +5 -1
- package/src/components/tabs/components/tabs-tab/tabs-tab.component.tsx +1 -1
- package/src/components/tabs/tabs.component.tsx +26 -5
- package/src/constants/message.ts +1 -0
- package/src/tailwind/utils/create-font-sizes.ts +11 -8
- package/src/tailwind/utils/generate-font-components.ts +18 -15
- package/src/tailwind/utils/generate-form-control.ts +11 -8
- package/dist/components/icon/components/twitter-icon.d.ts +0 -2
- package/dist/components/icon/components/twitter-icon.js +0 -35
- package/src/components/icon/components/twitter-icon.tsx +0 -37
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { HTMLAttributes
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { AriaFieldProps } from 'react-aria';
|
|
2
3
|
export type ErrorMessageProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Icon
|
|
@@ -7,7 +8,7 @@ export type ErrorMessageProps = {
|
|
|
7
8
|
/**
|
|
8
9
|
* Message or messages
|
|
9
10
|
*/
|
|
10
|
-
message?:
|
|
11
|
+
message?: AriaFieldProps['errorMessage'];
|
|
11
12
|
/**
|
|
12
13
|
* Tag to render
|
|
13
14
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
import React, { Fragment } from 'react';
|
|
16
|
+
import { Icon } from '../icon.component.js';
|
|
17
|
+
export function XIcon({ look ='filled' , 'aria-label': ariaLabel = 'X' , copyrightYear ='2024' , ...props }) {
|
|
18
|
+
return React.createElement(Icon, _extends({
|
|
19
|
+
"aria-label": ariaLabel,
|
|
20
|
+
copyrightYear: copyrightYear
|
|
21
|
+
}, props), look === 'filled' ? React.createElement(Fragment, null, React.createElement("path", {
|
|
22
|
+
fill: "currentColor",
|
|
23
|
+
d: "M15.815 19.008h2.12L8.178 5.04h-2.12l9.757 13.968Z"
|
|
24
|
+
}), React.createElement("path", {
|
|
25
|
+
fill: "currentColor",
|
|
26
|
+
"fill-rule": "evenodd",
|
|
27
|
+
d: "M2 0a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2Zm17.315 4-5.824 6.775L19.825 20h-4.659l-4.265-6.212L5.56 20H4.18l6.107-7.104L4.18 4H8.84l4.039 5.883L17.935 4h1.38Z",
|
|
28
|
+
"clip-rule": "evenodd"
|
|
29
|
+
})) : React.createElement(Fragment, null, React.createElement("path", {
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
"fill-rule": "evenodd",
|
|
32
|
+
d: "m19.315 4-5.824 6.775L19.825 20h-4.659l-4.265-6.212L5.56 20H4.18l6.107-7.104L4.18 4H8.84l4.039 5.883L17.935 4h1.38Zm-3.5 15.008h2.12L8.178 5.04h-2.12l9.757 13.968Z",
|
|
33
|
+
"clip-rule": "evenodd"
|
|
34
|
+
}), React.createElement("path", {
|
|
35
|
+
fill: "currentColor",
|
|
36
|
+
"fill-rule": "evenodd",
|
|
37
|
+
d: "M0 2a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2v20a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2Zm2 0h20v20H2V2Z",
|
|
38
|
+
"clip-rule": "evenodd"
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
@@ -211,7 +211,6 @@ export { TransferIcon } from './components/transfer-icon.js';
|
|
|
211
211
|
export { TransportIcon } from './components/transport-icon.js';
|
|
212
212
|
export { TravelExploreIcon } from './components/travel-explore-icon.js';
|
|
213
213
|
export { TuneIcon } from './components/tune-icon.js';
|
|
214
|
-
export { TwitterIcon } from './components/twitter-icon.js';
|
|
215
214
|
export { UmbrellaIcon } from './components/umbrella-icon.js';
|
|
216
215
|
export { UploadIcon } from './components/upload-icon.js';
|
|
217
216
|
export { VerifiedIcon } from './components/verified-icon.js';
|
|
@@ -229,6 +228,7 @@ export { WindowsNewIcon } from './components/windows-new-icon.js';
|
|
|
229
228
|
export { WineGlassIcon } from './components/wine-glass-icon.js';
|
|
230
229
|
export { WordFileIcon } from './components/word-file-icon.js';
|
|
231
230
|
export { WriteIcon } from './components/write-icon.js';
|
|
231
|
+
export { XIcon } from './components/x-icon.js';
|
|
232
232
|
export { YammerIcon } from './components/yammer-icon.js';
|
|
233
233
|
export { YoutubeIcon } from './components/youtube-icon.js';
|
|
234
234
|
export { ZipFileIcon } from './components/zip-file-icon.js';
|
|
@@ -211,7 +211,6 @@ export { TransferIcon } from './components/transfer-icon.js';
|
|
|
211
211
|
export { TransportIcon } from './components/transport-icon.js';
|
|
212
212
|
export { TravelExploreIcon } from './components/travel-explore-icon.js';
|
|
213
213
|
export { TuneIcon } from './components/tune-icon.js';
|
|
214
|
-
export { TwitterIcon } from './components/twitter-icon.js';
|
|
215
214
|
export { UmbrellaIcon } from './components/umbrella-icon.js';
|
|
216
215
|
export { UploadIcon } from './components/upload-icon.js';
|
|
217
216
|
export { VerifiedIcon } from './components/verified-icon.js';
|
|
@@ -229,6 +228,7 @@ export { WindowsNewIcon } from './components/windows-new-icon.js';
|
|
|
229
228
|
export { WineGlassIcon } from './components/wine-glass-icon.js';
|
|
230
229
|
export { WordFileIcon } from './components/word-file-icon.js';
|
|
231
230
|
export { WriteIcon } from './components/write-icon.js';
|
|
231
|
+
export { XIcon } from './components/x-icon.js';
|
|
232
232
|
export { YammerIcon } from './components/yammer-icon.js';
|
|
233
233
|
export { YoutubeIcon } from './components/youtube-icon.js';
|
|
234
234
|
export { ZipFileIcon } from './components/zip-file-icon.js';
|
|
@@ -9,5 +9,5 @@ export declare const ListItem: React.ForwardRefExoticComponent<{
|
|
|
9
9
|
nested?: number | undefined;
|
|
10
10
|
spacing?: "medium" | "large" | undefined;
|
|
11
11
|
target?: React.HTMLAttributeAnchorTarget | undefined;
|
|
12
|
-
type?: "link" | "icon" | "
|
|
12
|
+
type?: "link" | "icon" | "ordered" | "bullet" | "tick" | "cross" | "unstyled" | undefined;
|
|
13
13
|
} & React.HTMLAttributes<Element> & React.RefAttributes<unknown>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
2
|
import { GetStateValuesProps } from './list.types.js';
|
|
3
3
|
export declare const getStateValues: (props: GetStateValuesProps) => {
|
|
4
|
-
type: "link" | "icon" | "
|
|
4
|
+
type: "link" | "icon" | "ordered" | "bullet" | "tick" | "cross" | "unstyled";
|
|
5
5
|
look: "link" | "primary" | "hero" | "success" | "danger" | "neutral";
|
|
6
6
|
spacing: "medium" | "large";
|
|
7
7
|
icon: ((props: import("../icon/icon.types.js").IconProps) => JSX.Element) | undefined;
|
|
@@ -20,14 +20,16 @@ export function ModalBackdrop({ zIndex =100 , portalContainer , size , ...props
|
|
|
20
20
|
const ref = useRef(null);
|
|
21
21
|
const styles = backdropStyles({
|
|
22
22
|
className,
|
|
23
|
-
fullscreen: size === 'full'
|
|
23
|
+
fullscreen: size === 'full',
|
|
24
|
+
fluid: size === 'fluid'
|
|
24
25
|
});
|
|
25
26
|
const { modalProps , underlayProps } = useModalOverlay(props, state, ref);
|
|
26
27
|
if (!state.isOpen) {
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
30
|
+
const brandContainer = document.querySelector('[data-theme]') || document.querySelector('[className="data-theme"]');
|
|
29
31
|
return React.createElement(Overlay, {
|
|
30
|
-
portalContainer: portalContainer
|
|
32
|
+
portalContainer: portalContainer || brandContainer || document.body
|
|
31
33
|
}, React.createElement("div", _extends({
|
|
32
34
|
style: {
|
|
33
35
|
zIndex
|
|
@@ -5,6 +5,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
5
5
|
base: string;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
+
fluid: {
|
|
9
|
+
true: {
|
|
10
|
+
modal: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
8
13
|
}, {
|
|
9
14
|
base: string;
|
|
10
15
|
modal: string;
|
|
@@ -15,6 +20,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
15
20
|
base: string;
|
|
16
21
|
};
|
|
17
22
|
};
|
|
23
|
+
fluid: {
|
|
24
|
+
true: {
|
|
25
|
+
modal: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
18
28
|
}, {
|
|
19
29
|
base: string;
|
|
20
30
|
modal: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'fixed inset-0 z-50 flex animate-fadeIn justify-center overflow-y-auto bg-black/50 p-2',
|
|
5
|
-
modal: 'relative top-
|
|
4
|
+
base: 'fixed inset-0 z-50 flex animate-fadeIn items-center justify-center overflow-y-auto bg-black/50 p-2',
|
|
5
|
+
modal: 'relative top-3 z-10 h-fit w-full animate-fadeInDown'
|
|
6
6
|
},
|
|
7
7
|
variants: {
|
|
8
8
|
fullscreen: {
|
|
@@ -10,6 +10,11 @@ export const styles = tv({
|
|
|
10
10
|
modal: 'top-0 flex flex-1 flex-col',
|
|
11
11
|
base: 'flex flex-col p-0'
|
|
12
12
|
}
|
|
13
|
+
},
|
|
14
|
+
fluid: {
|
|
15
|
+
true: {
|
|
16
|
+
modal: 'px-2'
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
});
|
|
@@ -13,10 +13,15 @@ function _extends() {
|
|
|
13
13
|
return _extends.apply(this, arguments);
|
|
14
14
|
}
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { useModalDialogContext } from '../../modal-dialog.component.js';
|
|
17
|
+
import { styles as modalBodyStyles } from './modal-dialog-body.styles.js';
|
|
17
18
|
export function ModalDialogBody({ className , children , ...props }) {
|
|
19
|
+
const { size } = useModalDialogContext();
|
|
20
|
+
const styles = modalBodyStyles({
|
|
21
|
+
size
|
|
22
|
+
});
|
|
18
23
|
return React.createElement("div", _extends({
|
|
19
|
-
className: styles({
|
|
24
|
+
className: styles.base({
|
|
20
25
|
className
|
|
21
26
|
})
|
|
22
27
|
}, props), children);
|
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
export declare const styles: import("tailwind-variants").TVReturnType<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
full: {
|
|
4
|
+
base: string;
|
|
5
|
+
};
|
|
6
|
+
lg: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
md: {
|
|
10
|
+
base: string;
|
|
11
|
+
};
|
|
12
|
+
sm: {
|
|
13
|
+
base: string;
|
|
14
|
+
};
|
|
15
|
+
fluid: {
|
|
16
|
+
base: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}, {
|
|
20
|
+
base: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
responsiveVariants: string[];
|
|
23
|
+
}, {
|
|
24
|
+
size: {
|
|
25
|
+
full: {
|
|
26
|
+
base: string;
|
|
27
|
+
};
|
|
28
|
+
lg: {
|
|
29
|
+
base: string;
|
|
30
|
+
};
|
|
31
|
+
md: {
|
|
32
|
+
base: string;
|
|
33
|
+
};
|
|
34
|
+
sm: {
|
|
35
|
+
base: string;
|
|
36
|
+
};
|
|
37
|
+
fluid: {
|
|
38
|
+
base: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
base: string;
|
|
43
|
+
}>;
|
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'flex-1 overflow-auto'
|
|
5
|
+
},
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
full: {
|
|
9
|
+
base: 'px-4 py-3'
|
|
10
|
+
},
|
|
11
|
+
lg: {
|
|
12
|
+
base: 'px-12 pb-12'
|
|
13
|
+
},
|
|
14
|
+
md: {
|
|
15
|
+
base: 'px-7 pb-7'
|
|
16
|
+
},
|
|
17
|
+
sm: {
|
|
18
|
+
base: 'px-5 pb-7'
|
|
19
|
+
},
|
|
20
|
+
fluid: {
|
|
21
|
+
base: 'px-5 pb-7'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
responsiveVariants: [
|
|
27
|
+
'xsl',
|
|
28
|
+
'sm',
|
|
29
|
+
'md',
|
|
30
|
+
'lg',
|
|
31
|
+
'xl'
|
|
32
|
+
]
|
|
4
33
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type ModalDialogFooterProps } from './modal-dialog-footer.types.js';
|
|
2
|
-
export declare function ModalDialogFooter({ className,
|
|
2
|
+
export declare function ModalDialogFooter({ className, primaryLabel, primaryOnClick, secondaryLabel, secondaryOnClick, ...props }: ModalDialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
function _extends() {
|
|
2
3
|
_extends = Object.assign || function(target) {
|
|
3
4
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -13,11 +14,27 @@ function _extends() {
|
|
|
13
14
|
return _extends.apply(this, arguments);
|
|
14
15
|
}
|
|
15
16
|
import React from 'react';
|
|
16
|
-
import {
|
|
17
|
-
|
|
17
|
+
import { Button } from '../../../../../button/index.js';
|
|
18
|
+
import { useModalDialogContext } from '../../modal-dialog.component.js';
|
|
19
|
+
import { styles as modalFooterStyles } from './modal-dialog-footer.styles.js';
|
|
20
|
+
export function ModalDialogFooter({ className , primaryLabel , primaryOnClick , secondaryLabel , secondaryOnClick , ...props }) {
|
|
21
|
+
const { size } = useModalDialogContext();
|
|
22
|
+
const styles = modalFooterStyles({
|
|
23
|
+
size
|
|
24
|
+
});
|
|
18
25
|
return React.createElement("div", _extends({
|
|
19
|
-
className: styles({
|
|
26
|
+
className: styles.base({
|
|
20
27
|
className
|
|
21
28
|
})
|
|
22
|
-
}, props),
|
|
29
|
+
}, props), React.createElement(Button, {
|
|
30
|
+
look: "primary",
|
|
31
|
+
size: "large",
|
|
32
|
+
className: styles.primaryBtn(),
|
|
33
|
+
onClick: primaryOnClick
|
|
34
|
+
}, primaryLabel), secondaryLabel && React.createElement(Button, {
|
|
35
|
+
look: "link",
|
|
36
|
+
size: "large",
|
|
37
|
+
className: styles.secondaryBtn(),
|
|
38
|
+
onClick: secondaryOnClick
|
|
39
|
+
}, secondaryLabel));
|
|
23
40
|
}
|
|
@@ -1,5 +1,47 @@
|
|
|
1
|
-
export declare const styles: import("tailwind-variants").TVReturnType<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
full: {
|
|
4
|
+
base: string;
|
|
5
|
+
};
|
|
6
|
+
lg: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
md: {
|
|
10
|
+
base: string;
|
|
11
|
+
};
|
|
12
|
+
sm: {
|
|
13
|
+
base: string;
|
|
14
|
+
};
|
|
15
|
+
fluid: {
|
|
16
|
+
base: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}, {
|
|
20
|
+
base: string;
|
|
21
|
+
primaryBtn: string;
|
|
22
|
+
secondaryBtn: string;
|
|
23
|
+
}, undefined, {
|
|
24
|
+
responsiveVariants: string[];
|
|
25
|
+
}, {
|
|
26
|
+
size: {
|
|
27
|
+
full: {
|
|
28
|
+
base: string;
|
|
29
|
+
};
|
|
30
|
+
lg: {
|
|
31
|
+
base: string;
|
|
32
|
+
};
|
|
33
|
+
md: {
|
|
34
|
+
base: string;
|
|
35
|
+
};
|
|
36
|
+
sm: {
|
|
37
|
+
base: string;
|
|
38
|
+
};
|
|
39
|
+
fluid: {
|
|
40
|
+
base: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
base: string;
|
|
45
|
+
primaryBtn: string;
|
|
46
|
+
secondaryBtn: string;
|
|
47
|
+
}>;
|
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'flex gap-1',
|
|
5
|
+
primaryBtn: '',
|
|
6
|
+
secondaryBtn: 'no-underline hover:underline'
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
full: {
|
|
11
|
+
base: 'px-4 py-3'
|
|
12
|
+
},
|
|
13
|
+
lg: {
|
|
14
|
+
base: '-mt-6 px-12 pb-12'
|
|
15
|
+
},
|
|
16
|
+
md: {
|
|
17
|
+
base: '-mt-2 px-7 pb-7'
|
|
18
|
+
},
|
|
19
|
+
sm: {
|
|
20
|
+
base: '-mt-2 flex-col px-5 pb-5'
|
|
21
|
+
},
|
|
22
|
+
fluid: {
|
|
23
|
+
base: '-mt-2 px-5 pb-5 max-md:flex-col'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
responsiveVariants: [
|
|
29
|
+
'xsl',
|
|
30
|
+
'sm',
|
|
31
|
+
'md',
|
|
32
|
+
'lg',
|
|
33
|
+
'xl'
|
|
34
|
+
]
|
|
4
35
|
});
|
|
@@ -4,4 +4,20 @@ export type ModalDialogFooterProps = {
|
|
|
4
4
|
* Footer content
|
|
5
5
|
*/
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Label for primary button
|
|
9
|
+
*/
|
|
10
|
+
primaryLabel: string;
|
|
11
|
+
/**
|
|
12
|
+
* onClick for primary button
|
|
13
|
+
*/
|
|
14
|
+
primaryOnClick: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Label for secondary button
|
|
17
|
+
*/
|
|
18
|
+
secondaryLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* onClick for secondary button
|
|
21
|
+
*/
|
|
22
|
+
secondaryOnClick?: () => void;
|
|
7
23
|
} & HTMLAttributes<HTMLElement>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModalDialogBody } from './components/modal-dialog-body/index.js';
|
|
2
2
|
import { ModalDialogFooter } from './components/modal-dialog-footer/index.js';
|
|
3
|
-
import { type ModalDialogProps } from './modal-dialog.types.js';
|
|
3
|
+
import { ModalDialogContextValue, type ModalDialogProps } from './modal-dialog.types.js';
|
|
4
|
+
export declare const useModalDialogContext: () => ModalDialogContextValue;
|
|
4
5
|
/**
|
|
5
6
|
* @private
|
|
6
7
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
function _extends() {
|
|
2
3
|
_extends = Object.assign || function(target) {
|
|
3
4
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -12,12 +13,16 @@ function _extends() {
|
|
|
12
13
|
};
|
|
13
14
|
return _extends.apply(this, arguments);
|
|
14
15
|
}
|
|
15
|
-
import React, { useRef } from 'react';
|
|
16
|
+
import React, { createContext, useContext, useRef } from 'react';
|
|
16
17
|
import { useDialog, useFocusRing } from 'react-aria';
|
|
17
18
|
import { CloseIcon } from '../../../../components/icon/index.js';
|
|
18
19
|
import { ModalDialogBody } from './components/modal-dialog-body/index.js';
|
|
19
20
|
import { ModalDialogFooter } from './components/modal-dialog-footer/index.js';
|
|
20
21
|
import { styles as dialogStyles } from './modal-dialog.styles.js';
|
|
22
|
+
const ModalDialogContext = createContext({
|
|
23
|
+
size: 'md'
|
|
24
|
+
});
|
|
25
|
+
export const useModalDialogContext = ()=>useContext(ModalDialogContext);
|
|
21
26
|
export function ModalDialog({ className , body , onClose , size ='md' , ...props }) {
|
|
22
27
|
const { children } = props;
|
|
23
28
|
const { isFocusVisible , focusProps } = useFocusRing();
|
|
@@ -41,7 +46,11 @@ export function ModalDialog({ className , body , onClose , size ='md' , ...props
|
|
|
41
46
|
size: "small"
|
|
42
47
|
})), props.title && React.createElement("h3", _extends({}, titleProps, {
|
|
43
48
|
className: styles.title()
|
|
44
|
-
}), props.title),
|
|
49
|
+
}), props.title), React.createElement(ModalDialogContext.Provider, {
|
|
50
|
+
value: {
|
|
51
|
+
size
|
|
52
|
+
}
|
|
53
|
+
}, body ? React.createElement(ModalDialogBody, null, children) : children));
|
|
45
54
|
}
|
|
46
55
|
ModalDialog.Body = ModalDialogBody;
|
|
47
56
|
ModalDialog.Footer = ModalDialogFooter;
|
|
@@ -2,15 +2,24 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
2
2
|
size: {
|
|
3
3
|
full: {
|
|
4
4
|
base: string;
|
|
5
|
+
close: string;
|
|
6
|
+
title: string;
|
|
5
7
|
};
|
|
6
8
|
lg: {
|
|
7
9
|
base: string;
|
|
10
|
+
title: string;
|
|
8
11
|
};
|
|
9
12
|
md: {
|
|
10
13
|
base: string;
|
|
14
|
+
title: string;
|
|
11
15
|
};
|
|
12
16
|
sm: {
|
|
13
17
|
base: string;
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
fluid: {
|
|
21
|
+
base: string;
|
|
22
|
+
title: string;
|
|
14
23
|
};
|
|
15
24
|
};
|
|
16
25
|
isFocusVisible: {
|
|
@@ -31,15 +40,24 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
31
40
|
size: {
|
|
32
41
|
full: {
|
|
33
42
|
base: string;
|
|
43
|
+
close: string;
|
|
44
|
+
title: string;
|
|
34
45
|
};
|
|
35
46
|
lg: {
|
|
36
47
|
base: string;
|
|
48
|
+
title: string;
|
|
37
49
|
};
|
|
38
50
|
md: {
|
|
39
51
|
base: string;
|
|
52
|
+
title: string;
|
|
40
53
|
};
|
|
41
54
|
sm: {
|
|
42
55
|
base: string;
|
|
56
|
+
title: string;
|
|
57
|
+
};
|
|
58
|
+
fluid: {
|
|
59
|
+
base: string;
|
|
60
|
+
title: string;
|
|
43
61
|
};
|
|
44
62
|
};
|
|
45
63
|
isFocusVisible: {
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'relative mx-auto flex max-w-full flex-col overflow-hidden rounded bg-white outline-none',
|
|
5
|
-
title: '
|
|
6
|
-
close: 'absolute right-
|
|
4
|
+
base: 'relative mx-auto flex max-w-full flex-col overflow-hidden rounded bg-white text-text outline-none',
|
|
5
|
+
title: 'typography-body-7 pb-4 pt-9 font-bold text-text',
|
|
6
|
+
close: 'absolute right-0 top-0 block p-3'
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
10
10
|
full: {
|
|
11
|
-
base: 'max-h-screen w-full flex-1'
|
|
11
|
+
base: 'max-h-screen w-full flex-1',
|
|
12
|
+
close: 'p-2',
|
|
13
|
+
title: 'px-4 py-3'
|
|
12
14
|
},
|
|
13
15
|
lg: {
|
|
14
|
-
base: 'w-[
|
|
16
|
+
base: 'w-[50rem]',
|
|
17
|
+
title: 'px-12 pt-12'
|
|
15
18
|
},
|
|
16
19
|
md: {
|
|
17
|
-
base: 'w-[37.5rem]'
|
|
20
|
+
base: 'w-[37.5rem]',
|
|
21
|
+
title: 'px-7 '
|
|
18
22
|
},
|
|
19
23
|
sm: {
|
|
20
|
-
base: 'w-[
|
|
24
|
+
base: 'w-[25rem]',
|
|
25
|
+
title: 'px-5'
|
|
26
|
+
},
|
|
27
|
+
fluid: {
|
|
28
|
+
base: 'w-full',
|
|
29
|
+
title: 'px-5'
|
|
21
30
|
}
|
|
22
31
|
},
|
|
23
32
|
isFocusVisible: {
|
|
@@ -6,8 +6,8 @@ export const styles = tv({
|
|
|
6
6
|
arrow: 'absolute h-0 w-0 border-x-[8px] border-t-[12px] border-x-[transparent] border-t-muted after:absolute after:h-0 after:w-0 after:border-x-[7px] after:border-t-[11px] after:border-x-[transparent] after:border-t-white',
|
|
7
7
|
closeBtn: 'absolute right-1 top-1 m-1 p-0 hover:opacity-80',
|
|
8
8
|
content: 'w-[17.625rem] py-4 pl-3 pr-5',
|
|
9
|
-
heading: 'typography-body-9 mb-2 font-bold',
|
|
10
|
-
body: 'typography-body-10'
|
|
9
|
+
heading: 'typography-body-9 mb-2 font-bold text-text',
|
|
10
|
+
body: 'typography-body-10 text-text'
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
placement: {
|
package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js
CHANGED
|
@@ -18,8 +18,7 @@ import { VisuallyHidden, useFocusRing, useRadio } from 'react-aria';
|
|
|
18
18
|
import { RadioGroupContext } from '../../radio-group.component.js';
|
|
19
19
|
import { styles as radioStyles } from './radio-group-radio.styles.js';
|
|
20
20
|
function BaseRadioGroupRadio({ className , hint , label , ...props }, ref) {
|
|
21
|
-
const state = useContext(RadioGroupContext);
|
|
22
|
-
const { size , orientation } = state;
|
|
21
|
+
const { state , size , orientation } = useContext(RadioGroupContext);
|
|
23
22
|
const localRef = useRef(null);
|
|
24
23
|
const { inputProps , isSelected , isDisabled } = useRadio({
|
|
25
24
|
...props,
|