@ntbjs/react-components 0.0.1-beta.4 → 0.0.1-beta.40

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.
@@ -1,52 +0,0 @@
1
- import { a as applyDefaultTheme, _ as _taggedTemplateLiteral, s as styleInject, b as _objectWithoutProperties, c as _extends, p as propTypes } from './defaultTheme-789305db.js';
2
- import React__default from 'react';
3
- import styled from 'styled-components';
4
- import TippyTooltip from '@tippyjs/react';
5
-
6
- var _templateObject;
7
- var Tooltip$1 = styled(TippyTooltip).attrs(applyDefaultTheme)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n font-size: 1rem;\n font-weight: 400;\n background: ", ";\n border-radius: 3px;\n\n .tippy-content {\n padding: 9px 12px;\n }\n\n .tippy-arrow {\n color: ", ";\n }\n\n a {\n color: inherit;\n }\n"])), function (props) {
8
- return props.theme.primaryFontFamily;
9
- }, function (props) {
10
- return props.theme.getColor('gray-700');
11
- }, function (props) {
12
- return props.theme.getColor('gray-700');
13
- });
14
-
15
- var css_248z$1 = ".tippy_tippy-box__1QU-K[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy_tippy-box__1QU-K{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy_tippy-box__1QU-K[data-placement^=top]>.tippy_tippy-arrow__FuGvM{bottom:0}.tippy_tippy-box__1QU-K[data-placement^=top]>.tippy_tippy-arrow__FuGvM:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy_tippy-box__1QU-K[data-placement^=bottom]>.tippy_tippy-arrow__FuGvM{top:0}.tippy_tippy-box__1QU-K[data-placement^=bottom]>.tippy_tippy-arrow__FuGvM:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy_tippy-box__1QU-K[data-placement^=left]>.tippy_tippy-arrow__FuGvM{right:0}.tippy_tippy-box__1QU-K[data-placement^=left]>.tippy_tippy-arrow__FuGvM:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy_tippy-box__1QU-K[data-placement^=right]>.tippy_tippy-arrow__FuGvM{left:0}.tippy_tippy-box__1QU-K[data-placement^=right]>.tippy_tippy-arrow__FuGvM:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy_tippy-box__1QU-K[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy_tippy-arrow__FuGvM{width:16px;height:16px;color:#333}.tippy_tippy-arrow__FuGvM:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy_tippy-content__2mrjT{position:relative;padding:5px 9px;z-index:1}";
16
- styleInject(css_248z$1);
17
-
18
- var css_248z = ".shift-away-subtle_tippy-box__35Duy[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.shift-away-subtle_tippy-box__35Duy[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.shift-away-subtle_tippy-box__35Duy[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.shift-away-subtle_tippy-box__35Duy[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.shift-away-subtle_tippy-box__35Duy[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";
19
- styleInject(css_248z);
20
-
21
- var Tooltip = React__default.forwardRef(function Tooltip(_ref, ref) {
22
- var content = _ref.content,
23
- interactive = _ref.interactive,
24
- placement = _ref.placement,
25
- duration = _ref.duration,
26
- children = _ref.children,
27
- props = _objectWithoutProperties(_ref, ["content", "interactive", "placement", "duration", "children"]);
28
-
29
- return React__default.createElement(Tooltip$1, _extends({
30
- ref: ref,
31
- content: content,
32
- interactive: interactive,
33
- placement: placement,
34
- duration: duration,
35
- animation: 'shift-away-subtle'
36
- }, props), children);
37
- });
38
- Tooltip.propTypes = process.env.NODE_ENV !== "production" ? {
39
- content: propTypes.oneOfType([propTypes.string, propTypes.element]).isRequired,
40
- interactive: propTypes.bool,
41
- placement: propTypes.oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'auto', 'auto-start', 'auto-end']),
42
- duration: propTypes.number,
43
- children: propTypes.node.isRequired
44
- } : {};
45
- Tooltip.defaultProps = {
46
- content: 'Tooltip',
47
- interactive: false,
48
- placement: 'top',
49
- duration: 350
50
- };
51
-
52
- export { Tooltip as T };
@@ -1,15 +0,0 @@
1
- @import 'src/styles/config';
2
-
3
- @function color($name) {
4
- @if map-has-key($colors, $name) {
5
- @return map-get($colors, $name);
6
- } @else {
7
- @error "No color with the name `#{$name}`. was found.";
8
- }
9
- }
10
-
11
- :export {
12
- @each $name, $color in $colors {
13
- #{$name}: $color;
14
- }
15
- }
package/styles/theme.scss DELETED
@@ -1,33 +0,0 @@
1
- @mixin color($dark-color, $light-color) {
2
- @include genericThemeCode('color', $dark-color, $light-color);
3
- }
4
-
5
- @mixin background($dark-color, $light-color) {
6
- @include genericThemeCode('background', $dark-color, $light-color);
7
- }
8
-
9
- @mixin background-image($dark-color, $light-color) {
10
- @include genericThemeCode('background-image', $dark-color, $light-color);
11
- }
12
-
13
- @mixin border-color($dark-color, $light-color) {
14
- @include genericThemeCode('border-color', $dark-color, $light-color);
15
- }
16
-
17
- @mixin genericThemeCode($key, $dark-color, $light-color) {
18
- body:global(.dark-theme) & {
19
- #{$key}: $dark-color;
20
- }
21
-
22
- body:global(.light-theme) & {
23
- #{$key}: $light-color;
24
- }
25
-
26
- body & {
27
- #{$key}: $light-color;
28
-
29
- @media (prefers-color-scheme: dark) {
30
- #{$key}: $dark-color;
31
- }
32
- }
33
- }