Skip to content

Commit

Permalink
Merge branch 'main' into funnel/synthetic-focus-tracking-in-substeps
Browse files Browse the repository at this point in the history
  • Loading branch information
connorlanigan authored Jul 27, 2023
2 parents 01e6c37 + f2dbe92 commit 37c1cdb
Show file tree
Hide file tree
Showing 110 changed files with 383 additions and 524 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Here is a basic example that renders a primary button:
import Button from '@cloudscape-design/components/button';
import '@cloudscape-design/global-styles/index.css';

function App {
function App() {
return <Button variant="primary">Click me</Button>;
}
```
Expand Down
18 changes: 6 additions & 12 deletions build-tools/tasks/generate-i18n-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const { writeFile } = require('../utils/files');
const namespace = '@cloudscape-design/components';

const destinationDir = path.join(targetPath, 'components/i18n/messages');
const internalDestinationDir = path.join(targetPath, 'components/internal/i18n/messages');
const declarationFile = `import { I18nProviderProps } from "../provider";
declare const messages: I18nProviderProps.Messages;
export default messages;
Expand All @@ -36,21 +35,16 @@ module.exports = function generateI18nMessages() {
);
allParsedMessages[locale] = { ...(allParsedMessages[locale] ?? {}), ...parsedMessages };
const resultFormat = { [namespace]: { [locale]: parsedMessages } };

for (const directory of [destinationDir, internalDestinationDir]) {
writeFile(path.join(directory, `${subset}.${locale}.json`), JSON.stringify(resultFormat));
writeFile(path.join(directory, `${subset}.${locale}.d.ts`), declarationFile);
writeFile(path.join(directory, `${subset}.${locale}.js`), `export default ${JSON.stringify(resultFormat)}`);
}
writeFile(path.join(destinationDir, `${subset}.${locale}.json`), JSON.stringify(resultFormat));
writeFile(path.join(destinationDir, `${subset}.${locale}.d.ts`), declarationFile);
writeFile(path.join(destinationDir, `${subset}.${locale}.js`), `export default ${JSON.stringify(resultFormat)}`);
}

// Generate a ".all" file containing all locales.
const resultFormat = { [namespace]: allParsedMessages };
for (const directory of [destinationDir, internalDestinationDir]) {
writeFile(path.join(directory, `all.all.json`), JSON.stringify(resultFormat));
writeFile(path.join(directory, `all.all.d.ts`), declarationFile);
writeFile(path.join(directory, `all.all.js`), `export default ${JSON.stringify(resultFormat)}`);
}
writeFile(path.join(destinationDir, `all.all.json`), JSON.stringify(resultFormat));
writeFile(path.join(destinationDir, `all.all.d.ts`), declarationFile);
writeFile(path.join(destinationDir, `all.all.js`), `export default ${JSON.stringify(resultFormat)}`);

return Promise.resolve();
};
10 changes: 0 additions & 10 deletions build-tools/tasks/package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ function getComponentsExports() {
result[`./i18n/messages/${subset}.${locale}.json`] = `./i18n/messages/${subset}.${locale}.json`;
}

// i18n beta specific imports (delete after people switch over)
result['./internal/i18n'] = './internal/i18n/index.js';
result[`./internal/i18n/messages/all.all`] = `./internal/i18n/messages/all.all.js`;
result[`./internal/i18n/messages/all.all.json`] = `./internal/i18n/messages/all.all.json`;
for (const translationFile of fs.readdirSync('src/i18n/messages')) {
const [subset, locale] = translationFile.split('.');
result[`./internal/i18n/messages/${subset}.${locale}`] = `./internal/i18n/messages/${subset}.${locale}.js`;
result[`./internal/i18n/messages/${subset}.${locale}.json`] = `./internal/i18n/messages/${subset}.${locale}.json`;
}

return result;
}

Expand Down
228 changes: 0 additions & 228 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pages/alert/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ScreenshotArea from '../utils/screenshot-area';
import SpaceBetween from '~components/space-between';
import styles from './styles.scss';

import { I18nProvider } from '~components/internal/i18n';
import { I18nProvider } from '~components/i18n';
import messages from '~components/i18n/messages/all.all';

export default function AlertScenario() {
Expand Down
2 changes: 2 additions & 0 deletions pages/funnel-analytics/with-error-alert-in-wizard.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { i18nStrings } from '../wizard/common';
import Alert from '~components/alert';
import Container from '~components/container';
import Header from '~components/header';
import Link from '~components/link';

export default function WizardPage() {
const [errorMode, setErrorMode] = useState(0);

const steps: WizardProps.Step[] = [
{
title: 'Step 1',
info: <Link variant="info">Info</Link>,
content: (
<div>
<div>Content 1</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/property-filter/hooks.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { allItems, TableItem } from './table.data';
import { columnDefinitions, i18nStrings, filteringProperties } from './common-props';
import { useCollection } from '@cloudscape-design/collection-hooks';

import { I18nProvider } from '~components/internal/i18n';
import { I18nProvider } from '~components/i18n';
import messages from '~components/i18n/messages/all.all';

export default function () {
Expand Down
2 changes: 1 addition & 1 deletion src/alert/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AlertProps } from './interfaces';
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
import { SomeRequired } from '../internal/types';
import { useInternalI18n } from '../internal/i18n/context';
import { useInternalI18n } from '../i18n/context';
import { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';

const typeToIcon: Record<AlertProps.Type, IconProps['name']> = {
Expand Down
2 changes: 1 addition & 1 deletion src/app-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { isDevelopment } from '../internal/is-development';
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';

import RefreshedAppLayout from './visual-refresh';
import { useInternalI18n } from '../internal/i18n/context';
import { useInternalI18n } from '../i18n/context';
import { useSplitPanelFocusControl } from './utils/use-split-panel-focus-control';
import { useDrawerFocusControl } from './utils/use-drawer-focus-control';
import { awsuiPluginsInternal } from '../internal/plugins/api';
Expand Down
2 changes: 1 addition & 1 deletion src/area-chart/__tests__/area-chart-initial-state.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import popoverStyles from '../../../lib/components/popover/styles.css.js';
import chartWrapperStyles from '../../../lib/components/internal/components/chart-wrapper/styles.css.js';
import cartesianStyles from '../../../lib/components/internal/components/cartesian-chart/styles.css.js';
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
import TestI18nProvider from '../../../lib/components/internal/i18n/testing';
import TestI18nProvider from '../../../lib/components/i18n/testing';
import { cloneDeep } from 'lodash';
import '../../__a11y__/to-validate-a11y';

Expand Down
Loading

0 comments on commit 37c1cdb

Please sign in to comment.