@norges-domstoler/dds-components 0.0.0-dev-20240305141413 → 0.0.0-dev-20240306143134
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 +4 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ const App = () => (
|
|
|
23
23
|
<>
|
|
24
24
|
<TextInput label="Input" />
|
|
25
25
|
<Button>Primary</Button>
|
|
26
|
-
<Button purpose="secondary"
|
|
26
|
+
<Button purpose="secondary" size="small">
|
|
27
27
|
Secondary
|
|
28
28
|
</Button>
|
|
29
29
|
</>
|
|
@@ -50,6 +50,9 @@ Tilgjengelige komponenter:
|
|
|
50
50
|
- DescriptionList
|
|
51
51
|
- Divider
|
|
52
52
|
- Drawer
|
|
53
|
+
- EmptyContent
|
|
54
|
+
- FavStar
|
|
55
|
+
- Feedback
|
|
53
56
|
- FileUploader
|
|
54
57
|
- GlobalMessage
|
|
55
58
|
- Grid
|
package/dist/index.js
CHANGED
|
@@ -3821,6 +3821,22 @@ var getDefaultTypographyType = (h) => {
|
|
|
3821
3821
|
return "headingSans06";
|
|
3822
3822
|
}
|
|
3823
3823
|
};
|
|
3824
|
+
var scaledTypographyType = (type) => {
|
|
3825
|
+
switch (type) {
|
|
3826
|
+
case "headingSans08":
|
|
3827
|
+
return "headingSans07";
|
|
3828
|
+
case "headingSans07":
|
|
3829
|
+
return "headingSans06";
|
|
3830
|
+
case "headingSans06":
|
|
3831
|
+
return "headingSans05";
|
|
3832
|
+
case "headingSans05":
|
|
3833
|
+
return "headingSans04";
|
|
3834
|
+
case "headingSans04":
|
|
3835
|
+
return "headingSans03";
|
|
3836
|
+
default:
|
|
3837
|
+
return type;
|
|
3838
|
+
}
|
|
3839
|
+
};
|
|
3824
3840
|
var Heading = (0, import_react14.forwardRef)(
|
|
3825
3841
|
(props, ref) => {
|
|
3826
3842
|
const {
|
|
@@ -3833,9 +3849,12 @@ var Heading = (0, import_react14.forwardRef)(
|
|
|
3833
3849
|
...rest
|
|
3834
3850
|
} = props;
|
|
3835
3851
|
const headingElement = getHeadingElement(level);
|
|
3852
|
+
const standardTypographyType = typographyType7 != null ? typographyType7 : getDefaultTypographyType(headingElement);
|
|
3853
|
+
const screenSize = useScreenSize();
|
|
3854
|
+
const isSmallScreen = screenSize <= 1 /* Small */;
|
|
3836
3855
|
const headingProps = {
|
|
3837
3856
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
3838
|
-
typographyType:
|
|
3857
|
+
typographyType: isSmallScreen ? scaledTypographyType(standardTypographyType) : standardTypographyType,
|
|
3839
3858
|
as: headingElement,
|
|
3840
3859
|
ref
|
|
3841
3860
|
};
|