Skip to content

Commit

Permalink
Merge pull request #534 from patrickcate/develop
Browse files Browse the repository at this point in the history
Release 2023-01-08
  • Loading branch information
patrickcate authored Jan 8, 2023
2 parents 625b24a + cad5399 commit 3ee3ecc
Show file tree
Hide file tree
Showing 18 changed files with 601 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
core: {
builder: '@storybook/builder-vite',
disableTelemetry: true,
},
framework: '@storybook/vue3',

Expand Down
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
},
"lint-staged": {
"*.{js,vue}": [
"eslint"
"npm run lint"
]
}
}
8 changes: 4 additions & 4 deletions src/components/UsaBannerContent/UsaBannerContent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ describe('UsaBannerContent', () => {

cy.get('@consoleWarn').should(
'be.calledWith',
`The 'tldIcon' slot' is deprecated, use 'tld-icon' instead.`
`The 'tldIcon' slot is deprecated, use 'tld-icon' instead.`
)
cy.get('@consoleWarn').should(
'be.calledWith',
`The 'tldDescription' slot' is deprecated, use 'tld-description' instead.`
`The 'tldDescription' slot is deprecated, use 'tld-description' instead.`
)
cy.get('@consoleWarn').should(
'be.calledWith',
`The 'httpsIcon' slot' is deprecated, use 'https-icon' instead.`
`The 'httpsIcon' slot is deprecated, use 'https-icon' instead.`
)
cy.get('@consoleWarn').should(
'be.calledWith',
`The 'httpsDescription' slot' is deprecated, use 'https-description' instead.`
`The 'httpsDescription' slot is deprecated, use 'https-description' instead.`
)

cy.get('.usa-banner__guidance').should(
Expand Down
8 changes: 4 additions & 4 deletions src/components/UsaBannerContent/UsaBannerContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import {
const slots = useSlots()
if (slots?.tldIcon) {
console.warn(`The 'tldIcon' slot' is deprecated, use 'tld-icon' instead.`)
console.warn(`The 'tldIcon' slot is deprecated, use 'tld-icon' instead.`)
}
if (slots?.tldDescription) {
console.warn(
`The 'tldDescription' slot' is deprecated, use 'tld-description' instead.`
`The 'tldDescription' slot is deprecated, use 'tld-description' instead.`
)
}
if (slots?.httpsIcon) {
console.warn(`The 'httpsIcon' slot' is deprecated, use 'https-icon' instead.`)
console.warn(`The 'httpsIcon' slot is deprecated, use 'https-icon' instead.`)
}
if (slots?.httpsDescription) {
console.warn(
`The 'httpsDescription' slot' is deprecated, use 'https-description' instead.`
`The 'httpsDescription' slot is deprecated, use 'https-description' instead.`
)
}
Expand Down
93 changes: 93 additions & 0 deletions src/components/UsaDateInput/UsaDateInput.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const defaultProps = {
year: UsaDateInput.props.year.default,
dateOrder: UsaDateInput.props.dateOrder.default(),
dateLabels: UsaDateInput.props.dateLabels.default(),
monthAsSelect: UsaDateInput.props.monthAsSelect.default,
monthEmptyLabel: UsaDateInput.props.monthEmptyLabel.default,
monthOptions: UsaDateInput.props.monthOptions.default(),
name: UsaDateInput.props.name.default,
required: UsaDateInput.props.required.default,
error: UsaDateInput.props.error.default,
Expand Down Expand Up @@ -38,6 +41,15 @@ export default {
dateLabels: {
control: { type: 'object' },
},
monthAsSelect: {
control: { type: 'boolean' },
},
monthEmptyLabel: {
control: { type: 'text' },
},
monthOptions: {
control: { type: 'object' },
},
name: {
control: { type: 'text' },
},
Expand Down Expand Up @@ -71,6 +83,9 @@ export default {
year: defaultProps.year,
dateOrder: defaultProps.dateOrder,
dateLabels: defaultProps.dateLabels,
monthAsSelect: defaultProps.monthAsSelect,
monthEmptyLabel: defaultProps.monthEmptyLabel,
monthOptions: defaultProps.monthOptions,
name: defaultProps.name,
required: defaultProps.required,
error: defaultProps.error,
Expand Down Expand Up @@ -99,6 +114,9 @@ const DefaultTemplate = (args, { argTypes }) => ({
:year="year"
:dateOrder="dateOrder"
:dateLabels="dateLabels"
:monthAsSelect="monthAsSelect"
:monthEmptyLabel="monthEmptyLabel"
:monthOptions="monthOptions"
:name="name"
:required="required"
:error="error"
Expand Down Expand Up @@ -188,6 +206,81 @@ CustomInputLabelsDateInput.args = {
}
CustomInputLabelsDateInput.storyName = 'Custom Input Labels'

export const MonthAsSelectDateInput = DefaultTemplate.bind({})
MonthAsSelectDateInput.args = {
...defaultProps,
label: 'Month as select form element',
monthAsSelect: true,
}
MonthAsSelectDateInput.storyName = 'Month as Select form element'

export const CustomMonthSelectEmptyLabelDateInput = DefaultTemplate.bind({})
CustomMonthSelectEmptyLabelDateInput.args = {
...defaultProps,
label: 'Custom month empty label',
monthAsSelect: true,
monthEmptyLabel: 'Choose a month',
}
CustomMonthSelectEmptyLabelDateInput.storyName = 'Custom Month Empty Label'

export const CustomMonthOptionsDateInput = DefaultTemplate.bind({})
CustomMonthOptionsDateInput.args = {
...defaultProps,
label: 'Custom month options',
monthAsSelect: true,
monthOptions: [
{
value: 'January',
text: 'Jan - 1',
},
{
value: 'February',
text: 'Feb - 2',
},
{
value: 'March',
text: 'Mar - 3',
},
{
value: 'April',
text: 'Apr - 4',
},
{
value: 'May',
text: 'May - 5',
},
{
value: 'June',
text: 'Jun - 6',
},
{
value: 'July',
text: 'Jul - 7',
},
{
value: 'August',
text: 'Aug - 8',
},
{
value: 'September',
text: 'Sep - 9',
},
{
value: 'October',
text: 'Oct - 10',
},
{
value: 'November',
text: 'Nov - 11',
},
{
value: 'December',
text: 'Dec - 12',
},
],
}
CustomMonthOptionsDateInput.storyName = 'Custom Month Options'

export const LabelSlotDateInput = DefaultTemplate.bind({})
LabelSlotDateInput.args = {
...defaultProps,
Expand Down
Loading

0 comments on commit 3ee3ecc

Please sign in to comment.