groovinads-ui 1.0.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/.babelrc +3 -0
- package/.storybook/main.js +19 -0
- package/.storybook/preview.js +13 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.1.1.cjs +893 -0
- package/.yarnrc.yml +3 -0
- package/package.json +40 -0
- package/src/components/Button/Button.jsx +104 -0
- package/src/components/Button/index.jsx +3 -0
- package/src/index.jsx +3 -0
- package/src/scss/abstracts/_borders-radius.scss +6 -0
- package/src/scss/abstracts/_colors.scss +33 -0
- package/src/scss/abstracts/_fonts.scss +8 -0
- package/src/scss/abstracts/_helpers.scss +7 -0
- package/src/scss/abstracts/_media-queries.scss +6 -0
- package/src/scss/abstracts/_mixins.scss +143 -0
- package/src/scss/abstracts/_spinner-duration.scss +1 -0
- package/src/scss/abstracts/_variables.scss +2 -0
- package/src/scss/animations/_alertToUp.scss +10 -0
- package/src/scss/animations/_aurora.scss +17 -0
- package/src/scss/animations/_colors.scss +15 -0
- package/src/scss/animations/_dash.scss +13 -0
- package/src/scss/animations/_fadeCopyFromLeft.scss +10 -0
- package/src/scss/animations/_goAndBack.scss +8 -0
- package/src/scss/animations/_inputUp.scss +10 -0
- package/src/scss/animations/_shake.scss +22 -0
- package/src/scss/animations/_showIn.scss +8 -0
- package/src/scss/animations/_showMenu.scss +12 -0
- package/src/scss/animations/_statusLine.scss +9 -0
- package/src/scss/animations/_toDown.scss +8 -0
- package/src/scss/animations/_toastFromLeft.scss +10 -0
- package/src/scss/animations/_toastFromRight.scss +10 -0
- package/src/scss/base/_base.scss +14 -0
- package/src/scss/base/_typography.scss +188 -0
- package/src/scss/components/_alerts.scss +115 -0
- package/src/scss/components/_breadcrumb.scss +30 -0
- package/src/scss/components/_buttons.scss +808 -0
- package/src/scss/components/_checks.scss +105 -0
- package/src/scss/components/_dropdown-deck.scss +115 -0
- package/src/scss/components/_dropdowns.scss +131 -0
- package/src/scss/components/_img-404.scss +6 -0
- package/src/scss/components/_inputs.scss +279 -0
- package/src/scss/components/_login-source.scss +19 -0
- package/src/scss/components/_modals.scss +89 -0
- package/src/scss/components/_nav-tabs.scss +38 -0
- package/src/scss/components/_pills.scss +88 -0
- package/src/scss/components/_radio.scss +102 -0
- package/src/scss/components/_shadows.scss +18 -0
- package/src/scss/components/_spinner.scss +20 -0
- package/src/scss/components/_status-icon.scss +61 -0
- package/src/scss/components/_switch.scss +77 -0
- package/src/scss/components/_tabulator.scss +386 -0
- package/src/scss/components/_textareas.scss +22 -0
- package/src/scss/components/_toast.scss +129 -0
- package/src/scss/custom/_campaign-id.scss +56 -0
- package/src/scss/custom/_img-not-found.scss +7 -0
- package/src/scss/custom/_modal-edit.scss +10 -0
- package/src/scss/index.jsx +0 -0
- package/src/scss/index.scss +9 -0
- package/src/scss/layout/_aurora.scss +39 -0
- package/src/scss/layout/_authentication.scss +65 -0
- package/src/scss/layout/_footer.scss +21 -0
- package/src/scss/layout/_main.scss +41 -0
- package/src/scss/layout/_navbar.scss +64 -0
- package/src/scss/views/_skeleton.scss +266 -0
- package/src/stories/Button.stories.jsx +11 -0
package/.yarnrc.yml
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "groovinads-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.es.js",
|
|
6
|
+
"repository": "git@bitbucket.org:groovinads/react-components.git",
|
|
7
|
+
"author": "Pablo Piñero <pablo.piniero@groovinads.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"private": false,
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@babel/core": "^7.24.3",
|
|
12
|
+
"@babel/preset-react": "^7.24.1",
|
|
13
|
+
"@chromatic-com/storybook": "^1.2.25",
|
|
14
|
+
"@storybook/addon-essentials": "^8.0.4",
|
|
15
|
+
"@storybook/addon-interactions": "^8.0.4",
|
|
16
|
+
"@storybook/addon-links": "^8.0.4",
|
|
17
|
+
"@storybook/addon-onboarding": "^8.0.4",
|
|
18
|
+
"@storybook/blocks": "^8.0.4",
|
|
19
|
+
"@storybook/react": "^8.0.4",
|
|
20
|
+
"@storybook/react-vite": "^8.0.4",
|
|
21
|
+
"@storybook/test": "^8.0.4",
|
|
22
|
+
"prettier": "^3.2.5",
|
|
23
|
+
"prop-types": "^15.8.1",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-bootstrap": "^2.10.1",
|
|
26
|
+
"react-dom": "^18.2.0",
|
|
27
|
+
"sass": "^1.72.0",
|
|
28
|
+
"storybook": "^8.0.4",
|
|
29
|
+
"vite": "^5.2.2"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"react-dom": "^18.2.0"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "yarn@4.1.1",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"sb": "storybook dev -p 6006",
|
|
38
|
+
"build-storybook": "storybook build"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* import React from 'react';
|
|
2
|
+
|
|
3
|
+
//STYLES
|
|
4
|
+
//import 'https://brands.groovinads.com/css/scss/components/_buttons.scss';
|
|
5
|
+
|
|
6
|
+
const Button = ({ children, ...props }) => {
|
|
7
|
+
return <button {...props}>{children}</button>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default Button;
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
|
|
16
|
+
// STYLES
|
|
17
|
+
import '../../scss/components/_buttons.scss';
|
|
18
|
+
|
|
19
|
+
const Button = ({
|
|
20
|
+
variant,
|
|
21
|
+
size,
|
|
22
|
+
onClick,
|
|
23
|
+
children,
|
|
24
|
+
icon,
|
|
25
|
+
iconPosition,
|
|
26
|
+
className,
|
|
27
|
+
style,
|
|
28
|
+
processing,
|
|
29
|
+
}) => {
|
|
30
|
+
let classes = `btn ${className}`;
|
|
31
|
+
|
|
32
|
+
// Variant
|
|
33
|
+
if (variant !== 'default') {
|
|
34
|
+
classes += ` btn-${variant}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Size
|
|
38
|
+
if (size !== 'md') {
|
|
39
|
+
classes += ` btn-${size}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Style
|
|
43
|
+
if (style !== 'default') {
|
|
44
|
+
classes += ` btn-${style}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Processing
|
|
48
|
+
if (processing) {
|
|
49
|
+
classes += ` btn-processing`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Icon
|
|
53
|
+
const content = processing ? (
|
|
54
|
+
<>
|
|
55
|
+
<i className='fa-solid fa-spinner-third fa-spin' aria-hidden='true'></i>
|
|
56
|
+
{children && <span>{children}…</span>}
|
|
57
|
+
</>
|
|
58
|
+
) : icon ? (
|
|
59
|
+
iconPosition === 'end' ? (
|
|
60
|
+
<>
|
|
61
|
+
{children && <span>{children}</span>}
|
|
62
|
+
<i className={`fa-solid ${icon}`} aria-hidden='true'></i>
|
|
63
|
+
</>
|
|
64
|
+
) : (
|
|
65
|
+
<>
|
|
66
|
+
<i className={`fa-solid ${icon}`} aria-hidden='true'></i>
|
|
67
|
+
{children && <span>{children}</span>}
|
|
68
|
+
</>
|
|
69
|
+
)
|
|
70
|
+
) : (
|
|
71
|
+
children && <span>{children}</span>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<button className={classes} onClick={onClick}>
|
|
76
|
+
{content}
|
|
77
|
+
</button>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Button.propTypes = {
|
|
82
|
+
variant: PropTypes.oneOf(['primary', 'secondary', 'terciary', 'outline']),
|
|
83
|
+
size: PropTypes.oneOf(['xs', 'md', 'lg']),
|
|
84
|
+
onClick: PropTypes.func,
|
|
85
|
+
children: PropTypes.node,
|
|
86
|
+
icon: PropTypes.node,
|
|
87
|
+
iconPosition: PropTypes.oneOf(['start', 'end']),
|
|
88
|
+
className: PropTypes.string,
|
|
89
|
+
style: PropTypes.oneOf(['default', 'success', 'danger', 'warning', 'link']),
|
|
90
|
+
processing: PropTypes.bool,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
Button.defaultProps = {
|
|
94
|
+
variant: 'primary',
|
|
95
|
+
size: 'md',
|
|
96
|
+
onClick: null,
|
|
97
|
+
icon: null,
|
|
98
|
+
iconPosition: 'start',
|
|
99
|
+
className: '',
|
|
100
|
+
style: 'default',
|
|
101
|
+
processing: false,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export default Button;
|
package/src/index.jsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Groovinads colors
|
|
2
|
+
$ga-brand-dark: #00004b;
|
|
3
|
+
$ga-brand-midtone: #3930b1;
|
|
4
|
+
$ga-brand-light: #24b8ce;
|
|
5
|
+
|
|
6
|
+
// Neutrals
|
|
7
|
+
$grey-dark: #767676;
|
|
8
|
+
$grey-light: #efefef;
|
|
9
|
+
$white: #ffffff;
|
|
10
|
+
$black: #000000;
|
|
11
|
+
|
|
12
|
+
// Secondary colors
|
|
13
|
+
$secondary-blue-light: #2d85e5;
|
|
14
|
+
$secondary-blue: #12355b;
|
|
15
|
+
$secondary-violet-light: #9191db;
|
|
16
|
+
$secondary-violet: #746ec8;
|
|
17
|
+
$secondary-dark: #091a12;
|
|
18
|
+
|
|
19
|
+
// Messaging
|
|
20
|
+
$error: #e63137;
|
|
21
|
+
$warning: #f3a905;
|
|
22
|
+
$safeWarning: #aa5509;
|
|
23
|
+
$warning-bg: #FEEDC6;
|
|
24
|
+
$success: #5bbb84;
|
|
25
|
+
$safeSuccess: #31754e;
|
|
26
|
+
$success-bg: #D6EEE0;
|
|
27
|
+
|
|
28
|
+
// Brands
|
|
29
|
+
$linkedin-brand: #1877f2;
|
|
30
|
+
$facebook-brand: #0077B5;
|
|
31
|
+
$microsoft-font: #5e5e5e;
|
|
32
|
+
$microsoft-border: #8c8c8c;
|
|
33
|
+
$google-brand: #70757a;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
@use 'fonts' as f;
|
|
2
|
+
@use 'borders-radius' as br;
|
|
3
|
+
|
|
4
|
+
@mixin font-family($font_family, $font_size, $font_color, $font_weight) {
|
|
5
|
+
@if $font_family == f.$font-family-primary {
|
|
6
|
+
font-family: f.$font-family-primary, sans-serif;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@if $font_family == f.$font-family-secondary {
|
|
10
|
+
font-family: f.$font-family-secondary, sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@if $font_family == f.$font-family-code {
|
|
14
|
+
font-family: f.$font-family-code, monospace;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
font: {
|
|
18
|
+
size: $font_size;
|
|
19
|
+
weight: $font_weight;
|
|
20
|
+
}
|
|
21
|
+
color: $font_color;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin transition($properties, $duration, $easing) {
|
|
25
|
+
$value: ();
|
|
26
|
+
@each $property in $properties {
|
|
27
|
+
@if length($value) > 0 {
|
|
28
|
+
$value: append($value, unquote(',') #{$property} $duration $easing);
|
|
29
|
+
} @else {
|
|
30
|
+
$value: append($value, #{$property} $duration $easing);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
transition: $value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@mixin respond-to($media) {
|
|
37
|
+
@media #{$media} {
|
|
38
|
+
@content;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin shadow($depth, $color, $direction) {
|
|
43
|
+
@if $depth == 1 {
|
|
44
|
+
@if $direction != x {
|
|
45
|
+
box-shadow: 0px 1px 1px rgba($color, 0.25),
|
|
46
|
+
0px 1px 3px 1px rgba($color, 0.2);
|
|
47
|
+
} @else {
|
|
48
|
+
box-shadow: 1px 0px 1px rgba($color, 0.25),
|
|
49
|
+
1px 0px 3px 1px rgba($color, 0.2);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@if $depth == 2 {
|
|
54
|
+
@if $direction != x {
|
|
55
|
+
box-shadow: 0 10px 20px rgba($color, 0.19), 0px 6px 6px rgba($color, 0.23);
|
|
56
|
+
} @else {
|
|
57
|
+
box-shadow: 10px 0px 20px rgba($color, 0.19),
|
|
58
|
+
6px 0px 6px rgba($color, 0.23);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@if $depth == 3 {
|
|
63
|
+
@if $direction != x {
|
|
64
|
+
box-shadow: 0px 14px 28px rgba($color, 0.25),
|
|
65
|
+
0px 10px 10px rgba($color, 0.22);
|
|
66
|
+
} @else {
|
|
67
|
+
box-shadow: 14px 0px 28px rgba($color, 0.25),
|
|
68
|
+
10px 0px 10px rgba($color, 0.22);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@if $depth == 4 {
|
|
73
|
+
@if $direction != x {
|
|
74
|
+
box-shadow: 0px 19px 38px rgba($color, 0.3),
|
|
75
|
+
0px 15px 12px rgba($color, 0.22);
|
|
76
|
+
} @else {
|
|
77
|
+
box-shadow: 19px 0px 38px rgba($color, 0.3),
|
|
78
|
+
15px 0px 12px rgba($color, 0.22);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@mixin scrollbars(
|
|
84
|
+
$size,
|
|
85
|
+
$foreground-color,
|
|
86
|
+
$background-color: mix($foreground-color, white, 50%)
|
|
87
|
+
) {
|
|
88
|
+
// For Google Chrome
|
|
89
|
+
&::-webkit-scrollbar {
|
|
90
|
+
width: $size;
|
|
91
|
+
height: $size;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&::-webkit-scrollbar-thumb {
|
|
95
|
+
background: $foreground-color;
|
|
96
|
+
border-radius: br.$border-radius-sm;
|
|
97
|
+
@include transition(background-color, 0.15s, ease-in-out);
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
background-color: mix($foreground-color, black, 75%);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&::-webkit-scrollbar-track {
|
|
105
|
+
background: $background-color;
|
|
106
|
+
padding: 10px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// For Internet Explorer
|
|
110
|
+
& {
|
|
111
|
+
scrollbar-face-color: $foreground-color;
|
|
112
|
+
scrollbar-track-color: $background-color;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@mixin multipleEllipsisText($lineCount, $maxHeight, $lineHeight) {
|
|
117
|
+
max-height: $maxHeight;
|
|
118
|
+
-webkit-line-clamp: $lineCount;
|
|
119
|
+
-moz-line-clamp: $lineCount;
|
|
120
|
+
-ms-line-clamp: $lineCount;
|
|
121
|
+
line-clamp: $lineCount;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
line-height: $lineHeight;
|
|
125
|
+
display: -webkit-box;
|
|
126
|
+
-webkit-box-orient: vertical;
|
|
127
|
+
word-break: break-word;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@mixin simpleEllipsisText {
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@mixin setLabelTo($properties) {
|
|
137
|
+
transform: nth($properties, 1) nth($properties, 2) nth($properties, 3);
|
|
138
|
+
padding: nth($properties, 4) nth($properties, 5);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@function commonTextShadow($color) {
|
|
142
|
+
@return 2px 2px 1px $color, 2px -2px 1px $color, -2px 2px 1px $color, -2px -2px 1px $color, 2px 0px 1px $color, 0px 2px 1px $color, -2px 0px 1px $color, 0px -2px 1px $color;
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$spinner-duration: 0.75s;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@keyframes aurora {
|
|
2
|
+
0% {
|
|
3
|
+
background-position: left top;
|
|
4
|
+
}
|
|
5
|
+
25% {
|
|
6
|
+
background-position: right top;
|
|
7
|
+
}
|
|
8
|
+
50% {
|
|
9
|
+
background-position: right bottom;
|
|
10
|
+
}
|
|
11
|
+
75% {
|
|
12
|
+
background-position: left bottom;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
background-position: left top;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@keyframes shakeIt {
|
|
2
|
+
10%,
|
|
3
|
+
90% {
|
|
4
|
+
transform: translate3d(-2px, 0, 0);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
20%,
|
|
8
|
+
80% {
|
|
9
|
+
transform: translate3d(4px, 0, 0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
30%,
|
|
13
|
+
50%,
|
|
14
|
+
70% {
|
|
15
|
+
transform: translate3d(-6px, 0, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
40%,
|
|
19
|
+
60% {
|
|
20
|
+
transform: translate3d(6px, 0, 0);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Use
|
|
2
|
+
@use '../abstracts/helpers' as h;
|
|
3
|
+
|
|
4
|
+
body {
|
|
5
|
+
background-color: h.$grey-light;
|
|
6
|
+
@include h.scrollbars(0.5rem, transparent, transparent);
|
|
7
|
+
|
|
8
|
+
&.modal-open {
|
|
9
|
+
overflow: auto !important;
|
|
10
|
+
&[style] {
|
|
11
|
+
padding-right: 0px !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|