Skip to content

Commit 98932a8

Browse files
committed
feat(separator): update defaults
1 parent 37f3897 commit 98932a8

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Separator
22

3-
Horizontal rule component with alignment, variant, and margin options. Defaults: `alignment` is `full-width`, `variant` is `tertiary`.
3+
Horizontal rule component with alignment, variant, and margin options.
44

55
## Props
66

77
| Prop | Type | Default | Description |
88
|------|------|---------|-------------|
9-
| `alignment` | `'full-width'` \| `'none'` | `'full-width'` | `full-width` breaks out of the container to span the viewport; `none` stays within the container. |
9+
| `alignment` | `'full-width'` \| `'none'` | `'none'` | `full-width` breaks out of the container to span the viewport; `none` stays within the container. |
1010
| `className` | `string` || Additional CSS class. |
1111
| `marginBottom` | `number` \| `string` | `64` | Bottom margin (e.g. `64` or `"2rem"`). Capped at 32px on viewports < 783px. |
1212
| `marginTop` | `number` \| `string` | `64` | Top margin (e.g. `64` or `"2rem"`). Capped at 32px on viewports < 783px. |
13-
| `variant` | `'primary'` \| `'secondary'` \| `'tertiary'` | `'tertiary'` | Line color: `primary` uses the admin theme color (`--wp-admin-theme-color`); `secondary` uses `$gray-300`; `tertiary` uses `$gray-100` (lightest). |
13+
| `variant` | `'default'` \| `'primary'` \| `'secondary'` \| `'tertiary'` | `'default'` | Line color: `default` uses `$gray-300`; `primary` uses the admin theme color (`--wp-admin-theme-color`); `secondary` uses `$gray-900`; `tertiary` uses `$gray-100`. |
1414

1515
## Usage
1616

@@ -19,7 +19,7 @@ import { Separator } from '@newspack/components';
1919

2020
<Separator />
2121

22-
<Separator alignment="none" variant="primary" />
22+
<Separator alignment="full-width" variant="primary" />
2323

24-
<Separator marginBottom={48} marginTop={32} variant="secondary" />
24+
<Separator marginBottom={ 48 } marginTop={ 32 } variant="secondary" />
2525
```

packages/components/src/separator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import './style.scss';
1212
*/
1313
import classNames from 'classnames';
1414

15-
const Separator = ( { alignment = 'full-width', className, marginBottom = 64, marginTop = 64, variant = 'tertiary', ...otherProps } ) => {
15+
const Separator = ( { alignment = 'none', className = undefined, marginBottom = 64, marginTop = 64, variant = 'default', ...otherProps } ) => {
1616
const classes = classNames(
1717
'newspack-separator',
1818
className,

packages/components/src/separator/style.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@
3333

3434
// Variant
3535

36+
&--variant-default {
37+
background-color: wp-colors.$gray-300;
38+
}
39+
3640
&--variant-primary {
3741
background-color: var(--wp-admin-theme-color);
3842
}
3943

4044
&--variant-secondary {
41-
background-color: wp-colors.$gray-300;
45+
background-color: wp-colors.$gray-900;
4246
}
4347

4448
&--variant-tertiary {

src/wizards/audience/components/nrh-settings/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const NRHSettings = () => {
100100
{ __( 'Save Settings' ) }
101101
</Button>
102102
</div>
103-
<Separator />
103+
<Separator alignment="full-width" variant="tertiary" />
104104
</WizardsSection>
105105
);
106106
};

src/wizards/audience/views/setup/setup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default withWizardScreen(
125125
) ) }
126126
{ config.enabled && (
127127
<Card noBorder>
128-
<Separator />
128+
<Separator alignment="full-width" variant="tertiary" />
129129
<ActionCard
130130
title={ __( 'Present newsletter signup after checkout and registration', 'newspack-plugin' ) }
131131
description={ __(
@@ -171,7 +171,7 @@ export default withWizardScreen(
171171
toggleOnChange={ value => updateConfig( 'oauth_redirect_to_ras', value ) }
172172
/>
173173

174-
<Separator />
174+
<Separator alignment="full-width" variant="tertiary" />
175175

176176
<SectionHeader
177177
title={ __( 'Email Service Provider (ESP) Advanced Settings', 'newspack-plugin' ) }
@@ -314,7 +314,7 @@ export default withWizardScreen(
314314
) }
315315
{ newspackAudience.can_use_salesforce && (
316316
<Card noBorder>
317-
<Separator />
317+
<Separator alignment="full-width" variant="tertiary" />
318318
<Salesforce />
319319
</Card>
320320
) }

src/wizards/componentsDemo/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class ComponentsDemo extends Component {
123123
selectedItems={ selectedPostForAutocompleteWithSuggestions }
124124
/>
125125

126-
<Separator />
126+
<Separator marginTop={ 32 } marginBottom={ 32 } />
127127

128128
<h2>{ __( 'Autocomplete with Suggestions (multi-select)', 'newspack-plugin' ) }</h2>
129129
<AutocompleteWithSuggestions
@@ -154,7 +154,7 @@ class ComponentsDemo extends Component {
154154
selectedItems={ selectedPostForAutocompleteWithLatestPosts }
155155
/>
156156

157-
<Separator />
157+
<Separator marginTop={ 32 } marginBottom={ 32 } />
158158

159159
<h2>{ __( 'Autocomplete with Latest Posts (multi-select)', 'newspack-plugin' ) }</h2>
160160
<AutocompleteWithLatestPosts
@@ -613,6 +613,7 @@ class ComponentsDemo extends Component {
613613
<Button>{ __( 'Default', 'newspack-plugin' ) }</Button>
614614
<Button isLink>{ __( 'isLink', 'newspack-plugin' ) }</Button>
615615
</Card>
616+
<Separator variant="tertiary" />
616617
<p>
617618
<strong>{ __( 'Disabled', 'newspack-plugin' ) }</strong>
618619
</p>
@@ -631,6 +632,7 @@ class ComponentsDemo extends Component {
631632
{ __( 'isLink', 'newspack-plugin' ) }
632633
</Button>
633634
</Card>
635+
<Separator variant="tertiary" />
634636
<p>
635637
<strong>{ __( 'Small', 'newspack-plugin' ) }</strong>
636638
</p>

src/wizards/newspack/views/dashboard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Dashboard() {
3636
<>
3737
<BrandHeader />
3838
<SiteStatuses />
39-
<Separator alignment="none" />
39+
<Separator variant="tertiary" />
4040
<QuickActions />
4141
</>
4242
) }

src/wizards/newspack/views/dashboard/sections.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default [
3838
return dashSectionsKeys.map( sectionKey => {
3939
return (
4040
<Fragment key={ sectionKey }>
41-
<Separator alignment="none" />
41+
<Separator variant="tertiary" />
4242
<div className="newspack-dashboard__section">
4343
<h3>{ dashSections[ sectionKey ].title }</h3>
4444
<p>{ dashSections[ sectionKey ].desc }</p>

src/wizards/newspack/views/settings/connections/webhooks/modals/upsert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const Upsert = ( {
153153
</Button>
154154
</Card>
155155
</Grid>
156-
<Separator />
156+
<Separator alignment="full-width" variant="tertiary" />
157157
<TextControl
158158
label={ __( 'Label (optional)', 'newspack-plugin' ) }
159159
help={ __( 'A label to help you identify this endpoint. It will not be sent to the endpoint.', 'newspack-plugin' ) }

0 commit comments

Comments
 (0)