@cloudscape-design/components-themeable 3.0.352 → 3.0.354
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/cartesian-chart/styles.scss +38 -3
- package/lib/internal/scss/internal/components/chart-wrapper/styles.scss +17 -0
- package/lib/internal/scss/mixed-line-bar-chart/styles.scss +0 -1
- package/lib/internal/scss/pie-chart/styles.scss +22 -0
- package/lib/internal/template/area-chart/chart-container.d.ts +3 -1
- package/lib/internal/template/area-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/area-chart/chart-container.js +3 -2
- package/lib/internal/template/area-chart/chart-container.js.map +1 -1
- package/lib/internal/template/area-chart/internal.d.ts +1 -1
- package/lib/internal/template/area-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/area-chart/internal.js +3 -2
- package/lib/internal/template/area-chart/internal.js.map +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts +1 -0
- package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/index.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts +2 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js +8 -2
- package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +4 -4
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/tooltip.js +1 -1
- package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
- package/lib/internal/template/cards/index.d.ts.map +1 -1
- package/lib/internal/template/cards/index.js +8 -6
- package/lib/internal/template/cards/index.js.map +1 -1
- package/lib/internal/template/code-editor/index.js +1 -1
- package/lib/internal/template/code-editor/index.js.map +1 -1
- package/lib/internal/template/flashbar/common.js +2 -2
- package/lib/internal/template/flashbar/common.js.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +24 -5
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +1 -0
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.js +1 -0
- package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
- package/lib/internal/template/internal/analytics/index.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/index.js +1 -0
- package/lib/internal/template/internal/analytics/index.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +13 -2
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +10 -9
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.d.ts +2 -0
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.js +16 -3
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts +5 -0
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +27 -23
- package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +54 -27
- package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +27 -23
- package/lib/internal/template/internal/components/chart-plot/index.d.ts +2 -2
- package/lib/internal/template/internal/components/chart-plot/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-plot/index.js +3 -1
- package/lib/internal/template/internal/components/chart-plot/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts +1 -0
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.js +21 -6
- package/lib/internal/template/internal/components/chart-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/styles.css.js +9 -6
- package/lib/internal/template/internal/components/chart-wrapper/styles.scoped.css +20 -6
- package/lib/internal/template/internal/components/chart-wrapper/styles.selectors.js +9 -6
- package/lib/internal/template/internal/components/transition/index.js +1 -1
- package/lib/internal/template/internal/components/transition/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +6 -0
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.js +2 -1
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-visual-mode/index.d.ts +0 -4
- package/lib/internal/template/internal/hooks/use-visual-mode/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-visual-mode/index.js +0 -30
- package/lib/internal/template/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js +8 -2
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js +3 -3
- package/lib/internal/template/mixed-line-bar-chart/internal.js.map +1 -1
- package/lib/internal/template/pie-chart/index.d.ts +1 -1
- package/lib/internal/template/pie-chart/index.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/index.js +10 -3
- package/lib/internal/template/pie-chart/index.js.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.d.ts +5 -0
- package/lib/internal/template/pie-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.js.map +1 -1
- package/lib/internal/template/pie-chart/labels.d.ts +3 -2
- package/lib/internal/template/pie-chart/labels.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/labels.js +4 -4
- package/lib/internal/template/pie-chart/labels.js.map +1 -1
- package/lib/internal/template/pie-chart/pie-chart.d.ts +2 -1
- package/lib/internal/template/pie-chart/pie-chart.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/pie-chart.js +18 -14
- package/lib/internal/template/pie-chart/pie-chart.js.map +1 -1
- package/lib/internal/template/pie-chart/segments.d.ts +3 -2
- package/lib/internal/template/pie-chart/segments.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/segments.js +2 -6
- package/lib/internal/template/pie-chart/segments.js.map +1 -1
- package/lib/internal/template/pie-chart/styles.css.js +27 -23
- package/lib/internal/template/pie-chart/styles.scoped.css +58 -38
- package/lib/internal/template/pie-chart/styles.selectors.js +27 -23
- package/lib/internal/template/pie-chart/utils.d.ts +12 -2
- package/lib/internal/template/pie-chart/utils.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/utils.js +37 -9
- package/lib/internal/template/pie-chart/utils.js.map +1 -1
- package/lib/internal/template/popover/internal.d.ts.map +1 -1
- package/lib/internal/template/popover/internal.js +9 -3
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/tabs/smooth-scroll.js +1 -1
- package/lib/internal/template/tabs/smooth-scroll.js.map +1 -1
- package/package.json +2 -9
- package/NOTICE +0 -2
- package/lib/internal/template/internal/motion.d.ts +0 -2
- package/lib/internal/template/internal/motion.d.ts.map +0 -1
- package/lib/internal/template/internal/motion.js +0 -9
- package/lib/internal/template/internal/motion.js.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E,EAAE,IACjC,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAC5C,CACvB,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';\nimport { FormFieldContext } from '../internal/context/form-field-context';\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 '../internal/i18n/context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\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\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 triggerRef.current?.focus();\n }, []);\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((event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.tab || event.keyCode === KeyCode.escape) {\n setVisible(false);\n }\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\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 <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n >\n {content}\n </PopoverBody>\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 {...triggerProps} type=\"button\" aria-haspopup=\"dialog\" id={referrerId}>\n <span className={styles['trigger-inner-text']}>{children}</span>\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n <FormFieldContext.Provider value={{}}>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </FormFieldContext.Provider>\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["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;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,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,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ACG,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,gDAAY,YAAY,IAAE,IAAI,EAAC,QAAQ,mBAAe,QAAQ,EAAC,EAAE,EAAE,UAAU;YAC3E,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,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IACjC,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAC5C,CACvB,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';\nimport { FormFieldContext } from '../internal/context/form-field-context';\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 '../internal/i18n/context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\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\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((event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.tab || event.keyCode === KeyCode.escape) {\n setVisible(false);\n }\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\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 <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n >\n {content}\n </PopoverBody>\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 {...triggerProps} type=\"button\" aria-haspopup=\"dialog\" id={referrerId}>\n <span className={styles['trigger-inner-text']}>{children}</span>\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n <FormFieldContext.Provider value={{}}>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </FormFieldContext.Provider>\n </span>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { isMotionDisabled } from '
|
|
3
|
+
import { isMotionDisabled } from '@cloudscape-design/component-toolkit/internal';
|
|
4
4
|
import isNativeSmoothScrollingSupported from './native-smooth-scroll-supported';
|
|
5
5
|
// The scroll speed depends on the scrolling distance. The equation below is an interpolation of measurements in Chrome.
|
|
6
6
|
const getScrollSpeed = (pixels) => 0.0015 * Math.abs(pixels) + 0.558;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-scroll.js","sourceRoot":"lib/default/","sources":["tabs/smooth-scroll.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"smooth-scroll.js","sourceRoot":"lib/default/","sources":["tabs/smooth-scroll.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,gCAAgC,MAAM,kCAAkC,CAAC;AAUhF,wHAAwH;AACxH,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAC7E,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhG,MAAM,GAAG,GAAG,GA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C,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAAoB,EAAE,EAAU,EAAE,EAAE;IACxD,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,CAAC,UAAU,GAAG,EAAE,CAAC;QACxB,OAAO;KACR;IACD,IAAI,gCAAgC,EAAE,IAAI,OAAO,CAAC,QAAQ,EAAE;QAC1D,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QACH,OAAO;KACR;IACD,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isMotionDisabled } from '@cloudscape-design/component-toolkit/internal';\nimport isNativeSmoothScrollingSupported from './native-smooth-scroll-supported';\n\ninterface ScrollContext {\n scrollable: HTMLElement;\n startX: number;\n endX: number;\n startTime: number;\n scrollTime: number;\n}\n\n// The scroll speed depends on the scrolling distance. The equation below is an interpolation of measurements in Chrome.\nconst getScrollSpeed = (pixels: number) => 0.0015 * Math.abs(pixels) + 0.558;\nconst getScrollTime = (pixels: number) => Math.round(Math.abs(pixels) / getScrollSpeed(pixels));\n\nconst now = () => (window.performance ? window.performance.now() : Date.now());\n\nconst ease = (k: number): number => {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n};\n\nconst step = (context: ScrollContext): void => {\n const time = now();\n const elapsed = Math.min((time - context.startTime) / context.scrollTime, 1);\n const value = ease(elapsed);\n const currentX = context.startX + (context.endX - context.startX) * value;\n context.scrollable.scrollLeft = currentX;\n // scroll more if we have not reached our destination\n if (currentX !== context.endX) {\n requestAnimationFrame(() => step(context));\n }\n};\n\nconst simulateSmoothScroll = (element: HTMLElement, endX: number): void => {\n const startX = element.scrollLeft;\n step({\n scrollable: element,\n startX,\n endX,\n startTime: now(),\n scrollTime: getScrollTime(endX - startX),\n });\n};\n\nconst smoothScroll = (element: HTMLElement, to: number) => {\n if (isMotionDisabled(element)) {\n element.scrollLeft = to;\n return;\n }\n if (isNativeSmoothScrollingSupported() && element.scrollTo) {\n element.scrollTo({\n left: to,\n behavior: 'smooth',\n });\n return;\n }\n simulateSmoothScroll(element, to);\n};\n\nexport default smoothScroll;\n"]}
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudscape-design/components-themeable",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.354",
|
|
4
4
|
"files": [
|
|
5
|
-
"lib"
|
|
6
|
-
"package.json",
|
|
7
|
-
"README.md"
|
|
5
|
+
"lib"
|
|
8
6
|
],
|
|
9
7
|
"main": "lib/theming.js",
|
|
10
8
|
"types": "lib/theming.d.ts",
|
|
@@ -23,11 +21,6 @@
|
|
|
23
21
|
"dependencies": {
|
|
24
22
|
"@cloudscape-design/theming-build": "^1.0.0"
|
|
25
23
|
},
|
|
26
|
-
"lint-staged": {
|
|
27
|
-
"*.{js,jsx,ts,tsx}": [
|
|
28
|
-
"eslint --fix"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
24
|
"repository": {
|
|
32
25
|
"type": "git",
|
|
33
26
|
"url": "https://github.com/cloudscape-design/components.git"
|
package/NOTICE
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"lib/default/","sources":["internal/motion.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,YAAa,WAAW,KAAG,OAEoB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { findUpUntil } from './utils/dom';
|
|
4
|
-
export const isMotionDisabled = (element) => {
|
|
5
|
-
var _a, _b;
|
|
6
|
-
return !!findUpUntil(element, node => node.classList.contains('awsui-motion-disabled')) ||
|
|
7
|
-
((_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-reduced-motion: reduce)').matches) !== null && _b !== void 0 ? _b : false);
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=motion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"motion.js","sourceRoot":"lib/default/","sources":["internal/motion.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAoB,EAAW,EAAE;;IAChE,OAAA,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;QAChF,CAAC,MAAA,MAAA,MAAM,CAAC,UAAU,uDAAG,kCAAkC,EAAE,OAAO,mCAAI,KAAK,CAAC,CAAA;CAAA,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { findUpUntil } from './utils/dom';\n\nexport const isMotionDisabled = (element: HTMLElement): boolean =>\n !!findUpUntil(element, node => node.classList.contains('awsui-motion-disabled')) ||\n (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false);\n"]}
|