Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): component theming #5170

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

dbanksdesign
Copy link
Contributor

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • Relevant documentation is changed or added (and PR referenced)
  • yarn test passes and tests are updated/added
  • No side effects or sideEffects field updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dbanksdesign dbanksdesign requested a review from a team as a code owner April 18, 2024 22:21
Copy link

changeset-bot bot commented Apr 18, 2024

⚠️ No Changeset found

Latest commit: 89c5cfe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dbanksdesign dbanksdesign changed the title feat(ui): component theming (#4883) feat(ui): component theming Apr 18, 2024
packages/ui/src/theme/components/index.ts Fixed Show fixed Hide fixed
it('should work with top-level modifiers', () => {
const classname = ratingClassnames({ _modifiers: 'large' });
// @ts-expect-error
const badClassname = ratingClassnames({ _modifiers: 'foo' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable badClassname.
it('should work with elements without modifiers', () => {
const classname = ratingClassnames({ _element: 'item' });
// @ts-expect-error
const badClassname = ratingClassnames({ _element: 'foo' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable badClassname.
it('should work with elements with modifiers', () => {
const classname = ratingClassnames({ _element: { icon: 'empty' } });
// @ts-expect-error
const badClassname = ratingClassnames({ _element: 'foo' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable badClassname.
_modifiers: [null, undefined],
});

const badClassname = avatarClassnames({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable badClassname.
// these should all work and have type-safety
const c4 = className({ _element: 'icon' });
const c5 = className();
const c6 = className({ _element: 'icon', _modifiers: 'large' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c6.
const c4 = className({ _element: 'icon' });
const c5 = className();
const c6 = className({ _element: 'icon', _modifiers: 'large' });
const c7 = className({ _modifiers: 'small' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c7.
// These should all have TypeScript errors

// @ts-expect-error
const c1 = className({ _element: 'foo' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c1.
const c1 = className({ _element: 'foo' });

// @ts-expect-error
const c2 = className({ _element: { icon: 'foo' } });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c2.
const c2 = className({ _element: { icon: 'foo' } });

// @ts-expect-error
const c3 = className({ _modifiers: 'foo' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c3.
Comment on lines +5 to +12
import {
Alert,
Badge,
Button,
Flex,
Message,
Text,
} from '@aws-amplify/ui-react';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import Message.
@@ -0,0 +1,91 @@
import { createComponentTheme } from '../createTheme';
import { WebTokens } from '../tokens';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import WebTokens.
Comment on lines +4 to +10
import {
Modifiers,
BaseProperties,
Elements,
ColorTheme,
BaseTheme,
} from './utils';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import BaseTheme.
};
};

const test = createComponentTheme({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable test.
import { AlertTheme, alertTheme } from './alert';
import { AutoCompleteTheme } from './autocomplete';
import { BadgeTheme } from './badge';
import { BreadcrumbsTheme } from './breadcrumbs';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import BreadcrumbsTheme.
return className;
}

const c = createComponentClasses({ name: 'alert' });

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable c.
@@ -0,0 +1,32 @@
'use client';

Check warning

Code scanning / CodeQL

Unknown directive Warning

Unknown directive: 'use client'.
@@ -0,0 +1,41 @@
'use client';

Check warning

Code scanning / CodeQL

Unknown directive Warning

Unknown directive: 'use client'.
@@ -0,0 +1,7 @@
'use client';

Check warning

Code scanning / CodeQL

Unknown directive Warning

Unknown directive: 'use client'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant