@onepercentio/one-ui 0.3.0 → 0.5.1
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/cypress/support/{commands.js → commands.ts} +14 -1
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +39 -0
- package/cypress/support/{index.js → e2e.js} +0 -0
- package/dist/components/AdaptiveButton/AdaptiveButton.js +17 -15
- package/dist/components/AdaptiveButton/AdaptiveButton.js.map +1 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.d.ts +18 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js +122 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +1 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.module.scss +106 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.d.ts +14 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.js +67 -0
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.js.map +1 -0
- package/dist/components/AnimatedEntrance/index.d.ts +1 -0
- package/dist/components/AnimatedEntrance/index.js +9 -0
- package/dist/components/AnimatedEntrance/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +7 -0
- package/dist/components/Button/Button.js +5 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.stories.d.ts +2 -6
- package/dist/components/Button/Button.stories.js +29 -5
- package/dist/components/Button/Button.stories.js.map +1 -1
- package/dist/components/CheckBox/CheckBox.stories.js +25 -2
- package/dist/components/CheckBox/CheckBox.stories.js.map +1 -1
- package/dist/components/Collapsable/Collapsable.d.ts +0 -2
- package/dist/components/Collapsable/Collapsable.js +0 -2
- package/dist/components/Collapsable/Collapsable.js.map +1 -1
- package/dist/components/Countdown/Countdown.stories.js +25 -2
- package/dist/components/Countdown/Countdown.stories.js.map +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +1 -1
- package/dist/components/EmailInput/EmailInput.stories.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +3 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/Form.stories.d.ts +13 -0
- package/dist/components/Form/Form.stories.js +36 -0
- package/dist/components/Form/Form.stories.js.map +1 -0
- package/dist/components/Input/Input.js +2 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/InstantCounter/InstantCounter.js +3 -3
- package/dist/components/InstantCounter/InstantCounter.js.map +1 -1
- package/dist/components/InstantCounter/InstantCounter.stories.d.ts +13 -0
- package/dist/components/InstantCounter/InstantCounter.stories.js +48 -3
- package/dist/components/InstantCounter/InstantCounter.stories.js.map +1 -1
- package/dist/components/LinkToId/LinkToId.stories.d.ts +7 -0
- package/dist/components/LinkToId/LinkToId.stories.js +15 -0
- package/dist/components/LinkToId/LinkToId.stories.js.map +1 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.d.ts +7 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.js +15 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.js.map +1 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +45 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js +22 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js.map +1 -0
- package/dist/components/Portal/Portal.d.ts +11 -0
- package/dist/components/Portal/Portal.js +62 -0
- package/dist/components/Portal/Portal.js.map +1 -0
- package/dist/components/Portal/Portal.module.scss +3 -0
- package/dist/components/Portal/Portal.stories.d.ts +7 -0
- package/dist/components/Portal/Portal.stories.js +15 -0
- package/dist/components/Portal/Portal.stories.js.map +1 -0
- package/dist/components/Portal/index.d.ts +1 -0
- package/dist/components/Portal/index.js +10 -0
- package/dist/components/Portal/index.js.map +1 -0
- package/dist/components/SectionContainer/SectionContainer.stories.d.ts +14 -0
- package/dist/components/SectionContainer/SectionContainer.stories.js +15 -0
- package/dist/components/SectionContainer/SectionContainer.stories.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +17 -0
- package/dist/components/Tabs/Tabs.stories.js +57 -0
- package/dist/components/Tabs/Tabs.stories.js.map +1 -0
- package/dist/components/Text/Text.d.ts +8 -3
- package/dist/components/Text/Text.js +5 -3
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/Text/Text.stories.d.ts +2 -7
- package/dist/components/Text/Text.stories.js +26 -3
- package/dist/components/Text/Text.stories.js.map +1 -1
- package/dist/components/Transition/Transition.js +4 -4
- package/dist/components/Transition/Transition.js.map +1 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.d.ts +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +3 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +1 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +2 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.d.ts +4 -6
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +3 -2
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +1 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.d.ts +3 -8
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +6 -2
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +1 -1
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.module.scss +5 -0
- package/dist/context/OneUIProvider.d.ts +1 -1
- package/dist/context/OneUIProvider.js +15 -4
- package/dist/context/OneUIProvider.js.map +1 -1
- package/dist/hooks/shims/ObjectWatchShim.js +24 -17
- package/dist/hooks/shims/ObjectWatchShim.js.map +1 -1
- package/dist/hooks/useAsyncControl.d.ts +3 -4
- package/dist/hooks/useAsyncControl.js +9 -9
- package/dist/hooks/useAsyncControl.js.map +1 -1
- package/dist/hooks/useFirestoreWatch.d.ts +12 -0
- package/dist/hooks/useFirestoreWatch.js +38 -0
- package/dist/hooks/useFirestoreWatch.js.map +1 -0
- package/dist/hooks/useObserve.d.ts +1 -1
- package/dist/hooks/useObserve.js +6 -4
- package/dist/hooks/useObserve.js.map +1 -1
- package/dist/hooks/usePooledOperation.d.ts +1 -1
- package/dist/hooks/usePooling.d.ts +0 -1
- package/dist/hooks/useRebound.d.ts +0 -1
- package/package.json +23 -4
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
import "@muritavo/cypress-toolkit/dist/support/essentials"
|
|
1
3
|
// ***********************************************
|
|
2
|
-
// This example commands.
|
|
4
|
+
// This example commands.ts shows you how to
|
|
3
5
|
// create various custom commands and overwrite
|
|
4
6
|
// existing commands.
|
|
5
7
|
//
|
|
@@ -23,3 +25,14 @@
|
|
|
23
25
|
//
|
|
24
26
|
// -- This will overwrite an existing command --
|
|
25
27
|
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
28
|
+
//
|
|
29
|
+
// declare global {
|
|
30
|
+
// namespace Cypress {
|
|
31
|
+
// interface Chainable {
|
|
32
|
+
// login(email: string, password: string): Chainable<void>
|
|
33
|
+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
34
|
+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
35
|
+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
38
|
+
// }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<title>Components App</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div data-cy-root></div>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// ***********************************************************
|
|
2
|
+
// This example support/component.ts is processed and
|
|
3
|
+
// loaded automatically before your test files.
|
|
4
|
+
//
|
|
5
|
+
// This is a great place to put global configuration and
|
|
6
|
+
// behavior that modifies Cypress.
|
|
7
|
+
//
|
|
8
|
+
// You can change the location of this file or turn off
|
|
9
|
+
// automatically serving support files with the
|
|
10
|
+
// 'supportFile' configuration option.
|
|
11
|
+
//
|
|
12
|
+
// You can read more here:
|
|
13
|
+
// https://on.cypress.io/configuration
|
|
14
|
+
// ***********************************************************
|
|
15
|
+
|
|
16
|
+
// Import commands.js using ES2015 syntax:
|
|
17
|
+
import './commands'
|
|
18
|
+
|
|
19
|
+
// Alternatively you can use CommonJS syntax:
|
|
20
|
+
// require('./commands')
|
|
21
|
+
|
|
22
|
+
import { mount } from 'cypress/react'
|
|
23
|
+
|
|
24
|
+
// Augment the Cypress namespace to include type definitions for
|
|
25
|
+
// your custom command.
|
|
26
|
+
// Alternatively, can be defined in cypress/support/component.d.ts
|
|
27
|
+
// with a <reference path="./component" /> at the top of your spec.
|
|
28
|
+
declare global {
|
|
29
|
+
namespace Cypress {
|
|
30
|
+
interface Chainable {
|
|
31
|
+
mount: typeof mount
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Cypress.Commands.add('mount', mount)
|
|
37
|
+
|
|
38
|
+
// Example use:
|
|
39
|
+
// cy.mount(<MyComponent />)
|
|
File without changes
|
|
@@ -54,22 +54,24 @@ function AdaptiveButton(_a) {
|
|
|
54
54
|
if (sectionDiv)
|
|
55
55
|
sectionDiv.style.width = `${sectionDiv.clientWidth}px`;
|
|
56
56
|
setTimeout(() => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
sectionDiv.style.width
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
sectionDiv
|
|
57
|
+
if (uncontrolledRef.current) {
|
|
58
|
+
const sectionDiv = uncontrolledRef.current.sectionRef.current;
|
|
59
|
+
if (sectionDiv) {
|
|
60
|
+
const lastChild = sectionDiv.lastChild;
|
|
61
|
+
if (lastChild) {
|
|
62
|
+
const contentWidth = lastChild.clientWidth;
|
|
63
|
+
const targetWidth = `${contentWidth}px`;
|
|
64
|
+
sectionDiv.style.width = targetWidth;
|
|
65
|
+
function transEnd() {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
if ((sectionDiv === null || sectionDiv === void 0 ? void 0 : sectionDiv.style.width) === `${contentWidth}px`)
|
|
68
|
+
sectionDiv.style.width = "";
|
|
69
|
+
}, 100);
|
|
70
|
+
if (sectionDiv)
|
|
71
|
+
sectionDiv.removeEventListener("transitionend", transEnd);
|
|
72
|
+
}
|
|
73
|
+
sectionDiv.addEventListener("transitionend", transEnd);
|
|
71
74
|
}
|
|
72
|
-
sectionDiv.addEventListener("transitionend", transEnd);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
}, 100);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdaptiveButton.js","sourceRoot":"","sources":["../../../src/components/AdaptiveButton/AdaptiveButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AACf,uDAA+B;AAC/B,8CAAyD;AACzD,uFAA+D;AAC/D,8FAAkD;AAElD;;IAEI;AACJ,SAAwB,cAAc,CAAC,EAMN;QANM,EACrC,QAAQ,EACR,SAAS,GAAG,EAAE,OAIiB,EAH5B,WAAW,cAHuB,y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F,EACD,SAAS,EAAE,oCAAM,CAAC,YAAY,IAE7B,QAAQ,CACc,CAClB,CACR,CACJ,CAAC;AACJ,CAAC;AAnED,iCAmEC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Key, ReactElement } from "react";
|
|
2
|
+
export declare enum EntranceType {
|
|
3
|
+
SLIDE_AND_EXPAND = 0,
|
|
4
|
+
EXPAND = 1
|
|
5
|
+
}
|
|
6
|
+
export declare function AnimatedEntranceItem({ children, noEntranceAnimation, onRemoveChildren, entranceType, }: {
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
noEntranceAnimation: boolean;
|
|
9
|
+
onRemoveChildren: (key: Key) => void;
|
|
10
|
+
entranceType: EntranceType;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Animates the entrance and exit of a component
|
|
14
|
+
**/
|
|
15
|
+
export default function AnimatedEntrance({ children, entranceType, }: {
|
|
16
|
+
children: ReactElement[];
|
|
17
|
+
entranceType?: EntranceType;
|
|
18
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.AnimatedEntranceItem = exports.EntranceType = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const Transition_1 = require("../Transition");
|
|
32
|
+
const UncontrolledTransition_1 = __importDefault(require("../UncontrolledTransition"));
|
|
33
|
+
const AnimatedEntrance_module_scss_1 = __importDefault(require("./AnimatedEntrance.module.scss"));
|
|
34
|
+
var EntranceType;
|
|
35
|
+
(function (EntranceType) {
|
|
36
|
+
EntranceType[EntranceType["SLIDE_AND_EXPAND"] = 0] = "SLIDE_AND_EXPAND";
|
|
37
|
+
EntranceType[EntranceType["EXPAND"] = 1] = "EXPAND";
|
|
38
|
+
})(EntranceType = exports.EntranceType || (exports.EntranceType = {}));
|
|
39
|
+
const CONFIGS_BY_ENTRANCE_TYPE = {
|
|
40
|
+
[EntranceType.SLIDE_AND_EXPAND]: {
|
|
41
|
+
forward: {
|
|
42
|
+
elementEntering: AnimatedEntrance_module_scss_1.default.elementEntering,
|
|
43
|
+
elementExiting: AnimatedEntrance_module_scss_1.default.elementExiting,
|
|
44
|
+
},
|
|
45
|
+
backward: {
|
|
46
|
+
elementEntering: AnimatedEntrance_module_scss_1.default.elementEnteringReverse,
|
|
47
|
+
elementExiting: AnimatedEntrance_module_scss_1.default.elementExitingReverse,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
[EntranceType.EXPAND]: {
|
|
51
|
+
forward: {
|
|
52
|
+
elementEntering: AnimatedEntrance_module_scss_1.default.elementExpanding,
|
|
53
|
+
elementExiting: AnimatedEntrance_module_scss_1.default.elementShrinking,
|
|
54
|
+
},
|
|
55
|
+
backward: {
|
|
56
|
+
elementEntering: AnimatedEntrance_module_scss_1.default.elementExpandingReverse,
|
|
57
|
+
elementExiting: AnimatedEntrance_module_scss_1.default.elementShrinkingReverse,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
function AnimatedEntranceItem({ children, noEntranceAnimation, onRemoveChildren, entranceType, }) {
|
|
62
|
+
const uncontRef = (0, react_1.useRef)(null);
|
|
63
|
+
const [screen, setScreen] = (0, react_1.useState)(noEntranceAnimation ? children : react_1.default.createElement(react_1.Fragment, { key: "null" }));
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
if (String(children.key).includes("-nullated")) {
|
|
66
|
+
uncontRef.current.setOrientation("backward");
|
|
67
|
+
}
|
|
68
|
+
setScreen(children);
|
|
69
|
+
}, [children.key]);
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
const x = setTimeout(() => {
|
|
72
|
+
const key = String(screen.key);
|
|
73
|
+
if (key === "null" || key.includes("-nullated"))
|
|
74
|
+
uncontRef.current.sectionRef.current.style.maxHeight = `0px`;
|
|
75
|
+
else
|
|
76
|
+
uncontRef.current.sectionRef.current.style.maxHeight = `${uncontRef.current.sectionRef.current.scrollHeight}px`;
|
|
77
|
+
}, 100);
|
|
78
|
+
return () => {
|
|
79
|
+
clearTimeout(x);
|
|
80
|
+
};
|
|
81
|
+
}, [screen]);
|
|
82
|
+
const className = (0, react_1.useMemo)(() => (!noEntranceAnimation ? AnimatedEntrance_module_scss_1.default.maxHeight : ""), [String(children.key).includes("-nullated")]);
|
|
83
|
+
return (react_1.default.createElement(UncontrolledTransition_1.default, { ref: uncontRef, transitionType: Transition_1.TransitionAnimationTypes.CUSTOM, className: `${AnimatedEntrance_module_scss_1.default.resetHeight} ${className}`, lockTransitionWidth: true, key: String(children.key).replace("-nullated", ""), onDiscardStep: (k) => {
|
|
84
|
+
if (k !== "null")
|
|
85
|
+
onRemoveChildren(k);
|
|
86
|
+
}, config: CONFIGS_BY_ENTRANCE_TYPE[entranceType] }, screen));
|
|
87
|
+
}
|
|
88
|
+
exports.AnimatedEntranceItem = AnimatedEntranceItem;
|
|
89
|
+
/**
|
|
90
|
+
* Animates the entrance and exit of a component
|
|
91
|
+
**/
|
|
92
|
+
function AnimatedEntrance({ children, entranceType = EntranceType.SLIDE_AND_EXPAND, }) {
|
|
93
|
+
const firstRef = (0, react_1.useRef)(true);
|
|
94
|
+
(0, react_1.useEffect)(() => {
|
|
95
|
+
firstRef.current = false;
|
|
96
|
+
}, []);
|
|
97
|
+
const prevChildren = (0, react_1.useRef)([]);
|
|
98
|
+
const childrenDelayed = (0, react_1.useMemo)(() => {
|
|
99
|
+
var _a;
|
|
100
|
+
const newChildren = children.filter((c) => !prevChildren.current.find((a) => a.key === c.key));
|
|
101
|
+
const filteredOutChildren = prevChildren.current.map((c) => {
|
|
102
|
+
return children.find((a) => a.key === c.key) ? ( // If the previous child still exists, mantain
|
|
103
|
+
c) : (
|
|
104
|
+
// If not, toggle to null to animate exit
|
|
105
|
+
react_1.default.createElement(react_1.Fragment, { key: String(c.key).includes("-nullated") ? c.key : `${c.key}-nullated` }));
|
|
106
|
+
});
|
|
107
|
+
for (let child of newChildren) {
|
|
108
|
+
const previousChildKey = (_a = children[children.indexOf(child) - 1]) === null || _a === void 0 ? void 0 : _a.key;
|
|
109
|
+
if (previousChildKey) {
|
|
110
|
+
filteredOutChildren.splice(filteredOutChildren.findIndex((a) => a.key === previousChildKey) + 1, 0, child);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
filteredOutChildren.unshift(child);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return filteredOutChildren;
|
|
117
|
+
}, [children]);
|
|
118
|
+
prevChildren.current = childrenDelayed;
|
|
119
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, childrenDelayed.map((child) => (react_1.default.createElement(AnimatedEntranceItem, { key: String(child.key).replace("-nullated", ""), noEntranceAnimation: firstRef.current, entranceType: entranceType, onRemoveChildren: (k) => (prevChildren.current = prevChildren.current.filter((a) => a.key !== String(k) + "-nullated")) }, child)))));
|
|
120
|
+
}
|
|
121
|
+
exports.default = AnimatedEntrance;
|
|
122
|
+
//# sourceMappingURL=AnimatedEntrance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedEntrance.js","sourceRoot":"","sources":["../../../src/components/AnimatedEntrance/AnimatedEntrance.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CASe;AACf,8CAAyD;AACzD,uFAA+D;AAC/D,kGAAoD;AAEpD,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,uEAAgB,CAAA;IAChB,mDAAM,CAAA;AACR,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,MAAM,wBAAwB,GAAG;IAC/B,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE;QAC/B,OAAO,EAAE;YACP,eAAe,EAAE,sCAAM,CAAC,eAAe;YACvC,cAAc,EAAE,sCAAM,CAAC,cAAc;SACtC;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,sCAAM,CAAC,sBAAsB;YAC9C,cAAc,EAAE,sCAAM,CAAC,qBAAqB;SAC7C;KACF;IACD,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,EAAE;YACP,eAAe,EAAE,sCAAM,CAAC,gBAAgB;YACxC,cAAc,EAAE,sCAAM,CAAC,gBAAgB;SACxC;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,sCAAM,CAAC,uBAAuB;YAC/C,cAAc,EAAE,sCAAM,CAAC,uBAAuB;SAC/C;KACF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CACL,8DACG,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9B,8BAAC,oBAAoB,IACnB,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,GAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,EAChD,mBAAmB,EAAE,QAAQ,CAAC,OAAO,EACrC,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,CACtB,CAAC,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CACjD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CACzC,CAAC,IAGH,KAAK,CACe,CACxB,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAhED,mCAgEC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@keyframes expand {
|
|
2
|
+
0% {
|
|
3
|
+
transform: translateX(100%);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
35% {
|
|
7
|
+
transform: translateX(100%);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
85% {
|
|
11
|
+
transform: translateX(-5%);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
100% {
|
|
15
|
+
transform: translateX(0%);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes exiting {
|
|
20
|
+
100% {
|
|
21
|
+
transform: translateX(100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
65% {
|
|
25
|
+
transform: translateX(100%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
50% {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
15% {
|
|
33
|
+
transform: translateX(-5%);
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
0% {
|
|
38
|
+
transform: translateX(0%);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
$duration: 1s;
|
|
42
|
+
|
|
43
|
+
.elementExiting {
|
|
44
|
+
animation-duration: $duration !important;
|
|
45
|
+
animation-name: exiting;
|
|
46
|
+
position: absolute;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.elementEntering {
|
|
50
|
+
animation-duration: $duration !important;
|
|
51
|
+
animation-name: expand;
|
|
52
|
+
}
|
|
53
|
+
.elementExitingReverse {
|
|
54
|
+
animation-duration: $duration !important;
|
|
55
|
+
animation-name: exiting;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.elementEnteringReverse {
|
|
59
|
+
animation-duration: $duration !important;
|
|
60
|
+
animation-name: expand;
|
|
61
|
+
position: absolute;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.resetHeight {
|
|
65
|
+
transition: max-height $duration/2 $duration * 0.2;
|
|
66
|
+
min-height: initial;
|
|
67
|
+
align-items: flex-start !important;
|
|
68
|
+
> * {
|
|
69
|
+
justify-content: flex-start !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.maxHeight {
|
|
74
|
+
max-height: 0px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes nothing {
|
|
78
|
+
100% {
|
|
79
|
+
transform: translateX(0%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
0% {
|
|
83
|
+
transform: translateX(0%);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.elementShrinking {
|
|
88
|
+
animation-duration: $duration !important;
|
|
89
|
+
animation-name: nothing;
|
|
90
|
+
position: absolute;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.elementExpanding {
|
|
94
|
+
animation-duration: $duration !important;
|
|
95
|
+
animation-name: nothing;
|
|
96
|
+
}
|
|
97
|
+
.elementShrinkingReverse {
|
|
98
|
+
animation-duration: $duration !important;
|
|
99
|
+
animation-name: nothing;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.elementExpandingReverse {
|
|
103
|
+
animation-duration: $duration !important;
|
|
104
|
+
animation-name: nothing;
|
|
105
|
+
position: absolute;
|
|
106
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import AnimatedEntrance from "./AnimatedEntrance";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
component: typeof AnimatedEntrance;
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const InitialImplementation: {
|
|
9
|
+
(args: any): JSX.Element;
|
|
10
|
+
args: Partial<{
|
|
11
|
+
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
12
|
+
entranceType?: import("./AnimatedEntrance").EntranceType | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.InitialImplementation = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const Button_1 = __importDefault(require("../Button"));
|
|
32
|
+
const AnimatedEntrance_1 = __importDefault(require("./AnimatedEntrance"));
|
|
33
|
+
exports.default = {
|
|
34
|
+
component: AnimatedEntrance_1.default,
|
|
35
|
+
title: "Animated Entrance",
|
|
36
|
+
};
|
|
37
|
+
const ExampleEL = (key, removeElCb) => {
|
|
38
|
+
return (react_1.default.createElement("div", { key: key },
|
|
39
|
+
"Elemento ",
|
|
40
|
+
key,
|
|
41
|
+
" ",
|
|
42
|
+
react_1.default.createElement(Button_1.default, { variant: "outline", onClick: () => removeElCb((prev) => {
|
|
43
|
+
const filteredOut = prev.filter((prev) => String(prev.key) !== String(key));
|
|
44
|
+
return filteredOut;
|
|
45
|
+
}) }, "Remove")));
|
|
46
|
+
};
|
|
47
|
+
const InitialImplementation = (args) => {
|
|
48
|
+
const [exampleElements, setE] = (0, react_1.useState)([]);
|
|
49
|
+
(0, react_1.useMemo)(() => {
|
|
50
|
+
exampleElements.push(ExampleEL(1, setE));
|
|
51
|
+
exampleElements.push(ExampleEL(2, setE));
|
|
52
|
+
exampleElements.push(ExampleEL(3, setE));
|
|
53
|
+
exampleElements.push(ExampleEL(4, setE));
|
|
54
|
+
}, []);
|
|
55
|
+
const counter = (0, react_1.useRef)(4);
|
|
56
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
|
+
react_1.default.createElement("div", { style: { minHeight: 800 } },
|
|
58
|
+
react_1.default.createElement(AnimatedEntrance_1.default, null, exampleElements)),
|
|
59
|
+
react_1.default.createElement(Button_1.default, { variant: "filled", onClick: () => setE((prev) => {
|
|
60
|
+
counter.current++;
|
|
61
|
+
const currCounter = counter.current;
|
|
62
|
+
return [...prev, ExampleEL(currCounter, setE)];
|
|
63
|
+
}) }, "Add element")));
|
|
64
|
+
};
|
|
65
|
+
exports.InitialImplementation = InitialImplementation;
|
|
66
|
+
exports.InitialImplementation.args = {};
|
|
67
|
+
//# sourceMappingURL=AnimatedEntrance.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedEntrance.stories.js","sourceRoot":"","sources":["../../../src/components/AnimatedEntrance/AnimatedEntrance.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOe;AACf,uDAA+B;AAC/B,0EAAkD;AAElD,kBAAe;IACb,SAAS,EAAE,0BAAgB;IAC3B,KAAK,EAAE,mBAAmB;CAC3B,CAAC;AAEF,MAAM,SAAS,GAAG,CAChB,GAAW,EACX,UAAiE,EACjE,EAAE;IACF,OAAO,CACL,uCAAK,GAAG,EAAE,GAAG;;QACD,GAAG;QAAE,GAAG;QAClB,8BAAC,gBAAM,IACL,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,GAAG,EAAE,CACZ,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAC7B,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,CAC3C,CAAC;gBACF,OAAO,WAAW,CAAC;YACrB,CAAC,CAAC,aAIG,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAC,IAAS,EAAE,EAAE;IACjD,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,GAAG,IAAA,gBAAQ,EAAiB,EAAE,CAAC,CAAC;IAE7D,IAAA,eAAO,EAAC,GAAG,EAAE;QACX,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACzC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACzC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACzC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL;QACE,uCAAK,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE;YAC5B,8BAAC,0BAAgB,QAAE,eAAe,CAAoB,CAClD;QACN,8BAAC,gBAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACZ,OAAO,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;gBACpC,OAAO,CAAC,GAAG,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;YACjD,CAAC,CAAC,kBAIG,CACR,CACJ,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,qBAAqB,yBA8BhC;AACF,6BAAqB,CAAC,IAAI,GAAG,EAE5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AnimatedEntrance';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var AnimatedEntrance_1 = require("./AnimatedEntrance");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(AnimatedEntrance_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AnimatedEntrance/index.tsx"],"names":[],"mappings":";;;;;;AAAA,uDAA6C;AAApC,4HAAA,OAAO,OAAA"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
declare type ButtonProps = React.PropsWithChildren<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
variant?: "transparent" | "filled" | "outline";
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* A simple button with the new design
|
|
7
|
+
**/
|
|
8
|
+
export declare function _Button({ children, variant, className, ...otherProps }: ButtonProps): JSX.Element;
|
|
2
9
|
declare const _default: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
10
|
variant?: "transparent" | "filled" | "outline" | undefined;
|
|
4
11
|
} & {
|
|
@@ -37,14 +37,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports._Button = void 0;
|
|
40
41
|
const react_1 = __importStar(require("react"));
|
|
41
42
|
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
42
43
|
/**
|
|
43
44
|
* A simple button with the new design
|
|
44
45
|
**/
|
|
45
|
-
function
|
|
46
|
+
function _Button(_a) {
|
|
46
47
|
var { children, variant = "transparent", className = "" } = _a, otherProps = __rest(_a, ["children", "variant", "className"]);
|
|
47
|
-
return (react_1.default.createElement("button", Object.assign({ ref:
|
|
48
|
+
return (react_1.default.createElement("button", Object.assign({ ref: arguments[1], className: `${Button_module_scss_1.default.button} ${Button_module_scss_1.default[variant]} ${className}` }, otherProps), children));
|
|
48
49
|
}
|
|
49
|
-
exports.
|
|
50
|
+
exports._Button = _Button;
|
|
51
|
+
exports.default = (0, react_1.forwardRef)(_Button);
|
|
50
52
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoE;AACpE,8EAA0C;AAQ1C;;IAEI;AACJ,SAAgB,OAAO,CAAC,EAKV;QALU,EACtB,QAAQ,EACR,OAAO,GAAG,aAAa,EACvB,SAAS,GAAG,EAAE,OAEF,EADT,UAAU,cAJS,oCAKvB,CADc;IAEb,OAAO,CACL,wDACE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,SAAS,EAAE,GAAG,4BAAM,CAAC,MAAM,IAAI,4BAAM,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,IACzD,UAAU,GAEb,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AAfD,0BAeC;AAED,kBAAe,IAAA,kBAAU,EAAiC,OAAO,CAAC,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Comp from "
|
|
2
|
+
import Comp, { _Button } from "./Button";
|
|
3
3
|
declare const _default: {
|
|
4
|
-
component:
|
|
5
|
-
variant?: "transparent" | "filled" | "outline" | undefined;
|
|
6
|
-
} & {
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
component: typeof _Button;
|
|
9
5
|
title: string;
|
|
10
6
|
};
|
|
11
7
|
export default _default;
|
|
@@ -1,18 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.Primary = exports.TodasVariacoes = void 0;
|
|
7
30
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
31
|
+
const Button_1 = __importStar(require("./Button"));
|
|
9
32
|
const Spacing_1 = __importDefault(require("../Spacing"));
|
|
33
|
+
console.warn(Button_1._Button);
|
|
10
34
|
exports.default = {
|
|
11
|
-
component:
|
|
35
|
+
component: Button_1._Button,
|
|
12
36
|
title: "Botão",
|
|
13
37
|
};
|
|
14
38
|
const TodasVariacoes = () => {
|
|
15
|
-
const variantes =
|
|
39
|
+
const variantes = Button_1._Button.__docgenInfo.props
|
|
16
40
|
.variant.type.value;
|
|
17
41
|
return variantes
|
|
18
42
|
.map((a) => JSON.parse(a.value))
|
|
@@ -25,10 +49,10 @@ const TodasVariacoes = () => {
|
|
|
25
49
|
react_1.default.createElement("span", { style: { borderBottom: "2px solid black", marginBottom: 14 } },
|
|
26
50
|
"Tipo: ",
|
|
27
51
|
react_1.default.createElement("b", null, a)),
|
|
28
|
-
react_1.default.createElement(
|
|
52
|
+
react_1.default.createElement(Button_1.default, { variant: a }, "Texto do exemplo"),
|
|
29
53
|
react_1.default.createElement(Spacing_1.default, { size: "large" }))));
|
|
30
54
|
};
|
|
31
55
|
exports.TodasVariacoes = TodasVariacoes;
|
|
32
|
-
const Primary = (args) => (react_1.default.createElement(
|
|
56
|
+
const Primary = (args) => (react_1.default.createElement(Button_1.default, Object.assign({}, args), "Um simples bot\u00E3o"));
|
|
33
57
|
exports.Primary = Primary;
|
|
34
58
|
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,mDAAyC;AACzC,yDAAiC;AACjC,OAAO,CAAC,IAAI,CAAC,gBAAO,CAAC,CAAA;AAErB,kBAAe;IACb,SAAS,EAAE,gBAAO;IAClB,KAAK,EAAE,OAAO;CACf,CAAC;AAEK,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,SAAS,GAAyB,gBAAe,CAAC,YAAY,CAAC,KAAK;SACvE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IAEtB,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACV,uCACE,KAAK,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,aAAa;YACtB,aAAa,EAAE,QAAQ;SACxB;QAED,wCAAM,KAAK,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,EAAE,EAAE;;YAC1D,yCAAI,CAAC,CAAK,CACX;QACP,8BAAC,gBAAI,IAAC,OAAO,EAAE,CAAQ,uBAAyB;QAChD,8BAAC,iBAAO,IAAC,IAAI,EAAC,OAAO,GAAG,CACpB,CACP,CAAC,CAAC;AACP,CAAC,CAAC;AAtBW,QAAA,cAAc,kBAsBzB;AAEK,MAAM,OAAO,GAAG,CAAC,IAAuC,EAAE,EAAE,CAAC,CAClE,8BAAC,gBAAI,oBAAK,IAAI,2BAAyB,CACxC,CAAC;AAFW,QAAA,OAAO,WAElB"}
|