@luizleon/sf.prefeiturasp.vuecomponents 0.0.65 → 4.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.
Files changed (43) hide show
  1. package/dist/axios/axiosClient.d.ts +3 -3
  2. package/dist/components/button/Button.d.ts +12 -12
  3. package/dist/components/content/Content.d.ts +8 -8
  4. package/dist/components/drawer/Drawer.d.ts +13 -13
  5. package/dist/components/icon/Icon.d.ts +21 -22
  6. package/dist/components/internal/HeaderAvatar.d.ts +2 -2
  7. package/dist/components/internal/LoadingCircle.d.ts +1 -1
  8. package/dist/components/internal/MenuIcon.d.ts +1 -1
  9. package/dist/components/internal/ScrollToTop.d.ts +1 -1
  10. package/dist/components/internal/ThemeToggle.d.ts +1 -1
  11. package/dist/components/layout/Layout.d.ts +3 -2
  12. package/dist/components/message/Message.d.ts +12 -12
  13. package/dist/components/navmenu/NavMenu.d.ts +12 -0
  14. package/dist/components/navmenulink/NavMenuLink.d.ts +2 -2
  15. package/dist/components/panelmenu/PanelMenu.d.ts +4 -4
  16. package/dist/components/tabnavigation/TabNavigation.d.ts +9 -9
  17. package/dist/components/tooltip/Tooltip.d.ts +7 -7
  18. package/dist/index.d.ts +18 -18
  19. package/dist/services/authService.d.ts +2 -2
  20. package/dist/services/dialogService.d.ts +1 -1
  21. package/dist/sf.prefeiturasp.vuecomponents.es.js +4551 -4180
  22. package/dist/sf.prefeiturasp.vuecomponents.es.js.map +1 -1
  23. package/dist/sf.prefeiturasp.vuecomponents.umd.js +332 -69
  24. package/dist/sf.prefeiturasp.vuecomponents.umd.js.map +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/types/index.d.ts +12 -1
  27. package/package.json +6 -6
  28. package/src/components/button/Button.vue +1 -1
  29. package/src/components/icon/Icon.vue +12 -16
  30. package/src/components/internal/getMaxZindex.ts +3 -2
  31. package/src/components/layout/Layout.vue +1 -1
  32. package/src/components/navmenu/NavMenu.d.ts +30 -0
  33. package/src/components/navmenu/NavMenu.vue +105 -0
  34. package/src/index.ts +2 -0
  35. package/src/services/authService.ts +13 -4
  36. package/src/style/componentes.scss +5 -1
  37. package/src/style/src/_functions.scss +17 -2
  38. package/src/style/src/_mixins.scss +51 -29
  39. package/src/style/src/_variables.scss +11 -0
  40. package/src/style/src/components/_button.scss +8 -11
  41. package/src/style/src/components/_icon.scss +49 -47
  42. package/src/style/src/components/_tooltip.scss +6 -7
  43. package/src/types/index.ts +24 -0
@@ -1,4 +1,19 @@
1
1
  @function theme-colors($dark: false) {
2
- @return "primary", "info", "success", "warn", "help",
3
- "error", "secondary";
2
+ @return "primary", "info", "success", "warn", "help", "error",
3
+ "secondary";
4
+ }
5
+
6
+ @function str-replace($string, $search, $replace: "") {
7
+ $index: str-index($string, $search);
8
+
9
+ @if $index {
10
+ @return str-slice($string, 1, $index - 1) + $replace +
11
+ str-replace(
12
+ str-slice($string, $index + str-length($search)),
13
+ $search,
14
+ $replace
15
+ );
16
+ }
17
+
18
+ @return $string;
4
19
  }
@@ -74,38 +74,40 @@
74
74
  }
75
75
 
76
76
  @mixin button-colors($dark: false) {
77
- @each $color in theme-colors() {
78
- &[data-color="#{$color}"] {
79
- color: var(--bg-color);
77
+ @each $color in $theme-colors-list {
78
+ $button-var-color: var(#{$color}-color);
79
+ $button-filled-color: #fff;
80
+ @if ($color == "--warn") {
81
+ $button-filled-color: #000;
82
+ }
83
+ &[data-color="#{str-replace($color, '--')}"] {
80
84
  @media (pointer: fine) {
81
85
  &:focus-visible {
82
- outline: 2px solid var(--#{$color}-hover-color);
86
+ outline: 2px solid $button-var-color;
83
87
  outline-offset: 1px;
84
88
  border-color: var(--bg-color);
85
89
  }
86
90
  }
87
91
  &:active {
88
92
  transition: 0s;
89
- &:active {
90
- @if ($dark) {
91
- filter: brightness(0.9);
92
- } @else {
93
- filter: brightness(1.1);
94
- }
95
- }
93
+ filter: brightness(0.9);
96
94
  }
97
95
  &.#{$prefix}button-filled {
98
- background-color: var(--#{$color}-color);
96
+ color: #{$button-filled-color};
97
+ background-color: $button-var-color;
99
98
  }
100
99
  &.#{$prefix}button-outlined,
101
100
  &.#{$prefix}button-text {
101
+ color: $button-var-color;
102
102
  background-color: transparent;
103
- color: var(--#{$color}-color);
104
- border-color: var(--#{$color}-color);
105
103
  @media (pointer: fine) {
106
104
  &:hover,
107
105
  &:focus-visible {
108
- background-color: var(--#{$color}-hover-color);
106
+ background: color-mix(
107
+ in srgb,
108
+ currentColor 10%,
109
+ transparent
110
+ );
109
111
  }
110
112
  }
111
113
  }
@@ -117,34 +119,54 @@
117
119
  }
118
120
 
119
121
  @mixin dot-colors() {
120
- @each $color in theme-colors() {
121
- &[data-color="#{$color}"] {
122
- color: var(--#{$color}-color);
122
+ @each $color in $theme-colors-list {
123
+ $colorName: str-replace($color, "--");
124
+ &[data-color="#{$colorName}"] {
125
+ background-color: var(#{$color}-color);
123
126
  }
124
127
  }
125
128
  }
126
129
 
127
130
  @mixin input-colors() {
128
- @each $color in theme-colors() {
129
- &[data-color="#{$color}"] {
130
- background-color: var(--#{$color}-color);
131
+ @each $color in $theme-colors-list {
132
+ $colorName: str-replace($color, "--");
133
+ &[data-color="#{$colorName}"] {
134
+ color: var(#{$color}-color);
131
135
  }
132
136
  }
133
137
  }
134
138
 
135
139
  @mixin toast-colors() {
136
- @each $color in theme-colors() {
137
- &.toast-#{$color} {
138
- --animate-bg-color: var(--#{$color}-color);
140
+ @each $color, $colorValue in $theme-colors-list {
141
+ $colorName: str-replace($color, "--");
142
+ &.toast-#{$colorName} {
143
+ --toast-progress-color: var(#{$color}-color);
144
+ --toast-bg-color: hsla(
145
+ var(#{$color}-color-h),
146
+ var(#{$color}-color-s),
147
+ var(#{$color}-color-l),
148
+ 0.9
149
+ );
139
150
  }
140
151
  }
141
152
  }
142
153
 
143
- @mixin icon-button-hover-colors() {
144
- @each $color in theme-colors() {
145
- &:hover,
146
- &:focus-visible {
147
- background-color: var(--#{$color}-hover-color);
154
+ @mixin theme-colors-class() {
155
+ @each $color in $theme-colors-list {
156
+ $colorName: str-replace($color, "--");
157
+ .#{$colorName}-color:not(
158
+ :disabled,
159
+ .disabled,
160
+ .component-disabled
161
+ ) {
162
+ color: var(#{$color}-color) !important;
163
+ }
164
+ .#{$colorName}-bgcolor:not(
165
+ :disabled,
166
+ .disabled,
167
+ .component-disabled
168
+ ) {
169
+ background-color: var(#{$color}-color) !important;
148
170
  }
149
171
  }
150
172
  }
@@ -1 +1,12 @@
1
1
  $prefix: "sf-" !default;
2
+
3
+ $theme-colors-list: (
4
+ "--primary",
5
+ "--info",
6
+ "--success",
7
+ "--warn",
8
+ "--help",
9
+ "--error",
10
+ "--secondary",
11
+ "--text"
12
+ );
@@ -4,8 +4,10 @@
4
4
  position: relative;
5
5
  display: inline-flex;
6
6
  align-items: center;
7
- border-radius: 4px;
7
+ border-radius: 6px;
8
8
  border: 1px solid transparent;
9
+ width: fit-content;
10
+ word-break: break-word;
9
11
  font-weight: 400;
10
12
  transition: opacity 0.2s ease-in-out;
11
13
  &:hover {
@@ -13,11 +15,12 @@
13
15
  }
14
16
 
15
17
  .#{$prefix}button-label {
16
- white-space: nowrap;
18
+ white-space: wrap;
17
19
  }
18
20
 
19
21
  .#{$prefix}icon {
20
22
  position: absolute;
23
+ color: unset !important;
21
24
  > button {
22
25
  color: currentColor !important;
23
26
  }
@@ -41,7 +44,7 @@
41
44
  }
42
45
 
43
46
  &.#{$prefix}button-small {
44
- height: 32px;
47
+ min-height: 32px;
45
48
  font-size: 0.875rem;
46
49
  padding: 0 12px;
47
50
  &.#{$prefix}button-with-icon {
@@ -54,13 +57,10 @@
54
57
  margin-left: -8px;
55
58
  }
56
59
  }
57
- .#{$prefix}button-label {
58
- line-height: 32px;
59
- }
60
60
  }
61
61
 
62
62
  &.#{$prefix}button-medium {
63
- height: 36px;
63
+ min-height: 36px;
64
64
  font-size: 1rem;
65
65
  padding: 0 12px;
66
66
  &.#{$prefix}button-with-icon {
@@ -73,13 +73,10 @@
73
73
  margin-left: -12px;
74
74
  }
75
75
  }
76
- .#{$prefix}button-label {
77
- line-height: 36px;
78
- }
79
76
  }
80
77
 
81
78
  &.#{$prefix}button-large {
82
- height: 48px;
79
+ min-height: 48px;
83
80
  font-size: 1.25rem;
84
81
  padding: 0 16px;
85
82
  &.#{$prefix}button-with-icon {
@@ -14,7 +14,7 @@ div.#{$prefix}icon {
14
14
  align-items: center;
15
15
 
16
16
  > button {
17
- color: var(--text-color);
17
+ color: currentColor;
18
18
  pointer-events: none;
19
19
  background: none;
20
20
  border: none;
@@ -22,10 +22,10 @@ div.#{$prefix}icon {
22
22
  + span {
23
23
  position: absolute;
24
24
  border-radius: 50%;
25
- width: 6px;
26
- height: 6px;
27
- top: 4px;
28
- right: 4px;
25
+ width: 8px;
26
+ height: 8px;
27
+ top: 6px;
28
+ right: 6px;
29
29
  @include dot-colors;
30
30
  }
31
31
  &:focus-visible {
@@ -45,66 +45,68 @@ div.#{$prefix}icon {
45
45
  }
46
46
 
47
47
  &.#{$prefix}icon-small {
48
- min-width: 28px;
49
- > button {
50
- font-size: 20px;
51
- }
52
- .#{$prefix}loading-circle {
53
- width: 20px;
54
- height: 20px;
55
- }
48
+ --size: calc(var(--material-icon-font-size) * 0.75);
56
49
  }
57
50
 
58
51
  &.#{$prefix}icon-medium {
59
- min-width: 37px;
52
+ --size: var(--material-icon-font-size);
53
+ }
54
+
55
+ &.#{$prefix}icon-large {
56
+ --size: calc(var(--material-icon-font-size) * 1.25);
60
57
  > button {
61
- font-size: 24px;
62
- + span {
63
- width: 8px;
64
- height: 8px;
65
- top: 6px;
66
- right: 6px;
67
- }
58
+ font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0,
59
+ "opsz" 48;
68
60
  }
69
- .#{$prefix}loading-circle {
70
- width: 24px;
71
- height: 24px;
61
+ }
62
+
63
+ &.#{$prefix}icon-xlarge {
64
+ --size: calc(var(--material-icon-font-size) * 2);
65
+ > button {
66
+ font-variation-settings: "FILL" 0, "wght" 200, "GRAD" 0,
67
+ "opsz" 48;
72
68
  }
73
69
  }
74
70
 
75
- &.#{$prefix}icon-large {
76
- min-width: 48px;
71
+ &.#{$prefix}icon-2xlarge {
72
+ --size: calc(var(--material-icon-font-size) * 2.5);
77
73
  > button {
78
- font-size: 36px;
79
- + span {
80
- width: 12px;
81
- height: 12px;
82
- top: 6px;
83
- right: 6px;
84
- }
74
+ font-variation-settings: "FILL" 0, "wght" 100, "GRAD" 0,
75
+ "opsz" 48;
85
76
  }
86
- .#{$prefix}loading-circle {
87
- width: 28px;
88
- height: 28px;
77
+ }
78
+
79
+ &.#{$prefix}icon-3xlarge {
80
+ --size: calc(var(--material-icon-font-size) * 3);
81
+ > button {
82
+ font-variation-settings: "FILL" 0, "wght" 100, "GRAD" 0,
83
+ "opsz" 48;
89
84
  }
90
85
  }
91
86
 
87
+ .#{$prefix}loading-circle {
88
+ width: var(--size);
89
+ height: var(--size);
90
+ }
91
+
92
+ > button {
93
+ font-size: var(--size);
94
+ width: var(--size);
95
+ height: var(--size);
96
+ line-height: var(--size);
97
+ }
98
+
92
99
  &.#{$prefix}icon-button {
100
+ padding: 6px;
93
101
  border-radius: 50%;
94
102
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1)
95
103
  0ms;
96
- &.#{$prefix}icon-small {
97
- padding: 4px;
98
- }
99
- &.#{$prefix}icon-medium {
100
- padding: 6px;
101
- }
102
- &.#{$prefix}icon-large {
103
- padding: 8px;
104
- }
105
104
  @media (pointer: fine) {
106
- cursor: pointer;
107
- @include icon-button-hover-colors;
105
+ &:hover,
106
+ &:focus-within {
107
+ cursor: pointer;
108
+ background: color-mix(in srgb, currentColor 10%, transparent);
109
+ }
108
110
  }
109
111
  }
110
112
 
@@ -1,21 +1,18 @@
1
1
  .#{$prefix}tooltip-wrapper {
2
2
  --arrow-width: 7.5px;
3
3
  pointer-events: none;
4
- width: 120px;
5
4
  color: var(--bg-color);
6
5
  text-align: center;
7
- text-transform: lowercase;
8
6
  position: absolute;
9
7
  opacity: 0;
10
8
  transition: opacity 0.3s;
11
9
 
12
10
  .#{$prefix}tooltip-inner {
13
11
  position: relative;
14
- padding: 5px 2px;
15
- border-radius: 4px;
12
+ padding: var(--inline-spacing);
13
+ border-radius: 6px;
16
14
  background-color: var(--text-color);
17
- font-size: 0.825rem;
18
-
15
+ font-size: 0.875em;
19
16
  &::after {
20
17
  content: "";
21
18
  position: absolute;
@@ -45,7 +42,9 @@
45
42
  }
46
43
 
47
44
  .#{$prefix}tooltip-anchor {
48
- display: inline !important;
45
+ display: inline-block !important;
46
+ width: fit-content;
47
+ height: fit-content;
49
48
  border-radius: 50%;
50
49
  &:has(.component-disabled),
51
50
  &:has(.component-loading) {
@@ -1,5 +1,21 @@
1
1
  import Keycloak, { KeycloakInitOptions } from "./../keycloak";
2
2
 
3
+ export type Color =
4
+ | "primary"
5
+ | "secondary"
6
+ | "info"
7
+ | "success"
8
+ | "help"
9
+ | "warn"
10
+ | "error"
11
+ | "text";
12
+
13
+ export type Size = "sm" | "md" | "lg";
14
+
15
+ export type IconSize = Size | "xl" | "2xl" | "3xl";
16
+
17
+ export type ButtonVariant = "filled" | "outlined" | "text";
18
+
3
19
  interface SfPanelMenuItem {
4
20
  label: string;
5
21
  routeName?: string;
@@ -9,6 +25,14 @@ interface SfPanelMenuItem {
9
25
  key?: string;
10
26
  }
11
27
 
28
+ export interface SfNavMenuItem {
29
+ text: string;
30
+ [key: string]: any;
31
+ href?: string;
32
+ icon?: string;
33
+ items?: SfNavMenuItem[];
34
+ }
35
+
12
36
  interface User {
13
37
  name: string;
14
38
  email: string;