@westpac/ui 0.54.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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: "bottom start",
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
  */
@@ -1,4 +1,5 @@
1
1
  'use client';
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 }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westpac/ui",
3
- "version": "0.54.0",
3
+ "version": "0.55.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -205,18 +205,19 @@
205
205
  "!**/*.{test,spec,stories}.{ts,tsx,js,jsx}"
206
206
  ],
207
207
  "devDependencies": {
208
- "@chromatic-com/storybook": "^4.0.1",
208
+ "@chromatic-com/storybook": "^4.1.3",
209
209
  "@eslint/eslintrc": "~3.3.1",
210
210
  "@eslint/js": "~9.30.0",
211
211
  "@react-types/accordion": "3.0.0-alpha.14",
212
212
  "@react-types/combobox": "~3.13.6",
213
213
  "@react-types/shared": "~3.30.0",
214
214
  "@react-types/tabs": "~3.3.16",
215
- "@storybook/addon-a11y": "9.0.17",
216
- "@storybook/addon-docs": "9.0.17",
217
- "@storybook/addon-links": "9.0.17",
218
- "@storybook/addon-themes": "~9.0.17",
219
- "@storybook/react-vite": "9.0.17",
215
+ "@storybook/addon-a11y": "10.1.4",
216
+ "@storybook/addon-docs": "10.1.4",
217
+ "@storybook/addon-links": "10.1.4",
218
+ "@storybook/addon-mcp": "~0.1.4",
219
+ "@storybook/addon-themes": "~10.1.4",
220
+ "@storybook/react-vite": "10.1.4",
220
221
  "@swc/cli": "^0.1.62",
221
222
  "@swc/core": "^1.3.35",
222
223
  "@testing-library/jest-dom": "^5.16.5",
@@ -235,8 +236,8 @@
235
236
  "cross-env": "~7.0.3",
236
237
  "csstype": "~3.1.3",
237
238
  "eslint": "^9.32.0",
238
- "eslint-plugin-storybook": "~9.0.17",
239
- "glob": "~10.3.3",
239
+ "eslint-plugin-storybook": "~10.1.4",
240
+ "glob": "~10.5.0",
240
241
  "jsdom": "^22.1.0",
241
242
  "plop": "~3.1.2",
242
243
  "postcss": "~8.4.31",
@@ -247,17 +248,17 @@
247
248
  "react-docgen-typescript": "~2.2.2",
248
249
  "react-dom": "^18.2.0",
249
250
  "shx": "^0.3.4",
250
- "storybook": "9.0.17",
251
+ "storybook": "10.1.4",
251
252
  "tailwind-variants": "~0.2.1",
252
253
  "tailwindcss": "~3.4.15",
253
254
  "tailwindcss-themer": "~3.1.0",
254
255
  "ts-node": "~10.9.1",
255
256
  "typescript": "^5.5.4",
256
- "vite": "^7.0.5",
257
+ "vite": "^7.0.8",
257
258
  "vitest": "^3.2.4",
259
+ "@westpac/test-config": "~0.0.0",
258
260
  "@westpac/eslint-config": "~1.0.1",
259
- "@westpac/ts-config": "~0.0.0",
260
- "@westpac/test-config": "~0.0.0"
261
+ "@westpac/ts-config": "~0.0.0"
261
262
  },
262
263
  "dependencies": {
263
264
  "@duetds/date-picker": "~1.4.0",
@@ -285,6 +286,10 @@
285
286
  "tailwindcss": "~3.4.15",
286
287
  "tailwindcss-themer": "~3.1.0"
287
288
  },
289
+ "repository": {
290
+ "type": "git",
291
+ "url": "git+https://github.com/WestpacGEL/GEL-next.git"
292
+ },
288
293
  "scripts": {
289
294
  "dev": "pnpm build:watch",
290
295
  "clean": "shx rm -rf dist",
@@ -25,6 +25,7 @@ export function ButtonDropdown({
25
25
  soft = false,
26
26
  block = false,
27
27
  dropDownIcon: Icon = DropDownIcon,
28
+ placement = 'bottom start',
28
29
  shouldFlip,
29
30
  }: ButtonDropdownProps) {
30
31
  const ref = useRef<HTMLButtonElement & HTMLAnchorElement & HTMLSpanElement & HTMLDivElement>(null);
@@ -73,7 +74,7 @@ export function ButtonDropdown({
73
74
  {state.isOpen && (
74
75
  <ButtonDropdownPanel
75
76
  className={styles.panel({ className })}
76
- placement="bottom start"
77
+ placement={placement}
77
78
  triggerRef={ref}
78
79
  state={state}
79
80
  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
 
4
5
  import { ButtonProps } from '../button/index.js';
@@ -26,6 +27,10 @@ export type ButtonDropdownProps = {
26
27
  * State of whether the Popover is open
27
28
  */
28
29
  open?: boolean;
30
+ /**
31
+ * placement of the popover
32
+ */
33
+ placement?: Placement;
29
34
  /**
30
35
  * Soft look button
31
36
  */
@@ -1,5 +1,7 @@
1
1
  'use client';
2
2
 
3
+ import React from 'react';
4
+
3
5
  import { useModalDialogContext } from '../../modal-dialog.component.js';
4
6
 
5
7
  import { styles as modalBodyStyles } from './modal-dialog-body.styles.js';