@oslokommune/punkt-react 19.18.1 → 19.18.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "19.18.1",
3
+ "version": "19.18.2",
4
4
  "description": "React komponentbibliotek til Punkt, designsystem for Oslo kommune",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo kommune",
@@ -27,6 +27,7 @@
27
27
  "build": "tsc && vite build && node scripts/bundle-shared-types.js",
28
28
  "build-app": "tsc && vite build --config vite.config-app.ts",
29
29
  "check-tree-shaking": "node scripts/check-tree-shaking.mjs",
30
+ "check-browser-support": "node ../../scripts/check-browser-support.mjs dist",
30
31
  "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
31
32
  "lint:fix": "eslint --fix 'src/**/*.{jsx,ts,tsx}'",
32
33
  "format": "prettier --write src//**/*.{ts,tsx,css} --config ./.prettierrc",
@@ -102,5 +103,5 @@
102
103
  "url": "https://github.com/oslokommune/punkt/issues"
103
104
  },
104
105
  "license": "MIT",
105
- "gitHead": "7c8508f96a754c830bc794977065f4c162f45240"
106
+ "gitHead": "365dcae5072b21d9508448b2d541932ae7dee859"
106
107
  }
@@ -125,6 +125,7 @@ export function useComboboxState(props: IPktCombobox, ref: React.ForwardedRef<HT
125
125
  // Parse <option> children into options
126
126
  const optionsFromChildren = useMemo(() => {
127
127
  const result: IPktComboboxOption[] = []
128
+ // eslint-disable-next-line @eslint-react/no-children-for-each
128
129
  Children.forEach(children, (child) => {
129
130
  if (isValidElement(child) && child.type === 'option') {
130
131
  const childProps = child.props as {
@@ -7,9 +7,7 @@ import { useGeneratedId } from '../../hooks/useGeneratedId'
7
7
  import { usePktStrings } from '../../hooks/usePktStrings'
8
8
  import { formatString } from 'shared-strings'
9
9
  import { counterStatusId, isCounterExceeded } from 'shared-utils/forms/described-by'
10
- import { uuidish } from 'shared-utils/utils'
11
10
  import { INPUT_WRAPPER_DEFAULTS, type IPktInputWrapperBase } from 'shared-types'
12
- import type { TLayout } from 'shared-types'
13
11
 
14
12
  import { PktAlert } from '../alert/Alert'
15
13
  import { PktHelptext } from '../helptext/Helptext'
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
 
3
3
  import classNames from 'classnames'
4
- import { createRef, FC, HTMLAttributes, ReactNode, useCallback, useState } from 'react'
4
+ import { FC, HTMLAttributes, ReactNode, useCallback, useState } from 'react'
5
5
  import type { IPktStringsProps } from 'shared-strings'
6
6
  import { MESSAGEBOX_DEFAULTS, type IPktMessageboxBase, type TMessageboxSkin } from 'shared-types'
7
7
 
@@ -41,8 +41,6 @@ export const PktMessagebox: FC<IPktMessagebox> = ({
41
41
  'pkt-hide': closed,
42
42
  }
43
43
 
44
- const componentRootRef = createRef<HTMLDivElement>()
45
-
46
44
  const close = useCallback(() => {
47
45
  setClosed(true)
48
46
  if (onClose) {
@@ -51,7 +49,7 @@ export const PktMessagebox: FC<IPktMessagebox> = ({
51
49
  }, [setClosed, onClose])
52
50
 
53
51
  return (
54
- <div {...props} className={classNames(classes, className)} ref={componentRootRef}>
52
+ <div {...props} className={classNames(classes, className)}>
55
53
  {closable && (
56
54
  <div className={'pkt-messagebox__close'}>
57
55
  <button
@@ -53,8 +53,10 @@ export const PktStepper = forwardRef(
53
53
  orientation === 'horizontal' ? 'pkt-stepper--horizontal' : 'pkt-stepper--vertical',
54
54
  )
55
55
 
56
+ // eslint-disable-next-line @eslint-react/no-children-map
56
57
  const childrenWithProps = Children.map(children, (child, index) => {
57
58
  if (isValidElement(child)) {
59
+ // eslint-disable-next-line @eslint-react/no-clone-element
58
60
  return cloneElement(child, {
59
61
  className: classNames(child.props.className, {
60
62
  'pkt-step--hideStep': hideNonActiveSteps && index !== activeStep,
@@ -80,6 +80,7 @@ export const PktTabs = forwardRef(
80
80
  const useArrowNav = arrowNav && !disableArrowNav
81
81
 
82
82
  // Determine if we're using children or tabs array
83
+ // eslint-disable-next-line @eslint-react/no-children-to-array
83
84
  const childItems = Children.toArray(children)
84
85
  const hasChildren = childItems.length > 0
85
86
  const tabCount = hasChildren ? childItems.length : tabs?.length || 0