design-react-kit 5.8.2 → 5.9.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.
- package/CHANGELOG.md +17 -2
- package/README.EN.md +20 -0
- package/README.md +20 -0
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.cjs.map +1 -1
- package/dist/Card/Card.js +20 -13
- package/dist/Card/Card.js.map +1 -1
- package/dist/Video/Video.cjs +1 -1
- package/dist/Video/Video.cjs.map +1 -1
- package/dist/Video/Video.js +1 -1
- package/dist/Video/Video.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/types/Card/Card.d.ts +22 -8
- package/package.json +13 -15
- package/src/Card/Card.tsx +59 -34
- package/src/Video/Video.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
# [5.9.0](https://github.com/italia/design-react-kit/compare/v5.8.3...v5.9.0) (2025-09-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* new cards ([bf62d1b](https://github.com/italia/design-react-kit/commit/bf62d1b5e1a6652b6d7c1dd7c36d294e4cbc6140))
|
|
7
|
+
* new storybook ([925fe11](https://github.com/italia/design-react-kit/commit/925fe11a48e2593fb43d5364d5ac733806eb6d61))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [5.8.3](https://github.com/italia/design-react-kit/compare/v5.8.2...v5.8.3) (2025-07-15)
|
|
12
|
+
|
|
13
|
+
* fix: initialize video player component only once ([1d95757](https://github.com/italia/design-react-kit/commit/1d95757))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [5.8.2](https://github.com/italia/design-react-kit/compare/v5.8.1...v5.8.2) (2025-06-28)
|
|
2
18
|
|
|
3
19
|
* fix: upload image svg not found ([877db17](https://github.com/italia/design-react-kit/commit/877db17))
|
|
4
|
-
* chore: update software version in publiccode ([a91398e](https://github.com/italia/design-react-kit/commit/a91398e))
|
|
5
20
|
|
|
6
21
|
|
|
7
22
|
|
package/README.EN.md
CHANGED
|
@@ -82,6 +82,26 @@ The `design-react-kit` module does not include the CSS and font files in the bun
|
|
|
82
82
|
yarn add bootstrap-italia typeface-lora typeface-roboto-mono typeface-titillium-web --save
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
#### Note for `vite` users
|
|
86
|
+
|
|
87
|
+
If you are using `vite` as a bundler and want to customize the standard appearance of Bootstrap Italia, you need to
|
|
88
|
+
add an alias in the `vite.config.js` file:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
import { defineConfig } from 'vite';
|
|
92
|
+
import react from '@vitejs/plugin-react';
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
plugins: [react()],
|
|
96
|
+
resolve: {
|
|
97
|
+
alias: {
|
|
98
|
+
"@splidejs/splide/src/css/core/index":
|
|
99
|
+
"node_modules/@splidejs/splide/src/css/core/index.scss",
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
85
105
|
### Example
|
|
86
106
|
|
|
87
107
|
Then, you just need to import CSS e font editing `./src/App.js` as shown:
|
package/README.md
CHANGED
|
@@ -106,6 +106,26 @@ export default App;
|
|
|
106
106
|
Puoi consultare questo template web con StackBlitz:
|
|
107
107
|
[Template web](https://stackblitz.com/edit/vitejs-vite-yy8bnk?file=src%2FApp.tsx)
|
|
108
108
|
|
|
109
|
+
#### Nota per chi utilizza `vite`
|
|
110
|
+
|
|
111
|
+
Se si utilizza `vite` come bundler e si vuole personalizzare l'aspetto standard di Bootstrap Italia, è necessario
|
|
112
|
+
aggiungere un alias nel file `vite.config.js`:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import { defineConfig } from 'vite';
|
|
116
|
+
import react from '@vitejs/plugin-react';
|
|
117
|
+
|
|
118
|
+
export default defineConfig({
|
|
119
|
+
plugins: [react()],
|
|
120
|
+
resolve: {
|
|
121
|
+
alias: {
|
|
122
|
+
"@splidejs/splide/src/css/core/index":
|
|
123
|
+
"node_modules/@splidejs/splide/src/css/core/index.scss",
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
109
129
|
### Caricamento Font
|
|
110
130
|
|
|
111
131
|
Il tema Bootstrap Italia utilizza un set specifico di font typeface: `titillium-web`, `roboto-mono` e `lora`. Il caricamento di questi font è lasciato al browser ma, volendo può essere controllato tramite l'apposito componente `FontLoader`.
|
package/dist/Card/Card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var H=Object.create;var l=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var S=(e,r)=>{for(var o in r)l(e,o,{get:r[o],enumerable:!0})},s=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of L(r))!R.call(e,a)&&a!==o&&l(e,a,{get:()=>r[a],enumerable:!(n=E(r,a))||n.enumerable});return e};var d=(e,r,o)=>(o=e!=null?H(N(e)):{},s(r||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),w=e=>s(l({},"__esModule",{value:!0}),e);var y={};S(y,{Card:()=>x});module.exports=w(y);var c=d(require("react"),1),m=d(require("classnames"),1),x=({tag:e="article",teaser:r,image:o,border:n=!0,borderTop:a,inline:b,inlineReverse:p,inlineMini:u,rounded:f,fullHeight:g,banner:C,profile:M,shadow:t=null,testId:T,...i})=>{let h=(0,m.default)("it-card",i.className,{"card-teaser":r,"it-card-image":o,border:n,"it-card-inline":b,"it-card-inline-reverse":p,"it-card-inline-mini":u,"it-card-height-full":g,rounded:f,"card-teaser-wrapper":r,shadow:t==="normal","shadow-lg":t==="lg","shadow-sm":t==="sm","it-card-banner":C,"it-card-profile":M,"it-border-top":a,"it-border-top-secondary":a});return c.default.createElement(e,{...i,className:h,"data-testid":T})};0&&(module.exports={Card});
|
|
2
2
|
//# sourceMappingURL=Card.cjs.map
|
package/dist/Card/Card.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';\nimport classNames from 'classnames';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';\nimport classNames from 'classnames';\nimport { CSSModule } from 'reactstrap/types/lib/utils';\n\nexport interface CardProps extends HTMLAttributes<HTMLElement> {\n /** Utilizzarlo in caso di utilizzo di componenti personalizzati */\n tag?: ElementType;\n /** Classi aggiuntive da usare per il componente Card */\n className?: string;\n /** Da utilizzare per impostare un riferimento all'elemento DOM */\n innerRef?: Ref<HTMLElement>;\n /** Oggetto contenente la nuova mappatura per le classi CSS. */\n cssModule?: CSSModule;\n /** Abilita la versione teaser della Card */\n teaser?: boolean;\n /** La card contiene un'immagine */\n image?: boolean;\n /** La card è di tipo banner */\n banner?: boolean;\n /** La card è di tipo profile */\n profile?: boolean;\n /** La card è inline */\n inline?: boolean;\n /** La card è inline-reverse */\n inlineReverse?: boolean;\n /** La card è inline-mini */\n inlineMini?: boolean;\n /** La card è arrotondata */\n rounded?: boolean;\n /** La card è full height */\n fullHeight?: boolean;\n /** La card ha un bordo */\n border?: boolean;\n /** La card ha un bordo di estremità */\n borderTop?: boolean;\n /** La card ha un bordo */\n shadow?: 'sm' | 'lg' | 'normal' | null;\n testId?: string;\n}\n\nexport const Card: FC<CardProps> = ({\n tag = 'article',\n teaser,\n image,\n border=true,\n borderTop,\n inline,\n inlineReverse,\n inlineMini,\n rounded,\n fullHeight,\n banner,\n profile,\n shadow=null,\n testId,\n ...attributes\n}) => {\n const cardClasses = classNames('it-card', attributes.className, {\n 'card-teaser': teaser,\n 'it-card-image': image,\n 'border': border,\n 'it-card-inline': inline,\n 'it-card-inline-reverse': inlineReverse,\n 'it-card-inline-mini': inlineMini,\n 'it-card-height-full': fullHeight,\n 'rounded': rounded,\n 'card-teaser-wrapper': teaser,\n 'shadow': shadow === 'normal',\n 'shadow-lg': shadow === 'lg',\n 'shadow-sm': shadow === 'sm',\n 'it-card-banner': banner,\n 'it-card-profile': profile,\n 'it-border-top': borderTop,\n 'it-border-top-secondary': borderTop,\n\n });\n\n const T = tag;\n\n return (\n <T\n {...attributes}\n className={cardClasses}\n data-testid={testId}\n />\n );\n\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4D,sBAC5DC,EAAuB,2BAuCVH,EAAsB,CAAC,CAClC,IAAAI,EAAM,UACN,OAAAC,EACA,MAAAC,EACA,OAAAC,EAAO,GACP,UAAAC,EACA,OAAAC,EACA,cAAAC,EACA,WAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,QAAAC,EACA,OAAAC,EAAO,KACP,OAAAC,EACA,GAAGC,CACL,IAAM,CACJ,IAAMC,KAAc,EAAAC,SAAW,UAAWF,EAAW,UAAW,CAC9D,cAAeb,EACf,gBAAiBC,EACjB,OAAUC,EACV,iBAAkBE,EAClB,yBAA0BC,EAC1B,sBAAuBC,EACvB,sBAAuBE,EACvB,QAAWD,EACX,sBAAuBP,EACvB,OAAUW,IAAW,SACrB,YAAaA,IAAW,KACxB,YAAaA,IAAW,KACxB,iBAAkBF,EAClB,kBAAmBC,EACnB,gBAAiBP,EACjB,0BAA2BA,CAE7B,CAAC,EAID,OACE,EAAAa,QAAA,cAHQjB,EAGP,CACE,GAAGc,EACJ,UAAWC,EACX,cAAaF,EACf,CAGJ","names":["Card_exports","__export","Card","__toCommonJS","import_react","import_classnames","tag","teaser","image","border","borderTop","inline","inlineReverse","inlineMini","rounded","fullHeight","banner","profile","shadow","testId","attributes","cardClasses","classNames","React"]}
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'card-
|
|
7
|
-
'
|
|
3
|
+
export const Card = ({ tag = 'article', teaser, image, border = true, borderTop, inline, inlineReverse, inlineMini, rounded, fullHeight, banner, profile, shadow = null, testId, ...attributes }) => {
|
|
4
|
+
const cardClasses = classNames('it-card', attributes.className, {
|
|
5
|
+
'card-teaser': teaser,
|
|
6
|
+
'it-card-image': image,
|
|
7
|
+
'border': border,
|
|
8
|
+
'it-card-inline': inline,
|
|
9
|
+
'it-card-inline-reverse': inlineReverse,
|
|
10
|
+
'it-card-inline-mini': inlineMini,
|
|
11
|
+
'it-card-height-full': fullHeight,
|
|
12
|
+
'rounded': rounded,
|
|
13
|
+
'card-teaser-wrapper': teaser,
|
|
14
|
+
'shadow': shadow === 'normal',
|
|
15
|
+
'shadow-lg': shadow === 'lg',
|
|
16
|
+
'shadow-sm': shadow === 'sm',
|
|
17
|
+
'it-card-banner': banner,
|
|
18
|
+
'it-card-profile': profile,
|
|
19
|
+
'it-border-top': borderTop,
|
|
20
|
+
'it-border-top-secondary': borderTop,
|
|
8
21
|
});
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
if (noWrapper) {
|
|
13
|
-
return (React.createElement(CardBase, { ...attributes, className: cardClasses, tag: tag, href: tag === 'a' ? href : undefined, "data-testid": testId }));
|
|
14
|
-
}
|
|
15
|
-
return (React.createElement("div", { className: wrapperClasses, "data-testid": testId },
|
|
16
|
-
React.createElement(CardBase, { ...attributes, className: cardClasses, tag: tag, href: tag === 'a' ? href : undefined })));
|
|
22
|
+
const T = tag;
|
|
23
|
+
return (React.createElement(T, { ...attributes, className: cardClasses, "data-testid": testId }));
|
|
17
24
|
};
|
|
18
25
|
//# sourceMappingURL=Card.js.map
|
package/dist/Card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,UAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,UAAU,MAAM,YAAY,CAAC;AAuCpC,MAAM,CAAC,MAAM,IAAI,GAAkB,CAAC,EAClC,GAAG,GAAG,SAAS,EACf,MAAM,EACN,KAAK,EACL,MAAM,GAAC,IAAI,EACX,SAAS,EACT,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,EACV,MAAM,EACN,OAAO,EACP,MAAM,GAAC,IAAI,EACX,MAAM,EACN,GAAG,UAAU,EACd,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE;QAC9D,aAAa,EAAE,MAAM;QACrB,eAAe,EAAE,KAAK;QACtB,QAAQ,EAAE,MAAM;QAChB,gBAAgB,EAAE,MAAM;QACxB,wBAAwB,EAAE,aAAa;QACvC,qBAAqB,EAAE,UAAU;QACjC,qBAAqB,EAAE,UAAU;QACjC,SAAS,EAAE,OAAO;QAClB,qBAAqB,EAAE,MAAM;QAC7B,QAAQ,EAAE,MAAM,KAAK,QAAQ;QAC7B,WAAW,EAAE,MAAM,KAAK,IAAI;QAC5B,WAAW,EAAE,MAAM,KAAK,IAAI;QAC5B,gBAAgB,EAAE,MAAM;QACxB,iBAAiB,EAAE,OAAO;QAC1B,eAAe,EAAE,SAAS;QAC1B,yBAAyB,EAAE,SAAS;KAErC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,GAAG,CAAC;IAEd,OAAO,CACL,oBAAC,CAAC,OACI,UAAU,EACd,SAAS,EAAE,WAAW,iBACT,MAAM,GACnB,CACH,CAAC;AAEJ,CAAC,CAAC"}
|