@bonprix-ds/react-password-field 1.0.0 → 1.0.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/dist/index.d.ts CHANGED
@@ -1,30 +1,2 @@
1
- import { default as default_2 } from 'react';
2
- import { RefObject } from 'react';
3
- import { TextFieldBaseProps } from '@bonprix-ds/react-text-field';
4
-
5
- declare interface BaseProps extends TextFieldBaseProps {
6
- /** Reference to the input element. */
7
- inputRef?: RefObject<HTMLInputElement>;
8
- }
9
-
10
- declare type ControlledInputProps = BaseProps & {
11
- /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
12
- value: string;
13
- /** The default value of the input field. Should be used when the input is uncontrolled. */
14
- defaultValue?: never;
15
- /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */
16
- onChange: (value: string) => void;
17
- };
18
-
19
- declare const PasswordField: (props: PasswordFieldProps) => default_2.JSX.Element;
20
- export default PasswordField;
21
-
22
- export declare type PasswordFieldProps = ControlledInputProps | UncontrolledInputProps;
23
-
24
- declare type UncontrolledInputProps = BaseProps & {
25
- value?: never;
26
- defaultValue: string;
27
- onChange?: (value: string) => void;
28
- };
29
-
30
- export { }
1
+ export { default } from "./src/PasswordField";
2
+ export type { Props as PasswordFieldProps } from "./src/PasswordField";
@@ -0,0 +1,22 @@
1
+ import React, { RefObject } from "react";
2
+ import type { TextFieldBaseProps } from "@bonprix-ds/react-text-field";
3
+ interface BaseProps extends TextFieldBaseProps {
4
+ /** Reference to the input element. */
5
+ inputRef?: RefObject<HTMLInputElement>;
6
+ }
7
+ type ControlledInputProps = BaseProps & {
8
+ /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
9
+ value: string;
10
+ /** The default value of the input field. Should be used when the input is uncontrolled. */
11
+ defaultValue?: never;
12
+ /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */
13
+ onChange: (value: string) => void;
14
+ };
15
+ type UncontrolledInputProps = BaseProps & {
16
+ value?: never;
17
+ defaultValue: string;
18
+ onChange?: (value: string) => void;
19
+ };
20
+ export type Props = ControlledInputProps | UncontrolledInputProps;
21
+ declare const PasswordField: (props: Props) => React.JSX.Element;
22
+ export default PasswordField;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import e from "@bonprix-ds/react-base-input-field";
3
- import { useState as t } from "react";
2
+ import { useState as e } from "react";
3
+ import t from "@bonprix-ds/react-base-input-field";
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  //#region src/PasswordField.tsx
6
6
  var r = (r) => {
7
- let [i, a] = t("password");
8
- return /* @__PURE__ */ n(e, {
7
+ let [i, a] = e("password");
8
+ return /* @__PURE__ */ n(t, {
9
9
  type: i,
10
10
  buttonIcon: i === "password" ? "visibility" : "visibility-off",
11
11
  onIconButtonClick: () => a((e) => e === "password" ? "text" : "password"),
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","names":[],"sources":["../../src/PasswordField.tsx"],"sourcesContent":["\"use client\";\n\nimport BaseInputField from \"@bonprix-ds/react-base-input-field\";\nimport type { TextFieldBaseProps } from \"@bonprix-ds/react-text-field\";\nimport React, { RefObject, useState } from \"react\";\n\ninterface BaseProps extends TextFieldBaseProps {\n /** Reference to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n}\n\ntype ControlledInputProps = BaseProps & {\n /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */\n value: string;\n /** The default value of the input field. Should be used when the input is uncontrolled. */\n defaultValue?: never;\n /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */\n onChange: (value: string) => void;\n};\n\ntype UncontrolledInputProps = BaseProps & {\n value?: never;\n defaultValue: string;\n onChange?: (value: string) => void;\n};\n\nexport type Props = ControlledInputProps | UncontrolledInputProps;\n\nconst PasswordField = (props: Props) => {\n const [type, setType] = useState<\"password\" | \"text\">(\"password\");\n\n const onVisibilityChange = () => setType((prev) => (prev === \"password\" ? \"text\" : \"password\"));\n const inputIcon = type === \"password\" ? \"visibility\" : \"visibility-off\";\n const iconButtonLabel = type === \"password\" ? \"Passwort anzeigen\" : \"Passwort verstecken\";\n\n return (\n <BaseInputField\n type={type}\n buttonIcon={inputIcon}\n onIconButtonClick={onVisibilityChange}\n iconButtonLabel={iconButtonLabel}\n hideClear\n {...props}\n componentName=\"password-field\"\n />\n );\n};\nexport default PasswordField;\n"],"mappings":";;;;;AA4BA,IAAM,KAAiB,MAAiB;CACtC,IAAM,CAAC,GAAM,KAAW,EAA8B,UAAU;CAMhE,OACE,kBAAC,GAAD;EACQ;EACN,YANc,MAAS,aAAa,eAAe;EAOnD,yBAR6B,GAAS,MAAU,MAAS,aAAa,SAAS,UAAW;EASzE,iBAPG,MAAS,aAAa,sBAAsB;EAQhE,WAAA;EACA,GAAI;EACJ,eAAc;CACf,CAAA;AAEL"}
1
+ {"version":3,"file":"PasswordField.js","names":[],"sources":["../../src/PasswordField.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { RefObject, useState } from \"react\";\n\nimport BaseInputField from \"@bonprix-ds/react-base-input-field\";\nimport type { TextFieldBaseProps } from \"@bonprix-ds/react-text-field\";\n\ninterface BaseProps extends TextFieldBaseProps {\n /** Reference to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n}\n\ntype ControlledInputProps = BaseProps & {\n /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */\n value: string;\n /** The default value of the input field. Should be used when the input is uncontrolled. */\n defaultValue?: never;\n /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */\n onChange: (value: string) => void;\n};\n\ntype UncontrolledInputProps = BaseProps & {\n value?: never;\n defaultValue: string;\n onChange?: (value: string) => void;\n};\n\nexport type Props = ControlledInputProps | UncontrolledInputProps;\n\nconst PasswordField = (props: Props) => {\n const [type, setType] = useState<\"password\" | \"text\">(\"password\");\n\n const onVisibilityChange = () => setType((prev) => (prev === \"password\" ? \"text\" : \"password\"));\n const inputIcon = type === \"password\" ? \"visibility\" : \"visibility-off\";\n const iconButtonLabel = type === \"password\" ? \"Passwort anzeigen\" : \"Passwort verstecken\";\n\n return (\n <BaseInputField\n type={type}\n buttonIcon={inputIcon}\n onIconButtonClick={onVisibilityChange}\n iconButtonLabel={iconButtonLabel}\n hideClear\n {...props}\n componentName=\"password-field\"\n />\n );\n};\nexport default PasswordField;\n"],"mappings":";;;;;AA6BA,IAAM,KAAiB,MAAiB;CACtC,IAAM,CAAC,GAAM,KAAW,EAA8B,UAAU;CAMhE,OACE,kBAAC,GAAD;EACQ;EACN,YANc,MAAS,aAAa,eAAe;EAOnD,yBAR6B,GAAS,MAAU,MAAS,aAAa,SAAS,UAAW;EASzE,iBAPG,MAAS,aAAa,sBAAsB;EAQhE,WAAA;EACA,GAAI;EACJ,eAAc;CACf,CAAA;AAEL"}
package/package.json CHANGED
@@ -1,14 +1,25 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-password-field",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "PasswordField component, implemented in React, for the Bonprix Design System.",
5
- "type": "module",
6
- "publishConfig": {
7
- "access": "public",
8
- "provenance": true
5
+ "keywords": [],
6
+ "license": "UNLICENSED",
7
+ "author": "",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/bonprix/design-system.git",
11
+ "directory": "packages/react/password-field"
9
12
  },
10
- "module": "./dist/index.js",
13
+ "files": [
14
+ "dist",
15
+ "!dist/tsconfig.tsbuildinfo",
16
+ "!dist/vite.config.d.ts",
17
+ "!dist/**/*.test.d.ts"
18
+ ],
19
+ "type": "module",
11
20
  "sideEffects": false,
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
12
23
  "exports": {
13
24
  ".": {
14
25
  "import": "./dist/index.js",
@@ -16,35 +27,25 @@
16
27
  "default": "./dist/index.js"
17
28
  }
18
29
  },
19
- "types": "./dist/index.d.ts",
20
- "files": [
21
- "dist"
22
- ],
23
- "keywords": [],
24
- "author": "",
25
- "license": "UNLICENSED",
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/bonprix/design-system.git",
29
- "directory": "packages/react/password-field"
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": true
30
33
  },
31
34
  "dependencies": {
32
- "@bonprix-ds/react-base-input-field": "1.0.0",
33
- "@bonprix-ds/react-text-field": "1.0.0",
34
- "@bonprix-ds/utils": "0.2.1"
35
- },
36
- "peerDependencies": {
37
- "react": "^19.0.0",
38
- "react-dom": "^19.0.0",
39
- "tailwind-variants": "0.3.1"
35
+ "@bonprix-ds/react-base-input-field": "1.0.2",
36
+ "@bonprix-ds/react-text-field": "1.0.2",
37
+ "@bonprix-ds/utils": "0.2.2"
40
38
  },
41
39
  "devDependencies": {
42
- "vite": "8.2.2",
43
- "@types/react": "19.2.18",
40
+ "@types/react": "19.3.0",
44
41
  "@vitejs/plugin-react": "6.1.1",
45
42
  "rollup-preserve-directives": "1.1.3",
46
- "unplugin-dts": "1.0.3",
47
- "@microsoft/api-extractor": "7.59.0"
43
+ "vite": "8.3.0"
44
+ },
45
+ "peerDependencies": {
46
+ "react": "^19.3.0",
47
+ "react-dom": "^19.3.0",
48
+ "tailwind-variants": "0.3.1"
48
49
  },
49
50
  "scripts": {
50
51
  "build": "vite build"