Skip to content

Commit bbb7778

Browse files
daniele-zuricopeter-uzor-capgemaismaelcapaismaelcapIbabalola
authored
Release/0.8 (#528)
* [Design-System-FormSelect] Build the design system for the FormSelect component (#421) * feat: add design system * feat: fix conflicts * feat: final push * feat: final push * feat: revert some bad merge * feat: revert some bad merge * feat: add chromatic build * Feature/sb 0.7 (#474) * feat: migrating sb to 7 * feat: add the Button stories * feat: add charactercount to v7 * feat: add checkboxgroup to v7 * feat: add radiogroup to v7 * feat: add radiogroup to v7 * feat: add toggle to v7 * feat: add tooltip to v7 * feat: add range to v7 * feat: add multiUpload to v7 * feat: add select to v7 * feat: add multiselect to v7 * feat: add input to v7 * feat: add inputMask to v7 * feat: autocomplete to v7 * feat: autocomplete to v7 * feat: tabs to v7 * feat: details to v7 * feat: table to v7 * feat: fix live edit version (#476) * feat: cleanup example deps (#478) * Bug/autocomplete keydown scroll (#472) * BugFix: Autocomplete doesn't auto scroll for filtered list on keydown * Fixed Linting and test issues * Added Test and Refactered * feat: fix the documentation * feat: fix the documentation --------- Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * feat: remove controls (#481) * Feature/heading (#482) * Implement <Heading> component * lint fixes * give better description to what Header component does in docs * refactor Heading Component to make less verbose * refactor ClassBased and create Headings for all levels * add specific testing * lint fix * make className and id optional * Update src/heading/Heading.tsx Co-authored-by: Isaac Babalola <[email protected]> * Update src/heading/__test__/Heading.test.tsx * Update src/heading/__test__/Heading.test.tsx * fix: resolving heading issues * fix: resolving heading issues * update docs --------- Co-authored-by: aismaelcap <[email protected]> Co-authored-by: Daniele Zurico <[email protected]> Co-authored-by: Isaac Babalola <[email protected]> Co-authored-by: Isaac Babalola <[email protected]> * fix: heading component (#489) * Feature/label (#483) * Button demo test * Created Label component * added return statement * dcx-label embeded class updated * removed return statement * resolved all issues and added classbased stories * dcx-label, value mandatory field, govuk-label * added Typography for stories * Add new properties to the button component developer specified class name and a variant (#490) * Add new properties to the button component developer specified class name and a variant * resolve PR comment to cover developer specifiedclass name * Update src/button/Button.tsx Co-authored-by: Isaac Babalola <[email protected]> * feat: make the code more dynamic * feat: add in the doc * feat: add in the doc * feat: add in the doc * resolve PR comment to simplify code and get it more readable --------- Co-authored-by: Berhane Yohannes <[email protected]> Co-authored-by: Daniele Zurico <[email protected]> Co-authored-by: Isaac Babalola <[email protected]> * feat: remove duplicated story (#493) * Feature/link (#494) * created link component * Link component demo and stories * added new test case, added govuk-link css * added styles for link component * InsertTextComponent (#491) * InsertTextComponent * resolved pr comments * InsertTextComponent * resolved pr comments * resolved changes * feat: improve documentation * feat: improve documentation --------- Co-authored-by: kavithakurella-dev <[email protected]> Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * Feature/autocomplete update value (#496) * fix: {{ Autocomplete component - changing defaultValue prop has no affect }} * test: {{When defaultValue prop is changed, Autocomplete component updates. }} * test: {{Test updated with dom manipulation rather than re-rendering and fix has been commented out to intentionally see test failing}} * test: {{Now, uncommented the fix and verify that the test passes as intended}} * Feature/paragraph (#479) * feature/paragraph * paragraph doc and test * Update src/paragraph/Paragraph.tsx Co-authored-by: Daniele Zurico <[email protected]> * adressing pr comments. * update stories. * added more attribute. * new comments has been resolved. * paragraph live has been also updated. * files has been updated. * feat: update test for Heading * feat: update story --------- Co-authored-by: Daniele Zurico <[email protected]> * KeyboardInput Component (#504) * KeyboardInput Component * KeyboardInput * KeyboardInput * Commponent * KeyboardInput * feat: minor fix --------- Co-authored-by: kavithakurella-dev <[email protected]> Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * feature/blockquote (#505) * feature/blockquote * some more changes. * block quote component update. * update previewjs * intendation. * test file name test * test file * tsx * blockquote file * delete quote file * blockquote file. * delete blockquotelive * blockquoutelive * some comments has been fixed. * footer type has been made optional. * props type has been changed. * test has been updated. * documentation fix and styled class based component * deleted unstyled class based story. * styled with classname * feat: upgrade storybook and minor refactor --------- Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * create a list component (#495) * folder structure and test case scenarios added * files named changed from listitem to list * Added required test cases * added comments and updated code * code improvements * List compo mandatory for ListItem compo * code modifications * code improvements * feat: add value * feat: add value * feat: refactor list * feat: refactor list * added 3 new props * feat: fix props * feat: fix props * new test cases and stories added * added styling * code improvements * MarkerTypes seperated * added new style file for classbased.stories --------- Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * expose and document the hook useHydrated (#510) * expose the function clientOnly for client side rendering * document the function clientOnly for client side rendering * document useHydrated and create its own unit test file --------- Co-authored-by: Berhane Yohannes <[email protected]> * Highlight Component (#509) * feat: {{ Highlight component }} * test: {{ Adding unit tests for Highlight component }} * feat: {{ Tweaking Highlight component and test }} * feat: {{ Fixing storybook preview }} * feat: {{ Adding Demo, Storybook docs and live demo for Highlight Component }} * feat: {{ Tweaking Demo, Storybook docs and live demo }} * feat: {{ Tidy up }} * feat: {{ Modify to allow <Highlight>highlighted text </Highlight> usage without text prop }} * feat: {{ Removing commented out }} * feat: {{ Replacing HTMLQuoteElement with HTMLElement }} * feat: {{ Simplfying rendered function in class based stories and adding custom styling }} * feature/abbreviate (#512) * PreformattedText component (#511) * PreformattedText component * PreformattedText * PreformattedText comments * Resolved * setting.json resolved --------- Co-authored-by: kavithakurella-dev <[email protected]> * Breadcrumbs components (#508) * Breadcrumbs components * Added stories * Added official govuk style file * selected item * added separator functionality * improved separator * final * storybook order * feature/code (#507) * feature/code * text replaced with value. * code componets has been resolved as suggested. * Fix: CharacterCount component not resetting red error text after valid input (#471) * fix: charactercount component not resetting red error text after valid input * fix: the character count component error message returns to default after the text area is cleared --------- Co-authored-by: Nikki Algar <[email protected]> Co-authored-by: Berhane Yohannes <[email protected]> * Label Design System (#515) * Label Design System * Playground * comments resolved and added accessible page * Proper css for Label added and Dark theme added * feat: improve label color contrast on accesible and dark theme --------- Co-authored-by: mmirca <[email protected]> * Feature/ds-paragraph (#514) * feature/ds-paragraph --------- Co-authored-by: mmirca <[email protected]> * feat: Tabs are now non-js compliant (#506) * feat: Tabs are now non-js compliant --------- Co-authored-by: Zurico.Daniele_DEFRA <[email protected]> * Insert designing (#516) * Design InsertText --------- Co-authored-by: kavithakurella-dev <[email protected]> Co-authored-by: mmirca <[email protected]> * feat: add button tokens (#520) * feat: add list item design system styles (#519) * feat: add heading design system styles (#521) * Feature/bot upgrade libs (#525) * feat: upgrade libraries * Feature/release notes (#527) * feat: update release notes * feat: update release notes * feat: upgrade to 0.8.0 --------- Co-authored-by: peter-uzor-capgem <[email protected]> Co-authored-by: aismaelcap <[email protected]> Co-authored-by: aismaelcap <[email protected]> Co-authored-by: Isaac Babalola <[email protected]> Co-authored-by: Isaac Babalola <[email protected]> Co-authored-by: JadhavJeet <[email protected]> Co-authored-by: Berhane Yohannes <[email protected]> Co-authored-by: Berhane Yohannes <[email protected]> Co-authored-by: KavithaKurella <[email protected]> Co-authored-by: kavithakurella-dev <[email protected]> Co-authored-by: Ahmet <[email protected]> Co-authored-by: Yunus FIRAT <[email protected]> Co-authored-by: Nikki Algar <[email protected]> Co-authored-by: Nikki Algar <[email protected]> Co-authored-by: mmirca <[email protected]> Co-authored-by: Sri Viswanathan <[email protected]> Co-authored-by: jgonza16 <[email protected]> Co-authored-by: SOUNDAR-A <[email protected]>
1 parent 1579a81 commit bbb7778

File tree

385 files changed

+35006
-18529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+35006
-18529
lines changed

.babelrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

.storybook/capgeminiTheme.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export default create({
1111
appContentBg: 'white',
1212
appBorderColor: '#2b0a3d',
1313
appBorderRadius: 4,
14-
1514
// Text colors
1615
textColor: '#0070ad',
1716
fontWeight: 'bold',

.storybook/main.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
module.exports = {
2-
core: {
3-
builder: 'webpack5',
4-
},
5-
stories: ['../stories/**/*.stories.@(mdx)'],
1+
process.env.DESIGN_TOKEN_GLOB = "**/tokens.css";
2+
const config = {
3+
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
64
addons: [
75
'@storybook/addon-links',
86
'@storybook/addon-essentials',
97
'@storybook/addon-docs',
108
'@storybook/addon-controls',
119
'storybook-css-modules-preset',
1210
'@storybook/addon-a11y',
11+
{
12+
name: "storybook-design-token",
13+
options: {
14+
preserveCSSVars: false
15+
},
16+
docs: {
17+
autodocs: "tag",
18+
},
19+
},
20+
'@storybook/addon-mdx-gfm'
1321
],
22+
framework: {
23+
name: '@storybook/react-webpack5',
24+
options: {}
25+
},
1426
};
27+
28+
export default config;

.storybook/manager-head.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
<link rel="shortcut icon" href="https://www.capgemini.com/wp-content/themes/capgemini-komposite/assets/images/favicon.ico">
2-
<link rel="icon" type="image/png" href="/storybook.png" sizes="192x192">
1+
<link rel="shortcut icon"
2+
href="https://www.capgemini.com/wp-content/themes/capgemini-komposite/assets/images/favicon.ico">
3+
<link rel="icon" type="image/png" href="/storybook.png" sizes="192x192">
4+
<!-- TODO-DS: we'll remove this one when we'll decide to release the design tokens-->
5+
<script defer>
6+
if (location.hostname !== 'localhost') {
7+
const $hideDesignSystemFromSidebar = document.createElement('style');
8+
$hideDesignSystemFromSidebar.innerText = `
9+
button[data-item-id*="design-system"] {
10+
display: none !important;
11+
}
12+
`;
13+
document.head.appendChild($hideDesignSystemFromSidebar);
14+
}
15+
</script>

.storybook/preview.js

Lines changed: 142 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,148 @@
11
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters
2-
import '../stories/govUkStyle.css';
2+
import '../stories/govUkStyleOfficial.css';
3+
import '../stories/liveEdit/style.css';
4+
import {
5+
Title,
6+
Subtitle,
7+
Description,
8+
Primary,
9+
Controls,
10+
Stories,
11+
} from '@storybook/blocks';
12+
313
export const parameters = {
414
options: {
515
storySort: {
6-
order: ['DCXLibrary', ['Introduction','Utils', 'Form', 'CopyToClipboard', 'Details', 'Tabs', 'Table', 'Changelog']]
16+
order: [
17+
'DCXLibrary',
18+
[
19+
'Introduction',
20+
'Utils',
21+
'Form',
22+
[
23+
'Autocomplete',
24+
['Documentation', 'Live', 'Without style', 'Class based'],
25+
'Button',
26+
['Documentation', 'Live', 'Without style', 'Class based'],
27+
'CharacterCount',
28+
['Documentation', 'Live', 'Without style', 'Class based'],
29+
'Checkbox',
30+
['Documentation', 'Live', 'Without style', 'Class based'],
31+
'CheckboxGroup',
32+
['Documentation', 'Live', 'Without style', 'Class based'],
33+
'RadioGroup',
34+
['Documentation', 'Live', 'Without style', 'Class based'],
35+
'Input',
36+
['Documentation', 'Live', 'Without style', 'Class based'],
37+
'InputMasked',
38+
['Documentation', 'Live', 'Without style', 'Class based'],
39+
'Select',
40+
[
41+
'Documentation',
42+
'Live',
43+
'Without style',
44+
'Class based',
45+
'Design system',
46+
[
47+
'Playground',
48+
'Default',
49+
'Accessible',
50+
'Dark',
51+
'Material',
52+
'Floating',
53+
],
54+
],
55+
'MultiSelect',
56+
['Documentation', 'Live', 'Without style', 'Class based'],
57+
'Date',
58+
['Documentation', 'Live', 'Without style', 'Class based'],
59+
'MultiUpload',
60+
['Documentation', 'Live', 'Without style', 'Class based'],
61+
'Progress',
62+
['Documentation', 'Live', 'Without style', 'Class based'],
63+
'Range',
64+
['Documentation', 'Live', 'Without style', 'Class based'],
65+
'Toggle',
66+
['Documentation', 'Live', 'Without style', 'Class based'],
67+
'Tooltip',
68+
['Documentation', 'Live', 'Class based'],
69+
],
70+
'Breadcrumb',
71+
['Documentation', 'Live', 'Without style', 'Class based'],
72+
'CopyToClipboard',
73+
['Documentation', 'Live', 'Without style', 'Class based'],
74+
'Details',
75+
['Documentation', 'Live', 'Without style', 'Class based'],
76+
'Tabs',
77+
['Documentation', 'Live', 'Without style', 'Class based'],
78+
'Table',
79+
['Documentation', 'Live', 'Without style', 'Class based'],
80+
'Typography',
81+
[
82+
'Abbreviate',
83+
['Documentation', 'Live', 'Without style', 'Class based'],
84+
'Blockquote',
85+
['Documentation', 'Live', 'Without style', 'Class based'],
86+
'Heading',
87+
['Documentation', 'Live', 'Without style', 'Class based'],
88+
'Paragraph',
89+
['Documentation', 'Live', 'Without style', 'Class based'],
90+
'Blockquote',
91+
['Documentation', 'Live', 'Without style', 'Class based'],
92+
'CodeSnippet',
93+
['Documentation', 'Live', 'Without style', 'Class based'],
94+
'Label',
95+
['Documentation', 'Live', 'Without style', 'Class based'],
96+
'Link',
97+
['Documentation', 'Live', 'Without style', 'Class based'],
98+
'InsertText',
99+
['Documentation', 'Live', 'Without style', 'Class based'],
100+
'KeyboardInput',
101+
['Documentation', 'Live', 'Without style', 'Class based'],
102+
'Highlight',
103+
['Documentation', 'Live', 'Without style', 'Class based'],
104+
'List',
105+
['Documentation', 'Live', 'Without style', 'Class based'],
106+
],
107+
'Changelog',
108+
],
109+
],
7110
},
8111
},
9-
};
112+
//with this custom configuration we removed the <Controls/> (the properties table) from the page. By default it sits between Primary and Stories
113+
docs: {
114+
page: () => (
115+
<>
116+
<Title />
117+
<Subtitle />
118+
<Description />
119+
<Primary />
120+
<Stories includePrimary={false} />
121+
</>
122+
),
123+
},
124+
};
125+
126+
//It will allow to refresh the iframe all the time you move from one story to another - https://github.com/storybookjs/storybook/issues/16016
127+
let storyId;
128+
let storyTitle;
129+
export const decorators = [
130+
(storyFn, context) => {
131+
console.log('context.title:', context.title);
132+
console.log('storyTitle:', storyTitle);
133+
if (storyTitle && context.title !== storyTitle) {
134+
document.location.reload();
135+
console.log('first');
136+
} else if (
137+
storyId &&
138+
context.id !== storyId &&
139+
context.title !== storyTitle
140+
) {
141+
document.location.reload();
142+
console.log('second');
143+
}
144+
storyId = context.id;
145+
storyTitle = context.title;
146+
return storyFn();
147+
},
148+
];

.vscode/settings.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
2-
"window.zoomLevel": 0,
3-
"[typescriptreact]": {
4-
"editor.defaultFormatter": "esbenp.prettier-vscode"
5-
},
6-
"editor.formatOnSave": true
2+
"window.zoomLevel": 0,
3+
"[typescriptreact]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
},
6+
"editor.formatOnSave": true,
7+
"stylelint.validate": [
8+
"css",
9+
"scss"
10+
],
11+
"files.associations": {
12+
"*.css": "postcss"
13+
}
714
}

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
## 0.8.0 (15/09/2023)
2+
3+
<a name="0.8.0"></a>
4+
5+
[Autocomplete - changing defaultValue prop has no affect](https://github.com/Capgemini/dcx-react-library/issues/455)
6+
[Autocomplete - doesn't auto scroll for filtered list on keydown](https://github.com/Capgemini/dcx-react-library/issues/470)
7+
[Button - add new properties](https://github.com/Capgemini/dcx-react-library/issues/466)
8+
[Tabs - non-js compliant](https://github.com/Capgemini/dcx-react-library/issues/283)
9+
10+
**New components**
11+
[Code Snippet](https://github.com/Capgemini/dcx-react-library/issues/500)
12+
[Breadcrumbs](https://github.com/Capgemini/dcx-react-library/issues/415)
13+
[Preformatted Text](https://github.com/Capgemini/dcx-react-library/issues/503)
14+
[Abbreviate](https://github.com/Capgemini/dcx-react-library/issues/497)
15+
[Highlight](https://github.com/Capgemini/dcx-react-library/issues/498)
16+
[List item](https://github.com/Capgemini/dcx-react-library/issues/453)
17+
[Blockquote](https://github.com/Capgemini/dcx-react-library/issues/499)
18+
[Keyboard Shortcut](https://github.com/Capgemini/dcx-react-library/issues/501)
19+
[Paragraph](https://github.com/Capgemini/dcx-react-library/issues/455)
20+
[Insert Text](https://github.com/Capgemini/dcx-react-library/issues/452)
21+
[Link](https://github.com/Capgemini/dcx-react-library/issues/467)
22+
[Label](https://github.com/Capgemini/dcx-react-library/issues/466)
23+
[Heading](https://github.com/Capgemini/dcx-react-library/issues/450)
24+
25+
**Documentation**
26+
[clientOnly](https://github.com/Capgemini/dcx-react-library/issues/459)
27+
[Storybook - v7](https://github.com/Capgemini/dcx-react-library/issues/473)
28+
29+
**Design system - not publicly available yet... stay tuned ;)**
30+
[Button](https://github.com/Capgemini/dcx-react-library/issues/468)
31+
[Select](https://github.com/Capgemini/dcx-react-library/issues/469)
32+
[List Item](https://github.com/Capgemini/dcx-react-library/issues/487)
33+
[Heading](https://github.com/Capgemini/dcx-react-library/issues/484)
34+
[Insert Text](https://github.com/Capgemini/dcx-react-library/issues/486)
35+
[Paragraph](https://github.com/Capgemini/dcx-react-library/issues/488)
36+
[Label](https://github.com/Capgemini/dcx-react-library/issues/485)
37+
138
## 0.7.0 (27/03/2023)
239

340
<a name="0.7.0"></a>

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ To create a new component the following must be satisfied before adding
7070
4. create the test under `__tests__` within the component-name folder
7171
5. create or edit a demo in the `example/src`
7272
6. create or edit the story in the `stories`
73+
7. in case you create a new component update the `./storybook/preview,js` file adding your component (follow the style of the other items already present)
7374

7475
Example folder structure with component `SnackBar`:
7576

0 commit comments

Comments
 (0)