diff --git a/.changeset/nice-moons-watch.md b/.changeset/nice-moons-watch.md new file mode 100644 index 000000000..fe03d2c25 --- /dev/null +++ b/.changeset/nice-moons-watch.md @@ -0,0 +1,5 @@ +--- +"@cloudoperators/juno-ui-components": minor +--- + +Migrate NativeSelect, NativeSelectionOption and NativeSelectOptionGroup components to TypeScript diff --git a/.changeset/shaggy-pots-repeat.md b/.changeset/shaggy-pots-repeat.md new file mode 100644 index 000000000..e1c0496ce --- /dev/null +++ b/.changeset/shaggy-pots-repeat.md @@ -0,0 +1,5 @@ +--- +"@cloudoperators/juno-ui-components": minor +--- + +Migrate Form, FormRow and FormSection components to TypeScript diff --git a/packages/ui-components/src/components/FilterInput/FilterInput.component.js b/packages/ui-components/src/components/FilterInput/FilterInput.component.js index 69fd626d1..4a748642d 100644 --- a/packages/ui-components/src/components/FilterInput/FilterInput.component.js +++ b/packages/ui-components/src/components/FilterInput/FilterInput.component.js @@ -5,8 +5,8 @@ import React, { useState, useEffect } from "react" import PropTypes from "prop-types" -import { NativeSelect } from "../NativeSelect/NativeSelect.component" -import { NativeSelectOption } from "../NativeSelectOption/NativeSelectOption.component" +import { NativeSelect } from "../../deprecated_js/NativeSelect/NativeSelect.component" +import { NativeSelectOption } from "../../deprecated_js/NativeSelectOption/NativeSelectOption.component" import { TextInput } from "../../deprecated_js/TextInput/TextInput.component" import { Icon } from "../../deprecated_js/Icon/Icon.component" diff --git a/packages/ui-components/src/components/Form/Form.component.js b/packages/ui-components/src/components/Form/Form.component.js deleted file mode 100644 index e85a6f8b3..000000000 --- a/packages/ui-components/src/components/Form/Form.component.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from "react" -import PropTypes from "prop-types" - -const formStyles = ` - jn-mb-8 -` - -const formHeading = ` - jn-text-2xl - jn-font-bold - jn-mb-4 -` - -/** A Form to hold FormSections and/or FormGroups with an optional title. */ -export const Form = ({ title = null, className = "", children = null, ...props }) => { - return ( -
- ) -} - -Form.propTypes = { - /** Title to be rendered in the Form`. */ - title: PropTypes.string, - /** Custom className */ - className: PropTypes.string, - /** Children to render in the form */ - children: PropTypes.node, -} diff --git a/packages/ui-components/src/components/Form/Form.component.tsx b/packages/ui-components/src/components/Form/Form.component.tsx new file mode 100644 index 000000000..422f037c0 --- /dev/null +++ b/packages/ui-components/src/components/Form/Form.component.tsx @@ -0,0 +1,47 @@ +/* + * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React, { ReactNode, FormHTMLAttributes } from "react" + +const formBaseStyles = ` + jn-mb-8 +` + +const formTitleStyles = ` + jn-text-2xl + jn-font-bold + jn-mb-4 +` + +export interface FormProps extends FormHTMLAttributes