@toptal/picasso-alert 3.0.35-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.10 → 3.0.35-alpha-1757603192867.0
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/package.json +14 -14
- package/src/AlertInline/AlertInline.tsx +6 -1
- package/LICENSE +0 -20
- package/dist-package/src/Alert/Alert.d.ts +0 -27
- package/dist-package/src/Alert/Alert.d.ts.map +0 -1
- package/dist-package/src/Alert/Alert.js +0 -50
- package/dist-package/src/Alert/Alert.js.map +0 -1
- package/dist-package/src/Alert/index.d.ts +0 -5
- package/dist-package/src/Alert/index.d.ts.map +0 -1
- package/dist-package/src/Alert/index.js +0 -2
- package/dist-package/src/Alert/index.js.map +0 -1
- package/dist-package/src/AlertCompound/index.d.ts +0 -5
- package/dist-package/src/AlertCompound/index.d.ts.map +0 -1
- package/dist-package/src/AlertCompound/index.js +0 -6
- package/dist-package/src/AlertCompound/index.js.map +0 -1
- package/dist-package/src/AlertInline/AlertInline.d.ts +0 -14
- package/dist-package/src/AlertInline/AlertInline.d.ts.map +0 -1
- package/dist-package/src/AlertInline/AlertInline.js +0 -24
- package/dist-package/src/AlertInline/AlertInline.js.map +0 -1
- package/dist-package/src/AlertInline/index.d.ts +0 -5
- package/dist-package/src/AlertInline/index.d.ts.map +0 -1
- package/dist-package/src/AlertInline/index.js +0 -2
- package/dist-package/src/AlertInline/index.js.map +0 -1
- package/dist-package/src/index.d.ts +0 -4
- package/dist-package/src/index.d.ts.map +0 -1
- package/dist-package/src/index.js +0 -4
- package/dist-package/src/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-alert",
|
|
3
|
-
"version": "3.0.35-alpha-
|
|
3
|
+
"version": "3.0.35-alpha-1757603192867.0",
|
|
4
4
|
"description": "Toptal UI components library - Alert",
|
|
5
5
|
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
6
|
+
"access": "public",
|
|
7
|
+
"provenance": true
|
|
7
8
|
},
|
|
8
9
|
"main": "./dist-package/src/index.js",
|
|
9
10
|
"module": "./dist-package/src/index.js",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build:package": "tsc -b tsconfig.json",
|
|
12
|
-
"prepublishOnly": "
|
|
13
|
+
"prepublishOnly": "echo 0"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
|
15
16
|
"type": "git",
|
|
@@ -22,19 +23,19 @@
|
|
|
22
23
|
},
|
|
23
24
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@toptal/picasso-button": "4.0.24-alpha-
|
|
26
|
-
"@toptal/picasso-container": "3.1.3-alpha-
|
|
27
|
-
"@toptal/picasso-icons": "1.12.2-alpha-
|
|
28
|
-
"@toptal/picasso-typography": "4.0.5-alpha-
|
|
29
|
-
"@toptal/picasso-utils": "3.1.1-alpha-
|
|
26
|
+
"@toptal/picasso-button": "4.0.24-alpha-1757603192867.0",
|
|
27
|
+
"@toptal/picasso-container": "3.1.3-alpha-1757603192867.0",
|
|
28
|
+
"@toptal/picasso-icons": "1.12.2-alpha-1757603192867.0",
|
|
29
|
+
"@toptal/picasso-typography": "4.0.5-alpha-1757603192867.0",
|
|
30
|
+
"@toptal/picasso-utils": "3.1.1-alpha-1757603192867.0"
|
|
30
31
|
},
|
|
31
32
|
"sideEffects": [
|
|
32
33
|
"**/styles.ts",
|
|
33
34
|
"**/styles.js"
|
|
34
35
|
],
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@toptal/picasso-provider": "
|
|
37
|
-
"@toptal/picasso-tailwind": "
|
|
37
|
+
"@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
|
|
38
|
+
"@toptal/picasso-tailwind": "3.0.1-alpha-1757603192867.0",
|
|
38
39
|
"react": ">=16.12.0 < 19.0.0"
|
|
39
40
|
},
|
|
40
41
|
"exports": {
|
|
@@ -44,13 +45,12 @@
|
|
|
44
45
|
"./AlertCompound/*": "./dist-package/src/AlertInline/*"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"@toptal/picasso-provider": "5.0.2-alpha-
|
|
48
|
-
"@toptal/picasso-test-utils": "1.1.2-alpha-
|
|
48
|
+
"@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
|
|
49
|
+
"@toptal/picasso-test-utils": "1.1.2-alpha-1757603192867.0"
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"dist-package/**",
|
|
52
53
|
"!dist-package/tsconfig.tsbuildinfo",
|
|
53
54
|
"src"
|
|
54
|
-
]
|
|
55
|
-
"gitHead": "7db07b500402a91f0c09da3be294305a194fd1e4"
|
|
55
|
+
]
|
|
56
56
|
}
|
|
@@ -30,9 +30,10 @@ const icons = {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const AlertInline = forwardRef<HTMLDivElement, Props>(function Alert(
|
|
33
|
-
|
|
33
|
+
props,
|
|
34
34
|
ref
|
|
35
35
|
) {
|
|
36
|
+
const { variant, children, className } = props
|
|
36
37
|
const icon = icons[variant!]
|
|
37
38
|
|
|
38
39
|
let typographyColor = variant as ColorType
|
|
@@ -60,6 +61,10 @@ export const AlertInline = forwardRef<HTMLDivElement, Props>(function Alert(
|
|
|
60
61
|
)
|
|
61
62
|
})
|
|
62
63
|
|
|
64
|
+
AlertInline.defaultProps = {
|
|
65
|
+
variant: 'yellow',
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
AlertInline.displayName = 'AlertInline'
|
|
64
69
|
|
|
65
70
|
export default AlertInline
|
package/LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021-2022 Toptal, LLC
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { BaseProps } from '@toptal/picasso-shared';
|
|
4
|
-
import type { VariantType as ContainerVariants } from '@toptal/picasso-container';
|
|
5
|
-
import type { ButtonSplitProps, ButtonProps } from '@toptal/picasso-button';
|
|
6
|
-
export declare type VariantType = Extract<'red' | 'green' | 'yellow' | 'blue', ContainerVariants>;
|
|
7
|
-
declare type ButtonAction = Omit<ButtonProps, 'size' | 'variant' | 'children'> & {
|
|
8
|
-
label: string;
|
|
9
|
-
menu?: ButtonSplitProps['menu'];
|
|
10
|
-
};
|
|
11
|
-
declare type Actions = {
|
|
12
|
-
primary?: ButtonAction;
|
|
13
|
-
secondary?: ButtonAction;
|
|
14
|
-
};
|
|
15
|
-
export interface Props extends BaseProps {
|
|
16
|
-
/** Main content of the Alert */
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
/** Style variant of Alert */
|
|
19
|
-
variant?: VariantType;
|
|
20
|
-
/** Callback invoked when close is clicked */
|
|
21
|
-
onClose?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
-
/** Optional button actions */
|
|
23
|
-
actions?: Actions;
|
|
24
|
-
}
|
|
25
|
-
export declare const Alert: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
-
export default Alert;
|
|
27
|
-
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAWvD,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE3E,oBAAY,WAAW,GAAG,OAAO,CAC/B,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,EACnC,iBAAiB,CAClB,CAAA;AAED,aAAK,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG;IAGvE,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,aAAK,OAAO,GAAG;IACb,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,SAAS,CAAC,EAAE,YAAY,CAAA;CACzB,CAAA;AAED,MAAM,WAAW,KAAM,SAAQ,SAAS;IACtC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACxD,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAyDD,eAAO,MAAM,KAAK,8EAwChB,CAAA;AAIF,eAAe,KAAK,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React, { forwardRef } from 'react';
|
|
13
|
-
import { SPACING_4 } from '@toptal/picasso-provider';
|
|
14
|
-
import { Container } from '@toptal/picasso-container';
|
|
15
|
-
import { Typography } from '@toptal/picasso-typography';
|
|
16
|
-
import { ButtonCircular, Button, ButtonSplit } from '@toptal/picasso-button';
|
|
17
|
-
import { CloseMinor16, Exclamation16, Done16, Info16, } from '@toptal/picasso-icons';
|
|
18
|
-
const renderAlertCloseButton = ({ onClose }) => (React.createElement(Container, { left: 'small' },
|
|
19
|
-
React.createElement(ButtonCircular, { variant: 'transparent', onClick: onClose, title: 'Close alert', icon: React.createElement(CloseMinor16, { color: 'dark-grey' }) })));
|
|
20
|
-
const renderActionButton = (variant, props) => {
|
|
21
|
-
const { label, menu } = props, rest = __rest(props, ["label", "menu"]);
|
|
22
|
-
if (menu) {
|
|
23
|
-
return (React.createElement(Container, { inline: true },
|
|
24
|
-
React.createElement(ButtonSplit, { menu: menu, variant: variant, size: 'small', onClick: rest.onClick, actionButtonProps: Object.assign({}, rest), "data-testid": 'action-button' }, label)));
|
|
25
|
-
}
|
|
26
|
-
return (React.createElement(Container, { inline: true },
|
|
27
|
-
React.createElement(Button, Object.assign({}, rest, { variant: variant, size: 'small', "data-testid": 'action-button' }), label)));
|
|
28
|
-
};
|
|
29
|
-
const icons = {
|
|
30
|
-
red: React.createElement(Exclamation16, { color: 'red' }),
|
|
31
|
-
green: React.createElement(Done16, { color: 'dark-green' }),
|
|
32
|
-
blue: React.createElement(Info16, { color: 'light-blue' }),
|
|
33
|
-
yellow: React.createElement(Exclamation16, { color: 'yellow' }),
|
|
34
|
-
};
|
|
35
|
-
export const Alert = forwardRef(function Alert({ variant = 'yellow', children, onClose, className, actions }, ref) {
|
|
36
|
-
const icon = icons[variant];
|
|
37
|
-
return (React.createElement(Container, { flex: true, justifyContent: 'space-between', rounded: true, padded: 'small', role: 'alert', ref: ref, variant: variant, className: className },
|
|
38
|
-
React.createElement(Container, { inline: true, flex: true, ref: ref, className: 'text-lg/[1.375em]' },
|
|
39
|
-
React.createElement(Container, { right: 'small', flex: true, alignItems: 'center', className: 'h-[1.375em]' }, icon),
|
|
40
|
-
React.createElement(Typography, { size: 'medium', as: 'div', weight: 'regular', color: 'black' }, children)),
|
|
41
|
-
React.createElement(Container, { inline: true, flex: true },
|
|
42
|
-
React.createElement(Container, { inline: true, flex: true, gap: SPACING_4 },
|
|
43
|
-
(actions === null || actions === void 0 ? void 0 : actions.primary) && renderActionButton('primary', actions.primary),
|
|
44
|
-
(actions === null || actions === void 0 ? void 0 : actions.secondary) &&
|
|
45
|
-
renderActionButton('secondary', actions.secondary)),
|
|
46
|
-
onClose && renderAlertCloseButton({ onClose }))));
|
|
47
|
-
});
|
|
48
|
-
Alert.displayName = 'Alert';
|
|
49
|
-
export default Alert;
|
|
50
|
-
//# sourceMappingURL=Alert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/Alert/Alert.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,oBAAY,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Alert/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const AlertCompound: import("react").ForwardRefExoticComponent<import("../Alert/Alert").Props & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
|
-
Inline: import("react").ForwardRefExoticComponent<import("../AlertInline/AlertInline").Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AlertCompound/index.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,aAAa;;CAExB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AlertCompound/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IAChD,MAAM,EAAE,WAAW;CACpB,CAAC,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { BaseProps } from '@toptal/picasso-shared';
|
|
4
|
-
import type { VariantType as ContainerVariants } from '@toptal/picasso-container';
|
|
5
|
-
export declare type VariantType = Extract<'red' | 'green' | 'yellow' | 'blue', ContainerVariants>;
|
|
6
|
-
export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/** Main content of the Alert */
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
/** Style variant of Alert */
|
|
10
|
-
variant?: VariantType;
|
|
11
|
-
}
|
|
12
|
-
export declare const AlertInline: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export default AlertInline;
|
|
14
|
-
//# sourceMappingURL=AlertInline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertInline.d.ts","sourceRoot":"","sources":["../../../src/AlertInline/AlertInline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAA;AAQlE,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAEjF,oBAAY,WAAW,GAAG,OAAO,CAC/B,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,EACnC,iBAAiB,CAClB,CAAA;AAED,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,gCAAgC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AASD,eAAO,MAAM,WAAW,8EA6BtB,CAAA;AAIF,eAAe,WAAW,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import { Container } from '@toptal/picasso-container';
|
|
3
|
-
import { Typography } from '@toptal/picasso-typography';
|
|
4
|
-
import { ExclamationSolid16, DoneSolid16, InfoSolid16, } from '@toptal/picasso-icons';
|
|
5
|
-
const icons = {
|
|
6
|
-
red: React.createElement(ExclamationSolid16, { color: 'red' }),
|
|
7
|
-
green: React.createElement(DoneSolid16, { color: 'dark-green' }),
|
|
8
|
-
blue: React.createElement(InfoSolid16, { color: 'light-blue' }),
|
|
9
|
-
yellow: React.createElement(ExclamationSolid16, { color: 'yellow' }),
|
|
10
|
-
};
|
|
11
|
-
export const AlertInline = forwardRef(function Alert({ variant = 'yellow', children, className }, ref) {
|
|
12
|
-
const icon = icons[variant];
|
|
13
|
-
let typographyColor = variant;
|
|
14
|
-
// to comply with the designs
|
|
15
|
-
if (variant === 'blue') {
|
|
16
|
-
typographyColor = 'light-blue';
|
|
17
|
-
}
|
|
18
|
-
return (React.createElement(Container, { inline: true, flex: true, ref: ref, className: 'text-lg/[1.375em]' },
|
|
19
|
-
React.createElement(Container, { right: 'xsmall', flex: true, alignItems: 'center', className: 'h-[1.25em]' }, icon),
|
|
20
|
-
React.createElement(Typography, { size: 'small', as: 'div', weight: 'semibold', color: typographyColor, className: className }, children)));
|
|
21
|
-
});
|
|
22
|
-
AlertInline.displayName = 'AlertInline';
|
|
23
|
-
export default AlertInline;
|
|
24
|
-
//# sourceMappingURL=AlertInline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertInline.js","sourceRoot":"","sources":["../../../src/AlertInline/AlertInline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAe9B,MAAM,KAAK,GAAG;IACZ,GAAG,EAAE,oBAAC,kBAAkB,IAAC,KAAK,EAAC,KAAK,GAAG;IACvC,KAAK,EAAE,oBAAC,WAAW,IAAC,KAAK,EAAC,YAAY,GAAG;IACzC,IAAI,EAAE,oBAAC,WAAW,IAAC,KAAK,EAAC,YAAY,GAAG;IACxC,MAAM,EAAE,oBAAC,kBAAkB,IAAC,KAAK,EAAC,QAAQ,GAAG;CAC9C,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAwB,SAAS,KAAK,CACzE,EAAE,OAAO,GAAG,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC3C,GAAG;IAEH,MAAM,IAAI,GAAG,KAAK,CAAC,OAAQ,CAAC,CAAA;IAE5B,IAAI,eAAe,GAAG,OAAoB,CAAA;IAE1C,6BAA6B;IAC7B,IAAI,OAAO,KAAK,MAAM,EAAE;QACtB,eAAe,GAAG,YAAY,CAAA;KAC/B;IAED,OAAO,CACL,oBAAC,SAAS,IAAC,MAAM,QAAC,IAAI,QAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,mBAAmB;QAC5D,oBAAC,SAAS,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,QAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAC,YAAY,IACtE,IAAI,CACK;QACZ,oBAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,EAAE,EAAC,KAAK,EACR,MAAM,EAAC,UAAU,EACjB,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,SAAS,IAEnB,QAAQ,CACE,CACH,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,eAAe,WAAW,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OmitInternalProps } from '@toptal/picasso-shared';
|
|
2
|
-
import type { Props } from './AlertInline';
|
|
3
|
-
export { default as AlertInline } from './AlertInline';
|
|
4
|
-
export declare type AlertInlineProps = OmitInternalProps<Props>;
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AlertInline/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,oBAAY,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AlertInline/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA"}
|