Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6b14852
WIP
gerardo-rodriguez Mar 15, 2022
3cdb7f4
Update button to receive aria_controls value
gerardo-rodriguez Mar 15, 2022
60720f8
More WIP
gerardo-rodriguez Mar 15, 2022
f7bf494
Work in some of Tyler's suggestions
gerardo-rodriguez Mar 17, 2022
082b5a5
More changes
gerardo-rodriguez Mar 17, 2022
a079740
More progress
gerardo-rodriguez Mar 17, 2022
d6f47b4
Pretty solid state
gerardo-rodriguez Mar 17, 2022
4f6147d
Some cleanup
gerardo-rodriguez Mar 17, 2022
afd8072
Add button_class support to Buttton Swap
gerardo-rodriguez Mar 17, 2022
a98c1c2
Use button_class + cleanup
gerardo-rodriguez Mar 17, 2022
b45bf8c
More changes
gerardo-rodriguez Mar 17, 2022
26bdc4b
Refactor names
gerardo-rodriguez Mar 17, 2022
ad210d9
WIP, adding tests
gerardo-rodriguez Mar 18, 2022
888cb8a
Use page directly for accessibility tree snapshot
gerardo-rodriguez Mar 18, 2022
7f8d450
Add describe block, rename test using "should"
gerardo-rodriguez Mar 18, 2022
64edec0
Make things better
gerardo-rodriguez Mar 18, 2022
831c201
More work
gerardo-rodriguez Mar 18, 2022
12aa611
More progress
gerardo-rodriguez Mar 18, 2022
ccdd478
Simplify template a bit
gerardo-rodriguez Mar 18, 2022
9d7f43a
More updates
gerardo-rodriguez Mar 18, 2022
af6a7ce
Progress
gerardo-rodriguez Mar 18, 2022
84850e5
Fine-tune test
gerardo-rodriguez Mar 20, 2022
0da57a0
Fix broken code
gerardo-rodriguez Mar 20, 2022
8fa62b3
Adjust layout
gerardo-rodriguez Mar 21, 2022
752c6fc
Update tests
gerardo-rodriguez Mar 21, 2022
24a9992
Fix tab indentation
gerardo-rodriguez Mar 21, 2022
10fddc3
Delete logs
gerardo-rodriguez Mar 21, 2022
bcd22cf
Fix layout
gerardo-rodriguez Mar 21, 2022
e4f2f7d
Fix broken UI logic (thank you tests!)
gerardo-rodriguez Mar 21, 2022
a2c38e4
Make layout better
gerardo-rodriguez Mar 21, 2022
1ab9aa6
Add missing attributes
gerardo-rodriguez Mar 21, 2022
5b510a6
Remove unused code
gerardo-rodriguez Mar 21, 2022
ca4d80a
Update comments
gerardo-rodriguez Mar 21, 2022
80ef17e
Fix typo and update tests
gerardo-rodriguez Mar 21, 2022
4b02c69
Add comment
gerardo-rodriguez Mar 21, 2022
75b4d4b
Slight refactor
gerardo-rodriguez Mar 21, 2022
118f2a6
Add comment
gerardo-rodriguez Mar 21, 2022
e0883d4
Add content to Storybook story
gerardo-rodriguez Mar 21, 2022
e7c1ba4
Update code examples
gerardo-rodriguez Mar 21, 2022
49054e3
Update CI to use Node 16
gerardo-rodriguez Mar 22, 2022
dfcc609
Fix typo
gerardo-rodriguez Mar 22, 2022
f2e6cf0
Lint files
gerardo-rodriguez Mar 22, 2022
60e2173
Refactor to remove bg color, rename vars
gerardo-rodriguez Mar 22, 2022
81bab30
Remove bgColor from tests
gerardo-rodriguez Mar 22, 2022
5705d9d
Touch-ups
gerardo-rodriguez Mar 22, 2022
ec0ee5a
Add a changeset
gerardo-rodriguez Mar 22, 2022
f0ce6ba
Remove more form bg color code
gerardo-rodriguez Mar 22, 2022
cbffc8e
Add bg color back, theme-specific
gerardo-rodriguez Mar 22, 2022
8cbf7e7
Choose correct gray
gerardo-rodriguez Mar 22, 2022
802b90a
Edit description
gerardo-rodriguez Mar 22, 2022
42d8778
Add makeTwigInclude source
gerardo-rodriguez Mar 22, 2022
3aa54c2
Remove opacity change, not needed
gerardo-rodriguez Mar 22, 2022
975e09a
Use flexbox instead of grid
gerardo-rodriguez Mar 22, 2022
dfb3e6d
Delete unnused code
gerardo-rodriguez Mar 22, 2022
bf2ce34
Add more comments
gerardo-rodriguez Mar 22, 2022
189764e
Add extra check
gerardo-rodriguez Mar 22, 2022
e083296
Update comment
gerardo-rodriguez Mar 22, 2022
2399838
Update src/components/subscription-choices/subscription-choices.scss
gerardo-rodriguez Mar 22, 2022
1362e84
Use existing theme css prop, don't need these
gerardo-rodriguez Mar 22, 2022
d808584
Add CSS class to label
gerardo-rodriguez Mar 22, 2022
9d9b917
Use flex shorthand
gerardo-rodriguez Mar 22, 2022
fa3619d
c-subscription-choices -> c-subscribe
gerardo-rodriguez Mar 22, 2022
135a341
Better CSS class names
gerardo-rodriguez Mar 22, 2022
0a4c903
Update src/components/subscription-choices/subscription-choices.test.ts
gerardo-rodriguez Mar 22, 2022
9134022
Use toHaveAttribute assertion
gerardo-rodriguez Mar 22, 2022
b51acf6
Merge branch 'feature/disclosure-widget' of github.com:cloudfour/clou…
gerardo-rodriguez Mar 22, 2022
c6c548d
Lint
gerardo-rodriguez Mar 22, 2022
5766e69
Address PR feedback
gerardo-rodriguez Mar 22, 2022
8c4de41
Fix typo
gerardo-rodriguez Mar 22, 2022
8273485
Close form on Escape
gerardo-rodriguez Mar 23, 2022
0b39b22
Fix comments
gerardo-rodriguez Mar 23, 2022
32c928d
Fix typo
gerardo-rodriguez Mar 23, 2022
afc52b3
Use CSS grid because I couldn't flexbox correctly
gerardo-rodriguez Mar 23, 2022
fb5c566
Update src/components/button-swap/button-swap.stories.mdx
gerardo-rodriguez Mar 23, 2022
5c744b3
Update src/components/subscription-choices/subscription-choices.scss
gerardo-rodriguez Mar 23, 2022
2ab7015
Update changeset
gerardo-rodriguez Mar 23, 2022
013e962
subscription-choices -> subscribe
gerardo-rodriguez Mar 23, 2022
dd7a6da
Update src/components/subscribe/subscribe.test.ts
gerardo-rodriguez Mar 23, 2022
1a6ca26
More filename updates
gerardo-rodriguez Mar 23, 2022
0d3b273
More title changes
gerardo-rodriguez Mar 24, 2022
2a85120
PR feedback
gerardo-rodriguez Mar 24, 2022
297f704
Use an ArgsTable
gerardo-rodriguez Mar 24, 2022
c6276bb
Update comments
gerardo-rodriguez Mar 24, 2022
4295313
Add a class template prop to Input Group
gerardo-rodriguez Mar 24, 2022
6273078
Use Input Group component
gerardo-rodriguez Mar 24, 2022
d06656b
Update src/components/subscribe/subscribe.twig
gerardo-rodriguez Mar 24, 2022
7437d2a
Update src/objects/input-group/input-group.twig
gerardo-rodriguez Mar 24, 2022
b2401fc
controls-wrapper -> controls
gerardo-rodriguez Mar 24, 2022
b2df335
Merge branch 'feature/disclosure-widget' of github.com:cloudfour/clou…
gerardo-rodriguez Mar 24, 2022
14ce64e
Revert controls-wrapper -> controls
gerardo-rodriguez Mar 24, 2022
c9e2af3
PR feedback, make action not have default
gerardo-rodriguez Mar 24, 2022
6e7d0dc
Remove controls-wrapper
gerardo-rodriguez Mar 24, 2022
810fdea
Delete default form_action
gerardo-rodriguez Mar 24, 2022
3ec5c81
Update broken test
gerardo-rodriguez Mar 24, 2022
73159e1
Fix syntax error
gerardo-rodriguez Mar 24, 2022
c9216fd
Address feedback from Caleb
gerardo-rodriguez Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/little-colts-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@cloudfour/patterns': minor
---

- Add Subscribe component
- Update CI workflow to use Node 16
- Add a `button_class` template prop to the Button Swap component
- Add a `class` template prop to the Input Group component
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 12
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- name: Cache node modules
uses: actions/cache@v2
with:
Expand All @@ -35,10 +35,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 12
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- name: Cache node modules
uses: actions/cache@v2
with:
Expand All @@ -58,10 +58,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 12
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- name: Cache node modules
uses: actions/cache@v2
with:
Expand All @@ -80,10 +80,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 12
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- name: Cache node modules
uses: actions/cache@v2
with:
Expand Down
3 changes: 2 additions & 1 deletion src/components/button-swap/button-swap.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ You have the ability to pass `initialCallback` and `swappedCallback` callback fu

## Template Properties

- `class` (string): Appends a CSS class(es) to the root element.
- `class` (string): Appends to the CSS class of the root element.
- `button_class` (string): Appends to the CSS class of the button element.
- `content_start_icon` (string, default `'bell'`): The button [icon](/docs/design-icons--page) (the same icon is applied to both buttons).
- `initial_label` (string, default `'Unsubscribed from notifications'`): The first button visually hidden text.
- `initial_visual_label` (string, default `'Get notifications'`): The first button label.
Expand Down
9 changes: 7 additions & 2 deletions src/components/button-swap/button-swap.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</span>

{% include '@cloudfour/components/button/button.twig' with {
class: 'js-button-swap__button',
class: ['js-button-swap__button', button_class]|join(' '),
content_start_icon: content_start_icon|default('bell'),
label: initial_visual_label|default('Get notifications')
} only %}
Expand All @@ -20,7 +20,12 @@
</span>

{% include '@cloudfour/components/button/button.twig' with {
class: 'c-button--secondary is-slashed js-button-swap__button',
class: [
'c-button--secondary',
'is-slashed',
'js-button-swap__button',
button_class
]|join(' '),
content_start_icon: content_start_icon|default('bell'),
label: swapped_visual_label|default('Turn off notifications')
} only %}
Expand Down
5 changes: 5 additions & 0 deletions src/components/subscribe/demo/demo.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% embed '@cloudfour/components/subscribe/subscribe.twig' with {
form_id: 'test'
} only %}{% endembed %}

<p>This is only for demo purposes. <a href="#">I am a link</a></p>
55 changes: 55 additions & 0 deletions src/components/subscribe/subscribe.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@use '../../compiled/tokens/scss/breakpoint';
@use '../../compiled/tokens/scss/color';
@use '../../compiled/tokens/scss/size';
@use '../../mixins/a11y';
@use '../../mixins/theme';

///
/// Subscribe component
///

.c-subscribe {
position: relative;
}

.c-subscribe__controls {
display: grid;
gap: 1em;
margin: size.$rhythm-default 0;

@media (min-width: breakpoint.$s) {
grid-template-columns: 1fr 1fr;
}
}

.c-subscribe__control {
inline-size: 100%;
}

///
/// 1. Ensures the form background color matches the current theme
///

.c-subscribe__form {
background-color: var(--theme-color-background-base); // 1
block-size: 100%;
inline-size: 100%;
inset-block-start: 0;
inset-inline-start: 0;
position: absolute;

///
/// 1. Allows for the visually hidden form to be keyboard accessible, will be
/// visually hidden when elements within the form are not in focus.
///

.c-subscribe__form-input-label,
.c-subscribe:not(.activate-form) // 1
&:not(:target):not(:focus-within) {
@include a11y.sr-only;
}
}

.c-subscribe__form-input-group {
margin: size.$rhythm-default 0;
}
Loading