@westpac/ui 0.31.0 → 0.32.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 +7 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.styles.js +1 -1
- package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.styles.js +4 -4
- package/dist/components/circle/circle.styles.d.ts +2 -2
- package/dist/components/circle/circle.styles.js +1 -1
- package/dist/components/flexi-cell/components/flexi-cell-circle/flexi-cell-circle.styles.js +1 -1
- package/dist/components/header/header.styles.js +1 -1
- package/dist/components/icon/icon.styles.js +5 -5
- package/dist/components/list/components/list-item/list-item.styles.js +3 -3
- package/dist/components/pictogram/components/decorative/wbc-bank-card-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/accessibility-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/accounts-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/aeroplane-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/arrow-down-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/arrow-left-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/arrow-right-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/arrow-up-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/arrows-passing-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/atm-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/australia-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/bank-card-locked-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/bank-card-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/bank-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/birth-certificate-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/building-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/buoy-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/bus-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/business-person-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/calculator-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/calendar-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/car-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/cash-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/celebration-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/chat-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/clock-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/coffee-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/coins-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/compass-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/customer-profile-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/desktop-computer-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/document-and-pen-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/dollar-sign-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/drivers-licence-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/education-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/eftpos-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/envelope-email-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/envelope-printed-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/face-happy-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/face-unhappy-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/face-unsure-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/finger-motion-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/fingerprint-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/football-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/fork-knife-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/generic-document-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/gift-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/globe-australia-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/globe-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/graph-decreasing-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/graph-increasing-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/gym-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/headset-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/heart-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/house-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/light-bulb-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/loop-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/medicare-card-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/mobile-device-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/money-in-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/money-out-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/movie-tickets-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/nest-egg-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/noodles-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/number-1-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/number-2-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/number-3-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/number-4-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/number-5-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/padlock-locked-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/padlock-unlocked-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/passport-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/percent-sign-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/person-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/piggy-bank-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/pizza-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/plant-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/search-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/secure-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/shop-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/shopping-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/sparkle-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/star-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/stopwatch-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/target-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/tax-document-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/telephone-call-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/thumbs-up-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/tick-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/tools-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/tractor-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/truck-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/umbrella-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/unsecure-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/wallet-pictogram.js +1 -1
- package/dist/components/pictogram/components/informative/wearables-pictogram.js +1 -1
- package/dist/components/popover/components/panel/panel.component.d.ts +2 -1
- package/dist/components/popover/components/panel/panel.component.js +42 -40
- package/dist/components/popover/components/panel/panel.hook.d.ts +39 -0
- package/dist/components/popover/components/panel/panel.hook.js +83 -0
- package/dist/components/popover/components/panel/panel.styles.js +9 -6
- package/dist/components/popover/components/panel/panel.types.d.ts +4 -0
- package/dist/components/popover/popover.component.d.ts +1 -1
- package/dist/components/popover/popover.component.js +4 -3
- package/dist/components/popover/popover.types.d.ts +7 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js +5 -5
- package/dist/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.styles.js +1 -1
- package/dist/components/progress-rope/components/progress-rope-step/progress-rope-step.styles.js +2 -2
- package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.styles.js +4 -4
- package/dist/components/switch/switch.styles.js +4 -4
- package/dist/components/symbol/components/logos/red-avatar-circle-logo.js +1 -1
- package/dist/components/symbol/components/logos/red-avatar-circle-reversed-logo.js +1 -1
- package/dist/components/symbol/components/symbols/facebook-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/google-plus-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/instagram-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/linked-in-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/slack-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/twitter-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/x-mark-inverse-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/x-mark-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/x-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/yammer-symbol.js +1 -1
- package/dist/components/symbol/components/symbols/youtube-symbol.js +1 -1
- package/dist/components/textarea/textarea.styles.js +4 -4
- package/dist/css/westpac-ui.css +519 -515
- package/dist/css/westpac-ui.min.css +519 -515
- package/package.json +3 -3
- package/src/components/accordion/components/accordion-item/accordion-item.styles.ts +1 -1
- package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.styles.ts +4 -4
- package/src/components/circle/circle.styles.ts +1 -1
- package/src/components/flexi-cell/components/flexi-cell-circle/flexi-cell-circle.styles.ts +1 -1
- package/src/components/header/header.styles.ts +1 -1
- package/src/components/icon/icon.styles.ts +5 -5
- package/src/components/list/components/list-item/list-item.styles.ts +3 -3
- package/src/components/pictogram/components/decorative/wbc-bank-card-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/accessibility-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/accounts-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/aeroplane-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/arrow-down-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/arrow-left-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/arrow-right-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/arrow-up-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/arrows-passing-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/atm-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/australia-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/bank-card-locked-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/bank-card-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/bank-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/birth-certificate-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/building-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/buoy-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/bus-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/business-person-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/calculator-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/calendar-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/car-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/cash-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/celebration-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/chat-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/clock-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/coffee-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/coins-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/compass-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/customer-profile-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/desktop-computer-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/document-and-pen-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/dollar-sign-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/drivers-licence-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/education-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/eftpos-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/envelope-email-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/envelope-printed-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/face-happy-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/face-unhappy-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/face-unsure-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/finger-motion-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/fingerprint-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/football-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/fork-knife-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/generic-document-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/gift-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/globe-australia-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/globe-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/graph-decreasing-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/graph-increasing-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/gym-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/headset-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/heart-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/house-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/light-bulb-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/loop-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/medicare-card-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/mobile-device-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/money-in-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/money-out-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/movie-tickets-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/nest-egg-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/noodles-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/number-1-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/number-2-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/number-3-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/number-4-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/number-5-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/padlock-locked-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/padlock-unlocked-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/passport-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/percent-sign-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/person-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/piggy-bank-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/pizza-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/plant-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/search-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/secure-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/shop-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/shopping-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/sparkle-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/star-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/stopwatch-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/target-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/tax-document-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/telephone-call-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/thumbs-up-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/tick-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/tools-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/tractor-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/truck-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/umbrella-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/unsecure-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/wallet-pictogram.tsx +1 -1
- package/src/components/pictogram/components/informative/wearables-pictogram.tsx +1 -1
- package/src/components/popover/components/panel/panel.component.tsx +34 -45
- package/src/components/popover/components/panel/panel.hook.tsx +113 -0
- package/src/components/popover/components/panel/panel.styles.ts +9 -7
- package/src/components/popover/components/panel/panel.types.ts +4 -0
- package/src/components/popover/popover.component.tsx +10 -4
- package/src/components/popover/popover.types.ts +8 -0
- package/src/components/progress-indicator/progress-indicator.styles.ts +5 -5
- package/src/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.styles.ts +1 -1
- package/src/components/progress-rope/components/progress-rope-step/progress-rope-step.styles.ts +2 -2
- package/src/components/radio-group/components/radio-group-radio/radio-group-radio.styles.ts +4 -4
- package/src/components/switch/switch.styles.ts +4 -4
- package/src/components/symbol/components/logos/red-avatar-circle-logo.tsx +1 -1
- package/src/components/symbol/components/logos/red-avatar-circle-reversed-logo.tsx +1 -1
- package/src/components/symbol/components/symbols/facebook-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/google-plus-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/instagram-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/linked-in-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/slack-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/twitter-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/x-mark-inverse-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/x-mark-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/x-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/yammer-symbol.tsx +1 -1
- package/src/components/symbol/components/symbols/youtube-symbol.tsx +1 -1
- package/src/components/textarea/textarea.styles.ts +4 -4
- package/dist/components/popover/popover.utils.d.ts +0 -3
- package/dist/components/popover/popover.utils.js +0 -37
- package/src/components/popover/popover.utils.tsx +0 -59
|
@@ -18,7 +18,7 @@ export function GraphDecreasingPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function GraphIncreasingPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function HeadsetPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function LightBulbPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function MedicareCardPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function MobileDevicePictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function MoneyInPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function MoneyOutPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function MovieTicketsPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function NestEggPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function NoodlesPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function Number1Pictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function Number2Pictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function Number3Pictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function Number4Pictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function Number5Pictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function PadlockLockedPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function PadlockUnlockedPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function PassportPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function PercentSignPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function PiggyBankPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function ShoppingPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function SparklePictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function StopwatchPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function TaxDocumentPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function TelephoneCallPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function ThumbsUpPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function TractorPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function UmbrellaPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function UnsecurePictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -18,7 +18,7 @@ export function WearablesPictogram({
|
|
|
18
18
|
}: PictogramProps) {
|
|
19
19
|
return (
|
|
20
20
|
<Pictogram
|
|
21
|
-
className={clsx('
|
|
21
|
+
className={clsx('size-13', className)}
|
|
22
22
|
viewBoxWidth={viewBoxWidth}
|
|
23
23
|
viewBoxHeight={viewBoxHeight}
|
|
24
24
|
aria-label={ariaLabel}
|
|
@@ -1,58 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRef } from 'react';
|
|
2
2
|
import { FocusScope } from 'react-aria';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
3
4
|
|
|
4
5
|
import { Button } from '../../../button/index.js';
|
|
5
6
|
import { CloseIcon } from '../../../icon/index.js';
|
|
6
|
-
import { getPopoverPosition } from '../../popover.utils.js';
|
|
7
7
|
|
|
8
|
+
import { usePanel } from './panel.hook.js';
|
|
8
9
|
import { styles as panelStyles } from './panel.styles.js';
|
|
9
|
-
import { type PanelProps
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { type PanelProps } from './panel.types.js';
|
|
11
|
+
|
|
12
|
+
export function BasePanel({
|
|
13
|
+
state,
|
|
14
|
+
heading,
|
|
15
|
+
headingTag: Tag = 'h1',
|
|
16
|
+
content,
|
|
17
|
+
placement = 'bottom',
|
|
18
|
+
id,
|
|
19
|
+
triggerRef,
|
|
20
|
+
portal,
|
|
21
|
+
}: PanelProps) {
|
|
15
22
|
const popoverRef = useRef<HTMLDivElement>(null);
|
|
16
23
|
const arrowRef = useRef<HTMLDivElement>(null);
|
|
17
|
-
const
|
|
18
|
-
if (typeof window !== 'undefined') {
|
|
19
|
-
return parseInt(window.getComputedStyle(document.getElementsByTagName('html')[0]).fontSize);
|
|
20
|
-
}
|
|
21
|
-
return 1;
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
24
|
-
const [position, setPosition] = useState<Position>({
|
|
25
|
-
placement: 'top',
|
|
26
|
-
offset: 'left',
|
|
27
|
-
panelPosition: triggerRef.current ? triggerRef.current.offsetWidth / 2 / remSize : 0,
|
|
28
|
-
arrowPosition: popoverRef.current ? popoverRef.current.getBoundingClientRect().width / 2 / remSize : 0,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
useLayoutEffect(() => {
|
|
32
|
-
setPosition(getPopoverPosition(triggerRef, popoverRef, arrowRef, placement));
|
|
33
|
-
}, [placement, remSize, state.isOpen, triggerRef]);
|
|
34
|
-
|
|
35
|
-
const getPopoverClass = useCallback(() => {
|
|
36
|
-
return {
|
|
37
|
-
[position.offset as string]:
|
|
38
|
-
position.offset === 'left' ? `${position.panelPosition}rem` : `-${position.panelPosition}rem`,
|
|
39
|
-
transform: position.offset === 'left' ? 'translateX(-50%)' : 'none',
|
|
40
|
-
};
|
|
41
|
-
}, [position]);
|
|
42
|
-
|
|
43
|
-
const getArrowClass = useCallback(() => {
|
|
44
|
-
return {
|
|
45
|
-
[!position.offset || position.offset === 'left' ? 'left' : 'right']: `${position.arrowPosition}rem`,
|
|
46
|
-
};
|
|
47
|
-
}, [position]);
|
|
48
|
-
|
|
49
|
-
const styles = panelStyles({ placement: position.placement });
|
|
24
|
+
const { popoverPosition, arrowPosition } = usePanel({ state, placement, triggerRef, portal });
|
|
50
25
|
|
|
26
|
+
const styles = panelStyles({ placement });
|
|
51
27
|
return (
|
|
52
|
-
<FocusScope restoreFocus>
|
|
53
|
-
<div className={styles.popover()}
|
|
28
|
+
<FocusScope contain autoFocus restoreFocus>
|
|
29
|
+
<div style={popoverPosition} className={styles.popover()} test-id="popover" id={id} ref={popoverRef}>
|
|
54
30
|
<div className={styles.content()}>
|
|
55
|
-
<Tag className={styles.heading()}>
|
|
31
|
+
<Tag tabIndex={0} className={styles.heading()}>
|
|
32
|
+
{heading}
|
|
33
|
+
</Tag>
|
|
56
34
|
<div className={styles.body()}>{content}</div>
|
|
57
35
|
<Button
|
|
58
36
|
look="link"
|
|
@@ -62,9 +40,20 @@ export function Panel({ state, heading, headingTag: Tag = 'h1', content, placeme
|
|
|
62
40
|
aria-label="Close popover"
|
|
63
41
|
/>
|
|
64
42
|
</div>
|
|
65
|
-
<div aria-hidden className={styles.arrow()} style={
|
|
43
|
+
<div aria-hidden className={styles.arrow()} style={arrowPosition} test-id="arrow" ref={arrowRef} />
|
|
66
44
|
</div>
|
|
67
45
|
</FocusScope>
|
|
68
46
|
);
|
|
69
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
export function Panel({ portal = false, ...props }: PanelProps) {
|
|
53
|
+
if (portal) {
|
|
54
|
+
const portalValue = typeof portal === 'boolean' ? document.body : portal;
|
|
55
|
+
return createPortal(<BasePanel {...props} portal={portalValue} />, portalValue);
|
|
56
|
+
}
|
|
57
|
+
return <BasePanel portal={portal} {...props} />;
|
|
58
|
+
}
|
|
70
59
|
Panel.displayName = 'Popover.Panel';
|