@danske/sapphire-react-lab 0.88.0 → 0.88.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sources":["../../../../src/Typography/src/Heading.tsx"],"sourcesContent":["import { DOMProps } from '@react-types/shared';\nimport { filterDOMProps } from '@react-aria/utils';\nimport React, { ElementType, ForwardedRef, forwardRef } from 'react';\nimport clsx from 'clsx';\nimport styles from '@danske/sapphire-css/components/text/text.module.css';\n\nimport {\n useThemeCheck,\n useTextStyleProps,\n TextStyleProps,\n SapphireStyleProps,\n} from '@danske/sapphire-react';\n\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface TypographyHeadingProps\n extends DOMProps,\n TextStyleProps,\n SapphireStyleProps {\n children: React.ReactNode;\n /**\n * The level of the heading.\n */\n level: HeadingLevel;\n elementType?: `h${HeadingLevel}`;\n fontVariant?: 'default' | 'alternative';\n}\n\nexport const Heading = forwardRef(function Heading(\n props: TypographyHeadingProps,\n ref: ForwardedRef<HTMLHeadingElement>\n) {\n useThemeCheck();\n\n const domProps = filterDOMProps(props);\n const { children, level, elementType, ...otherProps } = props;\n const { styleProps } = useTextStyleProps(otherProps);\n const HeadingTag = elementType ? elementType : (`h${level}` as ElementType);\n\n return (\n <HeadingTag\n {...domProps}\n {...styleProps}\n className={clsx(\n styles['sapphire-text'],\n styles[`sapphire-text--heading-${level}` as const],\n styleProps.className,\n {\n [styles['sapphire-text--heading-alternative']]:\n props.fontVariant === 'alternative',\n }\n )}\n ref={ref}\n >\n {children}\n </HeadingTag>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,OAAU,GAAA,UAAA,CAAW,SAChC,QAAA,CAAA,KAAA,EACA,GACA,EAAA;AACA,EAAA,aAAA,EAAA,CAAA;AAEA,EAAA,MAAM,WAAW,cAAe,CAAA,KAAA,CAAA,CAAA;AAChC,EAAwD,MAAA,EAAA,GAAA,KAAA,EAAhD,YAAU,KAAO,EAAA,WAAA,EAAA,GAA+B,IAAf,UAAe,GAAA,SAAA,CAAA,EAAA,EAAf,CAAjC,UAAA,EAAU,OAAO,EAAA,aAAA,CAAA,CAAA,CAAA;AACzB,EAAM,MAAA,EAAE,eAAe,iBAAkB,CAAA,UAAA,CAAA,CAAA;AACzC,EAAM,MAAA,UAAA,GAAa,WAAc,GAAA,WAAA,GAAe,CAAI,CAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEpD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAD,aACM,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAA,QAAA,CAAA,EACA,UAFN,CAAA,EAAA;AAAA,IAGE,SAAA,EAAW,KACT,MAAO,CAAA,eAAA,CAAA,EACP,OAAO,CAA0B,uBAAA,EAAA,KAAA,CAAA,CAAA,CAAA,EACjC,WAAW,SACX,EAAA;AAAA,MACG,CAAA,MAAA,CAAO,oCACN,CAAA,GAAA,KAAA,CAAM,WAAgB,KAAA,aAAA;AAAA,KAAA,CAAA;AAAA,IAG5B,GAAA;AAAA,GAEC,CAAA,EAAA,QAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"Heading.js","sources":["../../../../src/Typography/src/Heading.tsx"],"sourcesContent":["import { DOMProps } from '@react-types/shared';\nimport { filterDOMProps } from '@react-aria/utils';\nimport React, { ElementType, ForwardedRef, forwardRef } from 'react';\nimport clsx from 'clsx';\nimport styles from '@danske/sapphire-css/components/text/text.module.css';\n\nimport {\n useThemeCheck,\n useTextStyleProps,\n TextStyleProps,\n SapphireStyleProps,\n} from '@danske/sapphire-react';\n\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface TypographyHeadingProps\n extends DOMProps,\n TextStyleProps,\n SapphireStyleProps {\n children: React.ReactNode;\n /**\n * The level of the heading.\n */\n level: HeadingLevel;\n elementType?: `h${HeadingLevel}`;\n /**\n * @deprecated 'alternative' variant will not be a part of the new CVI\n */\n fontVariant?: 'default' | 'alternative';\n}\n\nexport const Heading = forwardRef(function Heading(\n props: TypographyHeadingProps,\n ref: ForwardedRef<HTMLHeadingElement>\n) {\n useThemeCheck();\n\n const domProps = filterDOMProps(props);\n const { children, level, elementType, ...otherProps } = props;\n const { styleProps } = useTextStyleProps(otherProps);\n const HeadingTag = elementType ? elementType : (`h${level}` as ElementType);\n\n return (\n <HeadingTag\n {...domProps}\n {...styleProps}\n className={clsx(\n styles['sapphire-text'],\n styles[`sapphire-text--heading-${level}` as const],\n styleProps.className,\n {\n [styles['sapphire-text--heading-alternative']]:\n props.fontVariant === 'alternative',\n }\n )}\n ref={ref}\n >\n {children}\n </HeadingTag>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAM,OAAU,GAAA,UAAA,CAAW,SAChC,QAAA,CAAA,KAAA,EACA,GACA,EAAA;AACA,EAAA,aAAA,EAAA,CAAA;AAEA,EAAA,MAAM,WAAW,cAAe,CAAA,KAAA,CAAA,CAAA;AAChC,EAAwD,MAAA,EAAA,GAAA,KAAA,EAAhD,YAAU,KAAO,EAAA,WAAA,EAAA,GAA+B,IAAf,UAAe,GAAA,SAAA,CAAA,EAAA,EAAf,CAAjC,UAAA,EAAU,OAAO,EAAA,aAAA,CAAA,CAAA,CAAA;AACzB,EAAM,MAAA,EAAE,eAAe,iBAAkB,CAAA,UAAA,CAAA,CAAA;AACzC,EAAM,MAAA,UAAA,GAAa,WAAc,GAAA,WAAA,GAAe,CAAI,CAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEpD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAD,aACM,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAA,QAAA,CAAA,EACA,UAFN,CAAA,EAAA;AAAA,IAGE,SAAA,EAAW,KACT,MAAO,CAAA,eAAA,CAAA,EACP,OAAO,CAA0B,uBAAA,EAAA,KAAA,CAAA,CAAA,CAAA,EACjC,WAAW,SACX,EAAA;AAAA,MACG,CAAA,MAAA,CAAO,oCACN,CAAA,GAAA,KAAA,CAAM,WAAgB,KAAA,aAAA;AAAA,KAAA,CAAA;AAAA,IAG5B,GAAA;AAAA,GAEC,CAAA,EAAA,QAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
package/build/index.d.ts CHANGED
@@ -613,6 +613,9 @@ interface TypographyHeadingProps extends DOMProps, TextStyleProps, SapphireStyle
613
613
  */
614
614
  level: HeadingLevel;
615
615
  elementType?: `h${HeadingLevel}`;
616
+ /**
617
+ * @deprecated 'alternative' variant will not be a part of the new CVI
618
+ */
616
619
  fontVariant?: 'default' | 'alternative';
617
620
  }
618
621
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danske/sapphire-react-lab",
3
- "version": "0.88.0",
3
+ "version": "0.88.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Experimental React components of the Sapphire Design System from Danske Bank A/S",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  "cross-env": "^7.0.3"
37
37
  },
38
38
  "dependencies": {
39
- "@danske/sapphire-css": "^32.1.0",
39
+ "@danske/sapphire-css": "^32.1.1",
40
40
  "@internationalized/date": "^3.5.5",
41
41
  "@internationalized/string": "^3.2.3",
42
42
  "@react-aria/accordion": "^3.0.0-alpha.31",
@@ -74,5 +74,5 @@
74
74
  "clsx": "^1.1.1",
75
75
  "react-transition-group": "^4.4.5"
76
76
  },
77
- "gitHead": "d07b03faa800429f6bf0e28d47ac8accec8e9755"
77
+ "gitHead": "96f9ae692dc2cdc75d36dd92943cdf70a2b39b4c"
78
78
  }