@loja-integrada/admin-components 0.18.9 → 0.18.11

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.
@@ -0,0 +1 @@
1
+ .tippy-box{--bg-color:rgb(var(--color-inverted-1)/100);background-color:var(--bg-color);border-radius:3px;color:rgb(var(--color-base-1)/100);font-size:12px;letter-spacing:-.4px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.tippy-box [data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-box .tippy-arrow{color:var(--bg-color);height:15px;width:15px}.tippy-box .tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-box .tippy-content{padding:12px 8px;position:relative;z-index:1}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "0.18.9",
3
+ "version": "0.18.11",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -91,13 +91,13 @@
91
91
  "@types/react-modal": "^3.12.1",
92
92
  "@types/react-table": "^7.7.1",
93
93
  "@types/react-text-mask": "^5.4.8",
94
- "@types/styled-components": "^5.1.14",
95
94
  "autoprefixer": "^10.4.4",
96
95
  "babel-loader": "^8.2.2",
97
96
  "babel-plugin-istanbul": "^6.1.1",
98
97
  "babel-plugin-module-name-mapper": "^1.2.0",
99
98
  "babel-plugin-transform-class-properties": "^6.24.1",
100
99
  "chromatic": "^6.5.4",
100
+ "css-loader": "5.2.6",
101
101
  "cypress": "^9.6.0",
102
102
  "cypress-sonarqube-reporter": "^1.11.0",
103
103
  "eslint-plugin-prettier": "^3.4.0",
@@ -106,16 +106,21 @@
106
106
  "identity-obj-proxy": "^3.0.0",
107
107
  "postcss": "^8.4.12",
108
108
  "postcss-loader": "^4.2.0",
109
+ "postcss-nesting": "^11.2.1",
109
110
  "prettier": "^2.6.2",
110
111
  "react-is": "^18.1.0",
111
112
  "rollup-plugin-postcss": "^4.0.2",
113
+ "sass": "^1.59.3",
114
+ "sass-loader": "10.1.1",
112
115
  "size-limit": "^7.0.8",
113
116
  "storybook-addon-designs": "^6.3.1",
117
+ "storybook-dark-mode": "^2.1.1",
118
+ "style-loader": "2.0.0",
114
119
  "tailwindcss": "^3.1.2",
115
120
  "tsdx": "^0.14.1",
116
121
  "tslib": "^2.4.0",
117
122
  "typescript": "^4.6.4",
118
- "webpack": "^5.72.0",
123
+ "webpack": "^5.76.0",
119
124
  "webpack-dev-server": "^4.9.0"
120
125
  },
121
126
  "peerDependency": {
@@ -125,7 +130,7 @@
125
130
  "tailwindcss": ">=3.1.0"
126
131
  },
127
132
  "dependencies": {
128
- "@loja-integrada/tailwindcss-config": "^1.6.3",
133
+ "@loja-integrada/tailwindcss-config": "^1.7.1",
129
134
  "@tippyjs/react": "^4.2.5",
130
135
  "@types/react-select": "^4.0.17",
131
136
  "babel-jest": "^29.2.2",
@@ -138,7 +143,6 @@
138
143
  "react-table": "^7.7.0",
139
144
  "react-text-mask": "^5.4.3",
140
145
  "react-toastify": "^7.0.4",
141
- "sonarqube-scanner": "^2.8.2",
142
- "styled-components": "^5.3.1"
146
+ "sonarqube-scanner": "^2.8.2"
143
147
  }
144
148
  }
@@ -2,11 +2,11 @@ import React, { useState, useEffect } from 'react'
2
2
  import { Icon } from '../../Icons'
3
3
 
4
4
  const backgroundShadowEffect = [
5
- '[background:linear-gradient(#FFFFFF_33%,rgba(255,255,255,0)),linear-gradient(rgba(255,255,255,0),#FFFFFF_66%)_0_100%,radial-gradient(farthest-side_at_50%_0,rgba(156,156,156,0.5),rgba(0,0,0,0)),radial-gradient(farthest-side_at_50%_100%,_rgba(156,156,156,0.5),rgba(0,0,0,0))_0_100%]',
5
+ '[background:linear-gradient(theme(colors.base-1/100)_33%,rgba(255,255,255,0)),linear-gradient(rgba(255,255,255,0),theme(colors.base-1/100)_66%)_0_100%,radial-gradient(farthest-side_at_50%_0,rgba(156,156,156,0.5),rgba(0,0,0,0)),radial-gradient(farthest-side_at_50%_100%,_rgba(156,156,156,0.5),rgba(0,0,0,0))_0_100%]',
6
6
  '[background-size:100%_15px,100%_15px,100%_5px,100%_5px]',
7
7
  '[background-attachment:local,local,scroll,scroll]',
8
8
  '[background-repeat:no-repeat]',
9
- '[background-color:#FFFFFF]',
9
+ '[background-color:theme(colors.base-1/100]',
10
10
  '[&_.form-group_.bg-base-1]:bg-transparent',
11
11
  ]
12
12
 
@@ -123,7 +123,7 @@ const CustomControl = (
123
123
  variant: DropdownVariant,
124
124
  errorMessage?: string
125
125
  ) => {
126
- const controlClasses = `cursor-pointer transition-all flex itens-center border ${
126
+ const controlClasses = `cursor-pointer transition-all flex itens-center border bg-base-1 ${
127
127
  errorMessage ? varianErrorClasses[variant] : variantControlClasses[variant]
128
128
  } ${sizeClasses[size]} ${
129
129
  props.menuIsOpen ? variantSelectedClasses[variant] : ''
@@ -142,11 +142,11 @@ const IconOption = (
142
142
  const { isSelected, isDisabled, data } = optionDefaultProps
143
143
 
144
144
  const optionClasses = `${
145
- isSelected && markSelectedOption ? 'text-inverted-1' : 'text-inverted-2 '
146
- } text-sm first:pt-0 last:pb-0 p-2 ${
145
+ isSelected && markSelectedOption ? 'text-inverted-1' : 'text-inverted-2'
146
+ } text-sm first:mt-2 last:mb-2 py-2 px-5 font-semibold transition-colors ${
147
147
  isDisabled
148
- ? 'opacity-80 cursor-not-allowed'
149
- : 'hover:bg-transparent hover:text-on-base font-semibold cursor-pointer'
148
+ ? 'opacity-50 cursor-not-allowed'
149
+ : 'hover:text-on-base hover:bg-inverted-2/5 cursor-pointer'
150
150
  }`
151
151
 
152
152
  return (
@@ -175,7 +175,7 @@ const formatGroupLabel = (
175
175
  const CustomGroupHeading = (props: any) => (
176
176
  <GroupHeading
177
177
  {...props}
178
- className="p-2 pt-0 pb-3 text-card-stroke uppercase font-bold text-xs"
178
+ className="p-2 pt-0 pb-3 text-inverted-1 uppercase font-bold text-xs"
179
179
  />
180
180
  )
181
181
 
@@ -272,8 +272,8 @@ const DropdownComponent = (
272
272
  return {
273
273
  ...base,
274
274
  width: menuWidth,
275
+ backgroundColor: 'rgb(var(--color-base-1) / 100)',
275
276
  zIndex: 999,
276
- padding: 20,
277
277
  ...(menuHorizontalPlacement &&
278
278
  menuHorizontalPlacement === 'left' && { left: 0 }),
279
279
  ...(menuHorizontalPlacement &&
@@ -302,6 +302,7 @@ const DropdownComponent = (
302
302
  ...base,
303
303
  fontSize: '0.875rem',
304
304
  letterSpacing: '-0.025rem',
305
+ color: 'rgb(var(--color-on-base) / 100)',
305
306
  }
306
307
  },
307
308
  }}
@@ -1,8 +1,6 @@
1
1
  import React from 'react'
2
-
3
2
  import Tippy, { TippyProps } from '@tippyjs/react'
4
-
5
- import styled from 'styled-components'
3
+ import './style.scss'
6
4
 
7
5
  const TooltipComponent = (props: TooltipProps) => {
8
6
  const [mounted, setMounted] = React.useState(false)
@@ -30,7 +28,7 @@ const TooltipComponent = (props: TooltipProps) => {
30
28
  }
31
29
 
32
30
  return (
33
- <StyledTooltipComponent
31
+ <Tippy
34
32
  {...computedProps}
35
33
  appendTo={props?.appendTo || 'parent'}
36
34
  hideOnClick={props?.hideOnClick || false}
@@ -39,114 +37,10 @@ const TooltipComponent = (props: TooltipProps) => {
39
37
  duration={props?.duration || 150}
40
38
  placement={window?.innerWidth < 1024 ? 'top' : props?.placement || 'top'}
41
39
  interactive={props?.interactive || false}
42
- theme={props?.theme || 'dark'}
43
40
  />
44
41
  )
45
42
  }
46
43
 
47
- const theme: Record<string, Record<string, string>> = {
48
- light: {
49
- background: '#fff',
50
- color: '#371E56',
51
- },
52
- dark: {
53
- background: '#371E56',
54
- color: '#fff',
55
- },
56
- }
57
-
58
- const StyledTooltipComponent = styled(Tippy)<{
59
- theme: string
60
- }>`
61
- --bg-color: ${(props) => theme[props.theme].background};
62
- position: relative;
63
- background-color: var(--bg-color);
64
- color: ${(props) => theme[props.theme].color};
65
- border-radius: 3px;
66
- font-size: 12px;
67
- letter-spacing: -0.4px;
68
- line-height: 1.4;
69
- outline: 0;
70
- transition-property: transform, visibility, opacity;
71
-
72
- &[data-animation='fade'][data-state='hidden'] {
73
- opacity: 0;
74
- }
75
-
76
- [data-tippy-root] {
77
- max-width: calc(100vw - 10px);
78
- }
79
-
80
- &[data-placement^='top'] > .tippy-arrow {
81
- bottom: 0;
82
- }
83
-
84
- &[data-placement^='top'] > .tippy-arrow:before {
85
- bottom: -7px;
86
- left: 0;
87
- border-width: 8px 8px 0;
88
- border-top-color: initial;
89
- transform-origin: center top;
90
- }
91
-
92
- &[data-placement^='bottom'] > .tippy-arrow {
93
- top: 0;
94
- }
95
-
96
- &[data-placement^='bottom'] > .tippy-arrow:before {
97
- top: -7px;
98
- left: 0;
99
- border-width: 0 8px 8px;
100
- border-bottom-color: initial;
101
- transform-origin: center bottom;
102
- }
103
-
104
- &[data-placement^='left'] > .tippy-arrow {
105
- right: 0;
106
- }
107
-
108
- &[data-placement^='left'] > .tippy-arrow:before {
109
- border-width: 8px 0 8px 8px;
110
- border-left-color: initial;
111
- right: -7px;
112
- transform-origin: center left;
113
- }
114
-
115
- &[data-placement^='right'] > .tippy-arrow {
116
- left: 0;
117
- }
118
-
119
- &[data-placement^='right'] > .tippy-arrow:before {
120
- left: -7px;
121
- border-width: 8px 8px 8px 0;
122
- border-right-color: initial;
123
- transform-origin: center right;
124
- }
125
-
126
- &[data-inertia][data-state='visible'] {
127
- transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
128
- }
129
-
130
- .tippy-arrow {
131
- width: 15px;
132
- height: 15px;
133
- color: var(--bg-color);
134
- }
135
-
136
- .tippy-arrow:before {
137
- content: '';
138
- position: absolute;
139
- border-color: transparent;
140
- border-style: solid;
141
- }
142
-
143
- .tippy-content {
144
- position: relative;
145
- padding: 12px 8px;
146
- z-index: 1;
147
- }
148
- `
149
-
150
44
  export const Tooltip = React.memo(TooltipComponent)
151
45
 
152
46
  export interface TooltipProps extends TippyProps {
@@ -179,6 +73,7 @@ export interface TooltipProps extends TippyProps {
179
73
  * */
180
74
  interactive?: TippyProps['interactive']
181
75
  /** Tooltip theme
76
+ * @deprecated Not implemented
182
77
  * @default dark
183
78
  * */
184
79
  theme?: 'light' | 'dark'
@@ -0,0 +1,89 @@
1
+ .tippy-box {
2
+ --bg-color: theme('colors.inverted-1' / 100);
3
+ position: relative;
4
+ background-color: var(--bg-color);
5
+ color: theme('colors.base-1' / 100);
6
+ border-radius: 3px;
7
+ font-size: 12px;
8
+ letter-spacing: -0.4px;
9
+ line-height: 1.4;
10
+ outline: 0;
11
+ transition-property: transform, visibility, opacity;
12
+
13
+ &[data-animation='fade'][data-state='hidden'] {
14
+ opacity: 0;
15
+ }
16
+
17
+ [data-tippy-root] {
18
+ max-width: calc(100vw - 10px);
19
+ }
20
+
21
+ &[data-placement^='top'] > .tippy-arrow {
22
+ bottom: 0;
23
+ }
24
+
25
+ &[data-placement^='top'] > .tippy-arrow:before {
26
+ bottom: -7px;
27
+ left: 0;
28
+ border-width: 8px 8px 0;
29
+ border-top-color: initial;
30
+ transform-origin: center top;
31
+ }
32
+
33
+ &[data-placement^='bottom'] > .tippy-arrow {
34
+ top: 0;
35
+ }
36
+
37
+ &[data-placement^='bottom'] > .tippy-arrow:before {
38
+ top: -7px;
39
+ left: 0;
40
+ border-width: 0 8px 8px;
41
+ border-bottom-color: initial;
42
+ transform-origin: center bottom;
43
+ }
44
+
45
+ &[data-placement^='left'] > .tippy-arrow {
46
+ right: 0;
47
+ }
48
+
49
+ &[data-placement^='left'] > .tippy-arrow:before {
50
+ border-width: 8px 0 8px 8px;
51
+ border-left-color: initial;
52
+ right: -7px;
53
+ transform-origin: center left;
54
+ }
55
+
56
+ &[data-placement^='right'] > .tippy-arrow {
57
+ left: 0;
58
+ }
59
+
60
+ &[data-placement^='right'] > .tippy-arrow:before {
61
+ left: -7px;
62
+ border-width: 8px 8px 8px 0;
63
+ border-right-color: initial;
64
+ transform-origin: center right;
65
+ }
66
+
67
+ &[data-inertia][data-state='visible'] {
68
+ transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
69
+ }
70
+
71
+ .tippy-arrow {
72
+ width: 15px;
73
+ height: 15px;
74
+ color: var(--bg-color);
75
+ }
76
+
77
+ .tippy-arrow:before {
78
+ content: '';
79
+ position: absolute;
80
+ border-color: transparent;
81
+ border-style: solid;
82
+ }
83
+
84
+ .tippy-content {
85
+ position: relative;
86
+ padding: 12px 8px;
87
+ z-index: 1;
88
+ }
89
+ }
@@ -0,0 +1,9 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @import '@loja-integrada/tailwindcss-config/src/_variables.scss';
6
+
7
+ body {
8
+ @apply antialiased;
9
+ }