Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade babel runtime to latest #2503

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/dnb-design-system-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"react-live-ssr": "workspace:*"
},
"devDependencies": {
"@babel/core": "7.16.0",
"@babel/core": "7.22.5",
"@babel/eslint-parser": "7.18.2",
"@babel/node": "7.16.0",
"@babel/node": "7.22.5",
"@emotion/cache": "11.9.3",
"@typescript-eslint/parser": "5.60.0",
"babel-jest": "29.3.1",
"babel-jest": "29.5.0",
"camelcase": "6.2.0",
"cross-env": "7.0.3",
"current-git-branch": "1.1.0",
Expand Down
42 changes: 21 additions & 21 deletions packages/dnb-eufemia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
],
"typings": "./index.d.ts",
"dependencies": {
"@babel/runtime": "7.16.3",
"@babel/runtime": "7.22.5",
"classnames": "2.3.1",
"core-js": "3.26.1",
"date-fns": "2.25.0",
Expand All @@ -115,25 +115,25 @@
"react-dom": "^17"
},
"devDependencies": {
"@babel/cli": "7.16.0",
"@babel/core": "7.16.0",
"@babel/eslint-parser": "7.18.2",
"@babel/node": "7.16.0",
"@babel/parser": "7.16.3",
"@babel/plugin-proposal-class-properties": "7.16.0",
"@babel/plugin-proposal-export-default-from": "7.16.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.0",
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
"@babel/plugin-proposal-optional-chaining": "7.16.0",
"@babel/cli": "7.22.5",
"@babel/core": "7.22.5",
"@babel/eslint-parser": "7.22.5",
"@babel/node": "7.22.5",
"@babel/parser": "7.22.5",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-export-default-from": "7.22.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-typescript": "7.16.0",
"@babel/plugin-transform-modules-commonjs": "7.16.0",
"@babel/plugin-transform-react-constant-elements": "7.16.0",
"@babel/plugin-transform-runtime": "7.16.0",
"@babel/preset-env": "7.16.0",
"@babel/preset-react": "7.16.0",
"@babel/preset-typescript": "7.16.0",
"@babel/traverse": "7.16.3",
"@babel/plugin-syntax-typescript": "7.22.5",
"@babel/plugin-transform-modules-commonjs": "7.22.5",
"@babel/plugin-transform-react-constant-elements": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
"@babel/preset-react": "7.22.5",
"@babel/preset-typescript": "7.22.5",
"@babel/traverse": "7.22.5",
"@emotion/react": "11.9.3",
"@emotion/styled": "11.9.3",
"@reach/router": "1.3.4",
Expand Down Expand Up @@ -166,9 +166,9 @@
"@typescript-eslint/eslint-plugin": "5.60.0",
"@typescript-eslint/parser": "5.60.0",
"audit-ci": "5.1.2",
"babel-jest": "29.3.1",
"babel-jest": "29.5.0",
"babel-plugin-optimize-clsx": "2.6.2",
"babel-plugin-search-and-replace": "1.1.0",
"babel-plugin-search-and-replace": "1.1.1",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserslist": "4.21.4",
"camelcase": "6.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`babelPluginCorrectTypes has to match snapshot 1`] = `
* Test mock file
*
*/

import React from 'react';
import { PropTypes } from "react";
import SecondaryComponent, { secondaryDefaultProps, secondaryPropTypes } from './SecondaryComponent';
Expand All @@ -26,7 +27,6 @@ export default class PrimaryComponent extends React.PureComponent {
render() {
return [this.props.boolean, this.props.number, this.props.spacing, this.props.top, this.props.secondary_foo, this.props.secondary_spacing, this.props.children];
}

}
PrimaryComponent.propTypes = {
boolean: PropTypes.bool,
Expand Down Expand Up @@ -61,11 +61,9 @@ PrimaryComponent.defaultProps = {
};
PrimaryComponent.Secondary = SecondaryComponent;
PrimaryComponent.SecondaryDuplication = SecondaryComponent;

const Element = () => {
return null;
};

Element.propTypes = {
boolean: PropTypes.bool,
number: PropTypes.number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`babelPluginIncludeDocs has to match code snapshot 1`] = `
* Test mock file
*
*/

import React from 'react';
import { PropTypes } from "react";
import SecondaryComponent, { secondaryDefaultProps, secondaryPropTypes } from './SecondaryComponent';
Expand All @@ -26,7 +27,6 @@ export default class PrimaryComponent extends React.PureComponent {
render() {
return [this.props.boolean, this.props.number, this.props.spacing, this.props.top, this.props.secondary_foo, this.props.secondary_spacing, this.props.children];
}

}
PrimaryComponent.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
Expand Down Expand Up @@ -61,11 +61,9 @@ PrimaryComponent.defaultProps = {
};
PrimaryComponent.Secondary = SecondaryComponent;
PrimaryComponent.SecondaryDuplication = SecondaryComponent;

const Element = () => {
return null;
};

Element.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
number: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
Expand Down Expand Up @@ -101,6 +99,7 @@ exports[`babelPluginIncludeDocs has to match code snapshot in strict mode 1`] =
* Test mock file
*
*/

import React from 'react';
import { PropTypes } from "react";
import SecondaryComponent, { secondaryDefaultProps, secondaryPropTypes } from './SecondaryComponent';
Expand All @@ -122,7 +121,6 @@ export default class PrimaryComponent extends React.PureComponent {
render() {
return [this.props.boolean, this.props.number, this.props.spacing, this.props.top, this.props.secondary_foo, this.props.secondary_spacing, this.props.children];
}

}
PrimaryComponent.propTypes = {
boolean: PropTypes.bool,
Expand Down Expand Up @@ -157,11 +155,9 @@ PrimaryComponent.defaultProps = {
};
PrimaryComponent.Secondary = SecondaryComponent;
PrimaryComponent.SecondaryDuplication = SecondaryComponent;

const Element = () => {
return null;
};

Element.propTypes = {
boolean: PropTypes.bool,
number: PropTypes.number,
Expand Down Expand Up @@ -197,6 +193,7 @@ exports[`babelPluginIncludeDocs has to match collectProps snapshot given by onCo
* Test mock file
*
*/

import React from 'react';
import { PropTypes } from "react";
import SecondaryComponent, { secondaryDefaultProps, secondaryPropTypes } from './SecondaryComponent';
Expand All @@ -218,7 +215,6 @@ export default class PrimaryComponent extends React.PureComponent {
render() {
return [this.props.boolean, this.props.number, this.props.spacing, this.props.top, this.props.secondary_foo, this.props.secondary_spacing, this.props.children];
}

}
PrimaryComponent.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
Expand Down Expand Up @@ -253,11 +249,9 @@ PrimaryComponent.defaultProps = {
};
PrimaryComponent.Secondary = SecondaryComponent;
PrimaryComponent.SecondaryDuplication = SecondaryComponent;

const Element = () => {
return null;
};

Element.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
number: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`babelPluginPropTypesRelations has to match snapshot 1`] = `
* Test mock file
*
*/

import React from 'react';
import PropTypes from 'prop-types';
import SecondaryComponent, { secondaryDefaultProps, secondaryPropTypes } from './SecondaryComponent';
Expand All @@ -26,7 +27,6 @@ export default class PrimaryComponent extends React.PureComponent {
render() {
return [this.props.boolean, this.props.number, this.props.spacing, this.props.top, this.props.secondary_foo, this.props.secondary_spacing, this.props.children];
}

}
PrimaryComponent.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
Expand Down Expand Up @@ -61,11 +61,9 @@ PrimaryComponent.defaultProps = {
};
PrimaryComponent.Secondary = SecondaryComponent;
PrimaryComponent.SecondaryDuplication = SecondaryComponent;

const Element = () => {
return null;
};

Element.propTypes = {
boolean: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
number: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
Expand Down
26 changes: 0 additions & 26 deletions packages/dnb-eufemia/src/components/accordion/Accordion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type AccordionIcon =
| IconIcon
| {
closed?: React.ReactNode | ((...args: any[]) => any);

/**
* If set to `true` the accordion will be expanded as its initial state.
*/
Expand All @@ -30,108 +29,87 @@ export interface AccordionProps
*/
title?: React.ReactNode;
description?: React.ReactNode;

/**
* If set to `true` the accordion will be expanded as its initial state.
*/
expanded?: boolean;

/**
* If set to `true`, the open and close animation will be omitted.
*/
no_animation?: boolean;

/**
* If set to `true` the accordion will be expanded during SSR. Can be potentially useful for SEO, although it will disturb client hydration, where React expects the same state. But that's mainly a technical aspect to consider.
*/
expanded_ssr?: boolean;

/**
* If set to `true` the content will be present, even the accordion is not expanded. Can be useful for assistive technology or SEO.
*/
prerender?: boolean;

/**
* If set to `true` the accordion component will not re-render its content – can be useful for widgets you don't have control of storing the temporary state during an interaction.
*/
prevent_rerender?: boolean;

/**
* Use this prop together with `prevent_rerender` – and if it is to `true`, the accordion component will re-render if the children are a new React element and does not match the previous one anymore.
*/
prevent_rerender_conditional?: boolean;

/**
* If set to `true`, it will remember a changed state initiated by the user. It requires a unique `id`. It will store the sate in the local storage.
*/
remember_state?: boolean;

/**
* Send along a custom React Ref for `.dnb-accordion__content`.
*/
contentRef?: Record<string, unknown>;

/**
* If set to `true`, the saved (remembered) will be removed and the initial component state will be used and set.
*/
flush_remembered_state?: boolean;

/**
* If set to `true`, a group of accordions will be wrapped to sidebar looking menu for medium and larger screens.
*/
single_container?: boolean;

/**
* Defines the used styling. As of now, only `outlined` is available. Use `plain` for no styles. It defaults to `outlined`.
*/
variant?: AccordionVariant;

/**
* Will add a React element on the left side of the `title`, inside `AccordionHeaderContainer`.
*/
left_component?: React.ReactNode;

/**
* If set to `true`, the accordion button will be disabled (dimmed).
*/
disabled?: boolean;

/**
* If set to `true`, an overlaying skeleton with animation will be shown.
*/
skeleton?: SkeletonShow;

/**
* A unique `id` that will be used on the button element. If you use `remember_state`, an id is required.
*/
id?: string;
group?: string;

/**
* Gives you the option to replace the used `button` element. Provide a React element, including a string (HTML element). Defaults to a `div` with all the needed accessibility features included.
*/
element?: React.ReactNode;

/**
* If set to `true`, level 2 (h2) will be used. You can provide your own HTML heading (`h3`), or provide a `heading_level` property.
*/
heading?: AccordionHeading;

/**
* If `heading` is set to `true`, you can provide a numeric value to define a different heading level. Defaults to `2`.
*/
heading_level?: HeadingLevel;

/**
* Will replace the `chevron` icon. The icon will still rotate (by CSS). You can use an object to use two different icons, one for the closed state and one for the expanded state `{ closed, expanded }`.
*/
icon?: AccordionIcon;

/**
* Will set the placement of the icon. Defaults to `left`.
*/
icon_position?: AccordionIconPosition;

/**
* Define a different icon size. Defaults to `medium` (1.5rem).
*/
Expand All @@ -140,16 +118,13 @@ export interface AccordionProps
class?: string;
className?: string;
children?: React.ReactNode;

/**
* Will be called by user click interaction. Returns an object with a boolean state `expanded` inside `{ expanded, id, event, ...event }`.
*/
on_change?: (...args: any[]) => any;
on_state_update?: (...args: any[]) => any;
}

const StoreInstance = (group: string, id?: string) => new Store(group, id);

export default class Accordion extends React.Component<
AccordionProps,
any
Expand All @@ -166,7 +141,6 @@ export type GroupProps = {
allow_close_all?: boolean;
expanded_id?: string;
} & AccordionProps;

declare class Group extends React.Component<GroupProps, any> {
static defaultProps: object;
static Store: StoreInstance;
Expand Down
Loading