@italia/globals 1.0.0-beta.0 → 1.0.0-beta.2
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.
- package/README.md +5 -67
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@italia/globals`
|
|
2
2
|
|
|
3
3
|
This package contains extendable BaseComponent and BaseLocalizedComponent, utils and mixins, reusable in all web-components packages.
|
|
4
4
|
|
|
5
|
+
It is the foundation of all the Web Components in [`@italia/dev-kit-italia`](https://italia.github.io/dev-kit-italia).
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm i globals
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<script type="module">
|
|
15
|
-
import '@italia/globals';
|
|
16
|
-
</script>
|
|
10
|
+
npm i @italia/globals
|
|
17
11
|
```
|
|
18
12
|
|
|
19
13
|
### BaseComponent
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
Web Component with basic functionality, used for all the components that don't required translation functionalities.
|
|
22
16
|
|
|
23
17
|
Example:
|
|
24
18
|
|
|
@@ -71,59 +65,3 @@ export class MyElement extends BaseLocalizedComponent {
|
|
|
71
65
|
}
|
|
72
66
|
}
|
|
73
67
|
```
|
|
74
|
-
|
|
75
|
-
## Linting and formatting
|
|
76
|
-
|
|
77
|
-
To scan the project for linting and formatting errors, run
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npm run lint
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
To automatically fix linting and formatting errors, run
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npm run format
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Testing with Web Test Runner
|
|
90
|
-
|
|
91
|
-
To execute a single test run:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npm run test
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
To run the tests in interactive watch mode run:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npm run test:watch
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Demoing with Storybook
|
|
104
|
-
|
|
105
|
-
To run a local instance of Storybook for your component, run
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
npm run storybook
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
To build a production version of Storybook, run
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
npm run storybook:build
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Tooling configs
|
|
118
|
-
|
|
119
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
120
|
-
|
|
121
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
122
|
-
|
|
123
|
-
## Local Demo with `web-dev-server`
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npm start
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
To run a local development server that serves the basic demo located in `demo/index.html`
|
package/dist/src/index.js
CHANGED
|
@@ -6,7 +6,7 @@ if (typeof window !== 'undefined') {
|
|
|
6
6
|
window._itAnalytics = window._itAnalytics || {};
|
|
7
7
|
window._itAnalytics = {
|
|
8
8
|
...window._itAnalytics,
|
|
9
|
-
version: '1.0.0-beta.
|
|
9
|
+
version: '1.0.0-beta.2',
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export { TrackFocus, setAttributes, AriaKeyboardListController };
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,0BAA0B,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAUzF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAChD,MAAM,CAAC,YAAY,GAAG;QACpB,GAAG,MAAM,CAAC,YAAY;QACtB,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EACL,aAAa,EAGb,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,+BAA+B,GAEhC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAwB,MAAM,wCAAwC,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAgC,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAElG,OAAO,EAAE,aAAa,EAAyC,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,8BAA8B,EAAE,CAAC","sourcesContent":["import TrackFocus from './utils/track-focus.js';\n\nimport setAttributes from './directives/setAttributes.js';\nimport AriaKeyboardListController from './controllers/aria-keyboard-list-controller.js';\nimport { StoryFormControlMethodAndProps } from './stories/formControlReusableStories.js';\n\ndeclare global {\n interface Window {\n _itAnalytics: {\n version: string;\n };\n }\n}\n\nif (typeof window !== 'undefined') {\n window._itAnalytics = window._itAnalytics || {};\n window._itAnalytics = {\n ...window._itAnalytics,\n version: '1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,0BAA0B,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAUzF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAChD,MAAM,CAAC,YAAY,GAAG;QACpB,GAAG,MAAM,CAAC,YAAY;QACtB,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EACL,aAAa,EAGb,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,+BAA+B,GAEhC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAwB,MAAM,wCAAwC,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAgC,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAElG,OAAO,EAAE,aAAa,EAAyC,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,8BAA8B,EAAE,CAAC","sourcesContent":["import TrackFocus from './utils/track-focus.js';\n\nimport setAttributes from './directives/setAttributes.js';\nimport AriaKeyboardListController from './controllers/aria-keyboard-list-controller.js';\nimport { StoryFormControlMethodAndProps } from './stories/formControlReusableStories.js';\n\ndeclare global {\n interface Window {\n _itAnalytics: {\n version: string;\n };\n }\n}\n\nif (typeof window !== 'undefined') {\n window._itAnalytics = window._itAnalytics || {};\n window._itAnalytics = {\n ...window._itAnalytics,\n version: '1.0.0-beta.2',\n };\n}\n\nexport { TrackFocus, setAttributes, AriaKeyboardListController };\nexport type { AriaKeyboardConfig } from './controllers/aria-keyboard-list-controller.js';\nexport { RovingTabindexController } from './controllers/roving-tabindex-controller.js';\nexport type { RovingTabindexConfig } from './controllers/roving-tabindex-controller.js';\nexport {\n BaseComponent,\n BaseComponentInterface,\n BaseComponentType,\n BaseLocalizedComponent,\n} from './base-component/base-component.js';\nexport {\n AriaKeyboardAccordionController,\n type AriaKeyboardAccordionConfig,\n} from './controllers/aria-keyboard-accordion-controller.js';\nexport { CollapseAnimationController } from './controllers/collapse-controller.js';\nexport { FocusTrapController, type FocusTrapConfig } from './controllers/focus-trap-controller.js';\n\nexport { FormControl } from './form/form-control.js';\nexport { formCollections, FormControlControllerOptions, FormControlController } from './form/form-controller.js';\nexport { cookies } from './utils/cookies.js';\nexport { dispatchCancelable } from './utils/dispatch-cancelable.js';\nexport { focusableFallbackAncestor, nearestFocusableInDocument } from './utils/focus-fallback.js';\nexport type Constructor<T = {}> = new (...args: any[]) => T;\nexport { WindowManager, type ScrollCallback, type ScrollState } from './window-manager.js';\n\nexport { StoryFormControlMethodAndProps };\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/globals",
|
|
3
3
|
"description": "Utilities per i Web components del Design System .italia",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@floating-ui/dom": "^1.7.1",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"lit": "^3.3.0",
|
|
38
|
-
"@italia/i18n": "^1.0.0-beta.
|
|
38
|
+
"@italia/i18n": "^1.0.0-beta.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"rimraf": "^6.0.1",
|
|
46
46
|
"tslib": "^2.6.3",
|
|
47
47
|
"typescript": "^5.5.3",
|
|
48
|
-
"@italia/test-config": "^1.0.0-beta.
|
|
49
|
-
"@italia/typescript-config": "^1.0.0-beta.
|
|
48
|
+
"@italia/test-config": "^1.0.0-beta.2",
|
|
49
|
+
"@italia/typescript-config": "^1.0.0-beta.1"
|
|
50
50
|
},
|
|
51
51
|
"customElements": "custom-elements.json",
|
|
52
52
|
"scripts": {
|