diff --git a/pages/token/clickable.page.tsx b/pages/token/clickable.page.tsx
new file mode 100644
index 0000000000..626447e5dd
--- /dev/null
+++ b/pages/token/clickable.page.tsx
@@ -0,0 +1,166 @@
+// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+// SPDX-License-Identifier: Apache-2.0
+import React from 'react';
+
+import AppLayoutToolbar from '~components/app-layout-toolbar';
+import Box from '~components/box';
+import BreadcrumbGroup from '~components/breadcrumb-group';
+import Button from '~components/button';
+import Container from '~components/container';
+import Header from '~components/header';
+import Popover from '~components/popover';
+import SpaceBetween from '~components/space-between';
+import Token from '~components/token';
+interface FieldValue {
+ value: string;
+}
+interface FieldPopoverProps {
+ fieldName: string;
+ fieldValues: FieldValue[];
+ onAddValue: (value: string) => void;
+ onAggregation: (aggregationType: string) => void;
+}
+function AggregationButtons({ onAggregation }: { onAggregation: (type: string) => void }) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+function FieldPopover({ fieldName, fieldValues, onAddValue, onAggregation }: FieldPopoverProps) {
+ return (
+
+ {fieldValues.map((field, index) => (
+
+
+ {field.value}
+
+
+ ))}
+
+
+
+ }
+ dismissButton={true}
+ header={fieldName}
+ position="bottom"
+ size="medium"
+ triggerType="custom"
+ >
+
+
+ );
+}
+function QueryBuilder() {
+ const handleAddValue = (fieldName: string, value: string) => {
+ console.log(`Adding value "${value}" from field "${fieldName}"`);
+ };
+ const handleAggregation = (fieldName: string, aggregationType: string) => {
+ console.log(`Applying "${aggregationType}" aggregation to field "${fieldName}"`);
+ };
+ const statusCodeValues: FieldValue[] = [
+ {
+ value: '200',
+ },
+ {
+ value: '503',
+ },
+ {
+ value: '500',
+ },
+ ];
+ const serverAddressValues: FieldValue[] = [
+ {
+ value: '192.168.1.1',
+ },
+ {
+ value: '10.0.0.1',
+ },
+ {
+ value: '172.16.0.5',
+ },
+ ];
+ return (
+
+ }
+ content={
+
+
+
+ Group by fields
+
+ }
+ data-venue="true"
+ >
+
+ handleAddValue('http.status_code', value)}
+ onAggregation={type => handleAggregation('http.status_code', type)}
+ />
+ handleAddValue('server address', value)}
+ onAggregation={type => handleAggregation('server address', type)}
+ />
+
+
+
+ }
+ contentType="default"
+ navigationHide={true}
+ toolsHide={true}
+ />
+ );
+}
+export default QueryBuilder;
diff --git a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap
index 9e92f77915..6c75c365b6 100644
--- a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap
+++ b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap
@@ -29755,6 +29755,11 @@ Use this if the label is not plain text.",
"optional": true,
"type": "string",
},
+ {
+ "name": "clickable",
+ "optional": true,
+ "type": "boolean",
+ },
{
"description": "Further information about the token that appears below the label.",
"name": "description",
diff --git a/src/token/interfaces.ts b/src/token/interfaces.ts
index 47bfa0d75a..84663f86c0 100644
--- a/src/token/interfaces.ts
+++ b/src/token/interfaces.ts
@@ -69,6 +69,8 @@ export interface TokenProps extends BaseComponentProps {
* Only applies to plain text labels.
*/
tooltipContent?: string;
+
+ clickable?: boolean;
}
export namespace TokenProps {
diff --git a/src/token/internal.tsx b/src/token/internal.tsx
index bd16485a73..470e92796b 100644
--- a/src/token/internal.tsx
+++ b/src/token/internal.tsx
@@ -39,6 +39,7 @@ function InternalToken({
dismissLabel,
onDismiss,
tooltipContent,
+ clickable,
// Internal
role,
@@ -110,6 +111,7 @@ function InternalToken({
testUtilStyles.root,
!isInline ? styles['token-normal'] : styles['token-inline'],
analyticsSelectors.token,
+ clickable && styles.clickable,
baseProps.className
)}
aria-label={ariaLabel}
diff --git a/src/token/styles.scss b/src/token/styles.scss
index b00b7cfa2e..27b800a4bc 100644
--- a/src/token/styles.scss
+++ b/src/token/styles.scss
@@ -13,6 +13,10 @@
@include styles.styles-reset;
}
+.clickable {
+ cursor: pointer;
+}
+
.dismiss-button {
align-self: flex-start;
margin-block-end: 0;