Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
5187a92
Add disabled styles for usa-input and prefix/suffix
mahoneycm Oct 24, 2022
a0c0928
Add disable previews for prefix/suffix
mahoneycm Oct 24, 2022
27f837f
Update disabled suffix ID
mahoneycm Oct 24, 2022
83f5d39
Fix disabled input ID
mahoneycm Oct 31, 2022
123d806
Add quotes to disabled color
mahoneycm Oct 31, 2022
cb46d4b
Add disabled style to .usa-textarea:disabled
mahoneycm Nov 1, 2022
b2e66b9
Removed textarea style updates that are beyond scope of this work
mahoneycm Nov 23, 2022
312c981
Merge branch 'develop' of github.com:uswds/uswds into cm-prefix-suffi…
mahoneycm Nov 23, 2022
a0f03c5
Adds disabled styles to text-area and usa-select
mahoneycm Nov 28, 2022
b3a0e77
Update disabled input & prefix styles
mahoneycm Nov 28, 2022
6abf1e6
Add combo-box disabled styles
mahoneycm Nov 28, 2022
28a888e
Update file input disabled styles
mahoneycm Nov 28, 2022
a218bb9
Create range slide disabled styles
mahoneycm Nov 28, 2022
ac463d3
Merge branch 'develop' of github.com:uswds/uswds into cm-disabled-for…
mahoneycm Nov 29, 2022
cf18972
Update date picker disabled cursor
mahoneycm Nov 30, 2022
11908f8
Character Count: Add disabled form control
mahoneycm Dec 5, 2022
9586aa6
Memorable Date: Create dynamic disabled styling
mahoneycm Dec 5, 2022
e9ec6ba
Select: Override disabled opacity
mahoneycm Dec 5, 2022
309d0fd
Include aria-disabled styles & example
mahoneycm Dec 6, 2022
07b8a68
Fix aria-disabled ID's
mahoneycm Dec 7, 2022
f62c579
Fix label for aria-disabled inputs
mahoneycm Dec 7, 2022
392016b
Merge branch 'cm-prefix-suffix-disable' of github.com:uswds/uswds int…
mahoneycm Dec 8, 2022
259ea94
Include aria-disabled in disabled styles
mahoneycm Dec 8, 2022
f03da8a
Normalize disabled and aria-disabled options in storybook
mahoneycm Dec 8, 2022
58c7b57
Date Picker: Update disabled & aria-disabled controls to be similar t…
mahoneycm Dec 8, 2022
664e73c
Memorable date: normalize disabled storybook controls
mahoneycm Dec 8, 2022
3d46e95
Time Picker: Add disabled example
mahoneycm Dec 8, 2022
547b1eb
Create and test disabled mixin on usa-input
mahoneycm Dec 15, 2022
8b78b05
Move disabled settings into mixin
mahoneycm Dec 16, 2022
b1ca9f0
Consolidate character count controls
Dec 20, 2022
9f13406
Update checkbox stories
Dec 20, 2022
a41689a
Simplify aria_disabled check
Dec 20, 2022
9eb9e5b
Combo box fix formatting
Dec 20, 2022
71ee066
Combobox disable controls
Dec 20, 2022
4770bca
Range remove duplicate selector
Dec 20, 2022
6758d68
Select add comment for browser style
Dec 20, 2022
c662f50
Select simplify templates
Dec 20, 2022
49fc09f
Update import on disabled mixin
Dec 20, 2022
310d54a
Run prettier SCSS
Dec 20, 2022
4601bf3
Simplify controls in memorable date and time picker
Dec 20, 2022
060f707
Run prettier on component stories
Dec 21, 2022
12c3713
Replace prefix/suffix disabled styles with u-disabled mixin
mahoneycm Dec 27, 2022
6e9498e
Alphabetize core module exports
mahoneycm Dec 27, 2022
50f287c
Normalize usa-range disabled options
mahoneycm Dec 27, 2022
e99927e
Move disabled styles into mixin to match #5051
mahoneycm Dec 27, 2022
b5b7a02
Enables combo box to initialize with aria-disabled
mahoneycm Dec 27, 2022
c31da3d
Enabled time picker disabled initialization
mahoneycm Dec 27, 2022
6523f92
File input: Seperate disabled and aria-disabled logic
mahoneycm Dec 27, 2022
042a559
File input: move disabled and aria-disabled stories into radio controls
mahoneycm Dec 27, 2022
3f40ef7
Date Picker: Adjust calendar button opacity when disabled
mahoneycm Dec 27, 2022
3ed2001
File input: Adjust disabled text color
mahoneycm Dec 27, 2022
2fc2412
Checkbox & Radio: Adjust disabled text opacity for better color contrast
mahoneycm Dec 27, 2022
d08583e
Radio: Switch disabled storybook controls from boolean to radio buttons
mahoneycm Dec 27, 2022
d57db05
Checkbox: Update disabled storybook controls from boolean to radio bu…
mahoneycm Dec 27, 2022
d3511dc
Character count: Switch disable controls to radio buttons
mahoneycm Dec 28, 2022
d7ea78f
Combo Box: Switch disable controls to radio buttons
mahoneycm Dec 28, 2022
a88ec03
Date Picker: Check for aria-disabled on initialization
mahoneycm Dec 28, 2022
e6aedc3
Date Picker: Move disable controls to radio buttons
mahoneycm Dec 28, 2022
95c9dfc
Date Picker: Update default values for disabled stories
mahoneycm Dec 28, 2022
57692e1
Input Mask: Switch disabled controls to radio buttons
mahoneycm Dec 28, 2022
d23d70c
Memorable Date: Switch disable controls to radio buttons
mahoneycm Dec 28, 2022
6688411
Time Picker: Switch disabled controls to radio
mahoneycm Dec 28, 2022
f96691b
Select: Switch disabled controls to radio buttons
mahoneycm Dec 28, 2022
9a3db9f
Select: Switch disabled text color to compliant contrast
mahoneycm Dec 28, 2022
e98fd24
Text Input: Clean up story and state controls
mahoneycm Dec 29, 2022
7d01f03
Prefix Suffix: Clean up story and state controls
mahoneycm Dec 29, 2022
d959f4c
Text Input: Update input template
mahoneycm Dec 29, 2022
7abdf55
Normalize disabled stories
mahoneycm Dec 29, 2022
ac850d8
Set default args for disabled combo-box and file input to fix CircleC…
mahoneycm Dec 30, 2022
687156b
Prefix/Suffix: Remove error example and add disabled stories
mahoneycm Jan 9, 2023
fd7c14a
Date Picker: Fix closing tag alignment
mahoneycm Jan 9, 2023
e464b8d
Prefix: Remove extra space inside label
mahoneycm Jan 9, 2023
2afdb02
Radio: Increase readability of input tags
mahoneycm Jan 9, 2023
e68015d
Merge branch 'cm-disabled-forms-styles' of github.com:uswds/uswds int…
mahoneycm Jan 9, 2023
a753027
Range Slider: Replace duplicated styles with disabled mixin
mahoneycm Jan 10, 2023
5a1db56
Select: Adjust disabled opacity for compliance across browsers
mahoneycm Jan 10, 2023
0e828b0
Memorable Date: Add dynamic aria-disabled attributes and update template
mahoneycm Jan 11, 2023
3a2f797
Input: Add disabled stories
mahoneycm Jan 11, 2023
42be337
File input: Disabled styles improvements
mahoneycm Jan 11, 2023
f818d8a
Disabled mixin: Remove important flag to fix disabled button
mahoneycm Jan 11, 2023
67af58c
Button: Replace disabled styles with mixin
mahoneycm Jan 11, 2023
2200fd4
Create disabled forms pattern
mahoneycm Jan 17, 2023
a326260
Remove references to usa-button--disabled
mahoneycm Feb 1, 2023
8992c33
Removes file-input--disabled class and references
mahoneycm Feb 1, 2023
72f9178
Run prettier
mahoneycm Feb 2, 2023
4cc1c36
Normalize stories args
mahoneycm Feb 6, 2023
1466e8f
Normalize storybook arg controls
mahoneycm Feb 6, 2023
32253bd
Select: override disabled text color
mahoneycm Feb 6, 2023
0d72db4
File input: Override file input link color for color compliance
mahoneycm Feb 6, 2023
449f01e
Change aria_disabled to aria-disabled in all stories
mahoneycm Feb 7, 2023
fbf16cf
Memorable Date: Update disabled var names to follow existing patterns
mahoneycm Feb 7, 2023
da03960
Remove outline-disabled class references
mahoneycm Feb 7, 2023
0fa5b03
Added dynamic aria-disabled rules to match disabled attribute
mahoneycm Feb 7, 2023
ce16187
Switch prefix/suffix to absolute positioning and replace disabled class
mahoneycm Feb 8, 2023
7f95a35
Resolve padding issues due to absolute positioning
mahoneycm Feb 9, 2023
fe1cc75
Restore file-input--disabled class and settings
mahoneycm Feb 9, 2023
ed403d6
Add missing semi-colon
mahoneycm Feb 9, 2023
08e58b8
File input: Remove aria-disabled attribute from parent div
mahoneycm Feb 10, 2023
8d81793
Lower case variable names
mahoneycm Feb 13, 2023
4b020e3
Remove +1 input padding on prefix/suffix inputs
mahoneycm Feb 13, 2023
5581cdd
Remove references to disabled class
mahoneycm Feb 13, 2023
7963934
Add color utility note to disabled mixin
mahoneycm Feb 13, 2023
1820ddc
Replace focus js with css
mahoneycm Feb 13, 2023
bbb5ba2
Replace outline offset with var
mahoneycm Feb 13, 2023
3b9d228
Remove spec test
mahoneycm Feb 13, 2023
5db72ab
Use padding variable
mahoneycm Feb 13, 2023
c364ce6
Update packages/usa-input-prefix-suffix/src/styles/_usa-input-prefix-…
mahoneycm Feb 16, 2023
300a391
Minro CSS cleanup
mahoneycm Feb 16, 2023
180e117
Merge branch 'develop' of github.com:uswds/uswds into cm-disabled-for…
mahoneycm Feb 16, 2023
9f85c95
Input Mask: Small disabled story book controls fix
mahoneycm Feb 22, 2023
25f1950
Add note to disabled mixin
mahoneycm Feb 22, 2023
c2dd784
Merge branch 'cm-prefix-suffix-disable' of github.com:uswds/uswds int…
mahoneycm Feb 22, 2023
8841e3c
Merge branch 'cm-remove-disabled-classes' of github.com:uswds/uswds i…
mahoneycm Feb 22, 2023
c5b3685
Radio/Checkbox: Adjust disabled tile border color
mahoneycm Feb 22, 2023
ac3005f
Combobox: Adjusted input button separator to be visible in disabled s…
mahoneycm Feb 22, 2023
af556c1
File input: Minor scss cleanup
mahoneycm Feb 22, 2023
b2f77a1
Merge branch 'develop' of github.com:uswds/uswds into cm-disabled-for…
mahoneycm Mar 1, 2023
8541b86
Removed unused form examples from disabled forms
mahoneycm Mar 1, 2023
c7af4c1
Memorable date: Remove dynamic disabled styles
mahoneycm Mar 2, 2023
8c0c8b6
Button: Include aria-disabled in show all button states
mahoneycm Mar 2, 2023
88469de
Button: Update disabled button styles to be color contrast compliant
mahoneycm Mar 2, 2023
0ab76bf
Button Group: Fix button group disabled display
mahoneycm Mar 2, 2023
fbdad41
Remove important flags and establish disabled text variables (temporary)
mahoneycm Mar 3, 2023
33a7fb1
Button: Use set-text-from-bg to set text color for disabled variants
mahoneycm Mar 3, 2023
5ccfc5a
Create and use -text-disabled variables
Mar 3, 2023
f4ec744
Remove -text variables; declare text color on disabled
Mar 3, 2023
1118e66
Remove set-text-from-bg from button-disabled
Mar 3, 2023
6845ddb
Darken disabled checked color; update none normal bg-blue 31 bold no-…
Mar 3, 2023
cf6c71a
Change naming from -text-disabled to -color-disabled-text-text-disabl…
Mar 3, 2023
6e28e0e
Add disabled controls to usa-form disabled story
Mar 6, 2023
433656d
Add args to u-disabled
Mar 6, 2023
78153d0
Use u-disabled args in usa-button--outline disabled; remove unnecessa…
Mar 6, 2023
5e167d0
Update usa-combo-box__input-button-separator height and disabled color
Mar 6, 2023
b1b0590
Remove hover/active/focus styles from button-disabled
Mar 6, 2023
f776981
Rub prettier
Mar 6, 2023
9637c06
Restore checkbox test
Mar 6, 2023
5af8162
Fix test and tile stories for usa-checkbox
Mar 6, 2023
d7bd6dd
Remove defaultValue: none
Mar 6, 2023
3ffa73a
Remove usa-input-group--disabled from templates
Mar 6, 2023
d8915a6
Standardize disabled controls on input prefix/suffix
Mar 6, 2023
ff2928b
Make .usa-combo-box__input-button-separator color consistent
Mar 6, 2023
d96e612
Move styling for usa-date-picker__button out of JS
Mar 6, 2023
1aee744
Update variable names for input-prefix-suffix
Mar 6, 2023
b8a3b33
Code formatting for usa-range
Mar 6, 2023
0e15e5f
Remove important on usa-file-input__box
Mar 6, 2023
91c81b8
Remove unused @use
Mar 6, 2023
d73395c
Remove unused -disabled-alpha vars in checkbox/radio scss
Mar 6, 2023
ef31f3b
Restore input prefix error state
Mar 6, 2023
4139677
Update input prefix id to prevent test failure
Mar 6, 2023
a448409
Template formatting
Mar 6, 2023
0f13706
Undo formatting
Mar 6, 2023
e301a4c
Move usa-form into test-patterns
Mar 7, 2023
0780e50
Merge branch 'develop' of https://github.com/uswds/uswds into al-disa…
Mar 7, 2023
0b39e60
Restore usa-form.stories.js to /src; prefix usa-form.twig with 'test'
Mar 7, 2023
9cbaa85
Merge pull request #5167 from uswds/al-disabled-forms-styles
mahoneycm Mar 8, 2023
c00f390
Select & Combobox: Update disabled opacity and placeholder color to e…
mahoneycm Mar 9, 2023
75b3bc8
Select: remove child option selector that was irrelevent
mahoneycm Mar 9, 2023
370b23f
Date Picker: Fix safari default date text color
mahoneycm Mar 9, 2023
38ab836
Move safari text fill fix out of date-picker and into combobox and input
mahoneycm Mar 9, 2023
fa97c53
Include standard opacity in disabled mixin to normalize form elements…
mahoneycm Mar 9, 2023
fc6dde1
Range slider: Override opacity for mobile disabled styles
mahoneycm Mar 13, 2023
35c1c63
Combobox: Replace toggle-list/clear-input disabled mixin with cursor:…
mahoneycm Mar 13, 2023
8359062
Fix typo
mahoneycm Mar 13, 2023
6919151
Run prettier scss
mahoneycm Mar 13, 2023
e61302c
Update component names on disabled forms test story
Mar 20, 2023
9996c3d
Run prettier
Mar 20, 2023
13673e4
Merge branch 'develop' of https://github.com/uswds/uswds into cm-disa…
Mar 20, 2023
a26115a
Input: Remove storybook controls from showcase
mahoneycm Mar 21, 2023
79e0a5d
Move button demo setting to story
Mar 28, 2023
82d6958
Remove disabled check in prefix error state example
Mar 28, 2023
fff820d
Remove duplicate ID from text input
Mar 28, 2023
686fdd4
Disabled mixin: Remove usa-button hover & active classes from mixin
mahoneycm Mar 29, 2023
e7c7f10
Button Disabled: Include hover and active classes in mixin
mahoneycm Mar 29, 2023
52f16cf
Merge branch 'develop' of github.com:uswds/uswds into cm-disabled-for…
mahoneycm May 17, 2023
726d43a
[prettier] Fix whitespace
thisisdano May 17, 2023
799076c
[prettier] Remove trailing comma
thisisdano May 17, 2023
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
Prev Previous commit
Next Next commit
Memorable Date: Create dynamic disabled styling
  • Loading branch information
mahoneycm committed Dec 5, 2022
commit 9586aa6be84c61d5d494cd950f5afd701b62a2b9
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"disabledClass": true
}
43 changes: 43 additions & 0 deletions packages/usa-memorable-date/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const behavior = require("../../uswds-core/src/js/utils/behavior");
const { prefix: PREFIX } = require("../../uswds-core/src/js/config");
const selectOrMatches = require("../../uswds-core/src/js/utils/select-or-matches");

const MEMORABLE_DATE_CLASS = `.${PREFIX}-memorable-date`;
const MD_DISABLED = `${PREFIX}-memorable-date--disabled`;


const getMemorableDateForms = (el) => {
const MemDateEl = el.closest(MEMORABLE_DATE_CLASS);
const MemDateForms = []

const inputs = MemDateEl.getElementsByTagName("input");
MemDateForms.push(...inputs)

const selects = MemDateEl.getElementsByTagName("select");
MemDateForms.push(...selects);

return MemDateForms;
}

const disable = (el) => {
const children = getMemorableDateForms(el);

children.forEach(childEl => {
childEl.setAttribute('disabled', '')
})
}

const memorableDate = behavior(
{},
{
init(root) {
selectOrMatches(MEMORABLE_DATE_CLASS, root).forEach((MemDateEl) => {
if (MemDateEl.classList.contains(MD_DISABLED)) {
disable(MemDateEl);
}
})
}
}
);

module.exports = memorableDate;
5 changes: 5 additions & 0 deletions packages/usa-memorable-date/src/usa-memorable-date.stories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import Component from "./usa-memorable-date.twig";

import memorableDateDisabled from "./content/usa-memorable-date~disabled.json";

export default {
title: "Components/Form Inputs/Memorable Date",
};

const Template = (args) => Component(args);

export const MemorableDate = Template.bind({});

export const MemorableDateDisabled = Template.bind({});
MemorableDateDisabled.args = memorableDateDisabled;
2 changes: 1 addition & 1 deletion packages/usa-memorable-date/src/usa-memorable-date.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fieldset class="usa-fieldset">
<legend class="usa-legend">Date of Birth</legend>
<span class="usa-hint" id="mdHint">For example: January 19 2000</span>
<div class="usa-memorable-date">
<div class="usa-memorable-date {% if disabledClass == true %} usa-memorable-date--disabled {%- endif %}">
<div class="usa-form-group usa-form-group--month usa-form-group--select">
<label class="usa-label" for="date_of_birth_month">Month</label>
<select class="usa-select" id="date_of_birth_month" name="date_of_birth_month" aria-describedby="mdHint" >
Expand Down
3 changes: 3 additions & 0 deletions packages/uswds-core/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const inPageNavigation = require("../../../usa-in-page-navigation/src/index");
const inputMask = require("../../../usa-input-mask/src/index");
const inputPrefixSuffix = require("../../../usa-input-prefix-suffix/src/index");
const languageSelector = require("../../../usa-language-selector/src/index");
const memorableDate = require("../../../usa-memorable-date/src/index");
const modal = require("../../../usa-modal/src/index");
const navigation = require("../../../usa-header/src/index");
const password = require("../../../_usa-password/src/index");
Expand Down Expand Up @@ -42,4 +43,6 @@ module.exports = {
timePicker,
tooltip,
validator,

memorableDate,
};