Skip to content

Commit

Permalink
feat(design)!: remove DaffArticleTitleDirective and DaffArticleLeadDi…
Browse files Browse the repository at this point in the history
…rective and set styles directly on <h1> and first <p> of an article (#2887)

BREAKING CHANGE:

`DaffArticleTitleDirective` and `DaffArticleLeadDirective` have been removed. The styles from these directives will automatically apply to the `<h1>` and first `<p>` that comes after a `<h1>` in a `<daff-article>`.
  • Loading branch information
xelaint committed Jun 21, 2024
1 parent 3d1796f commit 223b304
Show file tree
Hide file tree
Showing 37 changed files with 78 additions and 152 deletions.
6 changes: 3 additions & 3 deletions apps/design-land/src/app/accordion/accordion.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Accordion</h1>
<p daffArticleLead>An accordion is a group of vertically stacked headings used to toggle the visibility of a section of content.</p>
<h1>Accordion</h1>
<p>An accordion is a group of vertically stacked headings used to toggle the visibility of a section of content.</p>

<h2>Overview</h2>
<p>Accordions are made up of <code>&lt;daff-accordion-item&gt;</code>s that can be expanded or collapsed to display large amounts of information. Accordions are helpful to shorten pages and reduce scrolling by hiding content that's not crucial to display at all times.</p>
Expand All @@ -9,7 +9,7 @@ <h2>Supported Content Types</h2>

<p>By default, the accordion item includes a toggle icon at the end of the header to indicate if it's expanded or collapsed.</p>

<h3>Setting an item to be expanded by default</h3>
<h3 id="setting-an-item-to-be-expanded-by-default">Setting an item to be expanded by default</h3>
<p>An item content can be visibile on render by setting the <code>initiallyExpanded</code> property to <code>true</code> on <code>&lt;daff-accordion-item&gt;</code>.</p>

<h2>Usage</h2>
Expand Down
8 changes: 2 additions & 6 deletions apps/design-land/src/app/article/article.component.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<h1 daffArticleTitle>Article</h1>
<p daffArticleLead>Article provides styles to common element selectors to create an article in a content page.</p>
<h1>Article</h1>
<p>Article provides styles to common element selectors to create an article in a content page.</p>

<h2>Overview</h2>
<p>Article can be used on any content page that displays large blocks of text-driven information. It's meant to be used as a standalone element and should not be nested inside any other components that may change the background color from the anticipated one. In the event that you must nest an article inside another component, please ensure that you set the article's background color to the default body color.</p>

<h2>Headings</h2>
<design-land-example-viewer-container example="article-headings"></design-land-example-viewer-container>

<h2>Article Lead</h2>
<p>Lead is used as the opening paragraph to provide a summary or leading information for an article. Lead is a custom directive of article and is not a native element selector. To use it, add the <code>daffArticleLead</code> attribute to a paragraph (<code>&lt;p&gt;</code>).</p>
<design-land-example-viewer-container example="article-lead"></design-land-example-viewer-container>

<h2>Article Meta</h2>
<p>Meta is used if there is metadata information about your article (i.e. author name, date, etc). Meta is a custom directive of article and is not a native element selector. To use it, add <code>daffArticleMeta</code> to a paragraph (<code>&lt;p&gt;</code>).</p>
<design-land-example-viewer-container example="article-meta"></design-land-example-viewer-container>
Expand Down
6 changes: 2 additions & 4 deletions apps/design-land/src/app/button/button.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<h1 daffArticleTitle>Button</h1>
<p daffArticleLead>
The button is used for making actions apparent to the end-user. It can be used to navigate users to a different page or to perform an action. Buttons can contain text, icons, or both.
</p>
<h1>Button</h1>
<p>The button is used for making actions apparent to the end-user. It can be used to navigate users to a different page or to perform an action. Buttons can contain text, icons, or both.</p>

<h2>Overview</h2>
<p>Native <code>&lt;button&gt;</code> or <code>&lt;a&gt;</code> elements are always used in order to provide an easy, accessible experience for users.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/callout/callout.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Callout</h1>
<p daffArticleLead>Callout is a versatile component that can be used to easily highlight a piece of content.</p>
<h1>Callout</h1>
<p>Callout is a versatile component that can be used to easily highlight a piece of content.</p>

<h2>Overview</h2>
<p>Callouts can be used multiple times on a page. It's a flexible and extensible component that includes pre-styled content containers. It can be used alongside a product list to highlight a set of products, quickly lay out an accordion, showcase a set of features, etc.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/card/card.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Card</h1>
<p daffArticleLead>Cards are versatile content containers that contain content and actions to convey information about a single subject.</p>
<h1>Card</h1>
<p>Cards are versatile content containers that contain content and actions to convey information about a single subject.</p>

<h2>Overview</h2>
<p>There are three types of cards: default (filled), raised, and stroked. Cards can contain anything from images, blocks of text, lists, accordions, and other components.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/container/container.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Container</h1>
<p daffArticleLead>Container is a basic structural element that can be used to restrict content to a specific width. Containers are not responsible for providing padding or margin.</p>
<h1>Container</h1>
<p>Container is a basic structural element that can be used to restrict content to a specific width. Containers are not responsible for providing padding or margin.</p>

<h2>Size</h2>
<p>The size of a container can be defined by using the <code>size</code> property. There is no default size set.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Color</h1>
<p daffArticleLead>Color is used to help us distinguish and create consistent experiences across products.</p>
<h1>Color</h1>
<p>Color is used to help us distinguish and create consistent experiences across products.</p>

<h2>Accessibility Considerations and Guarantees</h2>
<p>We are committed to complying with the <a href="https://www.w3.org/TR/WCAG/" target="_blank">Web Content Accessibility Guidelines (WCAG) 2.1</a>. The component kit is built with the guidelines in mind. If you choose to identify your own color palettes outside of Daffodil's colors, please make sure to choose primary, secondary, tertiary, and extended colors that will pass the guidelines. Ensure there is sufficient color contrast between elements so that people who are visually impaired can see and use your products.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Variables</h1>
<p daffArticleLead>Daffodil's CSS custom properties can be used for fast and easy design and development. We provide common, functional CSS variables that can be used to quickly style elements without the need to create theme files.</p>
<h1>Variables</h1>
<p>Daffodil's CSS custom properties can be used for fast and easy design and development. We provide common, functional CSS variables that can be used to quickly style elements without the need to create theme files.</p>

<h2>CSS Custom Properties</h2>
<p>Our custom properties are prefixed with <code>daff-</code> to avoid conflicts with third party variables.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/hero/hero.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Hero</h1>
<p daffArticleLead>Hero is a top level container that is large and captivating. It should only be used once as the first container on any given page.</p>
<h1>Hero</h1>
<p>Hero is a top level container that is large and captivating. It should only be used once as the first container on any given page.</p>

<h2>Overview</h2>
<p>Heros are the first thing users see on a page and are designed to catch their attention. It's a flexible and extensible component that includes pre-styled content containers.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/image/image.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Image</h1>
<p daffArticleLead>Image utilizes the native HTML <code>img</code> element to display responsive images on a page and prevent content jumping while images are loading. <code>daff-image</code> is an opinionated version that encourages friendly end-user usage.</p>
<h1>Image</h1>
<p>Image utilizes the native HTML <code>img</code> element to display responsive images on a page and prevent content jumping while images are loading. <code>daff-image</code> is an opinionated version that encourages friendly end-user usage.</p>

<h2>Attributes</h2>
<p> The <code>src</code>, <code>width</code>, <code>height</code>, and <code>alt</code> attributes must be defined. An error will be thrown any of these attributes are missing.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/input/input.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Input</h1>
<p daffArticleLead>Input is a form control element that can be used in forms.</p>
<h1>Input</h1>
<p>Input is a form control element that can be used in forms.</p>

<h2>Examples</h2>

Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/list/list.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>List</h1>
<p daffArticleLead> List is a flexible component that can be used to display a series of content. It can be modified to support a range of content types.</p>
<h1>List</h1>
<p> List is a flexible component that can be used to display a series of content. It can be modified to support a range of content types.</p>

<h2>Basic List</h2>
<p>A <code>&lt;daff-list&gt;</code> consists of multiple <code>&lt;daff-list-item&gt;s</code>.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Loading Icon</h1>
<p daffArticleLead>Loading icons are used as an indicator of an event in progress.</p>
<h1>Loading Icon</h1>
<p>Loading icons are used as an indicator of an event in progress.</p>

<h2>Overview</h2>
<p>Loading icons are used to indicate to users that an event is ocurring and is still in progress. They should only be used for short loading processes. For events that can take a considerable amount of time, use the <a routerLink="/progress-bar">Progress Bar</a> component instead.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Media Gallery</h1>
<p daffArticleLead>Media gallery is used to display a group of thumbnails in a gallery format. Media galleries are useful to showcase multiple images related to a single product or topic.</p>
<h1>Media Gallery</h1>
<p>Media gallery is used to display a group of thumbnails in a gallery format. Media galleries are useful to showcase multiple images related to a single product or topic.</p>

<h2>Thumbnail</h2>
<p><code>[daffThumbnail]</code>should be used as a directive with <code>&lt;daff-image&gt;</code>. (View <a href="/image">Image Documentation</a>)</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/menu/menu.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Menu</h1>
<p daffArticleLead>Menu is a small floating panel used to display a list of actions or navigational items.</p>
<h1>Menu</h1>
<p>Menu is a small floating panel used to display a list of actions or navigational items.</p>

<h2>Overview</h2>
<p>Menus only appear when a user interacts with a menu activator button. They should be used for secondary actions or options where users don't need immediate access to.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/modal/modal.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Modal</h1>
<p daffArticleLead>Modal is a dynamically rendered element that floats about the rest of a page's content. It can be especially useful for interstitials that require additional user feedback.</p>
<h1>Modal</h1>
<p>Modal is a dynamically rendered element that floats about the rest of a page's content. It can be especially useful for interstitials that require additional user feedback.</p>

<h2>Supported Content Types</h2>
<p>These components and directives help to structure the content in your modal.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Navbar</h1>
<p daffArticleLead>Navbar is a flexible and extensible, horizontally stacked component intended for major blocks of navigation links.</p>
<h1>Navbar</h1>
<p>Navbar is a flexible and extensible, horizontally stacked component intended for major blocks of navigation links.</p>

<h2>Overview</h2>
<p>The navbar contains minimal layout styles, allowing the content within it to be fluid and customizable. It utilizes the <code>flex</code> display and is customizable with all the flexbox properties. It's required to be used with the native HTML <code>&lt;nav&gt;</code> element to ensure an accessible experience by default.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Notification</h1>
<p daffArticleLead>Notifications provides a way to display and communicate information related user actions within a page's content.</p>
<h1>Notification</h1>
<p>Notifications provides a way to display and communicate information related user actions within a page's content.</p>

<h2>Overview</h2>
<p>Notifications are used to display short messages that provide context in close promixity to a piece of content. They're often used to provide feedback or to notify users about an action they performed within a page. Notifications should not be used to display app-level alerts. Instead, use the <a routerLink="/toast">Toast</a> component.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/paginator/paginator.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Paginator</h1>
<p daffArticleLead>Paginator is used to break up large amounts of content into multiple pages, enabling users to easily navigate between pages of content.</p>
<h1>Paginator</h1>
<p>Paginator is used to break up large amounts of content into multiple pages, enabling users to easily navigate between pages of content.</p>

<h2>Truncation</h2>
<p>An ellipsis is used to truncate pages when the number of pages exceed the maximum display limit. Double truncation appears when the current page is separated by more than three pages from both the first and last page.</p>
Expand Down
38 changes: 18 additions & 20 deletions apps/design-land/src/app/progress-bar/progress-bar.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
<daff-article>
<h1 daffArticleTitle>Progress Bar</h1>
<div daffArticleLead>A progress bar provides visual feedback about the duration or progress of a task or operation.</div>
<h1>Progress Bar</h1>
<div>A progress bar provides visual feedback about the duration or progress of a task or operation.</div>

<h2>Types</h2>
<p>There are two types of progress bars: <code>determinate</code> and <code>indeterminate</code>. They are <code>determinate</code> by default.</p>
<h2>Types</h2>
<p>There are two types of progress bars: <code>determinate</code> and <code>indeterminate</code>. They are <code>determinate</code> by default.</p>

<h3>Determinate</h3>
<p>Determinate progress bars should be used when the loading percentage of a task or operation is known.</p>
<design-land-example-viewer-container example="progress-bar-default"></design-land-example-viewer-container>

<h3>Indeterminate</h3>
<p>Indeterminate progress bars should be used when the loading percentage of a task or operation is unknown or cannot be calculated.</p>
<design-land-example-viewer-container example="progress-bar-indeterminate"></design-land-example-viewer-container>
<h3>Determinate</h3>
<p>Determinate progress bars should be used when the loading percentage of a task or operation is known.</p>
<design-land-example-viewer-container example="progress-bar-default"></design-land-example-viewer-container>

<h2>Theming</h2>
<p> The progress bar color is defined by using the <code>color</code> property. By default, the color is set to <code>primary</code>. This can be changed to one of the supported colors.</p>
<p>Supported colors: <code>primary | secondary | tertiary | theme | theme-contrast | white | black</code></p>
<h3>Indeterminate</h3>
<p>Indeterminate progress bars should be used when the loading percentage of a task or operation is unknown or cannot be calculated.</p>
<design-land-example-viewer-container example="progress-bar-indeterminate"></design-land-example-viewer-container>

<blockquote><code>theme</code>, <code>theme-contrast</code>, <code>white</code>, and <code>black</code> should be used with caution to ensure that there is sufficient contrast.</blockquote>
<h2>Theming</h2>
<p> The progress bar color is defined by using the <code>color</code> property. By default, the color is set to <code>primary</code>. This can be changed to one of the supported colors.</p>
<p>Supported colors: <code>primary | secondary | tertiary | theme | theme-contrast | white | black</code></p>

<design-land-example-viewer-container example="progress-bar-themes"></design-land-example-viewer-container>
<blockquote><code>theme</code>, <code>theme-contrast</code>, <code>white</code>, and <code>black</code> should be used with caution to ensure that there is sufficient contrast.</blockquote>

<h2>Accessibility</h2>
The progress bar component works with the ARIA <code>role="progressbar"</code> to provide an accessible experience. A label should always be provided by using <code>label[daffFormLabel]</code>, <code>aria-label</code>, or <code>aria-labelledby</code>.
</daff-article>
<design-land-example-viewer-container example="progress-bar-themes"></design-land-example-viewer-container>

<h2>Accessibility</h2>
The progress bar component works with the ARIA <code>role="progressbar"</code> to provide an accessible experience. A label should always be provided by using <code>label[daffFormLabel]</code>, <code>aria-label</code>, or <code>aria-labelledby</code>.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Quantity Field</h1>
<p daffArticleLead>Quantity field is a form control element that switches between a native select and input element.</p>
<h1>Quantity Field</h1>
<p>Quantity field is a form control element that switches between a native select and input element.</p>

<h2>Overview</h2>
<p>Quantity field is intended for use with cart items and product quantities. The maximum number accepted in a quantity select is configurable and set to 10 by default. It will switch to a quantity input if 10+ is selected.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Sidebar</h1>
<p daffArticleLead>Sidebar is a component used to display additional information to the side of a page that may be fixed or collapsible.</p>
<h1>Sidebar</h1>
<p>Sidebar is a component used to display additional information to the side of a page that may be fixed or collapsible.</p>

<h2>Overview</h2>
<p>Sidebars are often used for navigation, but it's built to be flexible and extensible so that it can be used for any content. Sidebar supports a header and footer component with minimal default styling.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/toast/toast.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Toast</h1>
<p daffArticleLead>Toasts are small messages designed to mimic push notifications. They are used to provide users with application level information.</p>
<h1>Toast</h1>
<p>Toasts are small messages designed to mimic push notifications. They are used to provide users with application level information.</p>

<h2>Overview</h2>
<p>Toasts should be used to display temporary messages about actions or events that occured or in need of attention, with no relation to content on a page. For messaging that provide context in close promixity to a piece of content within a page, use the <a routerLink="/notification">Notification</a> component.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/tree/tree.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Tree</h1>
<p daffArticleLead>Trees are used to visualize hierarchial information. They are often used to display navigational structures like nested lists of links.</p>
<h1>Tree</h1>
<p>Trees are used to visualize hierarchial information. They are often used to display navigational structures like nested lists of links.</p>

<h2>Overview</h2>
<p>The <code>DaffTreeComponent</code> renders a tree structure. Typically, this is a structure of <code>&lt;a&gt;</code> and <code>&lt;button&gt;</code> elements that allow users to either navigate to a page, or explore the tree to find an item inside the tree that they want to navigate to.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/design-land/src/app/typography/typography.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 daffArticleTitle>Typography</h1>
<p daffArticleLead>We use typography to establish hierarchy, organize information, and guide our users through a product or experience.</p>
<h1>Typography</h1>
<p>We use typography to establish hierarchy, organize information, and guide our users through a product or experience.</p>

<h2>Type scale</h2>
<p>The Design Land typopgrahic scale is designed with visual distinctions to help our users better understand content and UI. Text sizes, styles, and layouts were selected to maintain logical hierarchies and drive consistency throughout an application.</p>
Expand Down
5 changes: 0 additions & 5 deletions libs/design/article/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ Article can be used on any content page that displays large blocks of text-drive
## Headings
<design-land-example-viewer-container example="article-headings"></design-land-example-viewer-container>

## Article Lead
Lead is used as the opening paragraph to provide a summary or leading information for an article. Lead is a custom directive of article and is not a native element selector. To use it, add `daffArticleLead` to a paragraph (`<p>`).

<design-land-example-viewer-container example="article-lead"></design-land-example-viewer-container>

## Article Meta
Meta is used if there is metadata information about your article (i.e. author name, date, etc). Meta is a custom directive of article and is not a native element selector. To use it, add `daffArticleMeta` to a paragraph (`<p>`).

Expand Down
Loading

0 comments on commit 223b304

Please sign in to comment.