Skip to content

Commit

Permalink
fix: rename content prop to text and grammar edits
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemai2awesome committed Jan 23, 2020
1 parent cee5392 commit f5a4575
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 42 deletions.
@@ -0,0 +1,3 @@
---
title: 'Table of Contents'
---
Expand Up @@ -2,23 +2,23 @@
{% include "@bolt-components-toc/toc.twig" with {
items: [
{
content: "Section One",
text: "Section One",
url: "#section-one",
},
{
content: "Section Two",
text: "Section Two",
url: "#section-two",
},
{
content: "Section Three",
text: "Section Three",
url: "#section-three",
},
{
content: "Section Four",
text: "Section Four",
url: "#section-four",
},
{
content: "Section Five",
text: "Section Five",
url: "#section-five",
},
]
Expand Down
Expand Up @@ -9,24 +9,24 @@
{% include "@bolt-components-toc/toc.twig" with {
items: [
{
content: "Section One",
text: "Section One",
url: "#section-one",
},
{
content: "Section Two",
text: "Section Two",
url: "#section-two",
},
{
content: "Section Three",
text: "Section Three",
url: "#section-three",
active: true,
},
{
content: "Section Four",
text: "Section Four",
url: "#section-four",
},
{
content: "Section Five",
text: "Section Five",
url: "#section-five",
},
]
Expand Down
Expand Up @@ -2,31 +2,31 @@
Visible header
</bolt-text>
<bolt-text>
A header for a table of content can be created by passing plain text into the <bolt-code-snippet display="inline" lang="html">header</bolt-code-snippet> prop.
A header for table of contents can be created by passing plain text into the <bolt-code-snippet display="inline" lang="html">header</bolt-code-snippet> prop.
</bolt-text>

{# Start component specific code #}
{% include "@bolt-components-toc/toc.twig" with {
header: "This is the header",
items: [
{
content: "Section One",
text: "Section One",
url: "#section-one",
},
{
content: "Section Two",
text: "Section Two",
url: "#section-two",
},
{
content: "Section Three",
text: "Section Three",
url: "#section-three",
},
{
content: "Section Four",
text: "Section Four",
url: "#section-four",
},
{
content: "Section Five",
text: "Section Five",
url: "#section-five",
},
]
Expand Down
Expand Up @@ -7,15 +7,15 @@
header: "Marvel Cinematic Universe",
items: [
{
content: "Phase One",
text: "Phase One",
url: "#phase-one",
},
{
content: "Phase Two",
text: "Phase Two",
url: "#phase-two",
},
{
content: "Phase Three",
text: "Phase Three",
url: "#phase-three",
},
]
Expand Down
Expand Up @@ -52,7 +52,7 @@
Web Component Usage
</bolt-text>
<bolt-text>
Bolt Table of Content is a web component, you can simply use <bolt-code-snippet display="inline" lang="html">&lt;bolt-toc&gt;</bolt-code-snippet> in the markup to make it render.
Bolt Table of Contents is a web component, you can simply use <bolt-code-snippet display="inline" lang="html">&lt;bolt-toc&gt;</bolt-code-snippet> in the markup to make it render.
</bolt-text>
{% include toc_code.code_example(toc_demo) %}
</div>
Expand Down
3 changes: 2 additions & 1 deletion packages/components/bolt-toc/README.md
@@ -1,6 +1,7 @@
Table of Content is part of the collection of components, visual styles, and build tools that power the the [Bolt Design System](https://www.boltdesignsystem.com).
Table of Contents is part of the collection of components, visual styles, and build tools that power the the [Bolt Design System](https://www.boltdesignsystem.com).

###### Install via NPM

```
npm install @bolt/components-toc
```
18 changes: 9 additions & 9 deletions packages/components/bolt-toc/__tests__/toc.js
Expand Up @@ -19,15 +19,15 @@ describe('<bolt-toc> Component', () => {
const results = await render('@bolt-components-toc/toc.twig', {
items: [
{
content: 'Section One',
text: 'Section One',
url: '#section-one',
},
{
content: 'Section Two',
text: 'Section Two',
url: '#section-two',
},
{
content: 'Section Three',
text: 'Section Three',
url: '#section-three',
},
],
Expand All @@ -42,15 +42,15 @@ describe('<bolt-toc> Component', () => {
header: 'This is the header',
items: [
{
content: 'Section One',
text: 'Section One',
url: '#section-one',
},
{
content: 'Section Two',
text: 'Section Two',
url: '#section-two',
},
{
content: 'Section Three',
text: 'Section Three',
url: '#section-three',
},
],
Expand All @@ -63,16 +63,16 @@ describe('<bolt-toc> Component', () => {
const results = await render('@bolt-components-toc/toc.twig', {
items: [
{
content: 'Section One',
text: 'Section One',
url: '#section-one',
},
{
content: 'Section Two',
text: 'Section Two',
url: '#section-two',
active: true,
},
{
content: 'Section Three',
text: 'Section Three',
url: '#section-three',
},
],
Expand Down
4 changes: 2 additions & 2 deletions packages/components/bolt-toc/package.json
@@ -1,14 +1,14 @@
{
"name": "@bolt/components-toc",
"version": "0.0.0",
"description": "Table of Content is a navigation list, usually found on an article page, of its section titles.",
"description": "Table of Contents is a navigation list, usually found on an article page, of its section titles.",
"keywords": [
"bolt design system",
"bolt",
"css framework",
"design system",
"components",
"table of content"
"table of contents"
],
"homepage": "https://boltdesignsystem.com",
"bugs": "https://github.com/bolt-design-system/bolt/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/bolt-toc/src/_toc-item.scss
@@ -1,5 +1,5 @@
/* ------------------------------------ *\
Table of Content Item
Table of Contents Item
\* ------------------------------------ */

@import '@bolt/core-v3.x';
Expand Down
4 changes: 2 additions & 2 deletions packages/components/bolt-toc/src/_toc-item.twig
Expand Up @@ -39,12 +39,12 @@
#}
<bolt-toc-item
{% if outer_classes %} class="{{ outer_classes|join(' ') }}" {% endif %}
{{ this.props|without("content")|without("class") }}
{{ this.props|without("text")|without("class") }}
role="presentation"
>
<replace-with-grandchildren role="listitem">
<a {% if inner_classes %} class="{{ inner_classes|join(' ') }}" {% endif %} href="{{ url }}">
{{ content }}
{{ text }}
</a>
</replace-with-grandchildren>
</bolt-toc-item>
2 changes: 1 addition & 1 deletion packages/components/bolt-toc/src/toc.js
Expand Up @@ -80,7 +80,7 @@ class BoltToc extends withContext(BoltElement) {
})}"
id="js-bolt-toc-${this.uuid}"
>
${this.header ? this.header : 'Table of Content'}
${this.header ? this.header : 'Table of Contents'}
</h2>
<div class="${cx(`c-bolt-toc__list`)}" role="list">
${this.slotify('default')}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/bolt-toc/src/toc.scss
@@ -1,5 +1,5 @@
/* ------------------------------------ *\
Table of Content
Table of Contents
\* ------------------------------------ */

@import '@bolt/core-v3.x';
Expand Down
10 changes: 5 additions & 5 deletions packages/components/bolt-toc/toc.schema.js
@@ -1,8 +1,8 @@
module.exports = {
$schema: 'http://json-schema.org/draft-04/schema#',
title: 'Table of Content',
title: 'Table of Contents',
description:
'Table of Content is a navigation list, usually found on an article page, of its section titles.',
'A navigation list, usually found on an article page, of its section titles.',
type: 'object',
properties: {
attributes: {
Expand All @@ -19,7 +19,7 @@ module.exports = {
description:
'Renders a linked item that points to the beginning of a particular section.',
properties: {
content: {
text: {
type: 'string',
description: 'Renders the text for the linked item.',
},
Expand All @@ -38,12 +38,12 @@ module.exports = {
},
header: {
type: 'string',
description: 'Renders a header for the table of content.',
description: 'Renders a header for the table of contents.',
},
uuid: {
type: 'string',
description:
'Unique ID for the table of content, randomly generated if not provided.',
'Unique ID for the table of contents, randomly generated if not provided.',
},
},
};

0 comments on commit f5a4575

Please sign in to comment.