-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: rebase branch * feat: rebase completed
- Loading branch information
1 parent
da59c75
commit 1579a81
Showing
169 changed files
with
6,989 additions
and
3,854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
module.exports = { | ||
core: { | ||
builder: 'webpack5', | ||
}, | ||
stories: ['../stories/**/*.stories.@(mdx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-controls', | ||
'storybook-css-modules-preset', | ||
'@storybook/addon-a11y' | ||
], | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-controls', | ||
'storybook-css-modules-preset', | ||
'@storybook/addon-a11y', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,9 @@ | ||
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters | ||
import '../stories/govUkStyle.css'; | ||
export const parameters = { | ||
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args | ||
actions: { argTypesRegex: '^on.*' }, | ||
options: { | ||
storySort: (a, b) => { | ||
let order = 2000; | ||
if (a[0].includes('dcxlibrary-form')) { | ||
return order; | ||
} else if (a[0].includes('progress')) { | ||
return order--; | ||
} else if (a[0].includes('copy')) { | ||
return order--; | ||
} else if (a[0].includes('tabs')) { | ||
return order--; | ||
} else if (a[0].includes('table')) { | ||
return order--; | ||
} else if (a[0].includes('details')) { | ||
return order--; | ||
} | ||
else { | ||
return 0; | ||
} | ||
} | ||
} | ||
}; | ||
storySort: { | ||
order: ['DCXLibrary', ['Introduction','Utils', 'Form', 'CopyToClipboard', 'Details', 'Tabs', 'Table', 'Changelog']] | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { useRef } from 'react'; | ||
import { Button, CharacterCount } from '@capgeminiuk/dcx-react-library'; | ||
|
||
export const CharacterCountDemo = () => { | ||
const textRef = useRef<any>(null); | ||
const [value, setValue] = React.useState<string>(''); | ||
const edit = () => { | ||
setValue('prefill value'); | ||
}; | ||
|
||
return ( | ||
<> | ||
<h1>Character Count Component</h1> | ||
<form style={{ padding: '10px' }}> | ||
<CharacterCount | ||
label="Label for text area" | ||
hint={{ | ||
text: 'Type more than 15 characters to see the message change', | ||
}} | ||
maxLength={15} | ||
rows={5} | ||
cols={50} | ||
ref={textRef} | ||
value={value} | ||
onChange={(evt) => setValue(evt.currentTarget.value)} | ||
/> | ||
<Button onClick={() => textRef.current.reset()} label="Cancel" /> | ||
<Button onClick={edit} label="edit" /> | ||
</form> | ||
|
||
<h2>Constrained</h2> | ||
<CharacterCount | ||
label="Label for text area" | ||
hint={{ | ||
text: 'Type more than 15 characters to see the limitation', | ||
}} | ||
maxLength={15} | ||
constrained={true} | ||
rows={5} | ||
cols={50} | ||
/> | ||
<h2>Threshold</h2> | ||
<CharacterCount | ||
label="Label for text area" | ||
hint={{ | ||
text: 'Type more than 12 characters to see the message', | ||
}} | ||
maxLength={15} | ||
threshold={80} | ||
rows={5} | ||
cols={50} | ||
/> | ||
<h2>Word Count</h2> | ||
<CharacterCount | ||
label="Label for text area" | ||
hint={{ | ||
text: 'Type more than 15 words to see the message change', | ||
}} | ||
maxLength={15} | ||
limitType="words" | ||
rows={5} | ||
cols={50} | ||
/> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.