@cloudscape-design/components 3.0.606 → 3.0.608
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/styles.css.js +81 -81
- package/app-layout/visual-refresh/styles.scoped.css +275 -286
- package/app-layout/visual-refresh/styles.selectors.js +81 -81
- package/content-layout/styles.css.js +7 -7
- package/content-layout/styles.scoped.css +13 -15
- package/content-layout/styles.selectors.js +7 -7
- package/flashbar/styles.css.js +47 -47
- package/flashbar/styles.scoped.css +171 -171
- package/flashbar/styles.selectors.js +47 -47
- package/form-field/internal.d.ts.map +1 -1
- package/form-field/internal.js +10 -6
- package/form-field/internal.js.map +1 -1
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +39 -39
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +44 -46
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/popover/internal.js +1 -1
- package/popover/internal.js.map +1 -1
- package/popover/styles.css.js +50 -50
- package/popover/styles.scoped.css +64 -64
- package/popover/styles.selectors.js +50 -50
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/wizard/styles.css.js +32 -32
- package/wizard/styles.scoped.css +68 -68
- package/wizard/styles.selectors.js +32 -32
|
@@ -1,50 +1,48 @@
|
|
|
1
1
|
const customCSSPropertiesMap = {
|
|
2
|
-
breadcrumbsGap: '--awsui-breadcrumbs-gap-
|
|
3
|
-
contentGapLeft: '--awsui-content-gap-left-
|
|
4
|
-
contentGapRight: '--awsui-content-gap-right-
|
|
5
|
-
contentHeight: '--awsui-content-height-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
spinnerLineRightFrom: '--awsui-spinner-line-right-from-iof9y8',
|
|
47
|
-
spinnerLineRightTo: '--awsui-spinner-line-right-to-iof9y8',
|
|
2
|
+
breadcrumbsGap: '--awsui-breadcrumbs-gap-lgosor',
|
|
3
|
+
contentGapLeft: '--awsui-content-gap-left-lgosor',
|
|
4
|
+
contentGapRight: '--awsui-content-gap-right-lgosor',
|
|
5
|
+
contentHeight: '--awsui-content-height-lgosor',
|
|
6
|
+
defaultMaxContentWidth: '--awsui-default-max-content-width-lgosor',
|
|
7
|
+
defaultMinContentWidth: '--awsui-default-min-content-width-lgosor',
|
|
8
|
+
drawerSize: '--awsui-drawer-size-lgosor',
|
|
9
|
+
footerHeight: '--awsui-footer-height-lgosor',
|
|
10
|
+
headerGap: '--awsui-header-gap-lgosor',
|
|
11
|
+
headerHeight: '--awsui-header-height-lgosor',
|
|
12
|
+
layoutWidth: '--awsui-layout-width-lgosor',
|
|
13
|
+
mainGap: '--awsui-main-gap-lgosor',
|
|
14
|
+
mainOffsetLeft: '--awsui-main-offset-left-lgosor',
|
|
15
|
+
mainTemplateRows: '--awsui-main-template-rows-lgosor',
|
|
16
|
+
maxContentWidth: '--awsui-max-content-width-lgosor',
|
|
17
|
+
minContentWidth: '--awsui-min-content-width-lgosor',
|
|
18
|
+
mobileBarHeight: '--awsui-mobile-bar-height-lgosor',
|
|
19
|
+
notificationsGap: '--awsui-notifications-gap-lgosor',
|
|
20
|
+
notificationsHeight: '--awsui-notifications-height-lgosor',
|
|
21
|
+
offsetTop: '--awsui-offset-top-lgosor',
|
|
22
|
+
offsetTopWithNotifications: '--awsui-offset-top-with-notifications-lgosor',
|
|
23
|
+
overlapHeight: '--awsui-overlap-height-lgosor',
|
|
24
|
+
navigationWidth: '--awsui-navigation-width-lgosor',
|
|
25
|
+
splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-lgosor',
|
|
26
|
+
splitPanelReportedSize: '--awsui-split-panel-reported-size-lgosor',
|
|
27
|
+
splitPanelHeight: '--awsui-split-panel-height-lgosor',
|
|
28
|
+
splitPanelMinWidth: '--awsui-split-panel-min-width-lgosor',
|
|
29
|
+
splitPanelMaxWidth: '--awsui-split-panel-max-width-lgosor',
|
|
30
|
+
toolsMaxWidth: '--awsui-tools-max-width-lgosor',
|
|
31
|
+
toolsWidth: '--awsui-tools-width-lgosor',
|
|
32
|
+
toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-lgosor',
|
|
33
|
+
contentScrollMargin: '--awsui-content-scroll-margin-lgosor',
|
|
34
|
+
flashbarStackDepth: '--awsui-flashbar-stack-depth-lgosor',
|
|
35
|
+
flashbarStackIndex: '--awsui-flashbar-stack-index-lgosor',
|
|
36
|
+
flashbarStickyBottomMargin: '--awsui-flashbar-sticky-bottom-margin-lgosor',
|
|
37
|
+
stackedNotificationsBottomMargin: '--awsui-stacked-notifications-bottom-margin-lgosor',
|
|
38
|
+
stackedNotificationsDefaultBottomMargin: '--awsui-stacked-notifications-default-bottom-margin-lgosor',
|
|
39
|
+
dropdownDefaultMaxWidth: '--awsui-dropdown-default-max-width-lgosor',
|
|
40
|
+
spinnerRotatorFrom: '--awsui-spinner-rotator-from-lgosor',
|
|
41
|
+
spinnerRotatorTo: '--awsui-spinner-rotator-to-lgosor',
|
|
42
|
+
spinnerLineLeftFrom: '--awsui-spinner-line-left-from-lgosor',
|
|
43
|
+
spinnerLineLeftTo: '--awsui-spinner-line-left-to-lgosor',
|
|
44
|
+
spinnerLineRightFrom: '--awsui-spinner-line-right-from-lgosor',
|
|
45
|
+
spinnerLineRightTo: '--awsui-spinner-line-right-to-lgosor',
|
|
48
46
|
};
|
|
49
47
|
export default customCSSPropertiesMap;
|
|
50
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAA2B;IACrD,cAAc,EAAE,gCAAgC;IAChD,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,+BAA+B;IAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAA2B;IACrD,cAAc,EAAE,gCAAgC;IAChD,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,+BAA+B;IAC9C,sBAAsB,EAAE,0CAA0C;IAClE,sBAAsB,EAAE,0CAA0C;IAClE,UAAU,EAAE,4BAA4B;IACxC,YAAY,EAAE,8BAA8B;IAC5C,SAAS,EAAE,2BAA2B;IACtC,YAAY,EAAE,8BAA8B;IAC5C,WAAW,EAAE,6BAA6B;IAC1C,OAAO,EAAE,yBAAyB;IAClC,cAAc,EAAE,iCAAiC;IACjD,gBAAgB,EAAE,mCAAmC;IACrD,eAAe,EAAE,kCAAkC;IACnD,eAAe,EAAE,kCAAkC;IACnD,eAAe,EAAE,kCAAkC;IACnD,gBAAgB,EAAE,kCAAkC;IACpD,mBAAmB,EAAE,qCAAqC;IAC1D,SAAS,EAAE,2BAA2B;IACtC,0BAA0B,EAAE,8CAA8C;IAC1E,aAAa,EAAE,+BAA+B;IAC9C,eAAe,EAAE,iCAAiC;IAClD,4BAA4B,EAAE,iDAAiD;IAC/E,sBAAsB,EAAE,0CAA0C;IAClE,gBAAgB,EAAE,mCAAmC;IACrD,kBAAkB,EAAE,sCAAsC;IAC1D,kBAAkB,EAAE,sCAAsC;IAC1D,aAAa,EAAE,gCAAgC;IAC/C,UAAU,EAAE,4BAA4B;IACxC,6BAA6B,EAAE,iDAAiD;IAChF,mBAAmB,EAAE,sCAAsC;IAC3D,kBAAkB,EAAE,qCAAqC;IACzD,kBAAkB,EAAE,qCAAqC;IACzD,0BAA0B,EAAE,8CAA8C;IAC1E,gCAAgC,EAAE,oDAAoD;IACtF,uCAAuC,EAAE,4DAA4D;IACrG,uBAAuB,EAAE,2CAA2C;IACpE,kBAAkB,EAAE,qCAAqC;IACzD,gBAAgB,EAAE,mCAAmC;IACrD,mBAAmB,EAAE,uCAAuC;IAC5D,iBAAiB,EAAE,qCAAqC;IACxD,oBAAoB,EAAE,wCAAwC;IAC9D,kBAAkB,EAAE,sCAAsC;CAC3D,CAAC;AACF,eAAe,sBAAsB,CAAC","sourcesContent":["const customCSSPropertiesMap: Record<string, string> = {\n breadcrumbsGap: '--awsui-breadcrumbs-gap-lgosor',\n contentGapLeft: '--awsui-content-gap-left-lgosor',\n contentGapRight: '--awsui-content-gap-right-lgosor',\n contentHeight: '--awsui-content-height-lgosor',\n defaultMaxContentWidth: '--awsui-default-max-content-width-lgosor',\n defaultMinContentWidth: '--awsui-default-min-content-width-lgosor',\n drawerSize: '--awsui-drawer-size-lgosor',\n footerHeight: '--awsui-footer-height-lgosor',\n headerGap: '--awsui-header-gap-lgosor',\n headerHeight: '--awsui-header-height-lgosor',\n layoutWidth: '--awsui-layout-width-lgosor',\n mainGap: '--awsui-main-gap-lgosor',\n mainOffsetLeft: '--awsui-main-offset-left-lgosor',\n mainTemplateRows: '--awsui-main-template-rows-lgosor',\n maxContentWidth: '--awsui-max-content-width-lgosor',\n minContentWidth: '--awsui-min-content-width-lgosor',\n mobileBarHeight: '--awsui-mobile-bar-height-lgosor',\n notificationsGap: '--awsui-notifications-gap-lgosor',\n notificationsHeight: '--awsui-notifications-height-lgosor',\n offsetTop: '--awsui-offset-top-lgosor',\n offsetTopWithNotifications: '--awsui-offset-top-with-notifications-lgosor',\n overlapHeight: '--awsui-overlap-height-lgosor',\n navigationWidth: '--awsui-navigation-width-lgosor',\n splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-lgosor',\n splitPanelReportedSize: '--awsui-split-panel-reported-size-lgosor',\n splitPanelHeight: '--awsui-split-panel-height-lgosor',\n splitPanelMinWidth: '--awsui-split-panel-min-width-lgosor',\n splitPanelMaxWidth: '--awsui-split-panel-max-width-lgosor',\n toolsMaxWidth: '--awsui-tools-max-width-lgosor',\n toolsWidth: '--awsui-tools-width-lgosor',\n toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-lgosor',\n contentScrollMargin: '--awsui-content-scroll-margin-lgosor',\n flashbarStackDepth: '--awsui-flashbar-stack-depth-lgosor',\n flashbarStackIndex: '--awsui-flashbar-stack-index-lgosor',\n flashbarStickyBottomMargin: '--awsui-flashbar-sticky-bottom-margin-lgosor',\n stackedNotificationsBottomMargin: '--awsui-stacked-notifications-bottom-margin-lgosor',\n stackedNotificationsDefaultBottomMargin: '--awsui-stacked-notifications-default-bottom-margin-lgosor',\n dropdownDefaultMaxWidth: '--awsui-dropdown-default-max-width-lgosor',\n spinnerRotatorFrom: '--awsui-spinner-rotator-from-lgosor',\n spinnerRotatorTo: '--awsui-spinner-rotator-to-lgosor',\n spinnerLineLeftFrom: '--awsui-spinner-line-left-from-lgosor',\n spinnerLineLeftTo: '--awsui-spinner-line-left-to-lgosor',\n spinnerLineRightFrom: '--awsui-spinner-line-right-from-lgosor',\n spinnerLineRightTo: '--awsui-spinner-line-right-to-lgosor',\n};\nexport default customCSSPropertiesMap;\n"]}
|
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
package/popover/internal.js
CHANGED
|
@@ -88,7 +88,7 @@ function InternalPopover(_a, ref) {
|
|
|
88
88
|
};
|
|
89
89
|
const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);
|
|
90
90
|
const referrerId = useUniqueId();
|
|
91
|
-
const popoverContent = (React.createElement("div", { "aria-live": dismissButton ? undefined : 'polite', "aria-atomic": dismissButton ? undefined : true, className: clsx(popoverClasses, styles['popover-content']), "data-awsui-referrer-id": referrerId }, visible && (React.createElement(PopoverContainer, { size: size, fixedWidth: fixedWidth, position: position, trackRef: triggerRef, arrow: position => React.createElement(Arrow, { position: position }), renderWithPortal: renderWithPortal, zIndex: renderWithPortal ? 7000 : undefined },
|
|
91
|
+
const popoverContent = (React.createElement("div", { "aria-live": dismissButton ? undefined : 'polite', "aria-atomic": dismissButton ? undefined : true, className: clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content']), "data-awsui-referrer-id": referrerId }, visible && (React.createElement(PopoverContainer, { size: size, fixedWidth: fixedWidth, position: position, trackRef: triggerRef, arrow: position => React.createElement(Arrow, { position: position }), renderWithPortal: renderWithPortal, zIndex: renderWithPortal ? 7000 : undefined },
|
|
92
92
|
React.createElement(LinkDefaultVariantContext.Provider, { value: { defaultVariant: 'primary' } },
|
|
93
93
|
React.createElement(PopoverBody, { dismissButton: dismissButton, dismissAriaLabel: dismissAriaLabel, header: header, onDismiss: onDismiss, overflowVisible: "both" }, content))))));
|
|
94
94
|
const mergedRef = useMergeRefs(popoverRef, __internalRootRef);
|
package/popover/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/popover/internal.tsx"],"names":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EAAE,SAAS,CAAC,SAAS,CAAC,EACjD,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,GAAG,EAAE;YAChB,gFAAgF;YAChF,YAAY,CAAC,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBAChD,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC;QAEA,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,CACxB,gDACM,YAAY,IAChB,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAC,QAAQ,mBACC,QAAQ,EACtB,EAAE,EAAE,UAAU,gBACF,gBAAgB;YAE5B,8BAAM,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAG,QAAQ,CAAQ,CACzD,CACV,CAAC,CAAC,CAAC,CACF,8CAAU,YAAY,IAAE,EAAE,EAAE,UAAU,KACnC,QAAQ,CACJ,CACR;QACD,oBAAC,qBAAqB,QACnB,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACnB,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState, useImperativeHandle } from 'react';\nimport clsx from 'clsx';\n\nimport { KeyCode } from '../internal/keycode';\nimport { getBaseProps } from '../internal/base-component';\n\nimport Arrow from './arrow';\nimport Portal from '../internal/components/portal';\nimport { PopoverProps } from './interfaces';\nimport PopoverContainer from './container';\nimport PopoverBody from './body';\n\nimport styles from './styles.css.js';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useInternalI18n } from '../i18n/context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\nexport interface InternalPopoverProps extends PopoverProps, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n}\n\nexport interface InternalPopoverRef {\n dismissPopover: () => void;\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef = null,\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<InternalPopoverRef>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const clickFrameId = useRef<number | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [visible, setVisible] = useState(false);\n\n const focusTrigger = useCallback(() => {\n if (triggerType === 'text') {\n triggerRef.current?.focus();\n } else {\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n setVisible(true);\n }, [__onOpen]);\n\n const onDismiss = useCallback(() => {\n setVisible(false);\n focusTrigger();\n }, [focusTrigger]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n setVisible(false);\n }\n },\n [visible]\n );\n\n useImperativeHandle(ref, () => ({\n dismissPopover: onDismiss,\n }));\n\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n setVisible(false);\n }\n };\n\n // useCapture=false makes sure this listener is called after the one attached to the element.\n // the options.capture notation is unsupported by IE.\n document.addEventListener('mousedown', onDocumentClick, false);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick, false);\n };\n }, []);\n\n const popoverClasses = usePortalModeClasses(triggerRef);\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`]),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n const popoverContent = (\n <div\n aria-live={dismissButton ? undefined : 'polite'}\n aria-atomic={dismissButton ? undefined : true}\n className={clsx(popoverClasses, styles['popover-content'])}\n data-awsui-referrer-id={referrerId}\n >\n {visible && (\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n >\n {content}\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n )}\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {triggerType === 'text' ? (\n <button\n {...triggerProps}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n <span className={styles['trigger-inner-text']}>{children}</span>\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/popover/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,WAAW,MAAM,QAAQ,CAAC;AAEjC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAA6B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,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,CAAC,SAAS;QAE3C,oBAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;YACtE,oBAAC,WAAW,IACV,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,eAAe,EAAC,MAAM,IAErB,OAAO,CACI,CACqB,CACpB,CACpB,CACG,CACP,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAE9D,OAAO,CACL,8CACM,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EACjD,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,GAAG,EAAE;YAChB,gFAAgF;YAChF,YAAY,CAAC,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBAChD,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC;QAEA,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,CACxB,gDACM,YAAY,IAChB,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAC,QAAQ,mBACC,QAAQ,EACtB,EAAE,EAAE,UAAU,gBACF,gBAAgB;YAE5B,8BAAM,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAG,QAAQ,CAAQ,CACzD,CACV,CAAC,CAAC,CAAC,CACF,8CAAU,YAAY,IAAE,EAAE,EAAE,UAAU,KACnC,QAAQ,CACJ,CACR;QACD,oBAAC,qBAAqB,QACnB,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACnB,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState, useImperativeHandle } from 'react';\nimport clsx from 'clsx';\n\nimport { KeyCode } from '../internal/keycode';\nimport { getBaseProps } from '../internal/base-component';\n\nimport Arrow from './arrow';\nimport Portal from '../internal/components/portal';\nimport { PopoverProps } from './interfaces';\nimport PopoverContainer from './container';\nimport PopoverBody from './body';\n\nimport styles from './styles.css.js';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useInternalI18n } from '../i18n/context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\nexport interface InternalPopoverProps extends PopoverProps, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n}\n\nexport interface InternalPopoverRef {\n dismissPopover: () => void;\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef = null,\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<InternalPopoverRef>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const clickFrameId = useRef<number | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [visible, setVisible] = useState(false);\n\n const focusTrigger = useCallback(() => {\n if (triggerType === 'text') {\n triggerRef.current?.focus();\n } else {\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n setVisible(true);\n }, [__onOpen]);\n\n const onDismiss = useCallback(() => {\n setVisible(false);\n focusTrigger();\n }, [focusTrigger]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n setVisible(false);\n }\n },\n [visible]\n );\n\n useImperativeHandle(ref, () => ({\n dismissPopover: onDismiss,\n }));\n\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n setVisible(false);\n }\n };\n\n // useCapture=false makes sure this listener is called after the one attached to the element.\n // the options.capture notation is unsupported by IE.\n document.addEventListener('mousedown', onDocumentClick, false);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick, false);\n };\n }, []);\n\n const popoverClasses = usePortalModeClasses(triggerRef);\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`]),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n <div\n aria-live={dismissButton ? undefined : 'polite'}\n aria-atomic={dismissButton ? undefined : true}\n className={clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content'])}\n data-awsui-referrer-id={referrerId}\n >\n {visible && (\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n >\n {content}\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n )}\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {triggerType === 'text' ? (\n <button\n {...triggerProps}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n <span className={styles['trigger-inner-text']}>{children}</span>\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n </span>\n );\n}\n"]}
|
package/popover/styles.css.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"arrow": "
|
|
5
|
-
"arrow-outer": "awsui_arrow-
|
|
6
|
-
"arrow-inner": "awsui_arrow-
|
|
7
|
-
"refresh": "
|
|
8
|
-
"arrow-position-right-top": "awsui_arrow-position-right-
|
|
9
|
-
"arrow-position-right-bottom": "awsui_arrow-position-right-
|
|
10
|
-
"arrow-position-left-top": "awsui_arrow-position-left-
|
|
11
|
-
"arrow-position-left-bottom": "awsui_arrow-position-left-
|
|
12
|
-
"arrow-position-top-center": "awsui_arrow-position-top-
|
|
13
|
-
"arrow-position-top-right": "awsui_arrow-position-top-
|
|
14
|
-
"arrow-position-top-left": "awsui_arrow-position-top-
|
|
15
|
-
"arrow-position-top-responsive": "awsui_arrow-position-top-
|
|
16
|
-
"arrow-position-bottom-center": "awsui_arrow-position-bottom-
|
|
17
|
-
"arrow-position-bottom-right": "awsui_arrow-position-bottom-
|
|
18
|
-
"arrow-position-bottom-left": "awsui_arrow-position-bottom-
|
|
19
|
-
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-
|
|
20
|
-
"body": "
|
|
21
|
-
"body-overflow-visible": "awsui_body-overflow-
|
|
22
|
-
"has-dismiss": "awsui_has-
|
|
23
|
-
"dismiss": "
|
|
24
|
-
"dismiss-control": "awsui_dismiss-
|
|
25
|
-
"header-row": "awsui_header-
|
|
26
|
-
"header": "
|
|
27
|
-
"content": "
|
|
28
|
-
"content-overflow-visible": "awsui_content-overflow-
|
|
29
|
-
"container": "
|
|
30
|
-
"container-body": "awsui_container-
|
|
31
|
-
"container-body-variant-annotation": "awsui_container-body-variant-
|
|
32
|
-
"container-body-size-small": "awsui_container-body-size-
|
|
33
|
-
"fixed-width": "awsui_fixed-
|
|
34
|
-
"container-body-size-medium": "awsui_container-body-size-
|
|
35
|
-
"container-body-size-large": "awsui_container-body-size-
|
|
36
|
-
"container-arrow": "awsui_container-
|
|
37
|
-
"container-arrow-position-right-top": "awsui_container-arrow-position-right-
|
|
38
|
-
"container-arrow-position-right-bottom": "awsui_container-arrow-position-right-
|
|
39
|
-
"container-arrow-position-left-top": "awsui_container-arrow-position-left-
|
|
40
|
-
"container-arrow-position-left-bottom": "awsui_container-arrow-position-left-
|
|
41
|
-
"container-arrow-position-top-center": "awsui_container-arrow-position-top-
|
|
42
|
-
"container-arrow-position-top-right": "awsui_container-arrow-position-top-
|
|
43
|
-
"container-arrow-position-top-left": "awsui_container-arrow-position-top-
|
|
44
|
-
"container-arrow-position-top-responsive": "awsui_container-arrow-position-top-
|
|
45
|
-
"container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-
|
|
46
|
-
"container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-
|
|
47
|
-
"container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-
|
|
48
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
49
|
-
"root": "
|
|
50
|
-
"trigger": "
|
|
51
|
-
"trigger-type-text": "awsui_trigger-type-
|
|
52
|
-
"trigger-inner-text": "awsui_trigger-inner-
|
|
53
|
-
"popover-content": "awsui_popover-
|
|
4
|
+
"arrow": "awsui_arrow_xjuzf_1xq78_197",
|
|
5
|
+
"arrow-outer": "awsui_arrow-outer_xjuzf_1xq78_201",
|
|
6
|
+
"arrow-inner": "awsui_arrow-inner_xjuzf_1xq78_201",
|
|
7
|
+
"refresh": "awsui_refresh_xjuzf_1xq78_231",
|
|
8
|
+
"arrow-position-right-top": "awsui_arrow-position-right-top_xjuzf_1xq78_241",
|
|
9
|
+
"arrow-position-right-bottom": "awsui_arrow-position-right-bottom_xjuzf_1xq78_241",
|
|
10
|
+
"arrow-position-left-top": "awsui_arrow-position-left-top_xjuzf_1xq78_244",
|
|
11
|
+
"arrow-position-left-bottom": "awsui_arrow-position-left-bottom_xjuzf_1xq78_244",
|
|
12
|
+
"arrow-position-top-center": "awsui_arrow-position-top-center_xjuzf_1xq78_247",
|
|
13
|
+
"arrow-position-top-right": "awsui_arrow-position-top-right_xjuzf_1xq78_247",
|
|
14
|
+
"arrow-position-top-left": "awsui_arrow-position-top-left_xjuzf_1xq78_247",
|
|
15
|
+
"arrow-position-top-responsive": "awsui_arrow-position-top-responsive_xjuzf_1xq78_247",
|
|
16
|
+
"arrow-position-bottom-center": "awsui_arrow-position-bottom-center_xjuzf_1xq78_250",
|
|
17
|
+
"arrow-position-bottom-right": "awsui_arrow-position-bottom-right_xjuzf_1xq78_250",
|
|
18
|
+
"arrow-position-bottom-left": "awsui_arrow-position-bottom-left_xjuzf_1xq78_250",
|
|
19
|
+
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_xjuzf_1xq78_250",
|
|
20
|
+
"body": "awsui_body_xjuzf_1xq78_352",
|
|
21
|
+
"body-overflow-visible": "awsui_body-overflow-visible_xjuzf_1xq78_391",
|
|
22
|
+
"has-dismiss": "awsui_has-dismiss_xjuzf_1xq78_395",
|
|
23
|
+
"dismiss": "awsui_dismiss_xjuzf_1xq78_400",
|
|
24
|
+
"dismiss-control": "awsui_dismiss-control_xjuzf_1xq78_408",
|
|
25
|
+
"header-row": "awsui_header-row_xjuzf_1xq78_412",
|
|
26
|
+
"header": "awsui_header_xjuzf_1xq78_412",
|
|
27
|
+
"content": "awsui_content_xjuzf_1xq78_438",
|
|
28
|
+
"content-overflow-visible": "awsui_content-overflow-visible_xjuzf_1xq78_446",
|
|
29
|
+
"container": "awsui_container_xjuzf_1xq78_548",
|
|
30
|
+
"container-body": "awsui_container-body_xjuzf_1xq78_556",
|
|
31
|
+
"container-body-variant-annotation": "awsui_container-body-variant-annotation_xjuzf_1xq78_599",
|
|
32
|
+
"container-body-size-small": "awsui_container-body-size-small_xjuzf_1xq78_604",
|
|
33
|
+
"fixed-width": "awsui_fixed-width_xjuzf_1xq78_607",
|
|
34
|
+
"container-body-size-medium": "awsui_container-body-size-medium_xjuzf_1xq78_611",
|
|
35
|
+
"container-body-size-large": "awsui_container-body-size-large_xjuzf_1xq78_618",
|
|
36
|
+
"container-arrow": "awsui_container-arrow_xjuzf_1xq78_630",
|
|
37
|
+
"container-arrow-position-right-top": "awsui_container-arrow-position-right-top_xjuzf_1xq78_634",
|
|
38
|
+
"container-arrow-position-right-bottom": "awsui_container-arrow-position-right-bottom_xjuzf_1xq78_634",
|
|
39
|
+
"container-arrow-position-left-top": "awsui_container-arrow-position-left-top_xjuzf_1xq78_646",
|
|
40
|
+
"container-arrow-position-left-bottom": "awsui_container-arrow-position-left-bottom_xjuzf_1xq78_646",
|
|
41
|
+
"container-arrow-position-top-center": "awsui_container-arrow-position-top-center_xjuzf_1xq78_658",
|
|
42
|
+
"container-arrow-position-top-right": "awsui_container-arrow-position-top-right_xjuzf_1xq78_658",
|
|
43
|
+
"container-arrow-position-top-left": "awsui_container-arrow-position-top-left_xjuzf_1xq78_658",
|
|
44
|
+
"container-arrow-position-top-responsive": "awsui_container-arrow-position-top-responsive_xjuzf_1xq78_658",
|
|
45
|
+
"container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-center_xjuzf_1xq78_674",
|
|
46
|
+
"container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-right_xjuzf_1xq78_678",
|
|
47
|
+
"container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-left_xjuzf_1xq78_682",
|
|
48
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_xjuzf_1xq78_1",
|
|
49
|
+
"root": "awsui_root_xjuzf_1xq78_828",
|
|
50
|
+
"trigger": "awsui_trigger_xjuzf_1xq78_864",
|
|
51
|
+
"trigger-type-text": "awsui_trigger-type-text_xjuzf_1xq78_871",
|
|
52
|
+
"trigger-inner-text": "awsui_trigger-inner-text_xjuzf_1xq78_906",
|
|
53
|
+
"popover-inline-content": "awsui_popover-inline-content_xjuzf_1xq78_910"
|
|
54
54
|
};
|
|
55
55
|
|