@kubed/components 0.0.55 → 0.0.57
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/CHANGELOG.md +14 -0
- package/cjs/Banner/Banner.js +2 -2
- package/cjs/Banner/Banner.js.map +1 -1
- package/cjs/Banner/BannerTip.js +1 -1
- package/cjs/Banner/BannerTip.js.map +1 -1
- package/cjs/Dropzone/Dropzone.context.js +2 -0
- package/cjs/Dropzone/Dropzone.context.js.map +1 -0
- package/cjs/Dropzone/Dropzone.js +2 -0
- package/cjs/Dropzone/Dropzone.js.map +1 -0
- package/cjs/Dropzone/Dropzone.styles.js +14 -0
- package/cjs/Dropzone/Dropzone.styles.js.map +1 -0
- package/cjs/Dropzone/DropzoneStatus.js +2 -0
- package/cjs/Dropzone/DropzoneStatus.js.map +1 -0
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/utils/createSafeContext.js +2 -0
- package/cjs/utils/createSafeContext.js.map +1 -0
- package/cjs/utils/isElement.js +2 -0
- package/cjs/utils/isElement.js.map +1 -0
- package/cjs/utils/upperFirst.js +2 -0
- package/cjs/utils/upperFirst.js.map +1 -0
- package/esm/Banner/Banner.js +7 -7
- package/esm/Banner/Banner.js.map +1 -1
- package/esm/Banner/BannerTip.js +6 -6
- package/esm/Banner/BannerTip.js.map +1 -1
- package/esm/Dropzone/Dropzone.context.js +2 -0
- package/esm/Dropzone/Dropzone.context.js.map +1 -0
- package/esm/Dropzone/Dropzone.js +2 -0
- package/esm/Dropzone/Dropzone.js.map +1 -0
- package/esm/Dropzone/Dropzone.styles.js +14 -0
- package/esm/Dropzone/Dropzone.styles.js.map +1 -0
- package/esm/Dropzone/DropzoneStatus.js +2 -0
- package/esm/Dropzone/DropzoneStatus.js.map +1 -0
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/utils/createSafeContext.js +2 -0
- package/esm/utils/createSafeContext.js.map +1 -0
- package/esm/utils/isElement.js +2 -0
- package/esm/utils/isElement.js.map +1 -0
- package/esm/utils/upperFirst.js +2 -0
- package/esm/utils/upperFirst.js.map +1 -0
- package/lib/src/Banner/Banner.d.ts.map +1 -1
- package/lib/src/Banner/BannerTip.d.ts +10 -2
- package/lib/src/Banner/BannerTip.d.ts.map +1 -1
- package/lib/src/Dropzone/Dropzone.context.d.ts +11 -0
- package/lib/src/Dropzone/Dropzone.context.d.ts.map +1 -0
- package/lib/src/Dropzone/Dropzone.d.ts +85 -0
- package/lib/src/Dropzone/Dropzone.d.ts.map +1 -0
- package/lib/src/Dropzone/Dropzone.styles.d.ts +3 -0
- package/lib/src/Dropzone/Dropzone.styles.d.ts.map +1 -0
- package/lib/src/Dropzone/DropzoneStatus.d.ts +20 -0
- package/lib/src/Dropzone/DropzoneStatus.d.ts.map +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/utils/ForwardRefWithStaticComponents.d.ts +5 -0
- package/lib/src/utils/ForwardRefWithStaticComponents.d.ts.map +1 -0
- package/lib/src/utils/assignRef.d.ts +3 -0
- package/lib/src/utils/assignRef.d.ts.map +1 -0
- package/lib/src/utils/createSafeContext.d.ts +6 -0
- package/lib/src/utils/createSafeContext.d.ts.map +1 -0
- package/lib/src/utils/isElement.d.ts +3 -0
- package/lib/src/utils/isElement.d.ts.map +1 -0
- package/lib/src/utils/upperFirst.d.ts +2 -0
- package/lib/src/utils/upperFirst.d.ts.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @kubed/components
|
|
2
2
|
|
|
3
|
+
## 0.0.57
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`91371ab`](https://github.com/kubesphere/kube-design/commit/91371ab27f04cc75c1663cca38264392256a2f39) Thanks [@chenz24](https://github.com/chenz24)! - 1. Banner support customing operation.
|
|
8
|
+
|
|
9
|
+
## 0.0.56
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`dcefa97`](https://github.com/kubesphere/kube-design/commit/dcefa97af67af1fc84bebb7f1628ebf625ce1555) Thanks [@chenz24](https://github.com/chenz24)! - 1. Add Dropzone component.
|
|
14
|
+
|
|
15
|
+
* [`144f3bd`](https://github.com/kubesphere/kube-design/commit/144f3bd5039a5e737f93ca3ff44f0fd673c2e5f5) Thanks [@chenz24](https://github.com/chenz24)! - feat: Add Dropzone component
|
|
16
|
+
|
|
3
17
|
## 0.0.55
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/cjs/Banner/Banner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),styled=require("styled-components"),Card=require("../Card/Card.js"),Text=require("../Text/Text.js"),forwardRef=require("../utils/forwardRef.js"),color=require("../utils/color.js"),BannerTip=require("./BannerTip.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),styled__default=_interopDefaultLegacy(styled),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),styled=require("styled-components"),Card=require("../Card/Card.js"),Text=require("../Text/Text.js"),forwardRef=require("../utils/forwardRef.js"),color=require("../utils/color.js"),BannerTip=require("./BannerTip.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),styled__default=_interopDefaultLegacy(styled),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,n)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,__spreadValues=(e,r)=>{for(var n in r||(r={}))__hasOwnProp.call(r,n)&&__defNormalProp(e,n,r[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(r))__propIsEnum.call(r,n)&&__defNormalProp(e,n,r[n]);return e};const BannerTitle=styled__default.div`
|
|
2
2
|
padding: 24px 20px 21px;
|
|
3
3
|
display: flex;
|
|
4
4
|
`,BannerIcon=styled__default.div`
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
`,BannerNavs=styled__default.div`
|
|
31
31
|
padding: 8px 14px;
|
|
32
32
|
background-color: ${({theme:e})=>e.palette.accents_1};
|
|
33
|
-
`,Banner=forwardRef.default(({icon:e,title:r,description:
|
|
33
|
+
`,Banner=forwardRef.default(({icon:e,title:r,description:n,children:c,className:d},u)=>{const[i,s]=React.useState(),[o,x]=React.useState([]),v=t=>{s(t===i?"":t)},f=t=>{o.push(t),x([...o,t])},l=[],p=[];return React__default.Children.forEach(c,t=>{t.type===BannerTip.BannerTip?t.key&&o.indexOf(t.key)<0&&l.push(__spreadValues({key:t.key},t.props)):p.push(t)}),React__default.createElement(Card.Card,{ref:u,padding:0,className:d},React__default.createElement(BannerTitle,{className:"banner-title"},React__default.createElement(BannerIcon,null,e),React__default.createElement(BannerText,null,React__default.createElement(Text.Text,{variant:"h3",size:24,color:"accents_8"},r),React__default.createElement(Text.Text,{color:"accents_5"},n))),React__default.createElement(BannerExtra,{className:"banner-extra"},p.length>0&&React__default.createElement(BannerNavs,null,p),l.map(t=>{const{key:a,title:m,removable:y,operations:_}=t,h=a===i;return React__default.createElement(BannerTip.BannerTip,{key:a,tipKey:a,open:h,title:m,removable:y,onClick:()=>v(a),operations:_,onRemove:f},t.children)})))});Banner.displayName="@kubed/components/Banner",exports.BannerTip=BannerTip.BannerTip,exports.Banner=Banner;
|
|
34
34
|
//# sourceMappingURL=Banner.js.map
|
package/cjs/Banner/Banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","sources":["../../src/Banner/Banner.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Card } from '../Card/Card';\nimport { Text } from '../Text/Text';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\nimport { BannerTip } from './BannerTip';\n\nexport { BannerTip };\n\nconst BannerTitle = styled.div`\n padding: 24px 20px 21px;\n display: flex;\n`;\n\nconst BannerIcon = styled.div`\n border-radius: 100px 0 100px 100px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n padding: 6px;\n margin-right: 12px;\n width: 60px;\n height: 60px;\n margin-top: -1px;\n\n .kubed-icon {\n width: 48px;\n height: 48px;\n }\n`;\n\nconst BannerText = styled.div`\n line-height: 20px;\n h3 {\n margin-bottom: 0;\n line-height: 32px;\n text-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.1)};\n }\n`;\n\nconst BannerExtra = styled.div`\n & > div {\n &:last-of-type {\n border-radius: 0 0 4px 4px;\n }\n }\n`;\n\nconst BannerNavs = styled.div`\n padding: 8px 14px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nexport interface BannerProps extends DefaultProps {\n /** Icon of banner */\n icon?: React.ReactNode;\n\n /** Title of banner */\n title?: React.ReactNode;\n\n /** Description of banner */\n description?: React.ReactNode;\n}\n\nexport const Banner = forwardRef<BannerProps, 'div'>(\n ({ icon, title, description, children, className }, ref) => {\n const [activeKey, setActiveKey] = useState<string>();\n const onTipClick = (key) => {\n if (key === activeKey) {\n setActiveKey('');\n } else {\n setActiveKey(key);\n }\n };\n const tips = [];\n const others = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n if (child.type === BannerTip) {\n tips.push({ key: child.key, ...child.props });\n } else {\n others.push(child);\n }\n });\n\n return (\n <Card ref={ref} padding={0} className={className}>\n <BannerTitle className=\"banner-title\">\n <BannerIcon>{icon}</BannerIcon>\n <BannerText>\n <Text variant=\"h3\" size={24} color=\"accents_8\">\n {title}\n </Text>\n <Text color=\"accents_5\">{description}</Text>\n </BannerText>\n </BannerTitle>\n <BannerExtra className=\"banner-extra\">\n {others.length > 0 && <BannerNavs>{others}</BannerNavs>}\n {tips.map((tip) => {\n const { key, title: tipTitle } = tip;\n const isOpen = key === activeKey;\n return (\n <BannerTip
|
|
1
|
+
{"version":3,"file":"Banner.js","sources":["../../src/Banner/Banner.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Card } from '../Card/Card';\nimport { Text } from '../Text/Text';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\nimport { BannerTip, BannerTipProps } from './BannerTip';\n\nexport { BannerTip };\n\nconst BannerTitle = styled.div`\n padding: 24px 20px 21px;\n display: flex;\n`;\n\nconst BannerIcon = styled.div`\n border-radius: 100px 0 100px 100px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n padding: 6px;\n margin-right: 12px;\n width: 60px;\n height: 60px;\n margin-top: -1px;\n\n .kubed-icon {\n width: 48px;\n height: 48px;\n }\n`;\n\nconst BannerText = styled.div`\n line-height: 20px;\n h3 {\n margin-bottom: 0;\n line-height: 32px;\n text-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.1)};\n }\n`;\n\nconst BannerExtra = styled.div`\n & > div {\n &:last-of-type {\n border-radius: 0 0 4px 4px;\n }\n }\n`;\n\nconst BannerNavs = styled.div`\n padding: 8px 14px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nexport interface BannerProps extends DefaultProps {\n /** Icon of banner */\n icon?: React.ReactNode;\n\n /** Title of banner */\n title?: React.ReactNode;\n\n /** Description of banner */\n description?: React.ReactNode;\n}\n\nexport const Banner = forwardRef<BannerProps, 'div'>(\n ({ icon, title, description, children, className }, ref) => {\n const [activeKey, setActiveKey] = useState<string>();\n const [removedTipKeys, setRemovedTipKeys] = useState<Array<string | number>>([]);\n const onTipClick = (key) => {\n if (key === activeKey) {\n setActiveKey('');\n } else {\n setActiveKey(key);\n }\n };\n\n const onTipRemove = (key) => {\n removedTipKeys.push(key);\n setRemovedTipKeys([...removedTipKeys, key]);\n };\n\n const tips: BannerTipProps[] = [];\n const others = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n if (child.type === BannerTip) {\n if (child.key && removedTipKeys.indexOf(child.key) < 0) {\n tips.push({ key: child.key, ...child.props });\n }\n } else {\n others.push(child);\n }\n });\n\n return (\n <Card ref={ref} padding={0} className={className}>\n <BannerTitle className=\"banner-title\">\n <BannerIcon>{icon}</BannerIcon>\n <BannerText>\n <Text variant=\"h3\" size={24} color=\"accents_8\">\n {title}\n </Text>\n <Text color=\"accents_5\">{description}</Text>\n </BannerText>\n </BannerTitle>\n <BannerExtra className=\"banner-extra\">\n {others.length > 0 && <BannerNavs>{others}</BannerNavs>}\n {tips.map((tip) => {\n const { key, title: tipTitle, removable, operations } = tip;\n const isOpen = key === activeKey;\n return (\n <BannerTip\n key={key}\n tipKey={key}\n open={isOpen}\n title={tipTitle}\n removable={removable}\n onClick={() => onTipClick(key)}\n operations={operations}\n onRemove={onTipRemove}\n >\n {tip.children}\n </BannerTip>\n );\n })}\n </BannerExtra>\n </Card>\n );\n }\n);\n\nBanner.displayName = '@kubed/components/Banner';\n"],"names":["styled","addColorAlpha","forwardRef","useState","React","BannerTip","Card","Text"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,G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E,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC3G,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;AAChE,IAAI,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,CAAC;AACrC,IAAI,uBAAuBA,cAAK,CAAC,aAAa,CAACC,mBAAS,EAAE;AAC1D,MAAM,GAAG;AACT,MAAM,MAAM,EAAE,GAAG;AACjB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,KAAK,EAAE,QAAQ;AACrB,MAAM,SAAS;AACf,MAAM,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,CAAC;AACpC,MAAM,UAAU;AAChB,MAAM,QAAQ,EAAE,WAAW;AAC3B,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;AACrB,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,CAAC,EAAE;AACH,MAAM,CAAC,WAAW,GAAG,0BAA0B;;;;;"}
|
package/cjs/Banner/BannerTip.js
CHANGED
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
background-color: ${({theme:e})=>color.addColorAlpha(e.palette.accents_1,.6)};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
`;function BannerTip({title:e,children:n,onClick:r,open:t}){return React__default.createElement(TipWrapper,{onClick:r},React__default.createElement(TipIcon,null,t?React__default.createElement(icons.ChevronDown,null):React__default.createElement(icons.ChevronRight,null)),React__default.createElement(TipContent,null,React__default.createElement(Text.Text,{weight:700},e),t&&React__default.createElement(Text.Text,{color:"accents_5"},n)),React__default.createElement(TipOperations,null,React__default.createElement(icons.Close,{size:20})))}BannerTip.displayName="@kubed/components/BannerTip",exports.BannerTip=BannerTip;
|
|
37
|
+
`;function BannerTip({title:e,children:n,onClick:r,open:t,removable:o=!0,operations:i,onRemove:a=()=>{},tipKey:l}){const c=s=>{s.stopPropagation(),a(l)};return React__default.createElement(TipWrapper,{onClick:r},React__default.createElement(TipIcon,null,t?React__default.createElement(icons.ChevronDown,null):React__default.createElement(icons.ChevronRight,null)),React__default.createElement(TipContent,null,React__default.createElement(Text.Text,{weight:700},e),t&&React__default.createElement(Text.Text,{color:"accents_5"},n)),React__default.createElement(TipOperations,null,i,o&&React__default.createElement(icons.Close,{size:20,onClick:c})))}BannerTip.displayName="@kubed/components/BannerTip",exports.BannerTip=BannerTip;
|
|
38
38
|
//# sourceMappingURL=BannerTip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerTip.js","sources":["../../src/Banner/BannerTip.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { ChevronRight, ChevronDown, Close } from '@kubed/icons';\nimport { Text } from '../Text/Text';\nimport { addColorAlpha } from '../utils/color';\n\nconst TipWrapper = styled.div`\n position: relative;\n padding: 12px 60px 12px 52px;\n background-color: ${({ theme }) => theme.palette.background};\n border-top: 1px solid ${({ theme }) => theme.palette.accents_2};\n cursor: pointer;\n line-height: 1.67;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n\nconst TipIcon = styled.div`\n position: absolute;\n top: 11px;\n left: 24px;\n\n .kubed-icon {\n width: 20px;\n height: 20px;\n }\n`;\n\nconst TipContent = styled.div`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n`;\n\nconst TipOperations = styled.div`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 20px;\n display: inline-flex;\n\n .kubed-icon {\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_1, 0.6)};\n }\n }\n`;\n\nexport interface BannerTipProps {\n /** Title of banner tip */\n title?: React.ReactNode;\n\n /** children of banner tip */\n children?: React.ReactNode;\n\n /** Tip's key */\n key?: string;\n\n /** Tip open or not */\n open?: boolean;\n\n /** Callback of click event */\n onClick?: () => void;\n}\n\nexport function BannerTip({
|
|
1
|
+
{"version":3,"file":"BannerTip.js","sources":["../../src/Banner/BannerTip.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { ChevronRight, ChevronDown, Close } from '@kubed/icons';\nimport { Text } from '../Text/Text';\nimport { addColorAlpha } from '../utils/color';\n\nconst TipWrapper = styled.div`\n position: relative;\n padding: 12px 60px 12px 52px;\n background-color: ${({ theme }) => theme.palette.background};\n border-top: 1px solid ${({ theme }) => theme.palette.accents_2};\n cursor: pointer;\n line-height: 1.67;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n\nconst TipIcon = styled.div`\n position: absolute;\n top: 11px;\n left: 24px;\n\n .kubed-icon {\n width: 20px;\n height: 20px;\n }\n`;\n\nconst TipContent = styled.div`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n`;\n\nconst TipOperations = styled.div`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 20px;\n display: inline-flex;\n\n .kubed-icon {\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_1, 0.6)};\n }\n }\n`;\n\nexport interface BannerTipProps {\n /** Title of banner tip */\n title?: React.ReactNode;\n\n /** children of banner tip */\n children?: React.ReactNode;\n\n /** operations element of banner tip */\n operations?: React.ReactNode;\n\n /** Tip's key */\n key: string;\n\n /** Tip's key */\n tipKey?: string;\n\n /** Tip open or not */\n open?: boolean;\n\n /** Callback of click event */\n onClick?: () => void;\n\n /** Callback of click event */\n onRemove?: (key) => void;\n\n /** Whether Tip can be removed */\n removable?: boolean;\n}\n\nexport function BannerTip({\n title,\n children,\n onClick,\n open,\n removable = true,\n operations,\n onRemove = () => {},\n tipKey,\n}: BannerTipProps) {\n const handleRemove = (e: React.MouseEvent<SVGElement>) => {\n e.stopPropagation();\n onRemove(tipKey);\n };\n\n return (\n <TipWrapper onClick={onClick}>\n <TipIcon>{open ? <ChevronDown /> : <ChevronRight />}</TipIcon>\n <TipContent>\n <Text weight={700}>{title}</Text>\n {open && <Text color=\"accents_5\">{children}</Text>}\n </TipContent>\n <TipOperations>\n {operations}\n {removable && <Close size={20} onClick={handleRemove} />}\n </TipOperations>\n </TipWrapper>\n );\n}\n\nBannerTip.displayName = '@kubed/components/BannerTip';\n"],"names":["styled","addColorAlpha","React","ChevronDown","ChevronRight","Text","Close"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,UAAU,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC9B;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;AAC9D,wBAAwB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACjE;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA,CAAC,CAAC;AACF,MAAM,OAAO,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF,MAAM,UAAU,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC9B;AACA;AACA,CAAC,CAAC;AACF,MAAM,aAAa,GAAGA,eAAM,CAAC,GAAG,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAKC,mBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AACrF;AACA;AACA,CAAC,CAAC;AACK,SAAS,SAAS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.defineProperty(exports,"__esModule",{value:!0});var createSafeContext=require("../utils/createSafeContext.js");const[DropzoneProvider,useDropzoneContext]=createSafeContext.createSafeContext("Dropzone component was not found in tree");exports.DropzoneProvider=DropzoneProvider,exports.useDropzoneContext=useDropzoneContext;
|
|
2
|
+
//# sourceMappingURL=Dropzone.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropzone.context.js","sources":["../../src/Dropzone/Dropzone.context.ts"],"sourcesContent":["import { createSafeContext } from '../utils/createSafeContext';\n\nexport interface DropzoneContextValue {\n idle: boolean;\n accept: boolean;\n reject: boolean;\n}\n\nexport const [DropzoneProvider, useDropzoneContext] = createSafeContext<DropzoneContextValue>(\n 'Dropzone component was not found in tree'\n);\n"],"names":["createSafeContext"],"mappings":";;;;;;AACY,MAAC,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAGA,mCAAiB,CAAC,0CAA0C;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactDropzone=require("react-dropzone"),hooks=require("@kubed/hooks"),LoadingOverlay=require("../LoadingOverlay/LoadingOverlay.js"),Dropzone_context=require("./Dropzone.context.js"),DropzoneStatus=require("./DropzoneStatus.js"),Dropzone_styles=require("./Dropzone.styles.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,a)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,__spreadValues=(e,r)=>{for(var a in r||(r={}))__hasOwnProp.call(r,a)&&__defNormalProp(e,a,r[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(r))__propIsEnum.call(r,a)&&__defNormalProp(e,a,r[a]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r)),__objRest=(e,r)=>{var a={};for(var o in e)__hasOwnProp.call(e,o)&&r.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))r.indexOf(o)<0&&__propIsEnum.call(e,o)&&(a[o]=e[o]);return a};function _Dropzone(e){const r=e,{className:a,padding:o,radius:B,disabled:c,classNames:K,styles:M,loading:t=!1,multiple:d=!0,maxSize:u=1/0,accept:n,children:v,onDropAny:D,onDrop:g,onReject:f,openRef:O,name:_,maxFiles:m,autoFocus:y,activateOnClick:z=!0,activateOnDrag:b=!0,dragEventsBubbling:j=!0,activateOnKeyboard:P=!0,onDragEnter:E,onDragLeave:F,onDragOver:R,onFileDialogCancel:A,onFileDialogOpen:x,preventDropOnDocument:I,useFsAccessApi:h=!0,getFilesFromEvent:p,validator:q}=r,w=__objRest(r,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator"]),{getRootProps:L,getInputProps:N,isDragAccept:i,isDragReject:l,open:S}=reactDropzone.useDropzone(__spreadValues({onDrop:D,onDropAccepted:g,onDropRejected:f,disabled:c||t,accept:Array.isArray(n)?n.reduce((C,k)=>__spreadProps(__spreadValues({},C),{[k]:[]}),{}):n,multiple:d,maxSize:u,maxFiles:m,autoFocus:y,noClick:!z,noDrag:!b,noDragEventsBubbling:!j,noKeyboard:!P,onDragEnter:E,onDragLeave:F,onDragOver:R,onFileDialogCancel:A,onFileDialogOpen:x,preventDropOnDocument:I,useFsAccessApi:h,validator:q},p?{getFilesFromEvent:p}:null));hooks.assignRef(O,S);const s=!i&&!l;return React__default.createElement(Dropzone_context.DropzoneProvider,{value:{accept:i,reject:l,idle:s}},React__default.createElement(Dropzone_styles.DropzoneWrapper,__spreadProps(__spreadValues(__spreadValues({},w),L()),{"data-accept":i||void 0,"data-reject":l||void 0,"data-idle":s||void 0,"data-loading":t||void 0,className:a}),React__default.createElement(LoadingOverlay.LoadingOverlay,{visible:t}),React__default.createElement("input",__spreadProps(__spreadValues({},N()),{name:_})),React__default.createElement(Dropzone_styles.DropzoneInner,null,v)))}_Dropzone.displayName="@mantine/dropzone/Dropzone",_Dropzone.Accept=DropzoneStatus.DropzoneAccept,_Dropzone.Reject=DropzoneStatus.DropzoneReject,_Dropzone.Idle=DropzoneStatus.DropzoneIdle;const Dropzone=_Dropzone;exports.Dropzone=Dropzone,exports._Dropzone=_Dropzone;
|
|
2
|
+
//# sourceMappingURL=Dropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropzone.js","sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n FileRejection,\n Accept,\n FileWithPath,\n DropEvent,\n FileError,\n} from 'react-dropzone';\nimport { assignRef } from '@kubed/hooks';\n\nimport { ForwardRefWithStaticComponents } from '../utils/ForwardRefWithStaticComponents';\nimport { LoadingOverlay } from '../LoadingOverlay/LoadingOverlay';\nimport { DefaultProps, KubedNumberSize } from '../theme';\nimport { DropzoneProvider } from './Dropzone.context';\nimport { DropzoneAccept, DropzoneIdle, DropzoneReject } from './DropzoneStatus';\n\nimport { DropzoneWrapper, DropzoneInner } from './Dropzone.styles';\n\nexport interface DropzoneProps\n extends DefaultProps,\n Omit<React.ComponentPropsWithRef<'div'>, 'onDrop'> {\n /** Padding from theme.spacing, or number to set padding in px */\n padding?: KubedNumberSize;\n\n /** Border radius from theme.radius or number to set border-radius in px */\n radius?: KubedNumberSize;\n\n /** Dropzone statues */\n children: React.ReactNode;\n\n /** Disable files capturing */\n disabled?: boolean;\n\n /** Called when any files are dropped into dropzone */\n onDropAny?(files: FileWithPath[], fileRejections: FileRejection[]): void;\n\n /** Called when valid files are dropped into dropzone */\n onDrop(files: FileWithPath[]): void;\n\n /** Called when selected files don't meet file restrictions */\n onReject?(fileRejections: FileRejection[]): void;\n\n /** Display loading overlay over dropzone */\n loading?: boolean;\n\n /** File types to accept */\n accept?: Accept | string[];\n\n /** Get open function as ref */\n openRef?: React.ForwardedRef<() => void | undefined>;\n\n /** Allow selection of multiple files */\n multiple?: boolean;\n\n /** Set maximum file size in bytes */\n maxSize?: number;\n\n /** Name of the form control. Submitted with the form as part of a name/value pair. */\n name?: string;\n\n /** Number of files that user can pick */\n maxFiles?: number;\n\n /** Set to true to autofocus the root element */\n autoFocus?: boolean;\n\n /** If false, disables click to open the native file selection dialog */\n activateOnClick?: boolean;\n\n /** If false, disables drag 'n' drop */\n activateOnDrag?: boolean;\n\n /** If false, disables Space/Enter to open the native file selection dialog. Note that it also stops tracking the focus state. */\n activateOnKeyboard?: boolean;\n\n /** If false, stops drag event propagation to parents */\n dragEventsBubbling?: boolean;\n\n /** Called when the `dragenter` event occurs */\n onDragEnter?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragleave` event occurs */\n onDragLeave?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragover` event occurs */\n onDragOver?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when user closes the file selection dialog with no selection */\n onFileDialogCancel?(): void;\n\n /** Called when user opens the file selection dialog */\n onFileDialogOpen?(): void;\n\n /** If false, allow dropped items to take over the current browser window */\n preventDropOnDocument?: boolean;\n\n /** Set to true to use the File System Access API to open the file picker instead of using an <input type=\"file\"> click event, defaults to true */\n useFsAccessApi?: boolean;\n\n /** Use this to provide a custom file aggregator */\n getFilesFromEvent?: (event: DropEvent) => Promise<Array<File | DataTransferItem>>;\n\n /** Custom validation function. It must return null if there's no errors. */\n validator?: <T extends File>(file: T) => FileError | FileError[] | null;\n}\n\nexport function _Dropzone(props: DropzoneProps) {\n const {\n className,\n padding,\n radius,\n disabled,\n classNames,\n styles,\n loading = false,\n multiple = true,\n maxSize = Infinity,\n accept,\n children,\n onDropAny,\n onDrop,\n onReject,\n openRef,\n name,\n // unstyled,\n maxFiles,\n autoFocus,\n activateOnClick = true,\n activateOnDrag = true,\n dragEventsBubbling = true,\n activateOnKeyboard = true,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n useFsAccessApi = true,\n getFilesFromEvent,\n validator,\n ...others\n } = props;\n\n const { getRootProps, getInputProps, isDragAccept, isDragReject, open } = useDropzone({\n onDrop: onDropAny,\n onDropAccepted: onDrop,\n onDropRejected: onReject,\n disabled: disabled || loading,\n accept: Array.isArray(accept) ? accept.reduce((r, key) => ({ ...r, [key]: [] }), {}) : accept,\n multiple,\n maxSize,\n maxFiles,\n autoFocus,\n noClick: !activateOnClick,\n noDrag: !activateOnDrag,\n noDragEventsBubbling: !dragEventsBubbling,\n noKeyboard: !activateOnKeyboard,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n useFsAccessApi,\n validator,\n ...(getFilesFromEvent ? { getFilesFromEvent } : null),\n });\n\n assignRef(openRef, open);\n const isIdle = !isDragAccept && !isDragReject;\n\n return (\n <DropzoneProvider value={{ accept: isDragAccept, reject: isDragReject, idle: isIdle }}>\n <DropzoneWrapper\n {...others}\n {...getRootProps()}\n data-accept={isDragAccept || undefined}\n data-reject={isDragReject || undefined}\n data-idle={isIdle || undefined}\n data-loading={loading || undefined}\n className={className}\n >\n <LoadingOverlay visible={loading} />\n <input {...getInputProps()} name={name} />\n <DropzoneInner>{children}</DropzoneInner>\n </DropzoneWrapper>\n </DropzoneProvider>\n );\n}\n\n_Dropzone.displayName = '@mantine/dropzone/Dropzone';\n_Dropzone.Accept = DropzoneAccept;\n_Dropzone.Reject = DropzoneReject;\n_Dropzone.Idle = DropzoneIdle;\n\nexport const Dropzone: ForwardRefWithStaticComponents<\n DropzoneProps,\n {\n Accept: typeof DropzoneAccept;\n Reject: typeof DropzoneReject;\n Idle: typeof DropzoneIdle;\n }\n> = _Dropzone as any;\n"],"names":["useDropzone","assignRef","React","DropzoneProvider","DropzoneWrapper","LoadingOverlay","DropzoneInner","DropzoneAccept","DropzoneReject","DropzoneIdle"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,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AACvE,GAAG,kBAAkBD,cAAK,CAAC,aAAa,CAACE,+BAAe,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;AACpI,IAAI,aAAa,EAAE,YAAY,IAAI,KAAK,CAAC;AACzC,IAAI,aAAa,EAAE,YAAY,IAAI,KAAK,CAAC;AACzC,IAAI,WAAW,EAAE,MAAM,IAAI,KAAK,CAAC;AACjC,IAAI,cAAc,EAAE,OAAO,IAAI,KAAK,CAAC;AACrC,IAAI,SAAS;AACb,GAAG,CAAC,kBAAkBF,cAAK,CAAC,aAAa,CAACG,6BAAc,EAAE;AAC1D,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG,CAAC,kBAAkBH,cAAK,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AACtG,IAAI,IAAI;AACR,GAAG,CAAC,CAAC,kBAAkBA,cAAK,CAAC,aAAa,CAACI,6BAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,4BAA4B,CAAC;AACrD,SAAS,CAAC,MAAM,GAAGC,6BAAc,CAAC;AAClC,SAAS,CAAC,MAAM,GAAGC,6BAAc,CAAC;AAClC,SAAS,CAAC,IAAI,GAAGC,2BAAY,CAAC;AAClB,MAAC,QAAQ,GAAG;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styled=require("styled-components");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var styled__default=_interopDefaultLegacy(styled);const DropzoneWrapper=styled__default.div`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
user-select: none;
|
|
5
|
+
position: relative;
|
|
6
|
+
transition: background-color 150ms ease;
|
|
7
|
+
border: 2px dashed ${({theme:e})=>e.palette.border};
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
padding: 16px;
|
|
10
|
+
`,DropzoneInner=styled__default.div`
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
user-select: none;
|
|
13
|
+
`;exports.DropzoneInner=DropzoneInner,exports.DropzoneWrapper=DropzoneWrapper;
|
|
14
|
+
//# sourceMappingURL=Dropzone.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropzone.styles.js","sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const DropzoneWrapper = styled.div`\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n position: relative;\n transition: background-color 150ms ease;\n border: 2px dashed ${({ theme }) => theme.palette.border};\n border-radius: 4px;\n padding: 16px;\n`;\n\nexport const DropzoneInner = styled.div`\n pointer-events: none;\n user-select: none;\n`;\n"],"names":["styled"],"mappings":";;;;;;;;;;AACY,MAAC,eAAe,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA,qBAAqB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAC3D;AACA;AACA,EAAE;AACU,MAAC,aAAa,GAAGA,eAAM,CAAC,GAAG,CAAC;AACxC;AACA;AACA;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),isElement=require("../utils/isElement.js"),upperFirst=require("../utils/upperFirst.js"),Dropzone_context=require("./Dropzone.context.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__objRest=(e,r)=>{var n={};for(var t in e)__hasOwnProp.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))r.indexOf(t)<0&&__propIsEnum.call(e,t)&&(n[t]=e[t]);return n};function createDropzoneStatus(e){const r=n=>{const t=n,{children:o}=t,p=__objRest(t,["children"]),a=Dropzone_context.useDropzoneContext(),c=isElement.isElement(o)?o:React__default.createElement("span",null,o);return a[e]?React.cloneElement(c,p):null};return r.displayName=`@kubed/components/Dropzone/${upperFirst.upperFirst(e)}`,r}const DropzoneAccept=createDropzoneStatus("accept"),DropzoneReject=createDropzoneStatus("reject"),DropzoneIdle=createDropzoneStatus("idle");exports.DropzoneAccept=DropzoneAccept,exports.DropzoneIdle=DropzoneIdle,exports.DropzoneReject=DropzoneReject;
|
|
2
|
+
//# sourceMappingURL=DropzoneStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropzoneStatus.js","sources":["../../src/Dropzone/DropzoneStatus.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '../utils/isElement';\nimport { upperFirst } from '../utils/upperFirst';\nimport { DropzoneContextValue, useDropzoneContext } from './Dropzone.context';\n\nexport interface DropzoneStatusProps {\n // eslint-disable-next-line react/no-unused-prop-types\n children: React.ReactNode;\n}\n\nfunction createDropzoneStatus(status: keyof DropzoneContextValue) {\n const Component = (props: DropzoneStatusProps): JSX.Element => {\n const { children, ...others } = props;\n\n const ctx = useDropzoneContext();\n const _children = isElement(children) ? children : <span>{children}</span>;\n\n if (ctx[status]) {\n return cloneElement(_children, others);\n }\n\n return null;\n };\n\n Component.displayName = `@kubed/components/Dropzone/${upperFirst(status)}`;\n\n return Component;\n}\n\nexport const DropzoneAccept = createDropzoneStatus('accept');\nexport const DropzoneReject = createDropzoneStatus('reject');\nexport const DropzoneIdle = createDropzoneStatus('idle');\n\nexport type DropzoneAcceptProps = DropzoneStatusProps;\nexport type DropzoneRejectProps = DropzoneStatusPro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GAAG,GAAGA,mCAAkB,EAAE,CAAC;AACrC,IAAI,MAAM,SAAS,GAAGC,mBAAS,CAAC,QAAQ,CAAC,GAAG,QAAQ,mBAAmBC,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE;AACrB,MAAM,OAAOC,kBAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAC7C,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,WAAW,GAAG,CAAC,2BAA2B,EAAEC,qBAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7E,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACW,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,YAAY,GAAG,oBAAoB,CAAC,MAAM;;;;;;"}
|
package/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("./ConfigProvider/index.js"),Button=require("./Button/Button.js"),Group=require("./Group/Group.js"),Container=require("./Container/Container.js"),Center=require("./Center/Center.js"),Row=require("./Grid/Row.js"),Navs=require("./Navs/Navs.js"),Snippet=require("./Snippet/Snippet.js"),Tabs=require("./Tabs/Tabs.js"),Text=require("./Text/Text.js"),Tooltip=require("./Tooltip/Tooltip.js"),Popover=require("./Popover/Popover.js"),Divider=require("./Divider/Divider.js"),Menu=require("./Menu/Menu.js"),StatusDot=require("./StatusDot/StatusDot.js"),Tag=require("./Tag/Tag.js"),Badge=require("./Badge/Badge.js"),Alert=require("./Alert/Alert.js"),Card=require("./Card/Card.js"),Descriptions=require("./Descriptions/Descriptions.js"),Entity=require("./Entity/Entity.js"),Dropdown=require("./Dropdown/Dropdown.js"),LoadingOverlay=require("./LoadingOverlay/LoadingOverlay.js"),Input=require("./Input/Input.js"),InputPassword=require("./InputPassword/InputPassword.js"),FilterInput=require("./FilterInput/FilterInput.js"),Textarea=require("./Textarea/Textarea.js"),Empty=require("./Empty/Empty.js"),Form=require("./Form/Form.js"),Select=require("./Select/Select.js"),Checkbox=require("./Checkbox/Checkbox.js"),Radio=require("./Radio/Radio.js"),Switch=require("./Switch/Switch.js"),InputNumber=require("./InputNumber/InputNumber.js"),DatePicker=require("./DatePicker/DatePicker.js"),Banner=require("./Banner/Banner.js"),Notify=require("./Notify/Notify.js"),AutoComplete=require("./AutoComplete/AutoComplete.js"),ActionConfirm=require("./ActionConfirm/ActionConfirm.js"),Progress=require("./Progress/Progress.js"),color=require("./utils/color.js"),Steps=require("./Steps/Steps.js"),TypeSelect=require("./TypeSelect/TypeSelect.js"),ShowMore=require("./ShowMore/ShowMore.js"),Loading=require("./Loading/Loading.js"),TimePicker=require("./TimePicker/TimePicker.js"),Drawer=require("./Drawer/Drawer.js"),Collapse=require("./Collapse/Collapse.js"),forwardRef=require("./utils/forwardRef.js"),toArray=require("./utils/toArray.js"),useForm=require("./Form/hooks/useForm.js"),CssBaseline=require("./theme/CssBaseline.js"),ThemeContext=require("./theme/ThemeContext.js"),utils=require("./theme/utils.js"),Col=require("./Grid/Col.js"),Tab=require("./Tabs/Tab/Tab.js"),MenuItem=require("./Menu/MenuItem/MenuItem.js"),MenuLabel=require("./Menu/MenuLabel/MenuLabel.js"),BadgeAnchor=require("./Badge/BadgeAnchor.js"),Description=require("./Descriptions/Description.js"),Field=require("./Entity/Field.js"),FieldForm=require("rc-field-form"),FormItem=require("./Form/FormItem/FormItem.js"),Modal=require("./Modal/Modal.js"),ModalContext=require("./Modal/ModalProvider/ModalContext.js"),CheckboxGroup=require("./Checkbox/CheckboxGroup.js"),RadioGroup=require("./Radio/RadioGroup.js"),BannerTip=require("./Banner/BannerTip.js"),toast=require("react-hot-toast"),Slider=require("./Slider/Slider/Slider.js"),RangeSlider=require("./Slider/RangeSlider/RangeSlider.js"),Step=require("./Steps/Step/Step.js"),StepCompleted=require("./Steps/StepCompleted/StepCompleted.js"),TabStep=require("./Steps/TabStep/TabStep.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var toast__default=_interopDefaultLegacy(toast);exports.KubedConfigProvider=index.KubedConfigProvider,exports.Button=Button.Button,exports.Group=Group.Group,exports.Container=Container.Container,exports.sizes=Container.sizes,exports.Center=Center.Center,exports.Row=Row.Row,exports.Navs=Navs.Navs,exports.Snippet=Snippet.Snippet,exports.Tabs=Tabs.Tabs,exports.Text=Text.Text,exports.Tooltip=Tooltip.Tooltip,exports.Popover=Popover.Popover,exports.Divider=Divider.Divider,exports.Menu=Menu.Menu,exports.StatusDot=StatusDot.StatusDot,exports.Tag=Tag.Tag,exports.Badge=Badge.Badge,exports.Alert=Alert.Alert,exports.Card=Card.Card,exports.Descriptions=Descriptions.Descriptions,exports.Entity=Entity.Entity,exports.Dropdown=Dropdown.Dropdown,exports.LoadingOverlay=LoadingOverlay.LoadingOverlay,exports.Input=Input.Input,exports.fixControlledValue=Input.fixControlledValue,exports.InputPassword=InputPassword.InputPassword,exports.FilterInput=FilterInput.FilterInput,exports.Textarea=Textarea.Textarea,exports.Empty=Empty.Empty,exports.Form=Form.Form,exports.Select=Select.Select,exports.Checkbox=Checkbox.Checkbox,exports.Radio=Radio.Radio,exports.Switch=Switch.Switch,exports.InputNumber=InputNumber.InputNumber,exports.DatePicker=DatePicker.DatePicker,exports.Banner=Banner.Banner,exports.Notify=Notify.Notify,exports.AutoComplete=AutoComplete.AutoComplete,exports.ActionConfirm=ActionConfirm.ActionConfirm,exports.Progress=Progress.Progress,exports.addColorAlpha=color.addColorAlpha,exports.colorToRgbValues=color.colorToRgbValues,exports.Steps=Steps.Steps,exports.TypeSelect=TypeSelect.TypeSelect,exports.ShowMore=ShowMore.ShowMore,exports.Loading=Loading.Loading,exports.TimePicker=TimePicker.default,exports.Drawer=Drawer.default,exports.Collapse=Collapse.default,exports.forwardRef=forwardRef.default,exports.toArray=toArray.default,exports.useForm=useForm.default,exports.CssBaseline=CssBaseline.default,exports.useTheme=ThemeContext.useTheme,exports.themeUtils=utils.default,exports.Col=Col.Col,exports.Tab=Tab.Tab,exports.MenuItem=MenuItem.MenuItem,exports.MenuLabel=MenuLabel.MenuLabel,exports.BadgeAnchor=BadgeAnchor.BadgeAnchor,exports.Description=Description.Description,exports.Field=Field.Field,exports.FormList=FieldForm.List,exports.useWatch=FieldForm.useWatch,exports.FormItem=FormItem.FormItem,exports.Modal=Modal.Modal,exports.useModal=ModalContext.useModal,exports.CheckboxGroup=CheckboxGroup.CheckboxGroup,exports.RadioGroup=RadioGroup.RadioGroup,exports.BannerTip=BannerTip.BannerTip,exports.notify=toast__default,exports.Slider=Slider.Slider,exports.RangeSlider=RangeSlider.RangeSlider,exports.Step=Step.Step,exports.StepCompleted=StepCompleted.StepCompleted,exports.TabStep=TabStep.TabStep;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("./ConfigProvider/index.js"),Button=require("./Button/Button.js"),Group=require("./Group/Group.js"),Container=require("./Container/Container.js"),Center=require("./Center/Center.js"),Row=require("./Grid/Row.js"),Navs=require("./Navs/Navs.js"),Snippet=require("./Snippet/Snippet.js"),Tabs=require("./Tabs/Tabs.js"),Text=require("./Text/Text.js"),Tooltip=require("./Tooltip/Tooltip.js"),Popover=require("./Popover/Popover.js"),Divider=require("./Divider/Divider.js"),Menu=require("./Menu/Menu.js"),StatusDot=require("./StatusDot/StatusDot.js"),Tag=require("./Tag/Tag.js"),Badge=require("./Badge/Badge.js"),Alert=require("./Alert/Alert.js"),Card=require("./Card/Card.js"),Descriptions=require("./Descriptions/Descriptions.js"),Entity=require("./Entity/Entity.js"),Dropdown=require("./Dropdown/Dropdown.js"),LoadingOverlay=require("./LoadingOverlay/LoadingOverlay.js"),Input=require("./Input/Input.js"),InputPassword=require("./InputPassword/InputPassword.js"),FilterInput=require("./FilterInput/FilterInput.js"),Textarea=require("./Textarea/Textarea.js"),Empty=require("./Empty/Empty.js"),Form=require("./Form/Form.js"),Select=require("./Select/Select.js"),Checkbox=require("./Checkbox/Checkbox.js"),Radio=require("./Radio/Radio.js"),Switch=require("./Switch/Switch.js"),InputNumber=require("./InputNumber/InputNumber.js"),DatePicker=require("./DatePicker/DatePicker.js"),Banner=require("./Banner/Banner.js"),Notify=require("./Notify/Notify.js"),AutoComplete=require("./AutoComplete/AutoComplete.js"),ActionConfirm=require("./ActionConfirm/ActionConfirm.js"),Progress=require("./Progress/Progress.js"),color=require("./utils/color.js"),Steps=require("./Steps/Steps.js"),TypeSelect=require("./TypeSelect/TypeSelect.js"),ShowMore=require("./ShowMore/ShowMore.js"),Dropzone=require("./Dropzone/Dropzone.js"),Loading=require("./Loading/Loading.js"),TimePicker=require("./TimePicker/TimePicker.js"),Drawer=require("./Drawer/Drawer.js"),Collapse=require("./Collapse/Collapse.js"),forwardRef=require("./utils/forwardRef.js"),toArray=require("./utils/toArray.js"),useForm=require("./Form/hooks/useForm.js"),CssBaseline=require("./theme/CssBaseline.js"),ThemeContext=require("./theme/ThemeContext.js"),utils=require("./theme/utils.js"),Col=require("./Grid/Col.js"),Tab=require("./Tabs/Tab/Tab.js"),MenuItem=require("./Menu/MenuItem/MenuItem.js"),MenuLabel=require("./Menu/MenuLabel/MenuLabel.js"),BadgeAnchor=require("./Badge/BadgeAnchor.js"),Description=require("./Descriptions/Description.js"),Field=require("./Entity/Field.js"),FieldForm=require("rc-field-form"),FormItem=require("./Form/FormItem/FormItem.js"),Modal=require("./Modal/Modal.js"),ModalContext=require("./Modal/ModalProvider/ModalContext.js"),CheckboxGroup=require("./Checkbox/CheckboxGroup.js"),RadioGroup=require("./Radio/RadioGroup.js"),BannerTip=require("./Banner/BannerTip.js"),toast=require("react-hot-toast"),Slider=require("./Slider/Slider/Slider.js"),RangeSlider=require("./Slider/RangeSlider/RangeSlider.js"),Step=require("./Steps/Step/Step.js"),StepCompleted=require("./Steps/StepCompleted/StepCompleted.js"),TabStep=require("./Steps/TabStep/TabStep.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var toast__default=_interopDefaultLegacy(toast);exports.KubedConfigProvider=index.KubedConfigProvider,exports.Button=Button.Button,exports.Group=Group.Group,exports.Container=Container.Container,exports.sizes=Container.sizes,exports.Center=Center.Center,exports.Row=Row.Row,exports.Navs=Navs.Navs,exports.Snippet=Snippet.Snippet,exports.Tabs=Tabs.Tabs,exports.Text=Text.Text,exports.Tooltip=Tooltip.Tooltip,exports.Popover=Popover.Popover,exports.Divider=Divider.Divider,exports.Menu=Menu.Menu,exports.StatusDot=StatusDot.StatusDot,exports.Tag=Tag.Tag,exports.Badge=Badge.Badge,exports.Alert=Alert.Alert,exports.Card=Card.Card,exports.Descriptions=Descriptions.Descriptions,exports.Entity=Entity.Entity,exports.Dropdown=Dropdown.Dropdown,exports.LoadingOverlay=LoadingOverlay.LoadingOverlay,exports.Input=Input.Input,exports.fixControlledValue=Input.fixControlledValue,exports.InputPassword=InputPassword.InputPassword,exports.FilterInput=FilterInput.FilterInput,exports.Textarea=Textarea.Textarea,exports.Empty=Empty.Empty,exports.Form=Form.Form,exports.Select=Select.Select,exports.Checkbox=Checkbox.Checkbox,exports.Radio=Radio.Radio,exports.Switch=Switch.Switch,exports.InputNumber=InputNumber.InputNumber,exports.DatePicker=DatePicker.DatePicker,exports.Banner=Banner.Banner,exports.Notify=Notify.Notify,exports.AutoComplete=AutoComplete.AutoComplete,exports.ActionConfirm=ActionConfirm.ActionConfirm,exports.Progress=Progress.Progress,exports.addColorAlpha=color.addColorAlpha,exports.colorToRgbValues=color.colorToRgbValues,exports.Steps=Steps.Steps,exports.TypeSelect=TypeSelect.TypeSelect,exports.ShowMore=ShowMore.ShowMore,exports.Dropzone=Dropzone.Dropzone,exports._Dropzone=Dropzone._Dropzone,exports.Loading=Loading.Loading,exports.TimePicker=TimePicker.default,exports.Drawer=Drawer.default,exports.Collapse=Collapse.default,exports.forwardRef=forwardRef.default,exports.toArray=toArray.default,exports.useForm=useForm.default,exports.CssBaseline=CssBaseline.default,exports.useTheme=ThemeContext.useTheme,exports.themeUtils=utils.default,exports.Col=Col.Col,exports.Tab=Tab.Tab,exports.MenuItem=MenuItem.MenuItem,exports.MenuLabel=MenuLabel.MenuLabel,exports.BadgeAnchor=BadgeAnchor.BadgeAnchor,exports.Description=Description.Description,exports.Field=Field.Field,exports.FormList=FieldForm.List,exports.useWatch=FieldForm.useWatch,exports.FormItem=FormItem.FormItem,exports.Modal=Modal.Modal,exports.useModal=ModalContext.useModal,exports.CheckboxGroup=CheckboxGroup.CheckboxGroup,exports.RadioGroup=RadioGroup.RadioGroup,exports.BannerTip=BannerTip.BannerTip,exports.notify=toast__default,exports.Slider=Slider.Slider,exports.RangeSlider=RangeSlider.RangeSlider,exports.Step=Step.Step,exports.StepCompleted=StepCompleted.StepCompleted,exports.TabStep=TabStep.TabStep;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React);function createSafeContext(e){const r=React.createContext(null);return[({children:t,value:n})=>React__default.createElement(r.Provider,{value:n},t),()=>{const t=React.useContext(r);if(t===null)throw new Error(e);return t}]}exports.createSafeContext=createSafeContext;
|
|
2
|
+
//# sourceMappingURL=createSafeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSafeContext.js","sources":["../../src/utils/createSafeContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\n\nexport function createSafeContext<ContextValue>(errorMessage: string) {\n const Context = createContext<ContextValue | null>(null);\n\n const useSafeContext = () => {\n const ctx = useContext(Context);\n\n if (ctx === null) {\n throw new Error(errorMessage);\n }\n\n return ctx;\n };\n\n const Provider = ({ children, value }: { value: ContextValue; children: React.ReactNode }) => (\n <Context.Provider value={value}>{children}</Context.Provider>\n );\n\n return [Provider, useSafeContext] as const;\n}\n"],"names":["createContext","useContext","React"],"mappings":";;;;;;;;;;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE;AAChD,EAAE,MAAM,OAAO,GAAGA,mBAAa,CAAC,IAAI,CAAC,CAAC;AACtC,EAAE,MAAM,cAAc,GAAG,MAAM;AAC/B,IAAI,MAAM,GAAG,GAAGC,gBAAU,CAAC,OAAO,CAAC,CAAC;AACpC,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;AACtB,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,CAAC;AACJ,EAAE,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqBC,cAAK,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE;AAClG,IAAI,KAAK;AACT,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACpC;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React);function isElement(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==React__default.Fragment:!1}exports.isElement=isElement;
|
|
2
|
+
//# sourceMappingURL=isElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isElement.js","sources":["../../src/utils/isElement.ts"],"sourcesContent":["import React from 'react';\n\nexport function isElement(value: any): value is React.ReactElement {\n if (Array.isArray(value) || value === null) {\n return false;\n }\n\n if (typeof value === 'object') {\n if (value.type === React.Fragment) {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;AAC9C,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAKA,cAAK,CAAC,QAAQ,EAAE;AACvC,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upperFirst.js","sources":["../../src/utils/upperFirst.ts"],"sourcesContent":["export function upperFirst(value: string) {\n return typeof value !== 'string' ? '' : value.charAt(0).toUpperCase() + value.slice(1);\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS,UAAU,CAAC,KAAK,EAAE;AAClC,EAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzF;;;;"}
|
package/esm/Banner/Banner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o,{useState as d}from"react";import a from"styled-components";import{Card as k}from"../Card/Card.js";import{Text as x}from"../Text/Text.js";import C from"../utils/forwardRef.js";import{addColorAlpha as P}from"../utils/color.js";import{BannerTip as f}from"./BannerTip.js";export{BannerTip}from"./BannerTip.js";var R=Object.defineProperty,u=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,v=(e,r,n)=>r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,I=(e,r)=>{for(var n in r||(r={}))K.call(r,n)&&v(e,n,r[n]);if(u)for(var n of u(r))N.call(r,n)&&v(e,n,r[n]);return e};const S=a.div`
|
|
2
2
|
padding: 24px 20px 21px;
|
|
3
3
|
display: flex;
|
|
4
|
-
|
|
4
|
+
`,$=a.div`
|
|
5
5
|
border-radius: 100px 0 100px 100px;
|
|
6
6
|
background-color: ${({theme:e})=>e.palette.accents_1};
|
|
7
7
|
padding: 6px;
|
|
@@ -14,21 +14,21 @@ import a,{useState as b}from"react";import o from"styled-components";import{Card
|
|
|
14
14
|
width: 48px;
|
|
15
15
|
height: 48px;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,A=a.div`
|
|
18
18
|
line-height: 20px;
|
|
19
19
|
h3 {
|
|
20
20
|
margin-bottom: 0;
|
|
21
21
|
line-height: 32px;
|
|
22
|
-
text-shadow: 0 4px 8px ${({theme:e})=>
|
|
22
|
+
text-shadow: 0 4px 8px ${({theme:e})=>P(e.palette.accents_8,.1)};
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`,z=a.div`
|
|
25
25
|
& > div {
|
|
26
26
|
&:last-of-type {
|
|
27
27
|
border-radius: 0 0 4px 4px;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,V=a.div`
|
|
31
31
|
padding: 8px 14px;
|
|
32
32
|
background-color: ${({theme:e})=>e.palette.accents_1};
|
|
33
|
-
`,
|
|
33
|
+
`,h=C(({icon:e,title:r,description:n,children:y,className:_},g)=>{const[l,c]=d(),[i,T]=d([]),E=t=>{c(t===l?"":t)},b=t=>{i.push(t),T([...i,t])},m=[],s=[];return o.Children.forEach(y,t=>{t.type===f?t.key&&i.indexOf(t.key)<0&&m.push(I({key:t.key},t.props)):s.push(t)}),o.createElement(k,{ref:g,padding:0,className:_},o.createElement(S,{className:"banner-title"},o.createElement($,null,e),o.createElement(A,null,o.createElement(x,{variant:"h3",size:24,color:"accents_8"},r),o.createElement(x,{color:"accents_5"},n))),o.createElement(z,{className:"banner-extra"},s.length>0&&o.createElement(V,null,s),m.map(t=>{const{key:p,title:B,removable:w,operations:O}=t,j=p===l;return o.createElement(f,{key:p,tipKey:p,open:j,title:B,removable:w,onClick:()=>E(p),operations:O,onRemove:b},t.children)})))});h.displayName="@kubed/components/Banner";export{h as Banner};
|
|
34
34
|
//# sourceMappingURL=Banner.js.map
|
package/esm/Banner/Banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","sources":["../../src/Banner/Banner.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Card } from '../Card/Card';\nimport { Text } from '../Text/Text';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\nimport { BannerTip } from './BannerTip';\n\nexport { BannerTip };\n\nconst BannerTitle = styled.div`\n padding: 24px 20px 21px;\n display: flex;\n`;\n\nconst BannerIcon = styled.div`\n border-radius: 100px 0 100px 100px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n padding: 6px;\n margin-right: 12px;\n width: 60px;\n height: 60px;\n margin-top: -1px;\n\n .kubed-icon {\n width: 48px;\n height: 48px;\n }\n`;\n\nconst BannerText = styled.div`\n line-height: 20px;\n h3 {\n margin-bottom: 0;\n line-height: 32px;\n text-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.1)};\n }\n`;\n\nconst BannerExtra = styled.div`\n & > div {\n &:last-of-type {\n border-radius: 0 0 4px 4px;\n }\n }\n`;\n\nconst BannerNavs = styled.div`\n padding: 8px 14px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nexport interface BannerProps extends DefaultProps {\n /** Icon of banner */\n icon?: React.ReactNode;\n\n /** Title of banner */\n title?: React.ReactNode;\n\n /** Description of banner */\n description?: React.ReactNode;\n}\n\nexport const Banner = forwardRef<BannerProps, 'div'>(\n ({ icon, title, description, children, className }, ref) => {\n const [activeKey, setActiveKey] = useState<string>();\n const onTipClick = (key) => {\n if (key === activeKey) {\n setActiveKey('');\n } else {\n setActiveKey(key);\n }\n };\n const tips = [];\n const others = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n if (child.type === BannerTip) {\n tips.push({ key: child.key, ...child.props });\n } else {\n others.push(child);\n }\n });\n\n return (\n <Card ref={ref} padding={0} className={className}>\n <BannerTitle className=\"banner-title\">\n <BannerIcon>{icon}</BannerIcon>\n <BannerText>\n <Text variant=\"h3\" size={24} color=\"accents_8\">\n {title}\n </Text>\n <Text color=\"accents_5\">{description}</Text>\n </BannerText>\n </BannerTitle>\n <BannerExtra className=\"banner-extra\">\n {others.length > 0 && <BannerNavs>{others}</BannerNavs>}\n {tips.map((tip) => {\n const { key, title: tipTitle } = tip;\n const isOpen = key === activeKey;\n return (\n <BannerTip
|
|
1
|
+
{"version":3,"file":"Banner.js","sources":["../../src/Banner/Banner.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Card } from '../Card/Card';\nimport { Text } from '../Text/Text';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\nimport { BannerTip, BannerTipProps } from './BannerTip';\n\nexport { BannerTip };\n\nconst BannerTitle = styled.div`\n padding: 24px 20px 21px;\n display: flex;\n`;\n\nconst BannerIcon = styled.div`\n border-radius: 100px 0 100px 100px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n padding: 6px;\n margin-right: 12px;\n width: 60px;\n height: 60px;\n margin-top: -1px;\n\n .kubed-icon {\n width: 48px;\n height: 48px;\n }\n`;\n\nconst BannerText = styled.div`\n line-height: 20px;\n h3 {\n margin-bottom: 0;\n line-height: 32px;\n text-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.1)};\n }\n`;\n\nconst BannerExtra = styled.div`\n & > div {\n &:last-of-type {\n border-radius: 0 0 4px 4px;\n }\n }\n`;\n\nconst BannerNavs = styled.div`\n padding: 8px 14px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nexport interface BannerProps extends DefaultProps {\n /** Icon of banner */\n icon?: React.ReactNode;\n\n /** Title of banner */\n title?: React.ReactNode;\n\n /** Description of banner */\n description?: React.ReactNode;\n}\n\nexport const Banner = forwardRef<BannerProps, 'div'>(\n ({ icon, title, description, children, className }, ref) => {\n const [activeKey, setActiveKey] = useState<string>();\n const [removedTipKeys, setRemovedTipKeys] = useState<Array<string | number>>([]);\n const onTipClick = (key) => {\n if (key === activeKey) {\n setActiveKey('');\n } else {\n setActiveKey(key);\n }\n };\n\n const onTipRemove = (key) => {\n removedTipKeys.push(key);\n setRemovedTipKeys([...removedTipKeys, key]);\n };\n\n const tips: BannerTipProps[] = [];\n const others = [];\n\n React.Children.forEach(children, (child: React.ReactElement) => {\n if (child.type === BannerTip) {\n if (child.key && removedTipKeys.indexOf(child.key) < 0) {\n tips.push({ key: child.key, ...child.props });\n }\n } else {\n others.push(child);\n }\n });\n\n return (\n <Card ref={ref} padding={0} className={className}>\n <BannerTitle className=\"banner-title\">\n <BannerIcon>{icon}</BannerIcon>\n <BannerText>\n <Text variant=\"h3\" size={24} color=\"accents_8\">\n {title}\n </Text>\n <Text color=\"accents_5\">{description}</Text>\n </BannerText>\n </BannerTitle>\n <BannerExtra className=\"banner-extra\">\n {others.length > 0 && <BannerNavs>{others}</BannerNavs>}\n {tips.map((tip) => {\n const { key, title: tipTitle, removable, operations } = tip;\n const isOpen = key === activeKey;\n return (\n <BannerTip\n key={key}\n tipKey={key}\n open={isOpen}\n title={tipTitle}\n removable={removable}\n onClick={() => onTipClick(key)}\n operations={operations}\n onRemove={onTipRemove}\n >\n {tip.children}\n </BannerTip>\n );\n })}\n </BannerExtra>\n </Card>\n );\n }\n);\n\nBanner.displayName = '@kubed/components/Banner';\n"],"names":["React"],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI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Banner/BannerTip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"react";import o from"styled-components";import{ChevronDown as
|
|
1
|
+
import t from"react";import o from"styled-components";import{ChevronDown as h,ChevronRight as x,Close as g}from"@kubed/icons";import{Text as i}from"../Text/Text.js";import{addColorAlpha as f}from"../utils/color.js";const b=o.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
padding: 12px 60px 12px 52px;
|
|
4
4
|
background-color: ${({theme:e})=>e.palette.background};
|
|
@@ -9,7 +9,7 @@ import t from"react";import o from"styled-components";import{ChevronDown as c,Ch
|
|
|
9
9
|
&:hover {
|
|
10
10
|
background-color: ${({theme:e})=>e.palette.accents_0};
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
12
|
+
`,v=o.div`
|
|
13
13
|
position: absolute;
|
|
14
14
|
top: 11px;
|
|
15
15
|
left: 24px;
|
|
@@ -18,10 +18,10 @@ import t from"react";import o from"styled-components";import{ChevronDown as c,Ch
|
|
|
18
18
|
width: 20px;
|
|
19
19
|
height: 20px;
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,T=o.div`
|
|
22
22
|
font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,
|
|
23
23
|
微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;
|
|
24
|
-
`,
|
|
24
|
+
`,k=o.div`
|
|
25
25
|
position: absolute;
|
|
26
26
|
top: 50%;
|
|
27
27
|
transform: translateY(-50%);
|
|
@@ -31,8 +31,8 @@ import t from"react";import o from"styled-components";import{ChevronDown as c,Ch
|
|
|
31
31
|
.kubed-icon {
|
|
32
32
|
border-radius: 3px;
|
|
33
33
|
&:hover {
|
|
34
|
-
background-color: ${({theme:e})=>
|
|
34
|
+
background-color: ${({theme:e})=>f(e.palette.accents_1,.6)};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
`;function r({title:e,children:a,onClick:l,open:n}){return t.createElement(
|
|
37
|
+
`;function r({title:e,children:a,onClick:l,open:n,removable:c=!0,operations:p,onRemove:s=()=>{},tipKey:d}){const m=u=>{u.stopPropagation(),s(d)};return t.createElement(b,{onClick:l},t.createElement(v,null,n?t.createElement(h,null):t.createElement(x,null)),t.createElement(T,null,t.createElement(i,{weight:700},e),n&&t.createElement(i,{color:"accents_5"},a)),t.createElement(k,null,p,c&&t.createElement(g,{size:20,onClick:m})))}r.displayName="@kubed/components/BannerTip";export{r as BannerTip};
|
|
38
38
|
//# sourceMappingURL=BannerTip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerTip.js","sources":["../../src/Banner/BannerTip.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { ChevronRight, ChevronDown, Close } from '@kubed/icons';\nimport { Text } from '../Text/Text';\nimport { addColorAlpha } from '../utils/color';\n\nconst TipWrapper = styled.div`\n position: relative;\n padding: 12px 60px 12px 52px;\n background-color: ${({ theme }) => theme.palette.background};\n border-top: 1px solid ${({ theme }) => theme.palette.accents_2};\n cursor: pointer;\n line-height: 1.67;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n\nconst TipIcon = styled.div`\n position: absolute;\n top: 11px;\n left: 24px;\n\n .kubed-icon {\n width: 20px;\n height: 20px;\n }\n`;\n\nconst TipContent = styled.div`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n`;\n\nconst TipOperations = styled.div`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 20px;\n display: inline-flex;\n\n .kubed-icon {\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_1, 0.6)};\n }\n }\n`;\n\nexport interface BannerTipProps {\n /** Title of banner tip */\n title?: React.ReactNode;\n\n /** children of banner tip */\n children?: React.ReactNode;\n\n /** Tip's key */\n key?: string;\n\n /** Tip open or not */\n open?: boolean;\n\n /** Callback of click event */\n onClick?: () => void;\n}\n\nexport function BannerTip({
|
|
1
|
+
{"version":3,"file":"BannerTip.js","sources":["../../src/Banner/BannerTip.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { ChevronRight, ChevronDown, Close } from '@kubed/icons';\nimport { Text } from '../Text/Text';\nimport { addColorAlpha } from '../utils/color';\n\nconst TipWrapper = styled.div`\n position: relative;\n padding: 12px 60px 12px 52px;\n background-color: ${({ theme }) => theme.palette.background};\n border-top: 1px solid ${({ theme }) => theme.palette.accents_2};\n cursor: pointer;\n line-height: 1.67;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n\nconst TipIcon = styled.div`\n position: absolute;\n top: 11px;\n left: 24px;\n\n .kubed-icon {\n width: 20px;\n height: 20px;\n }\n`;\n\nconst TipContent = styled.div`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n`;\n\nconst TipOperations = styled.div`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 20px;\n display: inline-flex;\n\n .kubed-icon {\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_1, 0.6)};\n }\n }\n`;\n\nexport interface BannerTipProps {\n /** Title of banner tip */\n title?: React.ReactNode;\n\n /** children of banner tip */\n children?: React.ReactNode;\n\n /** operations element of banner tip */\n operations?: React.ReactNode;\n\n /** Tip's key */\n key: string;\n\n /** Tip's key */\n tipKey?: string;\n\n /** Tip open or not */\n open?: boolean;\n\n /** Callback of click event */\n onClick?: () => void;\n\n /** Callback of click event */\n onRemove?: (key) => void;\n\n /** Whether Tip can be removed */\n removable?: boolean;\n}\n\nexport function BannerTip({\n title,\n children,\n onClick,\n open,\n removable = true,\n operations,\n onRemove = () => {},\n tipKey,\n}: BannerTipProps) {\n const handleRemove = (e: React.MouseEvent<SVGElement>) => {\n e.stopPropagation();\n onRemove(tipKey);\n };\n\n return (\n <TipWrapper onClick={onClick}>\n <TipIcon>{open ? <ChevronDown /> : <ChevronRight />}</TipIcon>\n <TipContent>\n <Text weight={700}>{title}</Text>\n {open && <Text color=\"accents_5\">{children}</Text>}\n </TipContent>\n <TipOperations>\n {operations}\n {removable && <Close size={20} onClick={handleRemove} />}\n </TipOperations>\n </TipWrapper>\n );\n}\n\nBannerTip.displayName = '@kubed/components/BannerTip';\n"],"names":["React"],"mappings":";;;;;;AAKA,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC;AAC9B;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;AAC9D,wBAAwB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AACjE;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA,CAAC,CAAC;AACF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC;AAC9B;AACA;AACA,CAAC,CAAC;AACF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AACrF;AACA;AACA,CAAC,CAAC;A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
{"version":3,"file":"Dropzone.context.js","sources":["../../src/Dropzone/Dropzone.context.ts"],"sourcesContent":["import { createSafeContext } from '../utils/createSafeContext';\n\nexport interface DropzoneContextValue {\n idle: boolean;\n accept: boolean;\n reject: boolean;\n}\n\nexport const [DropzoneProvider, useDropzoneContext] = createSafeContext<DropzoneContextValue>(\n 'Dropzone component was not found in tree'\n);\n"],"names":[],"mappings":";;AACY,MAAC,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG,iBAAiB,CAAC,0CAA0C;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"react";import{useDropzone as Q}from"react-dropzone";import{assignRef as T}from"@kubed/hooks";import{LoadingOverlay as U}from"../LoadingOverlay/LoadingOverlay.js";import{DropzoneProvider as X}from"./Dropzone.context.js";import{DropzoneAccept as Y,DropzoneReject as Z,DropzoneIdle as $}from"./DropzoneStatus.js";import{DropzoneWrapper as ee,DropzoneInner as re}from"./Dropzone.styles.js";var oe=Object.defineProperty,ae=Object.defineProperties,te=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,f=(e,r,o)=>r in e?oe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,i=(e,r)=>{for(var o in r||(r={}))g.call(r,o)&&f(e,o,r[o]);if(l)for(var o of l(r))u.call(r,o)&&f(e,o,r[o]);return e},m=(e,r)=>ae(e,te(r)),ne=(e,r)=>{var o={};for(var a in e)g.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&l)for(var a of l(e))r.indexOf(a)<0&&u.call(e,a)&&(o[a]=e[a]);return o};function t(e){const r=e,{className:o,padding:a,radius:le,disabled:O,classNames:pe,styles:ce,loading:p=!1,multiple:_=!0,maxSize:y=1/0,accept:c,children:b,onDropAny:j,onDrop:z,onReject:P,openRef:E,name:F,maxFiles:A,autoFocus:R,activateOnClick:I=!0,activateOnDrag:w=!0,dragEventsBubbling:x=!0,activateOnKeyboard:h=!0,onDragEnter:N,onDragLeave:C,onDragOver:L,onFileDialogCancel:S,onFileDialogOpen:k,preventDropOnDocument:B,useFsAccessApi:K=!0,getFilesFromEvent:v,validator:V}=r,W=ne(r,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator"]),{getRootProps:q,getInputProps:G,isDragAccept:s,isDragReject:d,open:H}=Q(i({onDrop:j,onDropAccepted:z,onDropRejected:P,disabled:O||p,accept:Array.isArray(c)?c.reduce((J,M)=>m(i({},J),{[M]:[]}),{}):c,multiple:_,maxSize:y,maxFiles:A,autoFocus:R,noClick:!I,noDrag:!w,noDragEventsBubbling:!x,noKeyboard:!h,onDragEnter:N,onDragLeave:C,onDragOver:L,onFileDialogCancel:S,onFileDialogOpen:k,preventDropOnDocument:B,useFsAccessApi:K,validator:V},v?{getFilesFromEvent:v}:null));T(E,H);const D=!s&&!d;return n.createElement(X,{value:{accept:s,reject:d,idle:D}},n.createElement(ee,m(i(i({},W),q()),{"data-accept":s||void 0,"data-reject":d||void 0,"data-idle":D||void 0,"data-loading":p||void 0,className:o}),n.createElement(U,{visible:p}),n.createElement("input",m(i({},G()),{name:F})),n.createElement(re,null,b)))}t.displayName="@mantine/dropzone/Dropzone",t.Accept=Y,t.Reject=Z,t.Idle=$;const ie=t;export{ie as Dropzone,t as _Dropzone};
|
|
2
|
+
//# sourceMappingURL=Dropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropzone.js","sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n FileRejection,\n Accept,\n FileWithPath,\n DropEvent,\n FileError,\n} from 'react-dropzone';\nimport { assignRef } from '@kubed/hooks';\n\nimport { ForwardRefWithStaticComponents } from '../utils/ForwardRefWithStaticComponents';\nimport { LoadingOverlay } from '../LoadingOverlay/LoadingOverlay';\nimport { DefaultProps, KubedNumberSize } from '../theme';\nimport { DropzoneProvider } from './Dropzone.context';\nimport { DropzoneAccept, DropzoneIdle, DropzoneReject } from './DropzoneStatus';\n\nimport { DropzoneWrapper, DropzoneInner } from './Dropzone.styles';\n\nexport interface DropzoneProps\n extends DefaultProps,\n Omit<React.ComponentPropsWithRef<'div'>, 'onDrop'> {\n /** Padding from theme.spacing, or number to set padding in px */\n padding?: KubedNumberSize;\n\n /** Border radius from theme.radius or number to set border-radius in px */\n radius?: KubedNumberSize;\n\n /** Dropzone statues */\n children: React.ReactNode;\n\n /** Disable files capturing */\n disabled?: boolean;\n\n /** Called when any files are dropped into dropzone */\n onDropAny?(files: FileWithPath[], fileRejections: FileRejection[]): void;\n\n /** Called when valid files are dropped into dropzone */\n onDrop(files: FileWithPath[]): void;\n\n /** Called when selected files don't meet file restrictions */\n onReject?(fileRejections: FileRejection[]): void;\n\n /** Display loading overlay over dropzone */\n loading?: boolean;\n\n /** File types to accept */\n accept?: Accept | string[];\n\n /** Get open function as ref */\n openRef?: React.ForwardedRef<() => void | undefined>;\n\n /** Allow selection of multiple files */\n multiple?: boolean;\n\n /** Set maximum file size in bytes */\n maxSize?: number;\n\n /** Name of the form control. Submitted with the form as part of a name/value pair. */\n name?: string;\n\n /** Number of files that user can pick */\n maxFiles?: number;\n\n /** Set to true to autofocus the root element */\n autoFocus?: boolean;\n\n /** If false, disables click to open the native file selection dialog */\n activateOnClick?: boolean;\n\n /** If false, disables drag 'n' drop */\n activateOnDrag?: boolean;\n\n /** If false, disables Space/Enter to open the native file selection dialog. Note that it also stops tracking the focus state. */\n activateOnKeyboard?: boolean;\n\n /** If false, stops drag event propagation to parents */\n dragEventsBubbling?: boolean;\n\n /** Called when the `dragenter` event occurs */\n onDragEnter?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragleave` event occurs */\n onDragLeave?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragover` event occurs */\n onDragOver?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when user closes the file selection dialog with no selection */\n onFileDialogCancel?(): void;\n\n /** Called when user opens the file selection dialog */\n onFileDialogOpen?(): void;\n\n /** If false, allow dropped items to take over the current browser window */\n preventDropOnDocument?: boolean;\n\n /** Set to true to use the File System Access API to open the file picker instead of using an <input type=\"file\"> click event, defaults to true */\n useFsAccessApi?: boolean;\n\n /** Use this to provide a custom file aggregator */\n getFilesFromEvent?: (event: DropEvent) => Promise<Array<File | DataTransferItem>>;\n\n /** Custom validation function. It must return null if there's no errors. */\n validator?: <T extends File>(file: T) => FileError | FileError[] | null;\n}\n\nexport function _Dropzone(props: DropzoneProps) {\n const {\n className,\n padding,\n radius,\n disabled,\n classNames,\n styles,\n loading = false,\n multiple = true,\n maxSize = Infinity,\n accept,\n children,\n onDropAny,\n onDrop,\n onReject,\n openRef,\n name,\n // unstyled,\n maxFiles,\n autoFocus,\n activateOnClick = true,\n activateOnDrag = true,\n dragEventsBubbling = true,\n activateOnKeyboard = true,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n useFsAccessApi = true,\n getFilesFromEvent,\n validator,\n ...others\n } = props;\n\n const { getRootProps, getInputProps, isDragAccept, isDragReject, open } = useDropzone({\n onDrop: onDropAny,\n onDropAccepted: onDrop,\n onDropRejected: onReject,\n disabled: disabled || loading,\n accept: Array.isArray(accept) ? accept.reduce((r, key) => ({ ...r, [key]: [] }), {}) : accept,\n multiple,\n maxSize,\n maxFiles,\n autoFocus,\n noClick: !activateOnClick,\n noDrag: !activateOnDrag,\n noDragEventsBubbling: !dragEventsBubbling,\n noKeyboard: !activateOnKeyboard,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n useFsAccessApi,\n validator,\n ...(getFilesFromEvent ? { getFilesFromEvent } : null),\n });\n\n assignRef(openRef, open);\n const isIdle = !isDragAccept && !isDragReject;\n\n return (\n <DropzoneProvider value={{ accept: isDragAccept, reject: isDragReject, idle: isIdle }}>\n <DropzoneWrapper\n {...others}\n {...getRootProps()}\n data-accept={isDragAccept || undefined}\n data-reject={isDragReject || undefined}\n data-idle={isIdle || undefined}\n data-loading={loading || undefined}\n className={className}\n >\n <LoadingOverlay visible={loading} />\n <input {...getInputProps()} name={name} />\n <DropzoneInner>{children}</DropzoneInner>\n </DropzoneWrapper>\n </DropzoneProvider>\n );\n}\n\n_Dropzone.displayName = '@mantine/dropzone/Dropzone';\n_Dropzone.Accept = DropzoneAccept;\n_Dropzone.Reject = DropzoneReject;\n_Dropzone.Idle = DropzoneIdle;\n\nexport const Dropzone: ForwardRefWithStaticComponents<\n DropzoneProps,\n {\n Accept: typeof DropzoneAccept;\n Reject: typeof DropzoneReject;\n Idle: typeof DropzoneIdle;\n }\n> = _Dropzone as any;\n"],"names":["React"],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,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G,cAAc,CAAC;AAClC,SAAS,CAAC,IAAI,GAAG,YAAY,CAAC;AAClB,MAAC,QAAQ,GAAG;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from"styled-components";const r=e.div`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
user-select: none;
|
|
5
|
+
position: relative;
|
|
6
|
+
transition: background-color 150ms ease;
|
|
7
|
+
border: 2px dashed ${({theme:o})=>o.palette.border};
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
padding: 16px;
|
|
10
|
+
`,n=e.div`
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
user-select: none;
|
|
13
|
+
`;export{n as DropzoneInner,r as DropzoneWrapper};
|
|
14
|
+
//# sourceMappingURL=Dropzone.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropzone.styles.js","sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const DropzoneWrapper = styled.div`\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n position: relative;\n transition: background-color 150ms ease;\n border: 2px dashed ${({ theme }) => theme.palette.border};\n border-radius: 4px;\n padding: 16px;\n`;\n\nexport const DropzoneInner = styled.div`\n pointer-events: none;\n user-select: none;\n`;\n"],"names":[],"mappings":";;AACY,MAAC,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA,qBAAqB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAC3D;AACA;AACA,EAAE;AACU,MAAC,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC;AACxC;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import s,{cloneElement as m}from"react";import{isElement as f}from"../utils/isElement.js";import{upperFirst as _}from"../utils/upperFirst.js";import{useDropzoneContext as u}from"./Dropzone.context.js";var l=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,O=(t,r)=>{var n={};for(var e in t)d.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(t!=null&&l)for(var e of l(t))r.indexOf(e)<0&&j.call(t,e)&&(n[e]=t[e]);return n};function p(t){const r=n=>{const e=n,{children:o}=e,a=O(e,["children"]),c=u(),i=f(o)?o:s.createElement("span",null,o);return c[t]?m(i,a):null};return r.displayName=`@kubed/components/Dropzone/${_(t)}`,r}const b=p("accept"),y=p("reject"),v=p("idle");export{b as DropzoneAccept,v as DropzoneIdle,y as DropzoneReject};
|
|
2
|
+
//# sourceMappingURL=DropzoneStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropzoneStatus.js","sources":["../../src/Dropzone/DropzoneStatus.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '../utils/isElement';\nimport { upperFirst } from '../utils/upperFirst';\nimport { DropzoneContextValue, useDropzoneContext } from './Dropzone.context';\n\nexport interface DropzoneStatusProps {\n // eslint-disable-next-line react/no-unused-prop-types\n children: React.ReactNode;\n}\n\nfunction createDropzoneStatus(status: keyof DropzoneContextValue) {\n const Component = (props: DropzoneStatusProps): JSX.Element => {\n const { children, ...others } = props;\n\n const ctx = useDropzoneContext();\n const _children = isElement(children) ? children : <span>{children}</span>;\n\n if (ctx[status]) {\n return cloneElement(_children, others);\n }\n\n return null;\n };\n\n Component.displayName = `@kubed/components/Dropzone/${upperFirst(status)}`;\n\n return Component;\n}\n\nexport const DropzoneAccept = createDropzoneStatus('accept');\nexport const DropzoneReject = createDropzoneStatus('reject');\nexport const DropzoneIdle = createDropzoneStatus('idle');\n\nexport type DropzoneAcceptProps = DropzoneStatusProps;\nexport type DropzoneRejectProps = DropzoneStatusProps;\nexport type DropzoneIdleProps = DropzoneStatusProps;\n"],"names":["React"],"mappings":";;;;;AAAA,IAAI,mBAAmB,GAAG,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a,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE;AACrB,MAAM,OAAO,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAC7C,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,WAAW,GAAG,CAAC,2BAA2B,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7E,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACW,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,YAAY,GAAG,oBAAoB,CAAC,MAAM;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{KubedConfigProvider}from"./ConfigProvider/index.js";export{Button}from"./Button/Button.js";export{Group}from"./Group/Group.js";export{Container,sizes}from"./Container/Container.js";export{Center}from"./Center/Center.js";export{Row}from"./Grid/Row.js";export{Navs}from"./Navs/Navs.js";export{Snippet}from"./Snippet/Snippet.js";export{Tabs}from"./Tabs/Tabs.js";export{Text}from"./Text/Text.js";export{Tooltip}from"./Tooltip/Tooltip.js";export{Popover}from"./Popover/Popover.js";export{Divider}from"./Divider/Divider.js";export{Menu}from"./Menu/Menu.js";export{StatusDot}from"./StatusDot/StatusDot.js";export{Tag}from"./Tag/Tag.js";export{Badge}from"./Badge/Badge.js";export{Alert}from"./Alert/Alert.js";export{Card}from"./Card/Card.js";export{Descriptions}from"./Descriptions/Descriptions.js";export{Entity}from"./Entity/Entity.js";export{Dropdown}from"./Dropdown/Dropdown.js";export{LoadingOverlay}from"./LoadingOverlay/LoadingOverlay.js";export{Input,fixControlledValue}from"./Input/Input.js";export{InputPassword}from"./InputPassword/InputPassword.js";export{FilterInput}from"./FilterInput/FilterInput.js";export{Textarea}from"./Textarea/Textarea.js";export{Empty}from"./Empty/Empty.js";export{Form}from"./Form/Form.js";export{Select}from"./Select/Select.js";export{Checkbox}from"./Checkbox/Checkbox.js";export{Radio}from"./Radio/Radio.js";export{Switch}from"./Switch/Switch.js";export{InputNumber}from"./InputNumber/InputNumber.js";export{DatePicker}from"./DatePicker/DatePicker.js";export{Banner}from"./Banner/Banner.js";export{Notify}from"./Notify/Notify.js";export{AutoComplete}from"./AutoComplete/AutoComplete.js";export{ActionConfirm}from"./ActionConfirm/ActionConfirm.js";export{Progress}from"./Progress/Progress.js";export{addColorAlpha,colorToRgbValues}from"./utils/color.js";export{Steps}from"./Steps/Steps.js";export{TypeSelect}from"./TypeSelect/TypeSelect.js";export{ShowMore}from"./ShowMore/ShowMore.js";export{Loading}from"./Loading/Loading.js";export{default as TimePicker}from"./TimePicker/TimePicker.js";export{default as Drawer}from"./Drawer/Drawer.js";export{default as Collapse}from"./Collapse/Collapse.js";export{default as forwardRef}from"./utils/forwardRef.js";export{default as toArray}from"./utils/toArray.js";export{default as useForm}from"./Form/hooks/useForm.js";export{default as CssBaseline}from"./theme/CssBaseline.js";export{useTheme}from"./theme/ThemeContext.js";export{default as themeUtils}from"./theme/utils.js";export{Col}from"./Grid/Col.js";export{Tab}from"./Tabs/Tab/Tab.js";export{MenuItem}from"./Menu/MenuItem/MenuItem.js";export{MenuLabel}from"./Menu/MenuLabel/MenuLabel.js";export{BadgeAnchor}from"./Badge/BadgeAnchor.js";export{Description}from"./Descriptions/Description.js";export{Field}from"./Entity/Field.js";export{List as FormList,useWatch}from"rc-field-form";export{FormItem}from"./Form/FormItem/FormItem.js";export{Modal}from"./Modal/Modal.js";export{useModal}from"./Modal/ModalProvider/ModalContext.js";export{CheckboxGroup}from"./Checkbox/CheckboxGroup.js";export{RadioGroup}from"./Radio/RadioGroup.js";export{BannerTip}from"./Banner/BannerTip.js";export{default as notify}from"react-hot-toast";export{Slider}from"./Slider/Slider/Slider.js";export{RangeSlider}from"./Slider/RangeSlider/RangeSlider.js";export{Step}from"./Steps/Step/Step.js";export{StepCompleted}from"./Steps/StepCompleted/StepCompleted.js";export{TabStep}from"./Steps/TabStep/TabStep.js";
|
|
1
|
+
export{KubedConfigProvider}from"./ConfigProvider/index.js";export{Button}from"./Button/Button.js";export{Group}from"./Group/Group.js";export{Container,sizes}from"./Container/Container.js";export{Center}from"./Center/Center.js";export{Row}from"./Grid/Row.js";export{Navs}from"./Navs/Navs.js";export{Snippet}from"./Snippet/Snippet.js";export{Tabs}from"./Tabs/Tabs.js";export{Text}from"./Text/Text.js";export{Tooltip}from"./Tooltip/Tooltip.js";export{Popover}from"./Popover/Popover.js";export{Divider}from"./Divider/Divider.js";export{Menu}from"./Menu/Menu.js";export{StatusDot}from"./StatusDot/StatusDot.js";export{Tag}from"./Tag/Tag.js";export{Badge}from"./Badge/Badge.js";export{Alert}from"./Alert/Alert.js";export{Card}from"./Card/Card.js";export{Descriptions}from"./Descriptions/Descriptions.js";export{Entity}from"./Entity/Entity.js";export{Dropdown}from"./Dropdown/Dropdown.js";export{LoadingOverlay}from"./LoadingOverlay/LoadingOverlay.js";export{Input,fixControlledValue}from"./Input/Input.js";export{InputPassword}from"./InputPassword/InputPassword.js";export{FilterInput}from"./FilterInput/FilterInput.js";export{Textarea}from"./Textarea/Textarea.js";export{Empty}from"./Empty/Empty.js";export{Form}from"./Form/Form.js";export{Select}from"./Select/Select.js";export{Checkbox}from"./Checkbox/Checkbox.js";export{Radio}from"./Radio/Radio.js";export{Switch}from"./Switch/Switch.js";export{InputNumber}from"./InputNumber/InputNumber.js";export{DatePicker}from"./DatePicker/DatePicker.js";export{Banner}from"./Banner/Banner.js";export{Notify}from"./Notify/Notify.js";export{AutoComplete}from"./AutoComplete/AutoComplete.js";export{ActionConfirm}from"./ActionConfirm/ActionConfirm.js";export{Progress}from"./Progress/Progress.js";export{addColorAlpha,colorToRgbValues}from"./utils/color.js";export{Steps}from"./Steps/Steps.js";export{TypeSelect}from"./TypeSelect/TypeSelect.js";export{ShowMore}from"./ShowMore/ShowMore.js";export{Dropzone,_Dropzone}from"./Dropzone/Dropzone.js";export{Loading}from"./Loading/Loading.js";export{default as TimePicker}from"./TimePicker/TimePicker.js";export{default as Drawer}from"./Drawer/Drawer.js";export{default as Collapse}from"./Collapse/Collapse.js";export{default as forwardRef}from"./utils/forwardRef.js";export{default as toArray}from"./utils/toArray.js";export{default as useForm}from"./Form/hooks/useForm.js";export{default as CssBaseline}from"./theme/CssBaseline.js";export{useTheme}from"./theme/ThemeContext.js";export{default as themeUtils}from"./theme/utils.js";export{Col}from"./Grid/Col.js";export{Tab}from"./Tabs/Tab/Tab.js";export{MenuItem}from"./Menu/MenuItem/MenuItem.js";export{MenuLabel}from"./Menu/MenuLabel/MenuLabel.js";export{BadgeAnchor}from"./Badge/BadgeAnchor.js";export{Description}from"./Descriptions/Description.js";export{Field}from"./Entity/Field.js";export{List as FormList,useWatch}from"rc-field-form";export{FormItem}from"./Form/FormItem/FormItem.js";export{Modal}from"./Modal/Modal.js";export{useModal}from"./Modal/ModalProvider/ModalContext.js";export{CheckboxGroup}from"./Checkbox/CheckboxGroup.js";export{RadioGroup}from"./Radio/RadioGroup.js";export{BannerTip}from"./Banner/BannerTip.js";export{default as notify}from"react-hot-toast";export{Slider}from"./Slider/Slider/Slider.js";export{RangeSlider}from"./Slider/RangeSlider/RangeSlider.js";export{Step}from"./Steps/Step/Step.js";export{StepCompleted}from"./Steps/StepCompleted/StepCompleted.js";export{TabStep}from"./Steps/TabStep/TabStep.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n,{createContext as c,useContext as a}from"react";function u(r){const t=c(null);return[({children:e,value:o})=>n.createElement(t.Provider,{value:o},e),()=>{const e=a(t);if(e===null)throw new Error(r);return e}]}export{u as createSafeContext};
|
|
2
|
+
//# sourceMappingURL=createSafeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSafeContext.js","sources":["../../src/utils/createSafeContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\n\nexport function createSafeContext<ContextValue>(errorMessage: string) {\n const Context = createContext<ContextValue | null>(null);\n\n const useSafeContext = () => {\n const ctx = useContext(Context);\n\n if (ctx === null) {\n throw new Error(errorMessage);\n }\n\n return ctx;\n };\n\n const Provider = ({ children, value }: { value: ContextValue; children: React.ReactNode }) => (\n <Context.Provider value={value}>{children}</Context.Provider>\n );\n\n return [Provider, useSafeContext] as const;\n}\n"],"names":["React"],"mappings":";;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE;AAChD,EAAE,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AACtC,EAAE,MAAM,cAAc,GAAG,MAAM;AAC/B,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;AACpC,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;AACtB,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,CAAC;AACJ,EAAE,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqBA,cAAK,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE;AAClG,IAAI,KAAK;AACT,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACpC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isElement.js","sources":["../../src/utils/isElement.ts"],"sourcesContent":["import React from 'react';\n\nexport function isElement(value: any): value is React.ReactElement {\n if (Array.isArray(value) || value === null) {\n return false;\n }\n\n if (typeof value === 'object') {\n if (value.type === React.Fragment) {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":["React"],"mappings":";;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;AAC9C,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAKA,cAAK,CAAC,QAAQ,EAAE;AACvC,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO,KAAK,CAAC;AACf;;;;"}
|