@bbl-digital/snorre 2.2.48 → 2.2.49

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/bundle.js CHANGED
@@ -25472,6 +25472,8 @@
25472
25472
  text = 'Last opp fil',
25473
25473
  initialFiles = [],
25474
25474
  width = '130px',
25475
+ hideFileList,
25476
+ icon = /*#__PURE__*/jsxRuntime.jsx(IconAttachment$1, {}),
25475
25477
  onChange
25476
25478
  }) => {
25477
25479
  const [files, setFiles] = React.useState(initialFiles);
@@ -25521,7 +25523,7 @@
25521
25523
  children: [label && /*#__PURE__*/jsxRuntime.jsx(Label$4, {
25522
25524
  children: label
25523
25525
  }), /*#__PURE__*/jsxRuntime.jsxs(FileWrapper, {
25524
- children: [files.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DocumentList, {
25526
+ children: [files.length > 0 && !hideFileList && /*#__PURE__*/jsxRuntime.jsx(DocumentList, {
25525
25527
  children: files.map((item, index) => /*#__PURE__*/jsxRuntime.jsxs(DocumentWrapper, {
25526
25528
  children: [/*#__PURE__*/jsxRuntime.jsx(Document, {
25527
25529
  theme: theme,
@@ -25545,7 +25547,7 @@
25545
25547
  width: width,
25546
25548
  children: /*#__PURE__*/jsxRuntime.jsxs(ButtonContent, {
25547
25549
  children: [text, /*#__PURE__*/jsxRuntime.jsx(Icon, {
25548
- children: /*#__PURE__*/jsxRuntime.jsx(IconAttachment$1, {})
25550
+ children: icon
25549
25551
  })]
25550
25552
  })
25551
25553
  }), /*#__PURE__*/jsxRuntime.jsx(HiddenInput, {
@@ -14,6 +14,8 @@ const FileInput = ({
14
14
  text = 'Last opp fil',
15
15
  initialFiles = [],
16
16
  width = '130px',
17
+ hideFileList,
18
+ icon = /*#__PURE__*/_jsx(IconAttachment, {}),
17
19
  onChange
18
20
  }) => {
19
21
  const [files, setFiles] = useState(initialFiles);
@@ -63,7 +65,7 @@ const FileInput = ({
63
65
  children: [label && /*#__PURE__*/_jsx(Label, {
64
66
  children: label
65
67
  }), /*#__PURE__*/_jsxs(FileWrapper, {
66
- children: [files.length > 0 && /*#__PURE__*/_jsx(DocumentList, {
68
+ children: [files.length > 0 && !hideFileList && /*#__PURE__*/_jsx(DocumentList, {
67
69
  children: files.map((item, index) => /*#__PURE__*/_jsxs(DocumentWrapper, {
68
70
  children: [/*#__PURE__*/_jsx(Document, {
69
71
  theme: theme,
@@ -87,7 +89,7 @@ const FileInput = ({
87
89
  width: width,
88
90
  children: /*#__PURE__*/_jsxs(ButtonContent, {
89
91
  children: [text, /*#__PURE__*/_jsx(Icon, {
90
- children: /*#__PURE__*/_jsx(IconAttachment, {})
92
+ children: icon
91
93
  })]
92
94
  })
93
95
  }), /*#__PURE__*/_jsx(HiddenInput, {
@@ -11,11 +11,15 @@ interface IProps {
11
11
  /** Custom button text */
12
12
  text?: string;
13
13
  /** Initial files */
14
- initialFiles?: any;
14
+ initialFiles?: File[];
15
15
  /** Button width */
16
16
  width?: string;
17
+ /** Hides file list */
18
+ hideFileList?: boolean;
19
+ /** Hides file list */
20
+ icon?: React.ReactNode;
17
21
  /** Event CB on change, returns object if not multiple is set */
18
- onChange: (files: any) => void;
22
+ onChange: (files: File[] | null) => void;
19
23
  }
20
24
  declare const FileInput: React.FC<IProps>;
21
25
  export default FileInput;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/FileInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAmB/C,UAAU,MAAM;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAkG/B,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/FileInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAmB/C,UAAU,MAAM;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iEAAiE;IACjE,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,KAAK,IAAI,CAAA;CACzC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAkG/B,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -14,6 +14,8 @@ const FileInput = ({
14
14
  text = 'Last opp fil',
15
15
  initialFiles = [],
16
16
  width = '130px',
17
+ hideFileList,
18
+ icon = /*#__PURE__*/_jsx(IconAttachment, {}),
17
19
  onChange
18
20
  }) => {
19
21
  const [files, setFiles] = useState(initialFiles);
@@ -63,7 +65,7 @@ const FileInput = ({
63
65
  children: [label && /*#__PURE__*/_jsx(Label, {
64
66
  children: label
65
67
  }), /*#__PURE__*/_jsxs(FileWrapper, {
66
- children: [files.length > 0 && /*#__PURE__*/_jsx(DocumentList, {
68
+ children: [files.length > 0 && !hideFileList && /*#__PURE__*/_jsx(DocumentList, {
67
69
  children: files.map((item, index) => /*#__PURE__*/_jsxs(DocumentWrapper, {
68
70
  children: [/*#__PURE__*/_jsx(Document, {
69
71
  theme: theme,
@@ -87,7 +89,7 @@ const FileInput = ({
87
89
  width: width,
88
90
  children: /*#__PURE__*/_jsxs(ButtonContent, {
89
91
  children: [text, /*#__PURE__*/_jsx(Icon, {
90
- children: /*#__PURE__*/_jsx(IconAttachment, {})
92
+ children: icon
91
93
  })]
92
94
  })
93
95
  }), /*#__PURE__*/_jsx(HiddenInput, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "2.2.48",
3
+ "version": "2.2.49",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",