@nice-digital/nds-maintain-ratio 4.0.15 → 4.0.17-alpha-node-update.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/es/MaintainRatio.d.ts +17 -17
- package/es/MaintainRatio.js +41 -41
- package/package.json +5 -5
package/es/MaintainRatio.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "../scss/maintain-ratio.scss";
|
|
3
|
-
export declare const ratios: {
|
|
4
|
-
"16:9": string;
|
|
5
|
-
"21:9": string;
|
|
6
|
-
"4:3": string;
|
|
7
|
-
square: string;
|
|
8
|
-
"1:1": string;
|
|
9
|
-
};
|
|
10
|
-
export interface MaintainRatioProps {
|
|
11
|
-
[prop: string]: unknown;
|
|
12
|
-
ratio?: keyof typeof ratios;
|
|
13
|
-
className?: string;
|
|
14
|
-
stretchFirstChild?: boolean;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export declare const MaintainRatio: React.FC<MaintainRatioProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../scss/maintain-ratio.scss";
|
|
3
|
+
export declare const ratios: {
|
|
4
|
+
"16:9": string;
|
|
5
|
+
"21:9": string;
|
|
6
|
+
"4:3": string;
|
|
7
|
+
square: string;
|
|
8
|
+
"1:1": string;
|
|
9
|
+
};
|
|
10
|
+
export interface MaintainRatioProps {
|
|
11
|
+
[prop: string]: unknown;
|
|
12
|
+
ratio?: keyof typeof ratios;
|
|
13
|
+
className?: string;
|
|
14
|
+
stretchFirstChild?: boolean;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const MaintainRatio: React.FC<MaintainRatioProps>;
|
package/es/MaintainRatio.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.MaintainRatio = exports.ratios = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
require("../scss/maintain-ratio.scss");
|
|
21
|
-
exports.ratios = {
|
|
22
|
-
"16:9": "16:9",
|
|
23
|
-
"21:9": "21:9",
|
|
24
|
-
"4:3": "4:3",
|
|
25
|
-
square: "square",
|
|
26
|
-
"1:1": "square"
|
|
27
|
-
};
|
|
28
|
-
const MaintainRatio = (props) => {
|
|
29
|
-
const { ratio = "16:9", stretchFirstChild = false, className, children } = props, attributes = __rest(props, ["ratio", "stretchFirstChild", "className", "children"]);
|
|
30
|
-
const classNames = (0, classnames_1.default)({
|
|
31
|
-
"maintain-ratio": true,
|
|
32
|
-
"maintain-ratio--16-9": ratio === "16:9",
|
|
33
|
-
"maintain-ratio--21-9": ratio === "21:9",
|
|
34
|
-
"maintain-ratio--4-3": ratio === "4:3",
|
|
35
|
-
"maintain-ratio--square": ratio === "square" || ratio === "1:1",
|
|
36
|
-
"maintain-ratio--stretch": stretchFirstChild,
|
|
37
|
-
[`${className}`]: className && true
|
|
38
|
-
});
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classNames, "data-component": "maintain-ratio" }, attributes, { children: children })));
|
|
40
|
-
};
|
|
41
|
-
exports.MaintainRatio = MaintainRatio;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MaintainRatio = exports.ratios = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
require("../scss/maintain-ratio.scss");
|
|
21
|
+
exports.ratios = {
|
|
22
|
+
"16:9": "16:9",
|
|
23
|
+
"21:9": "21:9",
|
|
24
|
+
"4:3": "4:3",
|
|
25
|
+
square: "square",
|
|
26
|
+
"1:1": "square"
|
|
27
|
+
};
|
|
28
|
+
const MaintainRatio = (props) => {
|
|
29
|
+
const { ratio = "16:9", stretchFirstChild = false, className, children } = props, attributes = __rest(props, ["ratio", "stretchFirstChild", "className", "children"]);
|
|
30
|
+
const classNames = (0, classnames_1.default)({
|
|
31
|
+
"maintain-ratio": true,
|
|
32
|
+
"maintain-ratio--16-9": ratio === "16:9",
|
|
33
|
+
"maintain-ratio--21-9": ratio === "21:9",
|
|
34
|
+
"maintain-ratio--4-3": ratio === "4:3",
|
|
35
|
+
"maintain-ratio--square": ratio === "square" || ratio === "1:1",
|
|
36
|
+
"maintain-ratio--stretch": stretchFirstChild,
|
|
37
|
+
[`${className}`]: className && true
|
|
38
|
+
});
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classNames, "data-component": "maintain-ratio" }, attributes, { children: children })));
|
|
40
|
+
};
|
|
41
|
+
exports.MaintainRatio = MaintainRatio;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-maintain-ratio",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.17-alpha-node-update.0",
|
|
4
4
|
"description": "Maintain ratio component for the NICE Design System",
|
|
5
5
|
"author": "Ian Routledge <ian.routledge@nice.org.uk>",
|
|
6
6
|
"homepage": "https://design-system.nice.org.uk/",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nice-digital/nds-core": "^4.0.
|
|
35
|
+
"@nice-digital/nds-core": "^4.0.17-alpha-node-update.0",
|
|
36
36
|
"classnames": "^2.3.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@testing-library/react": "^13.4.0",
|
|
45
45
|
"@testing-library/user-event": "^14.4.3",
|
|
46
46
|
"@types/jest": "^29.2.2",
|
|
47
|
-
"@types/node": "
|
|
48
|
-
"typescript": "^
|
|
47
|
+
"@types/node": "22.19.0",
|
|
48
|
+
"typescript": "^5.9.3"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1b7a4a13183120071b022adecd2fcf4eebefbb6c"
|
|
51
51
|
}
|