Skip to content

Commit 75475ab

Browse files
committed
chore: Chat bubble visual context
1 parent 62efe83 commit 75475ab

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

style-dictionary/utils/contexts.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,11 @@ export const createAppLayoutToolbarContext = (tokens: TokenCategory<string, Glob
7575
tokens,
7676
};
7777
};
78+
79+
export const createChatBubbleContext = (tokens: TokenCategory<string, GlobalValue | ModeValue>) => {
80+
return {
81+
id: 'chat-bubble',
82+
selector: '.awsui-context-chat-bubble',
83+
tokens,
84+
};
85+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import merge from 'lodash/merge.js';
4+
5+
import { expandDensityDictionary } from '../../utils/index.js';
6+
import { StyleDictionary } from '../../utils/interfaces.js';
7+
import { tokens as parentTokens } from '../spacing.js';
8+
9+
const spacingTokens: StyleDictionary.SpacingDictionary = {
10+
spaceContainerHorizontal: '{spaceScaledS}',
11+
spaceCardVertical: '{spaceScaledS}',
12+
};
13+
14+
const borderTokens: StyleDictionary.BordersDictionary = {
15+
borderRadiusContainer: '{borderRadiusChatBubble}',
16+
};
17+
18+
const expandedSpacingTokens: StyleDictionary.ExpandedDensityScopeDictionary = expandDensityDictionary(
19+
merge({}, parentTokens, spacingTokens)
20+
);
21+
22+
const expandedTokens = {
23+
...expandedSpacingTokens,
24+
...borderTokens,
25+
};
26+
export { expandedTokens as tokens };

style-dictionary/visual-refresh/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ThemeBuilder } from '@cloudscape-design/theming-build';
55
import {
66
createAlertContext,
77
createAppLayoutToolbarContext,
8+
createChatBubbleContext,
89
createCompactTableContext,
910
createFlashbarContext,
1011
createFlashbarWarningContext,
@@ -52,6 +53,7 @@ export async function buildVisualRefresh(builder: ThemeBuilder) {
5253
builder.addContext(createAlertContext((await import('./contexts/alert.js')).tokens));
5354
builder.addContext(createHeaderAlertContext((await import('./contexts/header-alert.js')).tokens));
5455
builder.addContext(createAppLayoutToolbarContext((await import('./contexts/app-layout-toolbar.js')).tokens));
56+
builder.addContext(createChatBubbleContext((await import('./contexts/chat-bubble.js')).tokens));
5557

5658
return builder.build();
5759
}

0 commit comments

Comments
 (0)