@bonprix-ds/react-search-field 1.0.1 → 1.0.3

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,32 +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
- /** Callback that is triggered when the search button is clicked. */
7
- onSearch: () => void;
8
- /** Reference to the input element. */
9
- inputRef?: RefObject<HTMLInputElement>;
10
- }
11
-
12
- declare interface ControlledInputProps extends BaseProps {
13
- /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
14
- value: string;
15
- defaultValue?: never;
16
- /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */
17
- onChange: (value: string) => void;
18
- }
19
-
20
- declare const SearchField: ({ onSearch, ...props }: SearchFieldProps) => default_2.JSX.Element;
21
- export default SearchField;
22
-
23
- export declare type SearchFieldProps = ControlledInputProps | UncontrolledInputProps;
24
-
25
- declare interface UncontrolledInputProps extends BaseProps {
26
- value?: never;
27
- /** The default value of the input field. Should be used when the input is uncontrolled. */
28
- defaultValue: string;
29
- onChange?: (value: string) => void;
30
- }
31
-
32
- export { }
1
+ export { default } from "./src/SearchField";
2
+ export type { Props as SearchFieldProps } from "./src/SearchField";
@@ -0,0 +1,24 @@
1
+ import React, { RefObject } from "react";
2
+ import type { TextFieldBaseProps } from "@bonprix-ds/react-text-field";
3
+ interface BaseProps extends TextFieldBaseProps {
4
+ /** Callback that is triggered when the search button is clicked. */
5
+ onSearch: () => void;
6
+ /** Reference to the input element. */
7
+ inputRef?: RefObject<HTMLInputElement>;
8
+ }
9
+ interface ControlledInputProps extends BaseProps {
10
+ /** The current value of the input field. Should be used in conjunction with `onChange`, when controlling the input. Should be `undefined` otherwise. */
11
+ value: string;
12
+ defaultValue?: never;
13
+ /** Callback that is triggered when the input value changes. Should be used in conjunction with `value`, when controlling the input. Optional otherwise. */
14
+ onChange: (value: string) => void;
15
+ }
16
+ interface UncontrolledInputProps extends BaseProps {
17
+ value?: never;
18
+ /** The default value of the input field. Should be used when the input is uncontrolled. */
19
+ defaultValue: string;
20
+ onChange?: (value: string) => void;
21
+ }
22
+ export type Props = ControlledInputProps | UncontrolledInputProps;
23
+ declare const SearchField: ({ onSearch, ...props }: Props) => React.JSX.Element;
24
+ export default SearchField;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import e from "@bonprix-ds/react-base-input-field";
3
2
  import "react";
3
+ import e from "@bonprix-ds/react-base-input-field";
4
4
  import { jsx as t } from "react/jsx-runtime";
5
5
  //#region src/SearchField.tsx
6
6
  var n = ({ onSearch: n, ...r }) => /* @__PURE__ */ t(e, {
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.js","names":[],"sources":["../../src/SearchField.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 } from \"react\";\n\ninterface BaseProps extends TextFieldBaseProps {\n /** Callback that is triggered when the search button is clicked. */\n onSearch: () => void;\n /** Reference to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n}\n\ninterface ControlledInputProps extends 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 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\ninterface UncontrolledInputProps extends BaseProps {\n value?: never;\n /** The default value of the input field. Should be used when the input is uncontrolled. */\n defaultValue: string;\n onChange?: (value: string) => void;\n}\n\nexport type Props = ControlledInputProps | UncontrolledInputProps;\n\nconst SearchField = ({ onSearch, ...props }: Props) => {\n const iconButtonLabel = \"Suchen\";\n return (\n <BaseInputField\n {...props}\n type=\"text\"\n buttonIcon=\"search\"\n iconButtonType=\"submit\"\n iconButtonLabel={iconButtonLabel}\n onIconButtonClick={onSearch}\n componentName=\"search-field\"\n />\n );\n};\nexport default SearchField;\n"],"mappings":";;;;;AA8BA,IAAM,KAAe,EAAE,aAAU,GAAG,QAGhC,kBAAC,GAAD;CACE,GAAI;CACJ,MAAK;CACL,YAAW;CACX,gBAAe;CACE;CACjB,mBAAmB;CACnB,eAAc;AACf,CAAA"}
1
+ {"version":3,"file":"SearchField.js","names":["BaseInputField","SearchField","props","onSearch"],"sources":["../../src/SearchField.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { RefObject } 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 /** Callback that is triggered when the search button is clicked. */\n onSearch: () => void;\n /** Reference to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n}\n\ninterface ControlledInputProps extends 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 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\ninterface UncontrolledInputProps extends BaseProps {\n value?: never;\n /** The default value of the input field. Should be used when the input is uncontrolled. */\n defaultValue: string;\n onChange?: (value: string) => void;\n}\n\nexport type Props = ControlledInputProps | UncontrolledInputProps;\n\nconst SearchField = ({ onSearch, ...props }: Props) => {\n const iconButtonLabel = \"Suchen\";\n return (\n <BaseInputField\n {...props}\n type=\"text\"\n buttonIcon=\"search\"\n iconButtonType=\"submit\"\n iconButtonLabel={iconButtonLabel}\n onIconButtonClick={onSearch}\n componentName=\"search-field\"\n />\n );\n};\nexport default SearchField;\n"],"mappings":";;;;;AA+BA,IAAMC,KAAe,EAAE,aAAU,GAAGC,QAGhC,kBAACF,GAAD;CACE,GAAIE;CACJ,MAAK;CACL,YAAW;CACX,gBAAe;CACE;CACjB,mBAAmBC;CACnB,eAAc;AACf,CAAA"}
package/package.json CHANGED
@@ -1,14 +1,25 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-search-field",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "SearchField 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/search-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,36 +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/search-field"
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": true
30
33
  },
31
34
  "dependencies": {
32
- "@bonprix-ds/react-text-field": "1.0.1",
33
- "@bonprix-ds/react-base-input-field": "1.0.1",
34
- "@bonprix-ds/utils": "0.2.2"
35
+ "@bonprix-ds/react-base-input-field": "1.0.3",
36
+ "@bonprix-ds/react-text-field": "1.1.0",
37
+ "@bonprix-ds/utils": "0.3.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/react": "19.3.0",
41
+ "vite": "8.3.2",
42
+ "@bonprix-ds/vite-config": "0.0.0"
35
43
  },
36
44
  "peerDependencies": {
37
- "react": "^19.0.0",
38
- "react-dom": "^19.0.0",
45
+ "react": "^19",
46
+ "react-dom": "^19",
39
47
  "tailwind-variants": "0.3.1"
40
48
  },
41
- "devDependencies": {
42
- "vite": "8.2.2",
43
- "@types/react": "19.2.18",
44
- "@vitejs/plugin-react": "6.1.1",
45
- "rollup-preserve-directives": "1.1.3",
46
- "unplugin-dts": "1.1.0",
47
- "@microsoft/api-extractor": "7.59.1"
48
- },
49
49
  "scripts": {
50
50
  "build": "vite build"
51
51
  }