@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.
Files changed (127) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/component-type.json +1 -1
  3. package/dist/components/accordion/accordion.component.d.ts +2 -1
  4. package/dist/components/autocomplete/autocomplete.component.js +4 -2
  5. package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.d.ts +1 -1
  6. package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.js +1 -1
  7. package/dist/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.js +2 -1
  8. package/dist/components/badge/badge.component.js +3 -1
  9. package/dist/components/badge/badge.styles.js +1 -1
  10. package/dist/components/bottom-sheet/bottom-sheet.component.d.ts +1 -1
  11. package/dist/components/bottom-sheet/bottom-sheet.component.js +7 -2
  12. package/dist/components/bottom-sheet/bottom-sheet.types.d.ts +20 -0
  13. package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.d.ts +1 -1
  14. package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.js +26 -11
  15. package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.d.ts +47 -0
  16. package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.js +20 -0
  17. package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.d.ts +17 -1
  18. package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.d.ts +1 -1
  19. package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.js +8 -14
  20. package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.d.ts +11 -0
  21. package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.js +17 -0
  22. package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.d.ts +0 -5
  23. package/dist/components/button-group/button-group.component.js +58 -11
  24. package/dist/components/button-group/button-group.types.d.ts +9 -1
  25. package/dist/components/button-group/components/button-group-button/button-group-button.component.js +1 -2
  26. package/dist/components/checkbox-group/checkbox-group.component.js +61 -10
  27. package/dist/components/checkbox-group/checkbox-group.types.d.ts +5 -1
  28. package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.js +1 -2
  29. package/dist/components/date-picker/date-picker.types.d.ts +1 -0
  30. package/dist/components/error-message/error-message.types.d.ts +3 -2
  31. package/dist/components/icon/components/x-icon.d.ts +2 -0
  32. package/dist/components/icon/components/x-icon.js +40 -0
  33. package/dist/components/icon/index.d.ts +1 -1
  34. package/dist/components/icon/index.js +1 -1
  35. package/dist/components/list/components/list-item/list-item.component.d.ts +1 -1
  36. package/dist/components/list/list.utils.d.ts +1 -1
  37. package/dist/components/modal/components/modal-backdrop/modal-backdrop.component.js +4 -2
  38. package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.d.ts +10 -0
  39. package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.js +7 -2
  40. package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.js +7 -2
  41. package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.d.ts +43 -5
  42. package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.js +30 -1
  43. package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.d.ts +1 -1
  44. package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.js +21 -4
  45. package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.d.ts +47 -5
  46. package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.js +32 -1
  47. package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.d.ts +16 -0
  48. package/dist/components/modal/components/modal-dialog/modal-dialog.component.d.ts +2 -1
  49. package/dist/components/modal/components/modal-dialog/modal-dialog.component.js +11 -2
  50. package/dist/components/modal/components/modal-dialog/modal-dialog.styles.d.ts +18 -0
  51. package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +16 -7
  52. package/dist/components/modal/components/modal-dialog/modal-dialog.types.d.ts +6 -0
  53. package/dist/components/popover/components/panel/panel.styles.js +2 -2
  54. package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js +1 -2
  55. package/dist/components/radio-group/radio-group.component.js +58 -11
  56. package/dist/components/radio-group/radio-group.types.d.ts +5 -1
  57. package/dist/components/repeater/repeater.component.js +4 -2
  58. package/dist/components/selector/components/selector-button-group/selector-button-group.component.js +9 -7
  59. package/dist/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.js +50 -1
  60. package/dist/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.js +1 -1
  61. package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js +58 -11
  62. package/dist/components/selector/components/selector-radio-group/selector-radio-group.types.d.ts +5 -1
  63. package/dist/components/tabs/components/tabs-tab/tabs-tab.component.js +1 -1
  64. package/dist/components/tabs/tabs.component.d.ts +6 -2
  65. package/dist/components/tabs/tabs.component.js +7 -1
  66. package/dist/constants/message.d.ts +1 -0
  67. package/dist/constants/message.js +1 -0
  68. package/dist/css/westpac-ui.css +192 -100
  69. package/dist/css/westpac-ui.min.css +192 -100
  70. package/package.json +10 -10
  71. package/src/components/accordion/accordion.component.tsx +3 -3
  72. package/src/components/accordion/components/accordion-item/accordion-item.component.tsx +2 -2
  73. package/src/components/autocomplete/autocomplete.component.tsx +5 -1
  74. package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.component.tsx +1 -1
  75. package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.ts +1 -1
  76. package/src/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.tsx +4 -1
  77. package/src/components/badge/badge.component.tsx +2 -1
  78. package/src/components/badge/badge.styles.ts +1 -1
  79. package/src/components/bottom-sheet/bottom-sheet.component.tsx +20 -2
  80. package/src/components/bottom-sheet/bottom-sheet.types.ts +20 -0
  81. package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.tsx +33 -14
  82. package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.ts +16 -0
  83. package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.ts +17 -1
  84. package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.tsx +11 -26
  85. package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.ts +14 -0
  86. package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.ts +0 -5
  87. package/src/components/button-group/button-group.component.tsx +58 -11
  88. package/src/components/button-group/button-group.types.ts +9 -2
  89. package/src/components/button-group/components/button-group-button/button-group-button.component.tsx +1 -2
  90. package/src/components/checkbox-group/checkbox-group.component.tsx +62 -10
  91. package/src/components/checkbox-group/checkbox-group.types.ts +5 -1
  92. package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.tsx +1 -2
  93. package/src/components/date-picker/date-picker.types.ts +4 -0
  94. package/src/components/error-message/error-message.component.tsx +2 -2
  95. package/src/components/error-message/error-message.types.ts +2 -1
  96. package/src/components/icon/components/x-icon.tsx +37 -0
  97. package/src/components/icon/index.ts +1 -1
  98. package/src/components/modal/components/modal-backdrop/modal-backdrop.component.tsx +5 -2
  99. package/src/components/modal/components/modal-backdrop/modal-backdrop.styles.ts +7 -2
  100. package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.tsx +6 -2
  101. package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.ts +15 -3
  102. package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.tsx +25 -4
  103. package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.ts +15 -3
  104. package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.ts +16 -0
  105. package/src/components/modal/components/modal-dialog/modal-dialog.component.tsx +10 -3
  106. package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +14 -5
  107. package/src/components/modal/components/modal-dialog/modal-dialog.types.ts +7 -0
  108. package/src/components/pagination/pagination.component.tsx +6 -6
  109. package/src/components/popover/components/panel/panel.styles.ts +2 -2
  110. package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx +1 -2
  111. package/src/components/radio-group/radio-group.component.tsx +57 -13
  112. package/src/components/radio-group/radio-group.types.ts +5 -1
  113. package/src/components/repeater/repeater.component.tsx +2 -0
  114. package/src/components/selector/components/selector-button-group/selector-button-group.component.tsx +10 -7
  115. package/src/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.tsx +49 -0
  116. package/src/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.tsx +1 -1
  117. package/src/components/selector/components/selector-radio-group/selector-radio-group.component.tsx +58 -11
  118. package/src/components/selector/components/selector-radio-group/selector-radio-group.types.ts +5 -1
  119. package/src/components/tabs/components/tabs-tab/tabs-tab.component.tsx +1 -1
  120. package/src/components/tabs/tabs.component.tsx +26 -5
  121. package/src/constants/message.ts +1 -0
  122. package/src/tailwind/utils/create-font-sizes.ts +11 -8
  123. package/src/tailwind/utils/generate-font-components.ts +18 -15
  124. package/src/tailwind/utils/generate-form-control.ts +11 -8
  125. package/dist/components/icon/components/twitter-icon.d.ts +0 -2
  126. package/dist/components/icon/components/twitter-icon.js +0 -35
  127. package/src/components/icon/components/twitter-icon.tsx +0 -37
@@ -1,4 +1,5 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
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?: ReactNode | ReactNode[];
11
+ message?: AriaFieldProps['errorMessage'];
11
12
  /**
12
13
  * Tag to render
13
14
  */
@@ -0,0 +1,2 @@
1
+ import { type IconProps } from '../icon.types.js';
2
+ export declare function XIcon({ look, 'aria-label': ariaLabel, copyrightYear, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -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" | "bullet" | "tick" | "cross" | "unstyled" | "ordered" | undefined;
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" | "bullet" | "tick" | "cross" | "unstyled" | "ordered";
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-5 z-10 h-fit w-full animate-fadeInDown'
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 { styles } from './modal-dialog-body.styles.js';
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<import("tailwind-variants").TVVariantsDefault<undefined, "flex-1 overflow-auto px-4 py-3"> | {
2
- [x: string]: {
3
- [x: string]: import("tailwind-variants").ClassValue | import("tailwind-variants").SlotsClassValue<undefined, "flex-1 overflow-auto px-4 py-3">;
4
- } | undefined;
5
- } | {}, undefined, "flex-1 overflow-auto px-4 py-3", TVConfig<V, EV>, import("tailwind-variants").TVVariantsDefault<undefined, "flex-1 overflow-auto px-4 py-3"> | {}, undefined>;
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
- base: 'flex-1 overflow-auto px-4 py-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, children, ...props }: ModalDialogFooterProps): import("react/jsx-runtime").JSX.Element;
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 { styles } from './modal-dialog-footer.styles.js';
17
- export function ModalDialogFooter({ className , children , ...props }) {
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), children);
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<import("tailwind-variants").TVVariantsDefault<undefined, "border-t border-t-border bg-background px-3 py-2"> | {
2
- [x: string]: {
3
- [x: string]: import("tailwind-variants").ClassValue | import("tailwind-variants").SlotsClassValue<undefined, "border-t border-t-border bg-background px-3 py-2">;
4
- } | undefined;
5
- } | {}, undefined, "border-t border-t-border bg-background px-3 py-2", TVConfig<V, EV>, import("tailwind-variants").TVVariantsDefault<undefined, "border-t border-t-border bg-background px-3 py-2"> | {}, undefined>;
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
- base: 'border-t border-t-border bg-background px-3 py-2'
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), body ? React.createElement(ModalDialogBody, null, children) : children);
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: 'border-b border-b-heading pb-2 pl-4 pr-5 pt-3 text-lg font-medium',
6
- close: 'absolute right-1 top-1 block p-1'
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-[56.25rem]'
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-[18.75rem]'
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: {
@@ -33,4 +33,10 @@ export type ModalDialogProps = {
33
33
  */
34
34
  title?: string;
35
35
  } & AriaDialogProps;
36
+ export type ModalDialogContextValue = {
37
+ /**
38
+ * Size of dialog
39
+ */
40
+ size?: Variants['size'];
41
+ };
36
42
  export {};
@@ -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: {
@@ -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,