Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/__integ__/__snapshots__/themes.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "compact" 1`] =
"space-card-vertical-embedded": "8px",
"space-code-editor-status-focus-outline-gutter": "3px",
"space-container-content-top": "12px",
"space-container-content-vertical": "16px",
"space-container-header-bottom": "8px",
"space-container-header-top": "8px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "12px",
"space-dark-header-overlap-distance": "0px",
"space-expand-toggle-focus-outline-gutter": "3px",
"space-expandable-section-icon-offset-top": "4px",
"space-field-horizontal": "8px",
"space-field-icon-offset": "32px",
Expand Down Expand Up @@ -989,6 +991,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "compact" 1`] =
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "4px",
"space-table-content-bottom": "0px",
"space-table-embedded-header-top": "8px",
"space-table-footer-horizontal": "20px",
Expand Down Expand Up @@ -1931,11 +1934,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "dark" 1`] = `
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "3px",
"space-container-content-top": "16px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "12px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "0px",
"space-expand-toggle-focus-outline-gutter": "3px",
"space-expandable-section-icon-offset-top": "8px",
"space-field-horizontal": "8px",
"space-field-icon-offset": "32px",
Expand Down Expand Up @@ -2001,6 +2006,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "dark" 1`] = `
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "0px",
"space-table-embedded-header-top": "12px",
"space-table-footer-horizontal": "20px",
Expand Down Expand Up @@ -2943,11 +2949,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "light" 1`] = `
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "3px",
"space-container-content-top": "16px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "12px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "0px",
"space-expand-toggle-focus-outline-gutter": "3px",
"space-expandable-section-icon-offset-top": "8px",
"space-field-horizontal": "8px",
"space-field-icon-offset": "32px",
Expand Down Expand Up @@ -3013,6 +3021,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "light" 1`] = `
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "0px",
"space-table-embedded-header-top": "12px",
"space-table-footer-horizontal": "20px",
Expand Down Expand Up @@ -3955,11 +3964,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "reduced-motion"
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "3px",
"space-container-content-top": "16px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "12px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "0px",
"space-expand-toggle-focus-outline-gutter": "3px",
"space-expandable-section-icon-offset-top": "8px",
"space-field-horizontal": "8px",
"space-field-icon-offset": "32px",
Expand Down Expand Up @@ -4025,6 +4036,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "reduced-motion"
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "0px",
"space-table-embedded-header-top": "12px",
"space-table-footer-horizontal": "20px",
Expand Down Expand Up @@ -4967,11 +4979,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh"
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "-7px",
"space-container-content-top": "4px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "8px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "36px",
"space-expand-toggle-focus-outline-gutter": "4px",
"space-expandable-section-icon-offset-top": "4px",
"space-field-horizontal": "12px",
"space-field-icon-offset": "36px",
Expand Down Expand Up @@ -5037,6 +5051,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh"
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "4px",
"space-table-embedded-header-top": "0px",
"space-table-footer-horizontal": "0px",
Expand Down Expand Up @@ -5979,11 +5994,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-card-vertical-embedded": "8px",
"space-code-editor-status-focus-outline-gutter": "-7px",
"space-container-content-top": "4px",
"space-container-content-vertical": "16px",
"space-container-header-bottom": "4px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "12px",
"space-dark-header-overlap-distance": "32px",
"space-expand-toggle-focus-outline-gutter": "4px",
"space-expandable-section-icon-offset-top": "0px",
"space-field-horizontal": "12px",
"space-field-icon-offset": "36px",
Expand Down Expand Up @@ -6049,6 +6066,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "4px",
"space-table-content-bottom": "4px",
"space-table-embedded-header-top": "0px",
"space-table-footer-horizontal": "0px",
Expand Down Expand Up @@ -6991,11 +7009,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "-7px",
"space-container-content-top": "4px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "8px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "36px",
"space-expand-toggle-focus-outline-gutter": "4px",
"space-expandable-section-icon-offset-top": "4px",
"space-field-horizontal": "12px",
"space-field-icon-offset": "36px",
Expand Down Expand Up @@ -7061,6 +7081,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "4px",
"space-table-embedded-header-top": "0px",
"space-table-footer-horizontal": "0px",
Expand Down Expand Up @@ -8003,11 +8024,13 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-card-vertical-embedded": "10px",
"space-code-editor-status-focus-outline-gutter": "-7px",
"space-container-content-top": "4px",
"space-container-content-vertical": "20px",
"space-container-header-bottom": "8px",
"space-container-header-top": "12px",
"space-container-horizontal": "20px",
"space-content-header-padding-bottom": "16px",
"space-dark-header-overlap-distance": "36px",
"space-expand-toggle-focus-outline-gutter": "4px",
"space-expandable-section-icon-offset-top": "4px",
"space-field-horizontal": "12px",
"space-field-icon-offset": "36px",
Expand Down Expand Up @@ -8073,6 +8096,7 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
"space-static-xxxl": "40px",
"space-static-xxxs": "2px",
"space-status-indicator-padding-horizontal": "0px",
"space-table-cell-vertical": "8px",
"space-table-content-bottom": "4px",
"space-table-embedded-header-top": "0px",
"space-table-footer-horizontal": "0px",
Expand Down
2 changes: 1 addition & 1 deletion src/container/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
flex: 1;

&.with-paddings {
padding-block: awsui.$space-scaled-l;
padding-block: awsui.$space-container-content-vertical;
padding-inline: awsui.$space-container-horizontal;

&.with-header {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/components/expand-toggle-button/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// so we disable this one
&:not(.disable-focus-highlight) {
@include focus-visible.when-visible {
@include styles.focus-highlight(awsui.$space-button-focus-outline-gutter);
@include styles.focus-highlight(awsui.$space-expand-toggle-focus-outline-gutter);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/table/body-cell/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@use '../../internal/styles/tokens' as awsui;
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;

$cell-vertical-padding: awsui.$space-scaled-xs;
$cell-vertical-padding: awsui.$space-table-cell-vertical;
// Calculate padding to prevent a shift in content after selection due to the difference
// between selected border widths and normal row divider widths (visual refresh).
$cell-vertical-padding-w-border: calc(
Expand Down
12 changes: 11 additions & 1 deletion src/table/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@
@use '../internal/styles/tokens' as awsui;
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
@use '../container/shared' as container;
@use '../internal/styles/typography/constants.scss' as constants;

.root {
@include styles.default-text-style;
font-size: awsui.$font-size-table;
line-height: awsui.$table-line-height;
letter-spacing: awsui.$font-table-letter-spacing;
inline-size: 100%;

// default styling from mixin default-text-style
color: awsui.$color-text-body-default;
font-weight: constants.$font-weight-normal;
font-family: awsui.$font-family-base;
-webkit-font-smoothing: auto;
-moz-osx-font-smoothing: auto;
}

.tools {
Expand Down
3 changes: 3 additions & 0 deletions style-dictionary/classic/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const tokens: StyleDictionary.SizesDictionary = {
sizeIconMedium: '16px',
sizeTableSelectionHorizontal: '54px',
sizeVerticalInput: { comfortable: '32px', compact: '28px' },
fontSizeTable: '{fontSizeBodyM}',
tableLineHeight: '{lineHeightBodyM}',
fontTableLetterSpacing: 'normal',
};

const expandedTokens: StyleDictionary.ExpandedDensityScopeDictionary = merge(
Expand Down
3 changes: 3 additions & 0 deletions style-dictionary/classic/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceAlertMessageRight: '0px',
spaceAlertVertical: '{spaceScaledS}',
spaceButtonFocusOutlineGutter: '3px',
spaceExpandToggleFocusOutlineGutter: '{spaceButtonFocusOutlineGutter}',
spaceButtonHorizontal: '{spaceL}',
spaceFieldVertical: { comfortable: '4px', compact: '2px' },
spaceButtonIconFocusOutlineGutterVertical: '{spaceButtonFocusOutlineGutter}',
Expand All @@ -27,6 +28,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceCardVerticalEmbedded: { comfortable: '10px', compact: '{spaceXs}' },
spaceCodeEditorStatusFocusOutlineGutter: '3px',
spaceContainerContentTop: '{spaceScaledM}',
spaceContainerContentVertical: '{spaceScaledL}',
spaceContainerHeaderTop: '{spaceScaledS}',
spaceContainerHeaderBottom: '{spaceScaledS}',
spaceContainerHorizontal: '{spaceL}',
Expand Down Expand Up @@ -61,6 +63,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceTableHeaderHorizontal: '{spaceContainerHorizontal}',
spaceTableHeaderToolsBottom: '{spaceScaledXxs}',
spaceTableHorizontal: '0px',
spaceTableCellVertical: '{spaceScaledXs}',
spaceTokenVertical: '{spaceScaledXxs}',
spaceActionCardHorizontalDefault: '{spaceCardHorizontalDefault}',
spaceActionCardHorizontalEmbedded: '{spaceCardHorizontalEmbedded}',
Expand Down
35 changes: 35 additions & 0 deletions style-dictionary/one-theme/contexts/compact-table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import merge from 'lodash/merge.js';

import { expandDensityDictionary } from '../../utils/index.js';
import { StyleDictionary } from '../../utils/interfaces.js';
import { tokens as parentTokens } from '../spacing.js';

const spacingTokens: StyleDictionary.SpacingDictionary = {
spaceScaledXxxs: '{spaceNone}',
spaceScaledXxs: '{spaceXxxs}',
spaceScaledXs: '{spaceXxs}',
spaceScaledS: '{spaceXs}',
spaceScaledM: '{spaceS}',
spaceScaledL: '{spaceM}',
spaceScaledXl: '{spaceL}',
spaceScaledXxl: '{spaceXl}',
spaceScaledXxxl: '{spaceXxl}',

spaceExpandToggleFocusOutlineGutter: '1px',
spaceTableCellVertical: '2px',
};

const sizeTokens: StyleDictionary.SizesDictionary = {
sizeVerticalInput: '28px',
fontSizeTable: '{fontSizeBodyS}',
tableLineHeight: '{lineHeightBodyS}',
fontTableLetterSpacing: '{letterSpacingBodyS}',
};

const expandedTokens: StyleDictionary.ExpandedDensityScopeDictionary = expandDensityDictionary(
merge({}, parentTokens, { ...spacingTokens, ...sizeTokens })
);

export { expandedTokens as tokens };
2 changes: 1 addition & 1 deletion style-dictionary/one-theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tokenCategories.forEach(({ tokens, mode: modeId, referenceTokens }) => {
builder.addTokens(tokens, mode);
});

builder.addContext(createCompactTableContext((await import('../visual-refresh/contexts/compact-table.js')).tokens));
builder.addContext(createCompactTableContext((await import('./contexts/compact-table.js')).tokens));
builder.addContext(createAppLayoutToolbarContext((await import('./contexts/app-layout-toolbar.js')).tokens));
builder.addContext(createTopNavigationContext((await import('./contexts/top-navigation.js')).tokens));
builder.addContext(createHeaderContext((await import('./contexts/header.js')).tokens));
Expand Down
3 changes: 3 additions & 0 deletions style-dictionary/one-theme/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const tokens: StyleDictionary.SizesDictionary = {
sizeVerticalInput: { comfortable: '30px', compact: '26px' },
sizeSideNavigationItemHeight: { comfortable: '30px', compact: '26px' },
sizeSideNavigationItemCollapsed: { comfortable: '28px', compact: '26px' },
fontSizeTable: { comfortable: '{fontSizeBodyM}', compact: '{fontSizeBodyS}' },
tableLineHeight: { comfortable: '{lineHeightBodyM}', compact: '{lineHeightBodyS}' },
fontTableLetterSpacing: { comfortable: 'normal', compact: '{letterSpacingBodyS}' },
};

const expandedTokens: StyleDictionary.ExpandedDensityScopeDictionary = merge(
Expand Down
5 changes: 5 additions & 0 deletions style-dictionary/one-theme/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceTokenVertical: '1px',
spaceFieldVertical: { comfortable: '4px', compact: '2px' },
spaceStatusIndicatorPaddingHorizontal: '2px',
spaceContainerHeaderTop: { comfortable: '12px', compact: '8px' },
spaceContainerHorizontal: { comfortable: '20px', compact: '12px' },
spaceContainerContentVertical: { comfortable: '20px', compact: '8px' },
spaceExpandToggleFocusOutlineGutter: { comfortable: '4px', compact: '1px' },
spaceTableCellVertical: { comfortable: '4px', compact: '2px' },
};

const expandedTokens: StyleDictionary.ExpandedDensityScopeDictionary = merge(
Expand Down
8 changes: 7 additions & 1 deletion style-dictionary/utils/token-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1160,13 +1160,17 @@ export type SizesTokenName =
| 'sizeVerticalPanelIconOffset'
| 'sizeSideNavigationItemHeight'
| 'sizeSideNavigationItemCollapsed'
| 'sizeSideNavigationCollapsedWidth';
| 'sizeSideNavigationCollapsedWidth'
| 'fontSizeTable'
| 'tableLineHeight'
| 'fontTableLetterSpacing';
export type SpacingTokenName =
| 'spaceAlertActionLeft'
| 'spaceAlertHorizontal'
| 'spaceAlertMessageRight'
| 'spaceAlertVertical'
| 'spaceButtonFocusOutlineGutter'
| 'spaceExpandToggleFocusOutlineGutter'
| 'spaceButtonHorizontal'
| 'spaceButtonVertical'
| 'spaceTokenVertical'
Expand All @@ -1188,6 +1192,7 @@ export type SpacingTokenName =
| 'spaceItemCardVerticalEmbedded'
| 'spaceCodeEditorStatusFocusOutlineGutter'
| 'spaceContainerContentTop'
| 'spaceContainerContentVertical'
| 'spaceContainerHeaderTop'
| 'spaceContainerHeaderBottom'
| 'spaceContainerHorizontal'
Expand Down Expand Up @@ -1231,6 +1236,7 @@ export type SpacingTokenName =
| 'spaceTableHeaderToolsBottom'
| 'spaceTableHeaderToolsFullPageBottom'
| 'spaceTableHorizontal'
| 'spaceTableCellVertical'
| 'spaceTileGutter'
| 'spaceTreeViewIndentation'
| 'spaceSideNavigationItemDefaultGap'
Expand Down
3 changes: 3 additions & 0 deletions style-dictionary/visual-refresh/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const tokens: StyleDictionary.SizesDictionary = {
sizeSideNavigationItemHeight: { comfortable: '28px', compact: '24px' },
sizeSideNavigationItemCollapsed: { comfortable: '30px', compact: '28px' },
sizeSideNavigationCollapsedWidth: '52px',
fontSizeTable: '{fontSizeBodyM}',
tableLineHeight: '{lineHeightBodyM}',
fontTableLetterSpacing: 'normal',
};

const expandedTokens: StyleDictionary.ExpandedDensityScopeDictionary = expandDensityDictionary(tokens);
Expand Down
3 changes: 3 additions & 0 deletions style-dictionary/visual-refresh/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceAlertMessageRight: '{spaceXxs}',
spaceAlertVertical: '{spaceFlashbarVertical}',
spaceButtonFocusOutlineGutter: '4px',
spaceExpandToggleFocusOutlineGutter: '{spaceButtonFocusOutlineGutter}',
spaceButtonHorizontal: '{spaceScaledL}',
spaceButtonVertical: '{spaceScaledXxs}',
spaceTokenVertical: '{spaceScaledXxs}',
Expand All @@ -30,6 +31,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceItemCardVerticalEmbedded: '{spaceCardVerticalEmbedded}',
spaceCodeEditorStatusFocusOutlineGutter: '-7px',
spaceContainerContentTop: '{spaceXxs}',
spaceContainerContentVertical: '{spaceScaledL}',
spaceContainerHeaderTop: '{spaceS}',
spaceContainerHeaderBottom: '{spaceScaledXs}',
spaceContainerHorizontal: '{spaceL}',
Expand Down Expand Up @@ -73,6 +75,7 @@ const tokens: StyleDictionary.SpacingDictionary = {
spaceTableHeaderToolsBottom: '0px',
spaceTableHeaderToolsFullPageBottom: '4px',
spaceTableHorizontal: '{spaceContainerHorizontal}',
spaceTableCellVertical: '{spaceScaledXs}',
spaceTreeViewIndentation: '{spaceXl}',
spaceSideNavigationItemDefaultGap: '{spaceNone}',
spaceSideNavigationItemIconGap: '{spaceXxs}',
Expand Down
Loading