@cerberus-design/react 0.7.4-next-1cd5801 → 0.7.4-next-7fa6bfb
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/build/legacy/_tsup-dts-rollup.d.ts +306 -1
- package/build/legacy/{chunk-7CZ3NIGH.js → chunk-3RZUW5KH.js} +10 -10
- package/build/legacy/{chunk-XGNAFSMG.js → chunk-7BB66W4A.js} +2 -2
- package/build/legacy/chunk-7VJOPJVX.js +29 -0
- package/build/legacy/chunk-7VJOPJVX.js.map +1 -0
- package/build/legacy/{chunk-JWQJLOX4.js → chunk-ANXV7JDK.js} +2 -2
- package/build/legacy/chunk-DCI4IKCI.js +63 -0
- package/build/legacy/chunk-DCI4IKCI.js.map +1 -0
- package/build/legacy/{chunk-5GEC53G7.js → chunk-DED42MIR.js} +5 -5
- package/build/legacy/{chunk-C45DY4VE.js → chunk-GIHAFJYX.js} +3 -1
- package/build/legacy/chunk-GIHAFJYX.js.map +1 -0
- package/build/{modern/chunk-CU7HXAKM.js → legacy/chunk-JJGZRBIR.js} +4 -4
- package/build/{modern/chunk-6TXQZ3PB.js → legacy/chunk-OLQQB53X.js} +2 -2
- package/build/legacy/components/Droppable.js +8 -0
- package/build/legacy/components/Droppable.js.map +1 -0
- package/build/legacy/components/FileUploader.js +11 -0
- package/build/legacy/components/FileUploader.js.map +1 -0
- package/build/legacy/components/Input.js +4 -4
- package/build/legacy/components/Label.js +2 -2
- package/build/legacy/components/Toggle.js +3 -3
- package/build/legacy/config/cerbIcons.js +1 -1
- package/build/legacy/config/defineIcons.js +2 -2
- package/build/legacy/context/confirm-modal.js +3 -3
- package/build/legacy/context/prompt-modal.js +6 -6
- package/build/legacy/index.js +41 -30
- package/build/legacy/index.js.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +306 -1
- package/build/modern/chunk-2NSXMFKX.js +62 -0
- package/build/modern/chunk-2NSXMFKX.js.map +1 -0
- package/build/modern/chunk-7VJOPJVX.js +29 -0
- package/build/modern/chunk-7VJOPJVX.js.map +1 -0
- package/build/modern/{chunk-JWQJLOX4.js → chunk-ANXV7JDK.js} +2 -2
- package/build/modern/{chunk-5GEC53G7.js → chunk-DED42MIR.js} +5 -5
- package/build/modern/{chunk-FAXDUWAU.js → chunk-DKHQ5GBY.js} +10 -10
- package/build/modern/{chunk-C45DY4VE.js → chunk-GIHAFJYX.js} +3 -1
- package/build/modern/chunk-GIHAFJYX.js.map +1 -0
- package/build/{legacy/chunk-CU7HXAKM.js → modern/chunk-JJGZRBIR.js} +4 -4
- package/build/{legacy/chunk-6TXQZ3PB.js → modern/chunk-OLQQB53X.js} +2 -2
- package/build/modern/{chunk-TPRGGEVJ.js → chunk-SHNZS357.js} +2 -2
- package/build/modern/components/Droppable.js +8 -0
- package/build/modern/components/Droppable.js.map +1 -0
- package/build/modern/components/FileUploader.js +11 -0
- package/build/modern/components/FileUploader.js.map +1 -0
- package/build/modern/components/Input.js +4 -4
- package/build/modern/components/Label.js +2 -2
- package/build/modern/components/Toggle.js +3 -3
- package/build/modern/config/cerbIcons.js +1 -1
- package/build/modern/config/defineIcons.js +2 -2
- package/build/modern/context/confirm-modal.js +3 -3
- package/build/modern/context/prompt-modal.js +6 -6
- package/build/modern/index.js +41 -30
- package/build/modern/index.js.map +1 -1
- package/package.json +5 -2
- package/src/components/Droppable.tsx +33 -0
- package/src/components/FileUploader.tsx +55 -0
- package/src/config/cerbIcons.ts +3 -0
- package/src/index.ts +6 -0
- package/build/legacy/chunk-C45DY4VE.js.map +0 -1
- package/build/modern/chunk-C45DY4VE.js.map +0 -1
- /package/build/legacy/{chunk-7CZ3NIGH.js.map → chunk-3RZUW5KH.js.map} +0 -0
- /package/build/legacy/{chunk-XGNAFSMG.js.map → chunk-7BB66W4A.js.map} +0 -0
- /package/build/legacy/{chunk-JWQJLOX4.js.map → chunk-ANXV7JDK.js.map} +0 -0
- /package/build/legacy/{chunk-5GEC53G7.js.map → chunk-DED42MIR.js.map} +0 -0
- /package/build/legacy/{chunk-CU7HXAKM.js.map → chunk-JJGZRBIR.js.map} +0 -0
- /package/build/legacy/{chunk-6TXQZ3PB.js.map → chunk-OLQQB53X.js.map} +0 -0
- /package/build/modern/{chunk-JWQJLOX4.js.map → chunk-ANXV7JDK.js.map} +0 -0
- /package/build/modern/{chunk-5GEC53G7.js.map → chunk-DED42MIR.js.map} +0 -0
- /package/build/modern/{chunk-FAXDUWAU.js.map → chunk-DKHQ5GBY.js.map} +0 -0
- /package/build/modern/{chunk-CU7HXAKM.js.map → chunk-JJGZRBIR.js.map} +0 -0
- /package/build/modern/{chunk-6TXQZ3PB.js.map → chunk-OLQQB53X.js.map} +0 -0
- /package/build/modern/{chunk-TPRGGEVJ.js.map → chunk-SHNZS357.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultIcons
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GIHAFJYX.js";
|
|
4
4
|
|
|
5
5
|
// src/config/defineIcons.ts
|
|
6
6
|
function _validateIconsProperties(icons) {
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
defineIcons,
|
|
25
25
|
$cerberusIcons
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-OLQQB53X.js.map
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-JIZQFTW6.js";
|
|
28
28
|
import {
|
|
29
29
|
$cerberusIcons
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OLQQB53X.js";
|
|
31
31
|
import {
|
|
32
32
|
useModal
|
|
33
33
|
} from "./chunk-C5HLLGME.js";
|
|
@@ -151,4 +151,4 @@ export {
|
|
|
151
151
|
ConfirmModal,
|
|
152
152
|
useConfirmModal
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-SHNZS357.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Input
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-4O4QFF4S.js";
|
|
4
|
+
} from "../chunk-DED42MIR.js";
|
|
6
5
|
import "../chunk-ZAU4JVLL.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4O4QFF4S.js";
|
|
7
|
+
import "../chunk-OLQQB53X.js";
|
|
8
|
+
import "../chunk-GIHAFJYX.js";
|
|
9
9
|
export {
|
|
10
10
|
Input
|
|
11
11
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Toggle
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ANXV7JDK.js";
|
|
5
5
|
import "../chunk-ZAU4JVLL.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-OLQQB53X.js";
|
|
7
|
+
import "../chunk-GIHAFJYX.js";
|
|
8
8
|
export {
|
|
9
9
|
Toggle
|
|
10
10
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfirmModal,
|
|
4
4
|
useConfirmModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-SHNZS357.js";
|
|
6
6
|
import "../chunk-4CAT3FHV.js";
|
|
7
7
|
import "../chunk-2UFNQM55.js";
|
|
8
8
|
import "../chunk-4M4LCQ43.js";
|
|
@@ -12,8 +12,8 @@ import "../chunk-JJP2TFTU.js";
|
|
|
12
12
|
import "../chunk-2ATICEW3.js";
|
|
13
13
|
import "../chunk-4O4QFF4S.js";
|
|
14
14
|
import "../chunk-JIZQFTW6.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-OLQQB53X.js";
|
|
16
|
+
import "../chunk-GIHAFJYX.js";
|
|
17
17
|
import "../chunk-C5HLLGME.js";
|
|
18
18
|
export {
|
|
19
19
|
ConfirmModal,
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PromptModal,
|
|
4
4
|
usePromptModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-DKHQ5GBY.js";
|
|
6
6
|
import "../chunk-4CAT3FHV.js";
|
|
7
|
+
import "../chunk-DED42MIR.js";
|
|
8
|
+
import "../chunk-JJGZRBIR.js";
|
|
7
9
|
import "../chunk-2UFNQM55.js";
|
|
8
10
|
import "../chunk-4M4LCQ43.js";
|
|
9
11
|
import "../chunk-QU7UV5DB.js";
|
|
10
12
|
import "../chunk-JB7IQ2BM.js";
|
|
11
13
|
import "../chunk-JJP2TFTU.js";
|
|
12
14
|
import "../chunk-2ATICEW3.js";
|
|
13
|
-
import "../chunk-5GEC53G7.js";
|
|
14
|
-
import "../chunk-CU7HXAKM.js";
|
|
15
|
-
import "../chunk-4O4QFF4S.js";
|
|
16
15
|
import "../chunk-ZAU4JVLL.js";
|
|
16
|
+
import "../chunk-4O4QFF4S.js";
|
|
17
17
|
import "../chunk-JIZQFTW6.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-OLQQB53X.js";
|
|
19
|
+
import "../chunk-GIHAFJYX.js";
|
|
20
20
|
import "../chunk-C5HLLGME.js";
|
|
21
21
|
export {
|
|
22
22
|
PromptModal,
|
package/build/modern/index.js
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tag
|
|
3
|
+
} from "./chunk-Z6IWNVPN.js";
|
|
4
|
+
import {
|
|
5
|
+
Textarea
|
|
6
|
+
} from "./chunk-TCO46FK7.js";
|
|
1
7
|
import {
|
|
2
8
|
Toggle
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ANXV7JDK.js";
|
|
4
10
|
import {
|
|
5
11
|
ConfirmModal,
|
|
6
12
|
useConfirmModal
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SHNZS357.js";
|
|
8
14
|
import {
|
|
9
15
|
PromptModal,
|
|
10
16
|
usePromptModal
|
|
11
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DKHQ5GBY.js";
|
|
18
|
+
import {
|
|
19
|
+
NavMenuList,
|
|
20
|
+
getPosition
|
|
21
|
+
} from "./chunk-PMCYXRAH.js";
|
|
22
|
+
import {
|
|
23
|
+
NavMenuTrigger
|
|
24
|
+
} from "./chunk-RPZAPUCF.js";
|
|
25
|
+
import {
|
|
26
|
+
NavMenu,
|
|
27
|
+
useNavMenuContext
|
|
28
|
+
} from "./chunk-KJUCHZHV.js";
|
|
12
29
|
import {
|
|
13
30
|
Portal
|
|
14
31
|
} from "./chunk-4CAT3FHV.js";
|
|
@@ -25,11 +42,11 @@ import {
|
|
|
25
42
|
TabPanel
|
|
26
43
|
} from "./chunk-U72VPIZA.js";
|
|
27
44
|
import {
|
|
28
|
-
|
|
29
|
-
} from "./chunk-
|
|
45
|
+
Input
|
|
46
|
+
} from "./chunk-DED42MIR.js";
|
|
30
47
|
import {
|
|
31
|
-
|
|
32
|
-
} from "./chunk-
|
|
48
|
+
Label
|
|
49
|
+
} from "./chunk-JJGZRBIR.js";
|
|
33
50
|
import {
|
|
34
51
|
Modal
|
|
35
52
|
} from "./chunk-2UFNQM55.js";
|
|
@@ -48,17 +65,6 @@ import {
|
|
|
48
65
|
import {
|
|
49
66
|
NavMenuLink
|
|
50
67
|
} from "./chunk-6DIGPXAD.js";
|
|
51
|
-
import {
|
|
52
|
-
NavMenuList,
|
|
53
|
-
getPosition
|
|
54
|
-
} from "./chunk-PMCYXRAH.js";
|
|
55
|
-
import {
|
|
56
|
-
NavMenuTrigger
|
|
57
|
-
} from "./chunk-RPZAPUCF.js";
|
|
58
|
-
import {
|
|
59
|
-
NavMenu,
|
|
60
|
-
useNavMenuContext
|
|
61
|
-
} from "./chunk-KJUCHZHV.js";
|
|
62
68
|
import {
|
|
63
69
|
MODE_KEY,
|
|
64
70
|
THEME_KEY,
|
|
@@ -72,6 +78,9 @@ import {
|
|
|
72
78
|
import {
|
|
73
79
|
Button
|
|
74
80
|
} from "./chunk-2ATICEW3.js";
|
|
81
|
+
import {
|
|
82
|
+
Droppable
|
|
83
|
+
} from "./chunk-7VJOPJVX.js";
|
|
75
84
|
import {
|
|
76
85
|
FeatureFlag
|
|
77
86
|
} from "./chunk-VULPMZUW.js";
|
|
@@ -83,21 +92,18 @@ import {
|
|
|
83
92
|
FieldMessage
|
|
84
93
|
} from "./chunk-VGHVH2T3.js";
|
|
85
94
|
import {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Input
|
|
90
|
-
} from "./chunk-5GEC53G7.js";
|
|
95
|
+
Field,
|
|
96
|
+
useFieldContext
|
|
97
|
+
} from "./chunk-ZAU4JVLL.js";
|
|
91
98
|
import {
|
|
92
|
-
|
|
93
|
-
} from "./chunk-
|
|
99
|
+
FileUploader
|
|
100
|
+
} from "./chunk-2NSXMFKX.js";
|
|
94
101
|
import {
|
|
95
102
|
Show
|
|
96
103
|
} from "./chunk-4O4QFF4S.js";
|
|
97
104
|
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} from "./chunk-ZAU4JVLL.js";
|
|
105
|
+
IconButton
|
|
106
|
+
} from "./chunk-SLHX5K6I.js";
|
|
101
107
|
import "./chunk-55J6XMHW.js";
|
|
102
108
|
import {
|
|
103
109
|
createNavTriggerProps
|
|
@@ -116,19 +122,24 @@ import {
|
|
|
116
122
|
import {
|
|
117
123
|
$cerberusIcons,
|
|
118
124
|
defineIcons
|
|
119
|
-
} from "./chunk-
|
|
120
|
-
import "./chunk-
|
|
125
|
+
} from "./chunk-OLQQB53X.js";
|
|
126
|
+
import "./chunk-GIHAFJYX.js";
|
|
121
127
|
import {
|
|
122
128
|
useModal
|
|
123
129
|
} from "./chunk-C5HLLGME.js";
|
|
130
|
+
|
|
131
|
+
// src/index.ts
|
|
132
|
+
export * from "@dnd-kit/core";
|
|
124
133
|
export {
|
|
125
134
|
$cerberusIcons,
|
|
126
135
|
Button,
|
|
127
136
|
ConfirmModal,
|
|
137
|
+
Droppable,
|
|
128
138
|
FeatureFlag,
|
|
129
139
|
FeatureFlags,
|
|
130
140
|
Field,
|
|
131
141
|
FieldMessage,
|
|
142
|
+
FileUploader,
|
|
132
143
|
IconButton,
|
|
133
144
|
Input,
|
|
134
145
|
Label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/ModalIcon'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Portal'\nexport * from './components/Radio'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.7.4-next-
|
|
3
|
+
"version": "0.7.4-next-7fa6bfb",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"react": "*",
|
|
16
16
|
"react-dom": "*"
|
|
17
17
|
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@dnd-kit/core": "^6.1.0"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"@microsoft/api-extractor": "^7.46.2",
|
|
20
23
|
"@types/react": "^18",
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
"react-dom": "^18",
|
|
24
27
|
"tsup": "^8.1.0",
|
|
25
28
|
"@cerberus-design/configs": "0.0.0",
|
|
26
|
-
"@cerberus-design/styled-system": "0.7.4-next-
|
|
29
|
+
"@cerberus-design/styled-system": "0.7.4-next-7fa6bfb"
|
|
27
30
|
},
|
|
28
31
|
"publishConfig": {
|
|
29
32
|
"access": "public"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useDroppable, type UseDroppableArguments } from '@dnd-kit/core'
|
|
4
|
+
import { useId, type HtmlHTMLAttributes, type PropsWithChildren } from 'react'
|
|
5
|
+
|
|
6
|
+
export interface DroppableProps
|
|
7
|
+
extends Omit<HtmlHTMLAttributes<HTMLDivElement>, 'id'>,
|
|
8
|
+
UseDroppableArguments {
|
|
9
|
+
dropped?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function Droppable(props: PropsWithChildren<DroppableProps>) {
|
|
13
|
+
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } =
|
|
14
|
+
props
|
|
15
|
+
const uuid = useId()
|
|
16
|
+
const { isOver, setNodeRef } = useDroppable({
|
|
17
|
+
data,
|
|
18
|
+
disabled,
|
|
19
|
+
id: id || uuid,
|
|
20
|
+
resizeObserverConfig,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
{...nativeProps}
|
|
26
|
+
data-over={isOver}
|
|
27
|
+
data-dropped={dropped}
|
|
28
|
+
ref={setNodeRef}
|
|
29
|
+
>
|
|
30
|
+
{props.children}
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cx } from '@cerberus-design/styled-system/css'
|
|
4
|
+
import { circle, vstack } from '@cerberus-design/styled-system/patterns'
|
|
5
|
+
import { type InputHTMLAttributes } from 'react'
|
|
6
|
+
import { Show } from './Show'
|
|
7
|
+
import { fileUploader, modalIcon } from '@cerberus-design/styled-system/recipes'
|
|
8
|
+
import { $cerberusIcons } from '../config/defineIcons'
|
|
9
|
+
|
|
10
|
+
export interface FileUploaderProps
|
|
11
|
+
extends InputHTMLAttributes<HTMLInputElement> {
|
|
12
|
+
heading?: string
|
|
13
|
+
name: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function FileUploader(props: FileUploaderProps) {
|
|
17
|
+
const styles = fileUploader()
|
|
18
|
+
const Icon = $cerberusIcons.fileUploader
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
className={cx(
|
|
23
|
+
vstack({
|
|
24
|
+
justify: 'center',
|
|
25
|
+
}),
|
|
26
|
+
styles.container,
|
|
27
|
+
)}
|
|
28
|
+
>
|
|
29
|
+
<span className={cx(styles.icon, modalIcon(), circle())}>
|
|
30
|
+
<Icon />
|
|
31
|
+
</span>
|
|
32
|
+
|
|
33
|
+
<label
|
|
34
|
+
className={cx(
|
|
35
|
+
vstack({
|
|
36
|
+
justify: 'center',
|
|
37
|
+
}),
|
|
38
|
+
styles.label,
|
|
39
|
+
)}
|
|
40
|
+
htmlFor={props.name}
|
|
41
|
+
>
|
|
42
|
+
<Show when={Boolean(props.heading)}>
|
|
43
|
+
<p className={styles.heading}>{props.heading}</p>
|
|
44
|
+
</Show>
|
|
45
|
+
Import {props.accept?.replace(',', ', ')} files
|
|
46
|
+
<p className={styles.description}>Or click to upload</p>
|
|
47
|
+
<input
|
|
48
|
+
{...props}
|
|
49
|
+
className={cx(props.className, styles.input)}
|
|
50
|
+
type="file"
|
|
51
|
+
/>
|
|
52
|
+
</label>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
package/src/config/cerbIcons.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkmark,
|
|
3
|
+
CloudUpload,
|
|
3
4
|
Information,
|
|
4
5
|
WarningFilled,
|
|
5
6
|
type CarbonIconType,
|
|
@@ -8,6 +9,7 @@ import type { ElementType } from 'react'
|
|
|
8
9
|
|
|
9
10
|
export interface DefinedIcons {
|
|
10
11
|
confirmModal?: CarbonIconType | ElementType
|
|
12
|
+
fileUploader?: CarbonIconType | ElementType
|
|
11
13
|
promptModal?: CarbonIconType | ElementType
|
|
12
14
|
invalid: CarbonIconType | ElementType
|
|
13
15
|
toggleChecked?: CarbonIconType | ElementType
|
|
@@ -15,6 +17,7 @@ export interface DefinedIcons {
|
|
|
15
17
|
|
|
16
18
|
export const defaultIcons: DefinedIcons = {
|
|
17
19
|
confirmModal: Information,
|
|
20
|
+
fileUploader: CloudUpload,
|
|
18
21
|
promptModal: Information,
|
|
19
22
|
invalid: WarningFilled,
|
|
20
23
|
toggleChecked: Checkmark,
|
package/src/index.ts
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
// components
|
|
7
7
|
|
|
8
8
|
export * from './components/Button'
|
|
9
|
+
export * from './components/Droppable'
|
|
9
10
|
export * from './components/FieldMessage'
|
|
10
11
|
export * from './components/FeatureFlag'
|
|
12
|
+
export * from './components/FileUploader'
|
|
11
13
|
export * from './components/IconButton'
|
|
12
14
|
export * from './components/Input'
|
|
13
15
|
export * from './components/Label'
|
|
@@ -58,3 +60,7 @@ export * from './config/defineIcons'
|
|
|
58
60
|
// shared types
|
|
59
61
|
|
|
60
62
|
export * from './types'
|
|
63
|
+
|
|
64
|
+
// 3rd party
|
|
65
|
+
|
|
66
|
+
export * from '@dnd-kit/core'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n Information,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport interface DefinedIcons {\n confirmModal?: CarbonIconType | ElementType\n promptModal?: CarbonIconType | ElementType\n invalid: CarbonIconType | ElementType\n toggleChecked?: CarbonIconType | ElementType\n}\n\nexport const defaultIcons: DefinedIcons = {\n confirmModal: Information,\n promptModal: Information,\n invalid: WarningFilled,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAUA,IAAM,eAA6B;AAAA,EACxC,cAAc;AAAA,EACd,aAAa;AAAA,EACb,SAAS;AAAA,EACT,eAAe;AACjB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n Information,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport interface DefinedIcons {\n confirmModal?: CarbonIconType | ElementType\n promptModal?: CarbonIconType | ElementType\n invalid: CarbonIconType | ElementType\n toggleChecked?: CarbonIconType | ElementType\n}\n\nexport const defaultIcons: DefinedIcons = {\n confirmModal: Information,\n promptModal: Information,\n invalid: WarningFilled,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAUA,IAAM,eAA6B;AAAA,EACxC,cAAc;AAAA,EACd,aAAa;AAAA,EACb,SAAS;AAAA,EACT,eAAe;AACjB;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|