@norges-domstoler/dds-components 0.0.0-dev-20261020064610 → 0.0.0-dev-20261020070847
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/dist/index.cjs +24 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -9906
- package/dist/index.d.mts +13 -9906
- package/dist/index.mjs +24 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1374,7 +1374,7 @@ const getValue = (v, bp, invert) => {
|
|
|
1374
1374
|
else output = v;
|
|
1375
1375
|
return invert ? invertValue(output) : output;
|
|
1376
1376
|
};
|
|
1377
|
-
const convertMultiValue = (value, bp, invert) => value.split(" ").map((v) => getValue(v, bp, invert)).join(" ");
|
|
1377
|
+
const convertMultiValue = (value, bp, invert, mode = "token") => value.split(" ").map((v) => mode === "raw" ? v : getValue(v, bp, invert)).join(" ");
|
|
1378
1378
|
const invertValue = (v) => v === "0" ? "0" : `calc(-1 * ${v})`;
|
|
1379
1379
|
const buildCSSKey = (prefix, suffix, bp) => {
|
|
1380
1380
|
let key = `--${TOKEN_PREFIX}`;
|
|
@@ -1389,13 +1389,13 @@ function getCSSProperties(property, prefix, suffix, invert) {
|
|
|
1389
1389
|
properties[buildCSSKey(prefix, suffix)] = convertMultiValue(property.toString(), void 0, invert);
|
|
1390
1390
|
return properties;
|
|
1391
1391
|
}
|
|
1392
|
-
function getResponsiveCSSProperties(property, prefix, suffix,
|
|
1392
|
+
function getResponsiveCSSProperties(property, prefix, suffix, options = {}) {
|
|
1393
1393
|
if (property === void 0 || property === null) return;
|
|
1394
1394
|
const properties = {};
|
|
1395
1395
|
if (isBreakpointObject(property)) BREAKPOINTS.forEach((bp) => {
|
|
1396
|
-
if (property[bp] !== void 0 && property[bp] !== null) properties[buildCSSKey(prefix, suffix, bp)] = convertMultiValue(property[bp].toString(), bp, invert);
|
|
1396
|
+
if (property[bp] !== void 0 && property[bp] !== null) properties[buildCSSKey(prefix, suffix, bp)] = convertMultiValue(property[bp].toString(), bp, options.invert, options.mode);
|
|
1397
1397
|
});
|
|
1398
|
-
else properties[buildCSSKey(prefix, suffix)] = convertMultiValue(property.toString(), void 0, invert);
|
|
1398
|
+
else properties[buildCSSKey(prefix, suffix)] = convertMultiValue(property.toString(), void 0, options.invert, options.mode);
|
|
1399
1399
|
return properties;
|
|
1400
1400
|
}
|
|
1401
1401
|
/**
|
|
@@ -1462,30 +1462,30 @@ const Box = ({ id, className, style, padding, paddingInline, paddingBlock, margi
|
|
|
1462
1462
|
...getResponsiveCSSProperties(width, "r", "w"),
|
|
1463
1463
|
...getResponsiveCSSProperties(maxWidth, "r", "max-w"),
|
|
1464
1464
|
...getResponsiveCSSProperties(minWidth, "r", "min-w"),
|
|
1465
|
-
...getResponsiveCSSProperties(position, "r", "pos"),
|
|
1465
|
+
...getResponsiveCSSProperties(position, "r", "pos", { mode: "raw" }),
|
|
1466
1466
|
...getResponsiveCSSProperties(left, "r", "l"),
|
|
1467
1467
|
...getResponsiveCSSProperties(right, "r", "r"),
|
|
1468
1468
|
...getResponsiveCSSProperties(top, "r", "t"),
|
|
1469
1469
|
...getResponsiveCSSProperties(bottom, "r", "b"),
|
|
1470
|
-
...getResponsiveCSSProperties(overflow, "r", "o"),
|
|
1471
|
-
...getResponsiveCSSProperties(overflowX, "r", "o-x"),
|
|
1472
|
-
...getResponsiveCSSProperties(overflowY, "r", "o-y"),
|
|
1473
|
-
...getResponsiveCSSProperties(display, "r", "display"),
|
|
1474
|
-
...getResponsiveCSSProperties(textAlign, "r", "text-align"),
|
|
1475
|
-
...getResponsiveCSSProperties(flex, "r", "flex"),
|
|
1476
|
-
...getResponsiveCSSProperties(flexDirection, "r", "flex-dir"),
|
|
1470
|
+
...getResponsiveCSSProperties(overflow, "r", "o", { mode: "raw" }),
|
|
1471
|
+
...getResponsiveCSSProperties(overflowX, "r", "o-x", { mode: "raw" }),
|
|
1472
|
+
...getResponsiveCSSProperties(overflowY, "r", "o-y", { mode: "raw" }),
|
|
1473
|
+
...getResponsiveCSSProperties(display, "r", "display", { mode: "raw" }),
|
|
1474
|
+
...getResponsiveCSSProperties(textAlign, "r", "text-align", { mode: "raw" }),
|
|
1475
|
+
...getResponsiveCSSProperties(flex, "r", "flex", { mode: "raw" }),
|
|
1476
|
+
...getResponsiveCSSProperties(flexDirection, "r", "flex-dir", { mode: "raw" }),
|
|
1477
1477
|
...getResponsiveCSSProperties(gap, "r", "gap"),
|
|
1478
1478
|
...getResponsiveCSSProperties(columnGap, "r", "c-gap"),
|
|
1479
1479
|
...getResponsiveCSSProperties(rowGap, "r", "r-gap"),
|
|
1480
|
-
...getResponsiveCSSProperties(alignItems, "r", "a-i"),
|
|
1481
|
-
...getResponsiveCSSProperties(alignContent, "r", "a-c"),
|
|
1482
|
-
...getResponsiveCSSProperties(justifyItems, "r", "j-i"),
|
|
1483
|
-
...getResponsiveCSSProperties(placeItems, "r", "pl-i"),
|
|
1484
|
-
...getResponsiveCSSProperties(justifyContent, "r", "j-c"),
|
|
1485
|
-
...getResponsiveCSSProperties(flexWrap, "r", "wrap"),
|
|
1486
|
-
...getResponsiveCSSProperties(flexBasis, "r", "basis"),
|
|
1487
|
-
...getResponsiveCSSProperties(flexFlow, "r", "flow"),
|
|
1488
|
-
...getResponsiveCSSProperties(wordBreak, "r", "word-break"),
|
|
1480
|
+
...getResponsiveCSSProperties(alignItems, "r", "a-i", { mode: "raw" }),
|
|
1481
|
+
...getResponsiveCSSProperties(alignContent, "r", "a-c", { mode: "raw" }),
|
|
1482
|
+
...getResponsiveCSSProperties(justifyItems, "r", "j-i", { mode: "raw" }),
|
|
1483
|
+
...getResponsiveCSSProperties(placeItems, "r", "pl-i", { mode: "raw" }),
|
|
1484
|
+
...getResponsiveCSSProperties(justifyContent, "r", "j-c", { mode: "raw" }),
|
|
1485
|
+
...getResponsiveCSSProperties(flexWrap, "r", "wrap", { mode: "raw" }),
|
|
1486
|
+
...getResponsiveCSSProperties(flexBasis, "r", "basis", { mode: "raw" }),
|
|
1487
|
+
...getResponsiveCSSProperties(flexFlow, "r", "flow", { mode: "raw" }),
|
|
1488
|
+
...getResponsiveCSSProperties(wordBreak, "r", "word-break", { mode: "raw" }),
|
|
1489
1489
|
...getResponsiveCSSProperties(zIndex, "r", "z-index")
|
|
1490
1490
|
};
|
|
1491
1491
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShowHide, { ...getBaseHTMLProps(id, cn(className, hasValue(padding) && layout_module_default["dds-p"], hasValue(paddingInline) && layout_module_default["dds-p-i"], hasValue(paddingBlock) && layout_module_default["dds-p-b"], hasValue(margin) && layout_module_default["dds-m"], hasValue(marginInline) && layout_module_default["dds-m-i"], hasValue(marginBlock) && layout_module_default["dds-m-b"], hasValue(height) && layout_module_default["dds-h"], hasValue(maxHeight) && layout_module_default["dds-max-h"], hasValue(minHeight) && layout_module_default["dds-min-h"], hasValue(width) && layout_module_default["dds-w"], hasValue(maxWidth) && layout_module_default["dds-max-w"], hasValue(minWidth) && layout_module_default["dds-min-w"], hasValue(position) && layout_module_default["dds-pos"], hasValue(left) && layout_module_default["dds-l"], hasValue(right) && layout_module_default["dds-r"], hasValue(top) && layout_module_default["dds-t"], hasValue(bottom) && layout_module_default["dds-b"], hasValue(overflow) && layout_module_default["dds-o"], hasValue(overflowX) && layout_module_default["dds-o-x"], hasValue(overflowY) && layout_module_default["dds-o-y"], hasValue(display) && layout_module_default["dds-display"], hasValue(textAlign) && layout_module_default["dds-text-align"], hasValue(flex) && layout_module_default["dds-flex"], hasValue(flexDirection) && layout_module_default["dds-flex-dir"], hasValue(gap) && layout_module_default["dds-gap"], hasValue(columnGap) && layout_module_default["dds-c-gap"], hasValue(rowGap) && layout_module_default["dds-r-gap"], hasValue(alignContent) && layout_module_default["dds-a-c"], hasValue(alignItems) && layout_module_default["dds-a-i"], hasValue(justifyContent) && layout_module_default["dds-j-c"], hasValue(justifyItems) && layout_module_default["dds-j-i"], hasValue(placeItems) && layout_module_default["dds-pl-i"], hasValue(flexWrap) && layout_module_default["dds-wrap"], hasValue(flexBasis) && layout_module_default["dds-basis"], hasValue(flexFlow) && layout_module_default["dds-flow"], hasValue(wordBreak) && layout_module_default["dds-word-break"], hasValue(zIndex) && layout_module_default["dds-z-index"]), {
|
|
@@ -1502,8 +1502,8 @@ const Bleed = ({ id, className, style, htmlProps, bleedMarginBlock, bleedMarginI
|
|
|
1502
1502
|
...getResponsiveCSSProperties(bleedMarginBlock, "r", "p-b")
|
|
1503
1503
|
} : {};
|
|
1504
1504
|
const responsiveStyles = {
|
|
1505
|
-
...getResponsiveCSSProperties(bleedMarginInline, "r", "bleed-m-i", true),
|
|
1506
|
-
...getResponsiveCSSProperties(bleedMarginBlock, "r", "bleed-m-b", true),
|
|
1505
|
+
...getResponsiveCSSProperties(bleedMarginInline, "r", "bleed-m-i", { invert: true }),
|
|
1506
|
+
...getResponsiveCSSProperties(bleedMarginBlock, "r", "bleed-m-b", { invert: true }),
|
|
1507
1507
|
...reflStyles
|
|
1508
1508
|
};
|
|
1509
1509
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, { ...getBaseHTMLProps(id, cn(className, hasValue(bleedMarginInline) && layout_module_default["dds-bleed-m-i"], hasValue(bleedMarginBlock) && layout_module_default["dds-bleed-m-b"], hasValue(bleedMarginInline) && reflectivePadding && layout_module_default["dds-p-i"], hasValue(bleedMarginBlock) && reflectivePadding && layout_module_default["dds-p-b"]), {
|
|
@@ -1599,7 +1599,7 @@ const GridChild = ({ id, className, htmlProps, style, gridRow, gridArea, justify
|
|
|
1599
1599
|
const styleVariables = {
|
|
1600
1600
|
...getResponsiveCSSProperties(gridRow, "r", "grid-row"),
|
|
1601
1601
|
...getResponsiveCSSProperties(gridArea, "r", "grid-area"),
|
|
1602
|
-
...getResponsiveCSSProperties(justifySelf, "r", "j-self"),
|
|
1602
|
+
...getResponsiveCSSProperties(justifySelf, "r", "j-self", { mode: "raw" }),
|
|
1603
1603
|
...getResponsiveCSSProperties(columnsOccupied, "r", "grid-column")
|
|
1604
1604
|
};
|
|
1605
1605
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, { ...getBaseHTMLProps(id, cn(className, Grid_module_default["child-col-count"], hasValue(gridRow) && Grid_module_default["dds-grid-row"], hasValue(gridArea) && Grid_module_default["dds-grid-area"], hasValue(justifySelf) && Grid_module_default["dds-j-self"], hasValue(columnsOccupied) && Grid_module_default["dds-grid-column"], columnsOccupied === "firstHalf" && Grid_module_default["child--first-half"], columnsOccupied === "secondHalf" && Grid_module_default["child--second-half"]), {
|