Skip to content

Commit

Permalink
feat(quote): remove color-scheme (#11120)
Browse files Browse the repository at this point in the history
Co-authored-by: kennylam <[email protected]>
  • Loading branch information
ariellalgilmore and kennylam authored Nov 14, 2023
1 parent 45a8eb4 commit c4ebf0a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 98 deletions.
5 changes: 4 additions & 1 deletion docs/dotcom-v2-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For Carbon v11 migration guidance, see their
| link-with-icon | No API changes. |
| logo-grid | Deprecated in favor of `content-section` or `content-block` combined with `image-group`. |
| pictogram-item | Deprecated in favor of `content-item` (pictogram variation). |
| quote | No API changes. |
| quote | View [changes](#quote). |
| scroll-animations | No API changes. |
| search-with-typeahead | No API changes. |
| table-of-contents | No API changes. |
Expand Down Expand Up @@ -180,6 +180,9 @@ information.
- `link-list-item-card` has been replaced with `link-list-item`
- `link-list-item-card-cta` has been replaced with `link-list-item-cta`

### Quote
- Removed `color-scheme` `inverse` option in favor of `callout-quote (inverse)`

### Universal banner

- `universal-banner` renamed to `global-banner`
33 changes: 0 additions & 33 deletions packages/styles/scss/components/quote/_quote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,26 +137,6 @@
}
}

:host(#{$c4d-prefix}-quote)[color-scheme='inverse'] {
background: $background-inverse;
color: $icon-inverse;

.#{$prefix}--quote__mark {
color: $icon-inverse;
}

.#{$prefix}--quote__footer {
padding-left: 0;
padding-right: 0;

::slotted(#{$c4d-prefix}-quote-link-with-icon) {
margin-left: 0;
padding-left: $spacing-07;
outline: transparent;
}
}
}

.#{$prefix}--callout__container,
:host(#{$c4d-prefix}-callout) {
@include make-row;
Expand Down Expand Up @@ -203,17 +183,4 @@

display: inline-block;
}

:host-context(#{$c4d-prefix}-quote[color-scheme='inverse'])
a.#{$prefix}--link-with-icon.#{$prefix}--link.#{$prefix}--link-with-icon__icon-right {
color: $link-inverse;
outline-color: $focus-inverse;
&:hover {
color: $link-inverse;
text-decoration: underline;
}
&:active {
color: $link-inverse;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import C4DQuoteSourceBottomCopy from '@carbon/ibmdotcom-web-components/es/compon

function App() {
return (
<C4DQuote color-scheme="regular" mark-type="double-curved">
<C4DQuote mark-type="double-curved">
Bringing together the technology and expertise for a new way to create
<C4DQuoteSourceHeading>John Doe</C4DQuoteSourceHeading>
<C4DQuoteSourceCopy>Senior Vice President</C4DQuoteSourceCopy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import C4DQuoteSourceHeading from '@carbon/ibmdotcom-web-components/es/component
import C4DQuoteSourceCopy from '@carbon/ibmdotcom-web-components/es/components-react/quote/quote-source-copy';
import C4DQuoteSourceBottomCopy from '@carbon/ibmdotcom-web-components/es/components-react/quote/quote-source-bottom-copy';
import textNullable from '../../../../.storybook/knob-text-nullable';
import { QUOTE_TYPES, QUOTE_COLOR_SCHEMES } from '../quote';
import { QUOTE_TYPES } from '../quote';
import readme from './README.stories.react.mdx';

const types = {
Expand All @@ -31,22 +31,16 @@ const types = {
[`${QUOTE_TYPES.CORNER_BRACKET}`]: QUOTE_TYPES.CORNER_BRACKET,
};

const colorSchemes = {
[`${QUOTE_COLOR_SCHEMES.REGULAR}`]: QUOTE_COLOR_SCHEMES.REGULAR,
[`${QUOTE_COLOR_SCHEMES.INVERSE}`]: QUOTE_COLOR_SCHEMES.INVERSE,
};

export const Default = (args) => {
const {
copy,
quoteMark,
sourceHeading,
sourceCopy,
sourceBottomCopy,
colorScheme,
sourceBottomCopy
} = args?.Quote ?? {};
return (
<C4DQuote color-scheme={colorScheme} mark-type={quoteMark}>
<C4DQuote mark-type={quoteMark}>
{copy}
<C4DQuoteSourceHeading>{sourceHeading}</C4DQuoteSourceHeading>
<C4DQuoteSourceCopy>{sourceCopy}</C4DQuoteSourceCopy>
Expand Down Expand Up @@ -83,11 +77,6 @@ Default.story = {
'Source bottom copy (source-bottom-copy slot)',
'IBM Cloud'
),
colorScheme: select(
'Color Scheme (color-scheme)',
colorSchemes,
colorSchemes.regular
),
}),
},
propsSet: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { select } from '@storybook/addon-knobs';
import { html } from 'lit';
import ArrowRight20 from '../../../internal/vendor/@carbon/web-components/icons/arrow--right/20.js';
import { QUOTE_TYPES, QUOTE_COLOR_SCHEMES } from '../quote';
import { QUOTE_TYPES } from '../quote';
import '../index';
import '../quote-link-with-icon';
import textNullable from '../../../../.storybook/knob-text-nullable';
Expand All @@ -23,11 +23,10 @@ export const Default = (args) => {
quoteMark,
sourceHeading,
sourceCopy,
sourceBottomCopy,
colorScheme,
sourceBottomCopy
} = args?.Quote ?? {};
return html`
<c4d-quote color-scheme="${colorScheme}" mark-type="${quoteMark}">
<c4d-quote mark-type="${quoteMark}">
${copy}
<c4d-quote-source-heading> ${sourceHeading} </c4d-quote-source-heading>
<c4d-quote-source-copy> ${sourceCopy} </c4d-quote-source-copy>
Expand All @@ -51,11 +50,6 @@ const types = {
[`${QUOTE_TYPES.CORNER_BRACKET}`]: QUOTE_TYPES.CORNER_BRACKET,
};

const colorSchemes = {
[`${QUOTE_COLOR_SCHEMES.REGULAR}`]: QUOTE_COLOR_SCHEMES.REGULAR,
[`${QUOTE_COLOR_SCHEMES.INVERSE}`]: QUOTE_COLOR_SCHEMES.INVERSE,
};

export default {
title: 'Components/Quote',
decorators: [
Expand Down Expand Up @@ -94,11 +88,6 @@ export default {
'Source bottom copy (source-bottom-copy slot)',
'IBM Cloud'
),
colorScheme: select(
'Color Scheme (color-scheme)',
colorSchemes,
colorSchemes.regular
),
}),
},
propsSet: {
Expand All @@ -111,7 +100,6 @@ export default {
sourceHeading: 'Lorem ipsum dolor sit amet',
sourceCopy: 'consectetur adipiscing elit',
sourceBottomCopy: 'IBM Cloud',
colorScheme: 'regular',
},
},
},
Expand Down
12 changes: 0 additions & 12 deletions packages/web-components/src/components/quote/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,3 @@ export enum QUOTE_TYPES {
*/
CORNER_BRACKET = 'corner-bracket',
}

export enum QUOTE_COLOR_SCHEMES {
/**
* Regular Scheme
*/
REGULAR = 'regular',

/**
* Inverse Scheme
*/
INVERSE = 'inverse',
}
24 changes: 2 additions & 22 deletions packages/web-components/src/components/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { property } from 'lit/decorators.js';
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
import styles from './quote.scss';
import StableSelectorMixin from '../../globals/mixins/stable-selector';
import { QUOTE_TYPES, QUOTE_COLOR_SCHEMES } from './defs';
import { QUOTE_TYPES } from './defs';
import '../horizontal-rule/horizontal-rule';
import { carbonElement as customElement } from '../../internal/vendor/@carbon/web-components/globals/decorators/carbon-element';

export { QUOTE_TYPES, QUOTE_COLOR_SCHEMES };
export { QUOTE_TYPES };

const { prefix, stablePrefix: c4dPrefix } = settings;

Expand Down Expand Up @@ -51,12 +51,6 @@ class C4DQuote extends StableSelectorMixin(LitElement) {
@property({ reflect: true, attribute: 'mark-type' })
markType = QUOTE_TYPES.DEFAULT;

/**
* Defines if the inverse class is included
*/
@property({ reflect: true, attribute: 'color-scheme' })
colorScheme = '';

/**
* `true` if there is source heading.
*/
Expand Down Expand Up @@ -171,20 +165,6 @@ class C4DQuote extends StableSelectorMixin(LitElement) {
}

render() {
if (this.colorScheme === QUOTE_COLOR_SCHEMES.INVERSE) {
return html`
<div class="${prefix}--callout__column">
<div class="${prefix}--callout__content">
<div class="${prefix}--quote__container">
<div class="${prefix}--quote__wrapper">
${this._renderQuote()}${this._renderSource()}${this._renderFooter()}
</div>
</div>
</div>
</div>
`;
}

return html`
<div class="${prefix}--quote__container">
<div class="${prefix}--quote__wrapper">
Expand Down

0 comments on commit c4ebf0a

Please sign in to comment.