@mgdis/mg-components 5.13.1 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_32.cjs.entry.js +95 -57
  3. package/dist/cjs/mg-components.cjs.js +1 -1
  4. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +4 -4
  5. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +2 -1
  6. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  7. package/dist/collection/components/molecules/mg-details/mg-details.css +3 -0
  8. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  9. package/dist/collection/components/molecules/mg-form/mg-form.js +13 -8
  10. package/dist/collection/components/molecules/mg-message/mg-message.css +4 -0
  11. package/dist/collection/components/molecules/mg-modal/mg-modal.js +61 -36
  12. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -2
  13. package/dist/collection/components/molecules/mg-panel/mg-panel.css +3 -0
  14. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  15. package/dist/collection/styles/global.scss +0 -7
  16. package/dist/components/mg-details.js +2 -2
  17. package/dist/components/mg-form.js +13 -8
  18. package/dist/components/mg-icon2.js +11 -3
  19. package/dist/components/mg-input-checkbox-paginated2.js +4 -4
  20. package/dist/components/mg-input-select2.js +2 -2
  21. package/dist/components/mg-message.js +1 -1
  22. package/dist/components/mg-modal.js +61 -36
  23. package/dist/components/mg-pagination2.js +2 -2
  24. package/dist/components/mg-panel.js +2 -2
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm/mg-action-more_32.entry.js +95 -57
  27. package/dist/esm/mg-components.js +1 -1
  28. package/dist/mg-components/mg-components.css +1 -1
  29. package/dist/mg-components/mg-components.esm.js +1 -1
  30. package/dist/mg-components/p-6672f590.entry.js +1 -0
  31. package/dist/mg-components/styles/global.scss +0 -7
  32. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +1 -1
  33. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +16 -1
  34. package/package.json +14 -14
  35. package/readme.md +20 -25
  36. package/dist/collection/styles/components.scss +0 -3
  37. package/dist/mg-components/p-b790596f.entry.js +0 -1
  38. package/dist/mg-components/styles/components.scss +0 -3
@@ -30,13 +30,6 @@
30
30
  // Utilities
31
31
  @import './utilities.scss';
32
32
 
33
- /**
34
- * Components style
35
- * molecules
36
- */
37
-
38
- @import './components.scss';
39
-
40
33
  /* Atoms */
41
34
 
42
35
  // <mg-badge>
@@ -53,7 +53,7 @@ export declare class MgInputCheckboxPaginated implements IMgInputCheckboxBase {
53
53
  /**
54
54
  * Is checked items values expanded
55
55
  */
56
- itemsExpanded: boolean;
56
+ expanded: boolean;
57
57
  /***********
58
58
  * Methods *
59
59
  ***********/
@@ -5,8 +5,8 @@ export declare class MgModal {
5
5
  * Internal *
6
6
  ************/
7
7
  private modalFocusableElements;
8
+ private closeButtonElement;
8
9
  private readonly classHide;
9
- private closeButtonId;
10
10
  private titleId;
11
11
  private messages;
12
12
  private bodyOverflow;
@@ -61,6 +61,21 @@ export declare class MgModal {
61
61
  * @param event - keydown event
62
62
  */
63
63
  handleKeyDown(event: KeyboardEvent): void;
64
+ /**
65
+ * Handle last focusable element
66
+ * @param event - keyboard event
67
+ */
68
+ private handleLastFocusableElement;
69
+ /**
70
+ * Handle first focusable element
71
+ * @param event - keyboard event
72
+ */
73
+ private handleFirstFocusableElement;
74
+ /**
75
+ * Get last focusablmeElement
76
+ * @returns last modal focusable element
77
+ */
78
+ private getLastFocusableElement;
64
79
  /**
65
80
  * Method to manage focus on modal focusable elements
66
81
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgdis/mg-components",
3
- "version": "5.13.1",
3
+ "version": "5.15.0",
4
4
  "description": "MG Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "@popperjs/core": "^2.11.7",
27
27
  "@stencil/core": "^2.22.1",
28
28
  "normalize.css": "^8.0.1",
29
- "@mgdis/img": "1.0.0"
29
+ "@mgdis/img": "1.1.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@babel/core": "^7.20.12",
@@ -38,14 +38,14 @@
38
38
  "@playwright/test": "^1.34.3",
39
39
  "@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
40
40
  "@stencil/sass": "^1.5.2",
41
- "@storybook/addon-a11y": "^7.0.23",
42
- "@storybook/addon-actions": "^7.0.23",
43
- "@storybook/addon-essentials": "^7.0.23",
44
- "@storybook/addon-links": "^7.0.23",
45
- "@storybook/addon-mdx-gfm": "^7.0.23",
46
- "@storybook/blocks": "^7.0.23",
47
- "@storybook/html": "^7.0.23",
48
- "@storybook/html-webpack5": "^7.0.23",
41
+ "@storybook/addon-a11y": "^7.2.0",
42
+ "@storybook/addon-actions": "^7.2.0",
43
+ "@storybook/addon-essentials": "^7.2.0",
44
+ "@storybook/addon-links": "^7.2.0",
45
+ "@storybook/addon-mdx-gfm": "^7.2.0",
46
+ "@storybook/blocks": "^7.2.0",
47
+ "@storybook/html": "^7.2.0",
48
+ "@storybook/html-webpack5": "^7.2.0",
49
49
  "@storybook/preset-scss": "^1.0.3",
50
50
  "@types/jest": "npm:@types/jest@^26",
51
51
  "@types/jest-image-snapshot": "^4.3.2",
@@ -54,8 +54,8 @@
54
54
  "babel-plugin-jsx-pragmatic": "^1.0.2",
55
55
  "chromatic": "^6.15.0",
56
56
  "css-loader": "^5.2.7",
57
- "eslint": "^8.45.0",
58
- "eslint-plugin-storybook": "^0.6.12",
57
+ "eslint": "^8.x",
58
+ "eslint-plugin-storybook": "^0.6.13",
59
59
  "jest": "npm:jest@^26",
60
60
  "jest-cli": "npm:jest-cli@^26",
61
61
  "jest-image-snapshot": "^4.5.1",
@@ -70,12 +70,12 @@
70
70
  "react-textarea-autosize": "^8.5.0",
71
71
  "sass": "^1.58.0",
72
72
  "sass-loader": "^10.4.1",
73
- "storybook": "^7.0.23",
73
+ "storybook": "^7.2.0",
74
74
  "style-loader": "^2.0.0",
75
75
  "ts-node": "^10.9.1",
76
76
  "typescript": "^4.9.5",
77
- "playwright-config": "1.0.0",
78
77
  "@mgdis/linting-stencil": "1.1.0",
78
+ "playwright-config": "1.0.0",
79
79
  "eslint-config-stencil": "1.1.1",
80
80
  "tsconfig": "1.0.0"
81
81
  },
package/readme.md CHANGED
@@ -1,27 +1,22 @@
1
- ![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)
2
-
3
1
  # MG Components
4
2
 
5
- This project centralize MGDIS standalone Web Components using [Stencil](https://stenciljs.com/).
3
+ ## Introduction
6
4
 
7
- ## Stencil
5
+ MG Components is a reusable component library that aims to help MGDIS developers build UIs faster. It provides a collection of UI components that are designed to be productive, framework-agnostic, and satisfying to use. The library follows the principles of the Atomic Design methodology, which divides UI components into small, reusable parts.
8
6
 
9
- Stencil is a compiler for building fast web apps using Web Components.
7
+ Components in MG Components are written using [StencilJS](https://stenciljs.com/), a compiler for building fast web apps using Web Components. The library utilizes [StorybookJS](https://storybook.js.org/) for component development and documentation.
10
8
 
11
- Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
9
+ ### Atomic Design
12
10
 
13
- Stencil components are just Web Components, so they work in any major framework or with no framework at all.
11
+ Atomic Design is an interface design method that takes into account the constraints of development. It emphasizes the need to consider technical design constraints when creating web designs. You can learn more about Atomic Design in this [introduction to Atomic Design](https://openclassrooms.com/fr/courses/5249021-initiez-vous-a-la-methode-atomic-design/5630171-decouvrez-l-atomic-design) (in French).
14
12
 
15
- ## Getting Started
13
+ ### Stencil
16
14
 
17
- To run MG Components, clone this repository, go to your new directory and run:
15
+ MG Components is built using Stencil, a compiler for building fast web apps using Web Components. Stencil combines the best concepts from popular frontend frameworks and generates 100% standards-based Web Components that can run in any modern browser. Stencil components can be used with any major framework or even without a framework.
18
16
 
19
- ```bash
20
- # This repository uses pnpm as package manager
21
- corepack enable
22
- pnpm i
23
- pnpm start
24
- ```
17
+ ## Developer
18
+
19
+ ### Scripts
25
20
 
26
21
  To build for production, run:
27
22
 
@@ -49,7 +44,7 @@ pnpm test:unit -- mg-icon
49
44
 
50
45
  To regenerate snapshot you must add the `--updateSnapshot` parameter.
51
46
 
52
- For E2E tests you **must** use [WSL](https://docs.microsoft.com/fr-fr/windows/wsl/install) or a Linux OS to get the same screenshots as the GitLab CI.
47
+ For e2e tests you **must** use [WSL](https://docs.microsoft.com/fr-fr/windows/wsl/install) or a Linux OS to get the same screenshots as the GitLab CI.
53
48
 
54
49
  To add a component, run:
55
50
 
@@ -63,21 +58,21 @@ pnpm generate atoms/mg-icon
63
58
  pnpm generate molecules/mg-message
64
59
  ```
65
60
 
66
- ## Naming Components
61
+ ### Naming Components
67
62
 
68
63
  All of the MGDIS generated web components must use the prefix `mg`.
69
64
 
70
- ## Using this library
65
+ ### Using this library
71
66
 
72
- You will find how to use the library instructions in the [Getting Started section](src/stories/1-getting-started.stories.mdx).
67
+ You will find how to use the library instructions in the [Getting Started section](./getting-started.md).
73
68
 
74
- ## Style
69
+ ### Style
75
70
 
76
- ### Naming methodology
71
+ #### Naming methodology
77
72
 
78
73
  MG Components is using [BEM](https://en.bem.info/) (Block, Element, Modifier) methodology with the [two dashes style](https://en.bem.info/methodology/naming-convention/#two-dashes-style) naming scheme.
79
74
 
80
- ### Declaration organisation
75
+ #### Declaration organisation
81
76
 
82
77
  When a selector contains too many declaration it is recommended to organize them by theme : Display, Decoration, Font, Others.
83
78
 
@@ -102,18 +97,18 @@ When a selector contains too many declaration it is recommended to organize them
102
97
  }
103
98
  ```
104
99
 
105
- ## Storybook
100
+ ### Storybook
106
101
 
107
102
  The plugin [storybook-addon-docs-stencil
108
103
  ](https://github.com/pixtron/storybook-addon-docs-stencil) is used to generate the doc. **To be up to date on local it needs a fresh build**.
109
104
 
110
- ### run
105
+ #### run
111
106
 
112
107
  ```bash
113
108
  pnpm storybook
114
109
  ```
115
110
 
116
- ### Notes
111
+ #### Notes
117
112
 
118
113
  To display components in our `stories`, we use the `filterArgs` method to only show the necessary arguments in the code example. It takes in the first parameter an object containing the arguments to be used, and in the second parameter, an object containing the component default values.
119
114
 
@@ -1,3 +0,0 @@
1
- [hide] {
2
- display: none;
3
- }