@cloudscape-design/components 3.0.59 → 3.0.60
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/attribute-editor/styles.scoped.css +4 -1
- package/breadcrumb-group/item/styles.scoped.css +2 -0
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +2 -2
- package/flashbar/flash.js.map +1 -1
- package/flashbar/interfaces.d.ts +2 -0
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/help-panel/styles.scoped.css +2 -0
- package/input/internal.js +1 -1
- package/input/internal.js.map +1 -1
- package/internal/environment.js +1 -1
- package/link/styles.scoped.css +18 -1
- package/package.json +1 -1
- package/property-filter/styles.css.js +25 -30
- package/property-filter/styles.scoped.css +28 -55
- package/property-filter/styles.selectors.js +25 -30
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js +13 -28
- package/property-filter/token-editor.js.map +1 -1
- package/tag-editor/styles.scoped.css +2 -0
- package/text-content/styles.scoped.css +6 -1
- package/textarea/index.js +1 -1
- package/textarea/index.js.map +1 -1
- package/token-group/styles.scoped.css +2 -0
|
@@ -202,10 +202,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
202
202
|
color: var(--color-text-link-default-5f186r, #0972d3);
|
|
203
203
|
font-weight: var(--font-link-primary-weight-91pybi, "inherit");
|
|
204
204
|
letter-spacing: var(--font-link-primary-letter-spacing-vmsgcx, "inherit");
|
|
205
|
-
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
205
|
+
-webkit-text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
206
|
+
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
206
207
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
207
208
|
text-decoration-color: var(--color-text-link-primary-underline-ga7rq8, #0972d3);
|
|
209
|
+
transition-property: color, -webkit-text-decoration;
|
|
208
210
|
transition-property: color, text-decoration;
|
|
211
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
209
212
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
210
213
|
}
|
|
211
214
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -108,7 +108,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
108
108
|
text-decoration: none;
|
|
109
109
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
110
110
|
text-decoration-color: transparent;
|
|
111
|
+
transition-property: color, -webkit-text-decoration;
|
|
111
112
|
transition-property: color, text-decoration;
|
|
113
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
112
114
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
113
115
|
}
|
|
114
116
|
@media (prefers-reduced-motion: reduce) {
|
package/flashbar/flash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AA6C1B,UAAU,KAAM,SAAQ,aAAa,CAAC,iBAAiB;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AA6C1B,UAAU,KAAM,SAAQ,aAAa,CAAC,iBAAiB;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,8EA4EjB,CAAC"}
|
package/flashbar/flash.js
CHANGED
|
@@ -21,7 +21,7 @@ function dismissButton(dismissLabel, onDismiss) {
|
|
|
21
21
|
}
|
|
22
22
|
export var Flash = React.forwardRef(function (_a, ref) {
|
|
23
23
|
var _b;
|
|
24
|
-
var header = _a.header, content = _a.content, dismissible = _a.dismissible, dismissLabel = _a.dismissLabel, loading = _a.loading, action = _a.action, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onDismiss = _a.onDismiss, className = _a.className, transitionState = _a.transitionState, _c = _a.type, type = _c === void 0 ? 'info' : _c;
|
|
24
|
+
var header = _a.header, content = _a.content, dismissible = _a.dismissible, dismissLabel = _a.dismissLabel, statusIconAriaLabel = _a.statusIconAriaLabel, loading = _a.loading, action = _a.action, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onDismiss = _a.onDismiss, className = _a.className, transitionState = _a.transitionState, _c = _a.type, type = _c === void 0 ? 'info' : _c;
|
|
25
25
|
if (isDevelopment) {
|
|
26
26
|
if (buttonText && !onButtonClick) {
|
|
27
27
|
warnOnce('Flashbar', "You provided a `buttonText` prop without an `onButtonClick` handler. This will render a non-interactive action button.");
|
|
@@ -43,7 +43,7 @@ export var Flash = React.forwardRef(function (_a, ref) {
|
|
|
43
43
|
_b[styles.exiting] = transitionState === 'exiting',
|
|
44
44
|
_b[styles.exited] = transitionState === 'exited',
|
|
45
45
|
_b) : '') },
|
|
46
|
-
React.createElement("div", { className: clsx(styles['flash-icon'], styles['flash-text']) }, icon),
|
|
46
|
+
React.createElement("div", { className: clsx(styles['flash-icon'], styles['flash-text']), role: "img", "aria-label": statusIconAriaLabel }, icon),
|
|
47
47
|
React.createElement("div", { className: styles['flash-body'] },
|
|
48
48
|
React.createElement("div", { className: clsx(styles['flash-message'], styles['flash-text']) },
|
|
49
49
|
React.createElement("div", { className: styles['flash-header'] }, header),
|
package/flashbar/flash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flash.js","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,IAAM,UAAU,GAAG;IACjB,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,iBAAiB;CAChB,CAAC;AAEX,SAAS,YAAY,CACnB,UAAyD,EACzD,aAA+D;IAE/D,OAAO,CACL,oBAAC,cAAc,IAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,UAAU,EAAC,MAAM,IAC1F,UAAU,CACI,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CACpB,YAA6D,EAC7D,SAAuD;IAEvD,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC;QAC9C,oBAAC,cAAc,IACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,eAAe,EACvB,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,YAAY,GACvB,CACE,CACP,CAAC;AACJ,CAAC;AAOD,MAAM,CAAC,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,UACE,
|
|
1
|
+
{"version":3,"file":"flash.js","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"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AAe,KAAK,QAAQ;oBAEjD,CAAC,CAAC,EAAE,CACP;QAED,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAC,KAAK,gBAAa,mBAAmB,IACzG,IAAI,CACD;QACN,6BAAK,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC;YAClC,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;gBACjE,6BAAK,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAAG,MAAM,CAAO;gBACtD,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAAG,OAAO,CAAO,CACpD;YACL,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,MAAM,CAAO,CACtE;QACL,WAAW,IAAI,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,CAClD,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { FlashbarProps } from './interfaces';\nimport React from 'react';\nimport InternalSpinner from '../spinner/internal';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport { warnOnce } from '../internal/logging';\nimport { isDevelopment } from '../internal/is-development';\n\nconst ICON_TYPES = {\n success: 'status-positive',\n warning: 'status-warning',\n info: 'status-info',\n error: 'status-negative',\n} as const;\n\nfunction actionButton(\n buttonText: FlashbarProps.MessageDefinition['buttonText'],\n onButtonClick: FlashbarProps.MessageDefinition['onButtonClick']\n) {\n return (\n <InternalButton onClick={onButtonClick} className={styles['action-button']} formAction=\"none\">\n {buttonText}\n </InternalButton>\n );\n}\n\nfunction dismissButton(\n dismissLabel: FlashbarProps.MessageDefinition['dismissLabel'],\n onDismiss: FlashbarProps.MessageDefinition['onDismiss']\n) {\n return (\n <div className={styles['dismiss-button-wrapper']}>\n <InternalButton\n onClick={onDismiss}\n className={styles['dismiss-button']}\n variant=\"flashbar-icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={dismissLabel}\n />\n </div>\n );\n}\n\ninterface Flash extends FlashbarProps.MessageDefinition {\n className: string;\n transitionState?: string;\n}\n\nexport const Flash = React.forwardRef(\n (\n {\n header,\n content,\n dismissible,\n dismissLabel,\n statusIconAriaLabel,\n loading,\n action,\n buttonText,\n onButtonClick,\n onDismiss,\n className,\n transitionState,\n type = 'info',\n }: Flash,\n ref: React.Ref<HTMLDivElement>\n ) => {\n if (isDevelopment) {\n if (buttonText && !onButtonClick) {\n warnOnce(\n 'Flashbar',\n `You provided a \\`buttonText\\` prop without an \\`onButtonClick\\` handler. This will render a non-interactive action button.`\n );\n }\n\n if (dismissible && !onDismiss) {\n warnOnce(\n 'Flashbar',\n `You have set the \\`dismissible\\` prop without an \\`onDismiss\\` handler. This will render a non-interactive dismiss button.`\n );\n }\n }\n\n const button = action || (buttonText && actionButton(buttonText, onButtonClick));\n\n const iconType = ICON_TYPES[type];\n\n const icon = loading ? <InternalSpinner /> : <InternalIcon name={iconType} />;\n\n const effectiveType = loading ? 'info' : type;\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.flash,\n styles[`flash-type-${effectiveType}`],\n className,\n transitionState\n ? {\n [styles.enter]: transitionState === 'enter',\n [styles.entering]: transitionState === 'entering',\n [styles.entered]: transitionState === 'entered',\n [styles.exit]: transitionState === 'exit',\n [styles.exiting]: transitionState === 'exiting',\n [styles.exited]: transitionState === 'exited',\n }\n : ''\n )}\n >\n <div className={clsx(styles['flash-icon'], styles['flash-text'])} role=\"img\" aria-label={statusIconAriaLabel}>\n {icon}\n </div>\n <div className={styles['flash-body']}>\n <div className={clsx(styles['flash-message'], styles['flash-text'])}>\n <div className={styles['flash-header']}>{header}</div>\n <div className={styles['flash-content']}>{content}</div>\n </div>\n {button && <div className={styles['action-button-wrapper']}>{button}</div>}\n </div>\n {dismissible && dismissButton(dismissLabel, onDismiss)}\n </div>\n );\n }\n);\n"]}
|
package/flashbar/interfaces.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare namespace FlashbarProps {
|
|
|
7
7
|
content?: React.ReactNode;
|
|
8
8
|
dismissible?: boolean;
|
|
9
9
|
dismissLabel?: string;
|
|
10
|
+
statusIconAriaLabel?: string;
|
|
10
11
|
loading?: boolean;
|
|
11
12
|
type?: FlashbarProps.Type;
|
|
12
13
|
action?: React.ReactNode;
|
|
@@ -30,6 +31,7 @@ export interface FlashbarProps extends BaseComponentProps {
|
|
|
30
31
|
* * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.
|
|
31
32
|
* When a user clicks on this button the `onDismiss` handler is called.
|
|
32
33
|
* * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.
|
|
34
|
+
* * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.
|
|
33
35
|
* * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,
|
|
34
36
|
* our UX guidelines only allow you to add a button.
|
|
35
37
|
* * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/flashbar/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,iBAAiB;QAChC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,WAAW,CAAC,E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aAAa,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QACvC,SAAS,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;KACpC;IAED,KAAY,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;CAC7D;AAED,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;CACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/flashbar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport React from 'react';\nimport { ButtonProps } from '../button/interfaces';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called. If the `action` property is set, this property is ignored.\n * **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n * @visualrefresh `id` property\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/flashbar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport React from 'react';\nimport { ButtonProps } from '../button/interfaces';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n statusIconAriaLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called. If the `action` property is set, this property is ignored.\n * **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n * @visualrefresh `id` property\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n}\n"]}
|
|
@@ -245,7 +245,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
245
245
|
text-decoration: none;
|
|
246
246
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
247
247
|
text-decoration-color: transparent;
|
|
248
|
+
transition-property: color, -webkit-text-decoration;
|
|
248
249
|
transition-property: color, text-decoration;
|
|
250
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
249
251
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
250
252
|
}
|
|
251
253
|
@media (prefers-reduced-motion: reduce) {
|
package/input/internal.js
CHANGED
|
@@ -54,7 +54,7 @@ function InternalInput(_a, ref) {
|
|
|
54
54
|
return (React.createElement("div", __assign({}, baseProps, { className: clsx(baseProps.className, styles['input-container']), ref: __internalRootRef }),
|
|
55
55
|
__leftIcon && (React.createElement("span", { onClick: __onLeftIconClick, className: iconClassName('left', !!__onLeftIconClick) },
|
|
56
56
|
React.createElement(InternalIcon, { name: __leftIcon, variant: disabled ? 'disabled' : __leftIconVariant }))),
|
|
57
|
-
React.createElement("input", __assign({
|
|
57
|
+
React.createElement("input", __assign({ ref: mergedRef }, attributes, { spellCheck: false })),
|
|
58
58
|
__rightIcon && (React.createElement("span", { onClick: __onRightIconClick, onMouseDown: preventMouseDown, className: iconClassName('right', !!__onRightIconClick) },
|
|
59
59
|
React.createElement(InternalIcon, { name: __rightIcon, variant: disabled ? 'disabled' : __rightIconVariant })))));
|
|
60
60
|
}
|
package/input/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAA0B,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAEjB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAyB9E,IAAM,aAAa,GAAG,UAAC,QAAgB,EAAE,UAAmB;;IAC1D,OAAA,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,qBAAc,QAAQ,CAAE,CAAC,YAA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AE,GAAG,EAAE,iBAAiB;QACxG,UAAU,IAAI,CACb,8BAAM,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,iBAAiB,CAAC;YACrF,oBAAC,YAAY,IAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,GAAI,CACjF,CACR;QACD,wCAAO,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,IAAM,UAAU,EAAI;QAC3D,WAAW,IAAI,CACd,8BACE,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,kBAAkB,CAAC;YAEvD,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,GAAI,CACnF,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEventHandler, Ref, useRef } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport {\n fireNonCancelableEvent,\n fireKeyboardEvent,\n NonCancelableEventHandler,\n getBlurEventRelatedTarget,\n} from '../internal/events';\nimport { InputProps, BaseInputProps, BaseChangeDetail } from './interfaces';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { useSearchProps, convertAutoComplete } from './utils';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputProps,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __rightIconVariant?: IconProps['variant'];\n __onRightIconClick?: () => void;\n\n __nativeAttributes?: Record<string, any>;\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n}\n\nconst iconClassName = (position: string, hasHandler: boolean) =>\n clsx(styles['input-icon'], styles[`input-icon-${position}`], { [styles['input-icon-hoverable']]: hasHandler });\nconst preventMouseDown: MouseEventHandler = e => e.preventDefault();\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n name,\n value,\n controlId,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n invalid,\n ariaRequired,\n\n __rightIcon,\n __rightIconVariant = 'normal',\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n __nativeAttributes,\n __internalRootRef,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n onBlur && fireNonCancelableEvent(onBlur);\n __onBlurWithDetail &&\n fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: getBlurEventRelatedTarget(e.nativeEvent) });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n ...__nativeAttributes,\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles['input-container'])} ref={__internalRootRef}>\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={iconClassName('left', !!__onLeftIconClick)}>\n <InternalIcon name={__leftIcon} variant={disabled ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <input spellCheck={false} ref={mergedRef} {...attributes} />\n {__rightIcon && (\n <span\n onClick={__onRightIconClick}\n onMouseDown={preventMouseDown}\n className={iconClassName('right', !!__onRightIconClick)}\n >\n <InternalIcon name={__rightIcon} variant={disabled ? 'disabled' : __rightIconVariant} />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAA0B,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAEjB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAyB9E,IAAM,aAAa,GAAG,UAAC,QAAgB,EAAE,UAAmB;;IAC1D,OAAA,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,qBAAc,QAAQ,CAAE,CAAC,YAAI,GAAC,MAAM,CAAC,sBAAsB,CAAC,IAAG,UAAU,MAAG;AAA9G,CAA8G,CAAC;AACjH,IAAM,gBAAgB,GAAsB,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,cAAc,EAAE,EAAlB,CAAkB,CAAC;AAEpE,SAAS,aAAa,CACpB,EAuCqB,EACrB,GAA0B;;IAvCxB,IAAA,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EACb,IAAI,UA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,wCAAO,GAAG,EAAE,SAAS,IAAM,UAAU,IAAE,UAAU,EAAE,KAAK,IAAI;QAC3D,WAAW,IAAI,CACd,8BACE,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,kBAAkB,CAAC;YAEvD,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,GAAI,CACnF,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEventHandler, Ref, useRef } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport {\n fireNonCancelableEvent,\n fireKeyboardEvent,\n NonCancelableEventHandler,\n getBlurEventRelatedTarget,\n} from '../internal/events';\nimport { InputProps, BaseInputProps, BaseChangeDetail } from './interfaces';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { useSearchProps, convertAutoComplete } from './utils';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputProps,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __rightIconVariant?: IconProps['variant'];\n __onRightIconClick?: () => void;\n\n __nativeAttributes?: Record<string, any>;\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n}\n\nconst iconClassName = (position: string, hasHandler: boolean) =>\n clsx(styles['input-icon'], styles[`input-icon-${position}`], { [styles['input-icon-hoverable']]: hasHandler });\nconst preventMouseDown: MouseEventHandler = e => e.preventDefault();\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n name,\n value,\n controlId,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n invalid,\n ariaRequired,\n\n __rightIcon,\n __rightIconVariant = 'normal',\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n __nativeAttributes,\n __internalRootRef,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n onBlur && fireNonCancelableEvent(onBlur);\n __onBlurWithDetail &&\n fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: getBlurEventRelatedTarget(e.nativeEvent) });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n ...__nativeAttributes,\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles['input-container'])} ref={__internalRootRef}>\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={iconClassName('left', !!__onLeftIconClick)}>\n <InternalIcon name={__leftIcon} variant={disabled ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <input ref={mergedRef} {...attributes} spellCheck={false} />\n {__rightIcon && (\n <span\n onClick={__onRightIconClick}\n onMouseDown={preventMouseDown}\n className={iconClassName('right', !!__onRightIconClick)}\n >\n <InternalIcon name={__rightIcon} variant={disabled ? 'disabled' : __rightIconVariant} />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
package/internal/environment.js
CHANGED
package/link/styles.scoped.css
CHANGED
|
@@ -133,7 +133,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
133
133
|
text-decoration: none;
|
|
134
134
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
135
135
|
text-decoration-color: transparent;
|
|
136
|
+
transition-property: color, -webkit-text-decoration;
|
|
136
137
|
transition-property: color, text-decoration;
|
|
138
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
137
139
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
138
140
|
}
|
|
139
141
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -168,7 +170,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
168
170
|
text-decoration: none;
|
|
169
171
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
170
172
|
text-decoration-color: transparent;
|
|
173
|
+
transition-property: color, -webkit-text-decoration;
|
|
171
174
|
transition-property: color, text-decoration;
|
|
175
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
172
176
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
173
177
|
}
|
|
174
178
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -200,10 +204,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
200
204
|
color: var(--color-text-link-default-5f186r, #0972d3);
|
|
201
205
|
font-weight: var(--font-link-primary-weight-91pybi, "inherit");
|
|
202
206
|
letter-spacing: var(--font-link-primary-letter-spacing-vmsgcx, "inherit");
|
|
203
|
-
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
207
|
+
-webkit-text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
208
|
+
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
204
209
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
205
210
|
text-decoration-color: var(--color-text-link-primary-underline-ga7rq8, #0972d3);
|
|
211
|
+
transition-property: color, -webkit-text-decoration;
|
|
206
212
|
transition-property: color, text-decoration;
|
|
213
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
207
214
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
208
215
|
}
|
|
209
216
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -238,7 +245,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
238
245
|
text-decoration: none;
|
|
239
246
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
240
247
|
text-decoration-color: transparent;
|
|
248
|
+
transition-property: color, -webkit-text-decoration;
|
|
241
249
|
transition-property: color, text-decoration;
|
|
250
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
242
251
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
243
252
|
}
|
|
244
253
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -272,7 +281,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
272
281
|
text-decoration: none;
|
|
273
282
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
274
283
|
text-decoration-color: transparent;
|
|
284
|
+
transition-property: color, -webkit-text-decoration;
|
|
275
285
|
transition-property: color, text-decoration;
|
|
286
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
276
287
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
277
288
|
}
|
|
278
289
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -307,7 +318,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
307
318
|
text-decoration: none;
|
|
308
319
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
309
320
|
text-decoration-color: transparent;
|
|
321
|
+
transition-property: color, -webkit-text-decoration;
|
|
310
322
|
transition-property: color, text-decoration;
|
|
323
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
311
324
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
312
325
|
}
|
|
313
326
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -342,7 +355,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
342
355
|
text-decoration: underline;
|
|
343
356
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
344
357
|
text-decoration-color: var(--color-text-link-button-underline-8mp92t, transparent);
|
|
358
|
+
transition-property: color, -webkit-text-decoration;
|
|
345
359
|
transition-property: color, text-decoration;
|
|
360
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
346
361
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
347
362
|
}
|
|
348
363
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -377,7 +392,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
377
392
|
text-decoration: none;
|
|
378
393
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
379
394
|
text-decoration-color: transparent;
|
|
395
|
+
transition-property: color, -webkit-text-decoration;
|
|
380
396
|
transition-property: color, text-decoration;
|
|
397
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
381
398
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
382
399
|
}
|
|
383
400
|
@media (prefers-reduced-motion: reduce) {
|
package/package.json
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"search-field": "awsui_search-
|
|
6
|
-
"input-wrapper": "awsui_input-
|
|
7
|
-
"add-token": "awsui_add-
|
|
8
|
-
"tokens": "
|
|
9
|
-
"token-operator": "awsui_token-
|
|
10
|
-
"token-editor": "awsui_token-
|
|
11
|
-
"token-editor-form": "awsui_token-editor-
|
|
12
|
-
"token-editor-
|
|
13
|
-
"token-editor-
|
|
14
|
-
"token-editor-
|
|
15
|
-
"token-editor-
|
|
16
|
-
"token-editor-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"token-
|
|
29
|
-
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_1rh4s_224",
|
|
30
|
-
"remove-all": "awsui_remove-all_1wzqe_1rh4s_228",
|
|
31
|
-
"token-label": "awsui_token-label_1wzqe_1rh4s_229",
|
|
32
|
-
"join-operation": "awsui_join-operation_1wzqe_1rh4s_230",
|
|
33
|
-
"token-editor-submit": "awsui_token-editor-submit_1wzqe_1rh4s_231"
|
|
4
|
+
"root": "awsui_root_1wzqe_3s5a7_93",
|
|
5
|
+
"search-field": "awsui_search-field_1wzqe_3s5a7_104",
|
|
6
|
+
"input-wrapper": "awsui_input-wrapper_1wzqe_3s5a7_110",
|
|
7
|
+
"add-token": "awsui_add-token_1wzqe_3s5a7_114",
|
|
8
|
+
"tokens": "awsui_tokens_1wzqe_3s5a7_121",
|
|
9
|
+
"token-operator": "awsui_token-operator_1wzqe_3s5a7_125",
|
|
10
|
+
"token-editor": "awsui_token-editor_1wzqe_3s5a7_129",
|
|
11
|
+
"token-editor-form": "awsui_token-editor-form_1wzqe_3s5a7_136",
|
|
12
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1wzqe_3s5a7_139",
|
|
13
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_3s5a7_142",
|
|
14
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1wzqe_3s5a7_145",
|
|
15
|
+
"token-editor-actions": "awsui_token-editor-actions_1wzqe_3s5a7_148",
|
|
16
|
+
"token-editor-commit": "awsui_token-editor-commit_1wzqe_3s5a7_157",
|
|
17
|
+
"custom-control": "awsui_custom-control_1wzqe_3s5a7_161",
|
|
18
|
+
"input": "awsui_input_1wzqe_3s5a7_110",
|
|
19
|
+
"results": "awsui_results_1wzqe_3s5a7_169",
|
|
20
|
+
"results-visible": "awsui_results-visible_1wzqe_3s5a7_175",
|
|
21
|
+
"separator": "awsui_separator_1wzqe_3s5a7_179",
|
|
22
|
+
"toggle-collapsed": "awsui_toggle-collapsed_1wzqe_3s5a7_186",
|
|
23
|
+
"token-trigger": "awsui_token-trigger_1wzqe_3s5a7_191",
|
|
24
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_3s5a7_197",
|
|
25
|
+
"remove-all": "awsui_remove-all_1wzqe_3s5a7_201",
|
|
26
|
+
"token-label": "awsui_token-label_1wzqe_3s5a7_202",
|
|
27
|
+
"join-operation": "awsui_join-operation_1wzqe_3s5a7_203",
|
|
28
|
+
"token-editor-submit": "awsui_token-editor-submit_1wzqe_3s5a7_204"
|
|
34
29
|
};
|
|
35
30
|
|
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_root_1wzqe_3s5a7_93:not(#\9) {
|
|
94
94
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
95
95
|
border-collapse: separate;
|
|
96
96
|
border-spacing: 0;
|
|
@@ -127,78 +127,51 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
127
127
|
font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.awsui_search-
|
|
130
|
+
.awsui_search-field_1wzqe_3s5a7_104:not(#\9) {
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
133
|
max-width: calc(688px - 2 * var(--space-l-4vl6xu, 20px));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.awsui_input-
|
|
136
|
+
.awsui_input-wrapper_1wzqe_3s5a7_110:not(#\9) {
|
|
137
137
|
flex-grow: 1;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
.awsui_add-
|
|
140
|
+
.awsui_add-token_1wzqe_3s5a7_114:not(#\9) {
|
|
141
141
|
border-left: 1px solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
142
142
|
box-sizing: border-box;
|
|
143
143
|
margin-left: var(--space-m-17eucw, 16px);
|
|
144
144
|
padding-left: var(--space-m-17eucw, 16px);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.
|
|
147
|
+
.awsui_tokens_1wzqe_3s5a7_121:not(#\9) {
|
|
148
148
|
margin-top: var(--space-xs-rsr2qu, 8px);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.awsui_token-
|
|
151
|
+
.awsui_token-operator_1wzqe_3s5a7_125:not(#\9) {
|
|
152
152
|
font-weight: bold;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
.awsui_token-
|
|
155
|
+
.awsui_token-editor_1wzqe_3s5a7_129:not(#\9) {
|
|
156
156
|
margin: var(--space-xxs-ynfts5, 4px);
|
|
157
157
|
min-width: 300px;
|
|
158
158
|
display: flex;
|
|
159
159
|
flex-direction: column;
|
|
160
160
|
justify-content: space-between;
|
|
161
161
|
}
|
|
162
|
-
.awsui_token-editor-
|
|
163
|
-
display: grid;
|
|
164
|
-
grid-template-columns: max-content minmax(var(--space-xl-a39hup, 24px), 1fr) minmax(200px, min-content);
|
|
165
|
-
grid-row-gap: var(--space-scaled-l-t03y3z, 20px);
|
|
162
|
+
.awsui_token-editor-form_1wzqe_3s5a7_136:not(#\9) {
|
|
166
163
|
margin-bottom: var(--space-scaled-l-t03y3z, 20px);
|
|
167
164
|
}
|
|
168
|
-
.awsui_token-editor-
|
|
169
|
-
|
|
170
|
-
align-self: center;
|
|
171
|
-
}
|
|
172
|
-
.awsui_token-editor-label-text_1wzqe_1rh4s_146:not(#\9) {
|
|
173
|
-
word-wrap: break-word;
|
|
174
|
-
max-width: 100%;
|
|
175
|
-
overflow: hidden;
|
|
176
|
-
}
|
|
177
|
-
.awsui_token-editor-label-property_1wzqe_1rh4s_151:not(#\9) {
|
|
178
|
-
grid-row: 1;
|
|
179
|
-
grid-column: 1;
|
|
180
|
-
}
|
|
181
|
-
.awsui_token-editor-label-operator_1wzqe_1rh4s_155:not(#\9) {
|
|
182
|
-
grid-row: 2;
|
|
183
|
-
grid-column: 1;
|
|
184
|
-
}
|
|
185
|
-
.awsui_token-editor-label-value_1wzqe_1rh4s_159:not(#\9) {
|
|
186
|
-
grid-row: 3;
|
|
187
|
-
grid-column: 1;
|
|
188
|
-
}
|
|
189
|
-
.awsui_token-editor-field-property_1wzqe_1rh4s_163:not(#\9) {
|
|
190
|
-
grid-row: 1;
|
|
191
|
-
grid-column: 3;
|
|
165
|
+
.awsui_token-editor-field-property_1wzqe_3s5a7_139:not(#\9) {
|
|
166
|
+
/* used in test-utils */
|
|
192
167
|
}
|
|
193
|
-
.awsui_token-editor-field-
|
|
194
|
-
|
|
195
|
-
grid-column: 3;
|
|
168
|
+
.awsui_token-editor-field-operator_1wzqe_3s5a7_142:not(#\9) {
|
|
169
|
+
margin-top: var(--space-scaled-l-t03y3z, 20px);
|
|
196
170
|
}
|
|
197
|
-
.awsui_token-editor-field-
|
|
198
|
-
|
|
199
|
-
grid-column: 3;
|
|
171
|
+
.awsui_token-editor-field-value_1wzqe_3s5a7_145:not(#\9) {
|
|
172
|
+
margin-top: var(--space-scaled-l-t03y3z, 20px);
|
|
200
173
|
}
|
|
201
|
-
.awsui_token-editor-
|
|
174
|
+
.awsui_token-editor-actions_1wzqe_3s5a7_148:not(#\9) {
|
|
202
175
|
display: flex;
|
|
203
176
|
justify-content: flex-end;
|
|
204
177
|
padding-top: var(--space-s-hv8c1d, 12px);
|
|
@@ -207,53 +180,53 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
207
180
|
margin-left: calc(-1 * var(--space-m-17eucw, 16px) + -1 * var(--space-xxs-ynfts5, 4px));
|
|
208
181
|
margin-right: calc(-1 * var(--space-m-17eucw, 16px) + -1 * var(--space-xxs-ynfts5, 4px));
|
|
209
182
|
}
|
|
210
|
-
.awsui_token-editor-
|
|
183
|
+
.awsui_token-editor-commit_1wzqe_3s5a7_157:not(#\9) {
|
|
211
184
|
margin-left: var(--space-xs-rsr2qu, 8px);
|
|
212
185
|
}
|
|
213
186
|
|
|
214
|
-
.awsui_custom-
|
|
187
|
+
.awsui_custom-control_1wzqe_3s5a7_161:not(#\9) {
|
|
215
188
|
margin-right: var(--space-s-hv8c1d, 12px);
|
|
216
189
|
}
|
|
217
190
|
|
|
218
|
-
.
|
|
191
|
+
.awsui_input_1wzqe_3s5a7_110:not(#\9) {
|
|
219
192
|
flex: 1;
|
|
220
193
|
}
|
|
221
194
|
|
|
222
|
-
.
|
|
195
|
+
.awsui_results_1wzqe_3s5a7_169:not(#\9) {
|
|
223
196
|
color: var(--color-text-form-label-k3j0b4, #000716);
|
|
224
197
|
display: inline-block;
|
|
225
198
|
box-sizing: border-box;
|
|
226
199
|
white-space: nowrap;
|
|
227
200
|
}
|
|
228
|
-
.awsui_results-
|
|
201
|
+
.awsui_results-visible_1wzqe_3s5a7_175:not(#\9) {
|
|
229
202
|
padding-left: var(--space-s-hv8c1d, 12px);
|
|
230
203
|
}
|
|
231
204
|
|
|
232
|
-
.
|
|
205
|
+
.awsui_separator_1wzqe_3s5a7_179:not(#\9) {
|
|
233
206
|
margin: 0px var(--space-scaled-m-pv0fmt, 16px);
|
|
234
207
|
height: 100%;
|
|
235
208
|
width: var(--border-divider-section-width-4wm2it, 2px);
|
|
236
209
|
background-color: var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
237
210
|
}
|
|
238
211
|
|
|
239
|
-
.awsui_toggle-
|
|
212
|
+
.awsui_toggle-collapsed_1wzqe_3s5a7_186:not(#\9) {
|
|
240
213
|
margin-top: calc(-1 * var(--space-scaled-xxs-95dhkm, 4px));
|
|
241
214
|
margin-left: var(--space-xs-rsr2qu, 8px);
|
|
242
215
|
}
|
|
243
216
|
|
|
244
|
-
.awsui_token-
|
|
217
|
+
.awsui_token-trigger_1wzqe_3s5a7_191:not(#\9) {
|
|
245
218
|
min-width: 0;
|
|
246
219
|
-ms-word-break: break-all;
|
|
247
220
|
word-break: break-word;
|
|
248
221
|
}
|
|
249
222
|
|
|
250
|
-
.awsui_token-editor-
|
|
223
|
+
.awsui_token-editor-cancel_1wzqe_3s5a7_197:not(#\9) {
|
|
251
224
|
margin-right: var(--space-xs-rsr2qu, 8px);
|
|
252
225
|
}
|
|
253
226
|
|
|
254
|
-
.awsui_remove-
|
|
255
|
-
.awsui_token-
|
|
256
|
-
.awsui_join-
|
|
257
|
-
.awsui_token-editor-
|
|
227
|
+
.awsui_remove-all_1wzqe_3s5a7_201:not(#\9),
|
|
228
|
+
.awsui_token-label_1wzqe_3s5a7_202:not(#\9),
|
|
229
|
+
.awsui_join-operation_1wzqe_3s5a7_203:not(#\9),
|
|
230
|
+
.awsui_token-editor-submit_1wzqe_3s5a7_204:not(#\9) {
|
|
258
231
|
/* used in test-utils */
|
|
259
232
|
}
|
|
@@ -2,35 +2,30 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"search-field": "awsui_search-
|
|
7
|
-
"input-wrapper": "awsui_input-
|
|
8
|
-
"add-token": "awsui_add-
|
|
9
|
-
"tokens": "
|
|
10
|
-
"token-operator": "awsui_token-
|
|
11
|
-
"token-editor": "awsui_token-
|
|
12
|
-
"token-editor-form": "awsui_token-editor-
|
|
13
|
-
"token-editor-
|
|
14
|
-
"token-editor-
|
|
15
|
-
"token-editor-
|
|
16
|
-
"token-editor-
|
|
17
|
-
"token-editor-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"token-
|
|
30
|
-
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_1rh4s_224",
|
|
31
|
-
"remove-all": "awsui_remove-all_1wzqe_1rh4s_228",
|
|
32
|
-
"token-label": "awsui_token-label_1wzqe_1rh4s_229",
|
|
33
|
-
"join-operation": "awsui_join-operation_1wzqe_1rh4s_230",
|
|
34
|
-
"token-editor-submit": "awsui_token-editor-submit_1wzqe_1rh4s_231"
|
|
5
|
+
"root": "awsui_root_1wzqe_3s5a7_93",
|
|
6
|
+
"search-field": "awsui_search-field_1wzqe_3s5a7_104",
|
|
7
|
+
"input-wrapper": "awsui_input-wrapper_1wzqe_3s5a7_110",
|
|
8
|
+
"add-token": "awsui_add-token_1wzqe_3s5a7_114",
|
|
9
|
+
"tokens": "awsui_tokens_1wzqe_3s5a7_121",
|
|
10
|
+
"token-operator": "awsui_token-operator_1wzqe_3s5a7_125",
|
|
11
|
+
"token-editor": "awsui_token-editor_1wzqe_3s5a7_129",
|
|
12
|
+
"token-editor-form": "awsui_token-editor-form_1wzqe_3s5a7_136",
|
|
13
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1wzqe_3s5a7_139",
|
|
14
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_3s5a7_142",
|
|
15
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1wzqe_3s5a7_145",
|
|
16
|
+
"token-editor-actions": "awsui_token-editor-actions_1wzqe_3s5a7_148",
|
|
17
|
+
"token-editor-commit": "awsui_token-editor-commit_1wzqe_3s5a7_157",
|
|
18
|
+
"custom-control": "awsui_custom-control_1wzqe_3s5a7_161",
|
|
19
|
+
"input": "awsui_input_1wzqe_3s5a7_110",
|
|
20
|
+
"results": "awsui_results_1wzqe_3s5a7_169",
|
|
21
|
+
"results-visible": "awsui_results-visible_1wzqe_3s5a7_175",
|
|
22
|
+
"separator": "awsui_separator_1wzqe_3s5a7_179",
|
|
23
|
+
"toggle-collapsed": "awsui_toggle-collapsed_1wzqe_3s5a7_186",
|
|
24
|
+
"token-trigger": "awsui_token-trigger_1wzqe_3s5a7_191",
|
|
25
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_3s5a7_197",
|
|
26
|
+
"remove-all": "awsui_remove-all_1wzqe_3s5a7_201",
|
|
27
|
+
"token-label": "awsui_token-label_1wzqe_3s5a7_202",
|
|
28
|
+
"join-operation": "awsui_join-operation_1wzqe_3s5a7_203",
|
|
29
|
+
"token-editor-submit": "awsui_token-editor-submit_1wzqe_3s5a7_204"
|
|
35
30
|
};
|
|
36
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAiJxF,UAAU,gBAAgB;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,mBAAmB,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAClD,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,KAAK,CAAC;IACb,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,EACL,gBAAgB,GACjB,EAAE,gBAAgB,eAuGlB"}
|
|
@@ -2,26 +2,17 @@ import { __assign } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React, { useState, useRef } from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
5
|
import InternalSelect from '../select/internal';
|
|
7
6
|
import InternalAutosuggest from '../autosuggest/internal';
|
|
8
7
|
import InternalPopover from '../popover/internal';
|
|
9
8
|
import { InternalButton } from '../button/internal';
|
|
10
|
-
import { useUniqueId } from '../internal/hooks/use-unique-id/index';
|
|
11
9
|
import styles from './styles.css.js';
|
|
12
10
|
import { useLoadItems } from './use-load-items';
|
|
13
11
|
import { getAllowedOperators, getPropertyOptions, getPropertyByKey, operatorToDescription, getPropertySuggestions, } from './controller';
|
|
12
|
+
import InternalFormField from '../form-field/internal';
|
|
14
13
|
var freeTextOperators = [':', '!:'];
|
|
15
|
-
function TokenEditorField(_a) {
|
|
16
|
-
var type = _a.type, label = _a.label, children = _a.children;
|
|
17
|
-
var controlId = useUniqueId();
|
|
18
|
-
return (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement("label", { className: clsx(styles['token-editor-label'], styles["token-editor-label-".concat(type)]), htmlFor: controlId },
|
|
20
|
-
React.createElement("span", { className: styles['token-editor-label-text'] }, label)),
|
|
21
|
-
React.createElement("div", { className: clsx(styles['token-editor-field'], styles["token-editor-field-".concat(type)]) }, children({ controlId: controlId }))));
|
|
22
|
-
}
|
|
23
14
|
function PropertyInput(_a) {
|
|
24
|
-
var
|
|
15
|
+
var propertyKey = _a.propertyKey, onChangePropertyKey = _a.onChangePropertyKey, asyncProps = _a.asyncProps, filteringProperties = _a.filteringProperties, onLoadItems = _a.onLoadItems, customGroupsText = _a.customGroupsText, i18nStrings = _a.i18nStrings, disableFreeTextFiltering = _a.disableFreeTextFiltering;
|
|
25
16
|
var property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;
|
|
26
17
|
var propertySelectHandlers = useLoadItems(onLoadItems);
|
|
27
18
|
var asyncPropertySelectProps = asyncProps ? __assign(__assign({}, asyncProps), propertySelectHandlers) : {};
|
|
@@ -40,7 +31,7 @@ function PropertyInput(_a) {
|
|
|
40
31
|
if (!disableFreeTextFiltering) {
|
|
41
32
|
propertyOptions.unshift(allPropertiesOption);
|
|
42
33
|
}
|
|
43
|
-
return (React.createElement(InternalSelect, __assign({
|
|
34
|
+
return (React.createElement(InternalSelect, __assign({ options: propertyOptions, selectedOption: property
|
|
44
35
|
? {
|
|
45
36
|
value: propertyKey !== null && propertyKey !== void 0 ? propertyKey : undefined,
|
|
46
37
|
label: property.propertyLabel
|
|
@@ -48,7 +39,7 @@ function PropertyInput(_a) {
|
|
|
48
39
|
: allPropertiesOption, onChange: function (e) { return onChangePropertyKey(e.detail.selectedOption.value); } }, asyncPropertySelectProps)));
|
|
49
40
|
}
|
|
50
41
|
function OperatorInput(_a) {
|
|
51
|
-
var
|
|
42
|
+
var propertyKey = _a.propertyKey, operator = _a.operator, onChangeOperator = _a.onChangeOperator, filteringProperties = _a.filteringProperties, i18nStrings = _a.i18nStrings;
|
|
52
43
|
var property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;
|
|
53
44
|
var freeTextOperators = [':', '!:'];
|
|
54
45
|
var operatorOptions = (property ? getAllowedOperators(property) : freeTextOperators).map(function (operator) { return ({
|
|
@@ -56,7 +47,7 @@ function OperatorInput(_a) {
|
|
|
56
47
|
label: operator,
|
|
57
48
|
description: operatorToDescription(operator, i18nStrings)
|
|
58
49
|
}); });
|
|
59
|
-
return (React.createElement(InternalSelect, {
|
|
50
|
+
return (React.createElement(InternalSelect, { options: operatorOptions, triggerVariant: "option", selectedOption: operator
|
|
60
51
|
? {
|
|
61
52
|
value: operator,
|
|
62
53
|
label: operator,
|
|
@@ -65,7 +56,7 @@ function OperatorInput(_a) {
|
|
|
65
56
|
: null, onChange: function (e) { return onChangeOperator(e.detail.selectedOption.value); } }));
|
|
66
57
|
}
|
|
67
58
|
function ValueInput(_a) {
|
|
68
|
-
var
|
|
59
|
+
var propertyKey = _a.propertyKey, operator = _a.operator, value = _a.value, onChangeValue = _a.onChangeValue, asyncProps = _a.asyncProps, filteringProperties = _a.filteringProperties, filteringOptions = _a.filteringOptions, onLoadItems = _a.onLoadItems, i18nStrings = _a.i18nStrings;
|
|
69
60
|
var property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;
|
|
70
61
|
var valueOptions = property ? getPropertyOptions(property, filteringOptions).map(function (_a) {
|
|
71
62
|
var value = _a.value;
|
|
@@ -74,7 +65,7 @@ function ValueInput(_a) {
|
|
|
74
65
|
var valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property);
|
|
75
66
|
var asyncValueAutosuggesProps = propertyKey
|
|
76
67
|
? __assign(__assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty };
|
|
77
|
-
return (React.createElement(InternalAutosuggest, __assign({
|
|
68
|
+
return (React.createElement(InternalAutosuggest, __assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: value !== null && value !== void 0 ? value : '', onChange: function (e) { return onChangeValue(e.detail.value); }, disabled: !operator, options: valueOptions }, asyncValueAutosuggesProps, { virtualScroll: true })));
|
|
78
69
|
}
|
|
79
70
|
export function TokenEditor(_a) {
|
|
80
71
|
var asyncProperties = _a.asyncProperties, asyncProps = _a.asyncProps, customGroupsText = _a.customGroupsText, disableFreeTextFiltering = _a.disableFreeTextFiltering, expandToViewport = _a.expandToViewport, filteringOptions = _a.filteringOptions, filteringProperties = _a.filteringProperties, i18nStrings = _a.i18nStrings, onLoadItems = _a.onLoadItems, setToken = _a.setToken, token = _a.token, triggerComponent = _a.triggerComponent;
|
|
@@ -102,18 +93,12 @@ export function TokenEditor(_a) {
|
|
|
102
93
|
};
|
|
103
94
|
return (React.createElement(InternalPopover, { ref: popoverRef, className: styles['token-label'], triggerType: "text", header: i18nStrings.editTokenHeader, size: "large", position: "right", dismissAriaLabel: i18nStrings.dismissAriaLabel, __onOpen: function () { return setTemporaryToken(token); }, renderWithPortal: expandToViewport, content: React.createElement("div", { className: styles['token-editor'] },
|
|
104
95
|
React.createElement("div", { className: styles['token-editor-form'] },
|
|
105
|
-
React.createElement(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
React.createElement(
|
|
110
|
-
|
|
111
|
-
return (React.createElement(OperatorInput, { controlId: controlId, propertyKey: propertyKey, operator: operator, onChangeOperator: onChangeOperator, filteringProperties: filteringProperties, i18nStrings: i18nStrings }));
|
|
112
|
-
}),
|
|
113
|
-
React.createElement(TokenEditorField, { label: i18nStrings.valueText, type: "value" }, function (_a) {
|
|
114
|
-
var controlId = _a.controlId;
|
|
115
|
-
return (React.createElement(ValueInput, { controlId: controlId, propertyKey: propertyKey, operator: operator, value: value, onChangeValue: onChangeValue, asyncProps: asyncProps, filteringProperties: filteringProperties, filteringOptions: filteringOptions, onLoadItems: onLoadItems, i18nStrings: i18nStrings }));
|
|
116
|
-
})),
|
|
96
|
+
React.createElement(InternalFormField, { label: i18nStrings.propertyText, className: styles['token-editor-field-property'] },
|
|
97
|
+
React.createElement(PropertyInput, { propertyKey: propertyKey, onChangePropertyKey: onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties: filteringProperties, onLoadItems: onLoadItems, customGroupsText: customGroupsText, i18nStrings: i18nStrings, disableFreeTextFiltering: disableFreeTextFiltering })),
|
|
98
|
+
React.createElement(InternalFormField, { label: i18nStrings.operatorText, className: styles['token-editor-field-operator'] },
|
|
99
|
+
React.createElement(OperatorInput, { propertyKey: propertyKey, operator: operator, onChangeOperator: onChangeOperator, filteringProperties: filteringProperties, i18nStrings: i18nStrings })),
|
|
100
|
+
React.createElement(InternalFormField, { label: i18nStrings.valueText, className: styles['token-editor-field-value'] },
|
|
101
|
+
React.createElement(ValueInput, { propertyKey: propertyKey, operator: operator, value: value, onChangeValue: onChangeValue, asyncProps: asyncProps, filteringProperties: filteringProperties, filteringOptions: filteringOptions, onLoadItems: onLoadItems, i18nStrings: i18nStrings }))),
|
|
117
102
|
React.createElement("div", { className: styles['token-editor-actions'] },
|
|
118
103
|
React.createElement(InternalButton, { variant: "link", className: styles['token-editor-cancel'], onClick: closePopover }, i18nStrings.cancelActionText),
|
|
119
104
|
React.createElement(InternalButton, { className: styles['token-editor-submit'], onClick: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,mBAAmB,MAAM,yBAAy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AAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,GACxB,CACH;gBATmB,CASnB,CACgB;gBAEnB,oBAAC,gBAAgB,IAAC,KAAK,EAAE,WAAW,CAAC,SAAS,EAAE,IAAI,EAAC,OAAO,IACzD,UAAC,EAAa;wBAAX,SAAS,eAAA;oBAAO,OAAA,CAClB,oBAAC,UAAU,IACT,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,GACxB,CACH;gBAbmB,CAanB,CACgB,CACf;YAEN,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;gBAC5C,oBAAC,cAAc,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,YAAY,IAC3F,WAAW,CAAC,gBAAgB,CACd;gBACjB,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,EACxC,OAAO,EAAE;wBACP,QAAQ,CAAC,cAAc,CAAC,CAAC;wBACzB,YAAY,EAAE,CAAC;oBACjB,CAAC,IAEA,WAAW,CAAC,eAAe,CACb,CACb,CACF,IAGP,gBAAgB,CACD,CACnB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalAutosuggest from '../autosuggest/internal';\nimport InternalPopover, { InternalPopoverRef } from '../popover/internal';\nimport { InternalButton } from '../button/internal';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\n\nimport {\n ComparisonOperator,\n FilteringOption,\n FilteringProperty,\n GroupText,\n I18nStrings,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport styles from './styles.css.js';\nimport { useLoadItems } from './use-load-items';\nimport {\n getAllowedOperators,\n getPropertyOptions,\n getPropertyByKey,\n operatorToDescription,\n getPropertySuggestions,\n} from './controller';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\n\nconst freeTextOperators: ComparisonOperator[] = [':', '!:'];\n\ninterface TokenEditorFieldProps {\n label: React.ReactNode;\n type: 'property' | 'operator' | 'value';\n children: ({ controlId }: { controlId: string }) => React.ReactNode;\n}\n\nfunction TokenEditorField({ type, label, children }: TokenEditorFieldProps) {\n const controlId = useUniqueId();\n return (\n <>\n <label className={clsx(styles['token-editor-label'], styles[`token-editor-label-${type}`])} htmlFor={controlId}>\n <span className={styles['token-editor-label-text']}>{label}</span>\n </label>\n <div className={clsx(styles['token-editor-field'], styles[`token-editor-field-${type}`])}>\n {children({ controlId })}\n </div>\n </>\n );\n}\n\ninterface PropertyInputProps {\n controlId: string;\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disableFreeTextFiltering?: boolean;\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n propertyKey: undefined | string;\n}\n\nfunction PropertyInput({\n controlId,\n propertyKey,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n disableFreeTextFiltering,\n}: PropertyInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyLabel, key }) => ({\n value: key,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!disableFreeTextFiltering) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n controlId={controlId}\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n controlId: string;\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n propertyKey: undefined | string;\n}\n\nfunction OperatorInput({\n controlId,\n propertyKey,\n operator,\n onChangeOperator,\n filteringProperties,\n i18nStrings,\n}: OperatorInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const freeTextOperators: ComparisonOperator[] = [':', '!:'];\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextOperators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n controlId={controlId}\n options={operatorOptions}\n triggerVariant=\"option\"\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n controlId: string;\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly FilteringOption[];\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangeValue: (value: string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n propertyKey: undefined | string;\n value: undefined | string;\n}\n\nfunction ValueInput({\n controlId,\n propertyKey,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringProperties,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const valueOptions = property ? getPropertyOptions(property, filteringOptions).map(({ value }) => ({ value })) : [];\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property);\n const asyncValueAutosuggesProps = propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n return (\n <InternalAutosuggest\n controlId={controlId}\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={value ?? ''}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggesProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface TokenEditorProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n disableFreeTextFiltering?: boolean;\n expandToViewport?: boolean;\n filteringOptions: readonly FilteringOption[];\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n setToken: (newToken: Token) => void;\n token: Token;\n triggerComponent?: React.ReactNode;\n}\n\nexport function TokenEditor({\n asyncProperties,\n asyncProps,\n customGroupsText,\n disableFreeTextFiltering,\n expandToViewport,\n filteringOptions,\n filteringProperties,\n i18nStrings,\n onLoadItems,\n setToken,\n token,\n triggerComponent,\n}: TokenEditorProps) {\n const [temporaryToken, setTemporaryToken] = useState<Token>(token);\n const popoverRef = useRef<InternalPopoverRef>(null);\n const closePopover = () => {\n popoverRef.current && popoverRef.current.dismissPopover();\n };\n\n const propertyKey = temporaryToken.propertyKey;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<FilteringProperty | undefined>(\n (acc, property) => (property.key === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextOperators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n setTemporaryToken({ ...temporaryToken, propertyKey: newPropertyKey, operator });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n setTemporaryToken({ ...temporaryToken, operator: newOperator });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: string) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return (\n <InternalPopover\n ref={popoverRef}\n className={styles['token-label']}\n triggerType=\"text\"\n header={i18nStrings.editTokenHeader}\n size=\"large\"\n position=\"right\"\n dismissAriaLabel={i18nStrings.dismissAriaLabel}\n __onOpen={() => setTemporaryToken(token)}\n renderWithPortal={expandToViewport}\n content={\n <div className={styles['token-editor']}>\n <div className={styles['token-editor-form']}>\n <TokenEditorField label={i18nStrings.propertyText} type=\"property\">\n {({ controlId }) => (\n <PropertyInput\n controlId={controlId}\n propertyKey={propertyKey}\n onChangePropertyKey={onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n disableFreeTextFiltering={disableFreeTextFiltering}\n />\n )}\n </TokenEditorField>\n\n <TokenEditorField label={i18nStrings.operatorText} type=\"operator\">\n {({ controlId }) => (\n <OperatorInput\n controlId={controlId}\n propertyKey={propertyKey}\n operator={operator}\n onChangeOperator={onChangeOperator}\n filteringProperties={filteringProperties}\n i18nStrings={i18nStrings}\n />\n )}\n </TokenEditorField>\n\n <TokenEditorField label={i18nStrings.valueText} type=\"value\">\n {({ controlId }) => (\n <ValueInput\n controlId={controlId}\n propertyKey={propertyKey}\n operator={operator}\n value={value}\n onChangeValue={onChangeValue}\n asyncProps={asyncProps}\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n )}\n </TokenEditorField>\n </div>\n\n <div className={styles['token-editor-actions']}>\n <InternalButton variant=\"link\" className={styles['token-editor-cancel']} onClick={closePopover}>\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton\n className={styles['token-editor-submit']}\n onClick={() => {\n setToken(temporaryToken);\n closePopover();\n }}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n </div>\n }\n >\n {triggerComponent}\n </InternalPopover>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,eAAuC,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAWpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,IAAM,iBAAiB,GAAyB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAa5D,SAAS,aAAa,CAAC,EASF;QARnB,WAAW,iBAAA,EACX,mBAAmB,yBAAA,EACnB,UAAU,gBAAA,EACV,mBAAmB,yBAAA,EACnB,WAAW,iBAAA,EACX,g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B,IAAC,KAAK,EAAE,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC;oBAC5F,oBAAC,UAAU,IACT,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,GACxB,CACgB,CAChB;YAEN,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;gBAC5C,oBAAC,cAAc,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,YAAY,IAC3F,WAAW,CAAC,gBAAgB,CACd;gBACjB,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,EACxC,OAAO,EAAE;wBACP,QAAQ,CAAC,cAAc,CAAC,CAAC;wBACzB,YAAY,EAAE,CAAC;oBACjB,CAAC,IAEA,WAAW,CAAC,eAAe,CACb,CACb,CACF,IAGP,gBAAgB,CACD,CACnB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef } from 'react';\n\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalAutosuggest from '../autosuggest/internal';\nimport InternalPopover, { InternalPopoverRef } from '../popover/internal';\nimport { InternalButton } from '../button/internal';\n\nimport {\n ComparisonOperator,\n FilteringOption,\n FilteringProperty,\n GroupText,\n I18nStrings,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport styles from './styles.css.js';\nimport { useLoadItems } from './use-load-items';\nimport {\n getAllowedOperators,\n getPropertyOptions,\n getPropertyByKey,\n operatorToDescription,\n getPropertySuggestions,\n} from './controller';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport InternalFormField from '../form-field/internal';\n\nconst freeTextOperators: ComparisonOperator[] = [':', '!:'];\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disableFreeTextFiltering?: boolean;\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n propertyKey: undefined | string;\n}\n\nfunction PropertyInput({\n propertyKey,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n disableFreeTextFiltering,\n}: PropertyInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyLabel, key }) => ({\n value: key,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!disableFreeTextFiltering) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n propertyKey: undefined | string;\n}\n\nfunction OperatorInput({\n propertyKey,\n operator,\n onChangeOperator,\n filteringProperties,\n i18nStrings,\n}: OperatorInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const freeTextOperators: ComparisonOperator[] = [':', '!:'];\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextOperators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant=\"option\"\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly FilteringOption[];\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onChangeValue: (value: string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n propertyKey: undefined | string;\n value: undefined | string;\n}\n\nfunction ValueInput({\n propertyKey,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringProperties,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const property = propertyKey !== undefined ? getPropertyByKey(filteringProperties, propertyKey) : undefined;\n const valueOptions = property ? getPropertyOptions(property, filteringOptions).map(({ value }) => ({ value })) : [];\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property);\n const asyncValueAutosuggesProps = propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={value ?? ''}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggesProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface TokenEditorProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n disableFreeTextFiltering?: boolean;\n expandToViewport?: boolean;\n filteringOptions: readonly FilteringOption[];\n filteringProperties: readonly FilteringProperty[];\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n setToken: (newToken: Token) => void;\n token: Token;\n triggerComponent?: React.ReactNode;\n}\n\nexport function TokenEditor({\n asyncProperties,\n asyncProps,\n customGroupsText,\n disableFreeTextFiltering,\n expandToViewport,\n filteringOptions,\n filteringProperties,\n i18nStrings,\n onLoadItems,\n setToken,\n token,\n triggerComponent,\n}: TokenEditorProps) {\n const [temporaryToken, setTemporaryToken] = useState<Token>(token);\n const popoverRef = useRef<InternalPopoverRef>(null);\n const closePopover = () => {\n popoverRef.current && popoverRef.current.dismissPopover();\n };\n\n const propertyKey = temporaryToken.propertyKey;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<FilteringProperty | undefined>(\n (acc, property) => (property.key === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextOperators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n setTemporaryToken({ ...temporaryToken, propertyKey: newPropertyKey, operator });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n setTemporaryToken({ ...temporaryToken, operator: newOperator });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: string) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return (\n <InternalPopover\n ref={popoverRef}\n className={styles['token-label']}\n triggerType=\"text\"\n header={i18nStrings.editTokenHeader}\n size=\"large\"\n position=\"right\"\n dismissAriaLabel={i18nStrings.dismissAriaLabel}\n __onOpen={() => setTemporaryToken(token)}\n renderWithPortal={expandToViewport}\n content={\n <div className={styles['token-editor']}>\n <div className={styles['token-editor-form']}>\n <InternalFormField label={i18nStrings.propertyText} className={styles['token-editor-field-property']}>\n <PropertyInput\n propertyKey={propertyKey}\n onChangePropertyKey={onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n disableFreeTextFiltering={disableFreeTextFiltering}\n />\n </InternalFormField>\n\n <InternalFormField label={i18nStrings.operatorText} className={styles['token-editor-field-operator']}>\n <OperatorInput\n propertyKey={propertyKey}\n operator={operator}\n onChangeOperator={onChangeOperator}\n filteringProperties={filteringProperties}\n i18nStrings={i18nStrings}\n />\n </InternalFormField>\n\n <InternalFormField label={i18nStrings.valueText} className={styles['token-editor-field-value']}>\n <ValueInput\n propertyKey={propertyKey}\n operator={operator}\n value={value}\n onChangeValue={onChangeValue}\n asyncProps={asyncProps}\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n </InternalFormField>\n </div>\n\n <div className={styles['token-editor-actions']}>\n <InternalButton variant=\"link\" className={styles['token-editor-cancel']} onClick={closePopover}>\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton\n className={styles['token-editor-submit']}\n onClick={() => {\n setToken(temporaryToken);\n closePopover();\n }}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n </div>\n }\n >\n {triggerComponent}\n </InternalPopover>\n );\n}\n"]}
|
|
@@ -105,7 +105,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
105
105
|
text-decoration: underline;
|
|
106
106
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
107
107
|
text-decoration-color: var(--color-text-link-button-underline-8mp92t, transparent);
|
|
108
|
+
transition-property: color, -webkit-text-decoration;
|
|
108
109
|
transition-property: color, text-decoration;
|
|
110
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
109
111
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
110
112
|
}
|
|
111
113
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -198,10 +198,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
198
198
|
color: var(--color-text-link-default-5f186r, #0972d3);
|
|
199
199
|
font-weight: var(--font-link-primary-weight-91pybi, "inherit");
|
|
200
200
|
letter-spacing: var(--font-link-primary-letter-spacing-vmsgcx, "inherit");
|
|
201
|
-
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
201
|
+
-webkit-text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
202
|
+
text-decoration: var(--font-link-primary-decoration-wfgjh2, underline);
|
|
202
203
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
203
204
|
text-decoration-color: var(--color-text-link-primary-underline-ga7rq8, #0972d3);
|
|
205
|
+
transition-property: color, -webkit-text-decoration;
|
|
204
206
|
transition-property: color, text-decoration;
|
|
207
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
205
208
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
206
209
|
}
|
|
207
210
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -247,7 +250,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
247
250
|
text-decoration: none;
|
|
248
251
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
249
252
|
text-decoration-color: transparent;
|
|
253
|
+
transition-property: color, -webkit-text-decoration;
|
|
250
254
|
transition-property: color, text-decoration;
|
|
255
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
251
256
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
252
257
|
}
|
|
253
258
|
@media (prefers-reduced-motion: reduce) {
|
package/textarea/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var Textarea = React.forwardRef(function (_a, ref) {
|
|
|
52
52
|
attributes.spellCheck = 'false';
|
|
53
53
|
}
|
|
54
54
|
return (React.createElement("span", __assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef }),
|
|
55
|
-
React.createElement("textarea", __assign({ ref: textareaRef, id: controlId }, attributes))));
|
|
55
|
+
React.createElement("textarea", __assign({ ref: textareaRef, id: controlId }, attributes, { spellCheck: false }))));
|
|
56
56
|
});
|
|
57
57
|
applyDisplayName(Textarea, 'Textarea');
|
|
58
58
|
export default Textarea;
|
package/textarea/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/textarea/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,UACE,EAmBgB,EAChB,GAA2B;;IAnBzB,IAAA,KAAK,WAAA,EACL,oBAAmB,EAAnB,YAAY,mBAAG,IAAI,KAAA,EACnB,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,yBAAyB,+BAAA,EACzB,wBAAwB,8BAAA,EACxB,SAAS,eAAA,E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,EAA/B,CAA+B,CAAC;KAC5D,CAAC;IAEF,IAAI,yBAAyB,EAAE;QAC7B,UAAU,CAAC,WAAW,GAAG,KAAK,CAAC;QAC/B,UAAU,CAAC,cAAc,GAAG,KAAK,CAAC;KACnC;IAED,IAAI,wBAAwB,EAAE;QAC5B,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC;KACjC;IAED,OAAO,CACL,yCAAU,SAAS,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB;QAC5F,2CAAU,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,IAAM,UAAU,IAAE,UAAU,EAAE,KAAK,IAAI,CAC3E,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useRef } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport { TextareaProps } from './interfaces';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { convertAutoComplete } from '../input/utils';\n\nexport { TextareaProps };\n\nconst Textarea = React.forwardRef(\n (\n {\n value,\n autoComplete = true,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n disableBrowserSpellcheck,\n onKeyDown,\n onKeyUp,\n onChange,\n onBlur,\n onFocus,\n ariaRequired,\n name,\n rows,\n placeholder,\n autoFocus,\n ariaLabel,\n ...rest\n }: TextareaProps,\n ref: Ref<TextareaProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('Textarea');\n const { ariaLabelledby, ariaDescribedby, controlId, invalid } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n useForwardFocus(ref, textareaRef);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-required': ariaRequired ? 'true' : undefined,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: rows || 3,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value || '',\n onChange: onChange && (event => fireNonCancelableEvent(onChange, { value: event.target.value })),\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n if (disableBrowserSpellcheck) {\n attributes.spellCheck = 'false';\n }\n\n return (\n <span {...baseProps} className={clsx(styles.root, baseProps.className)} ref={__internalRootRef}>\n <textarea ref={textareaRef} id={controlId} {...attributes} spellCheck={false} />\n </span>\n );\n }\n);\n\napplyDisplayName(Textarea, 'Textarea');\nexport default Textarea;\n"]}
|
|
@@ -236,7 +236,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
236
236
|
text-decoration: none;
|
|
237
237
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
238
238
|
text-decoration-color: transparent;
|
|
239
|
+
transition-property: color, -webkit-text-decoration;
|
|
239
240
|
transition-property: color, text-decoration;
|
|
241
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
240
242
|
transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
|
|
241
243
|
display: flex;
|
|
242
244
|
align-items: center;
|