@tiddh/brave-vue 1.92.20 → 1.92.21

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,16 +1,7 @@
1
1
  <template>
2
2
  <div class="top-bar">
3
- <div class="preview-button" @click="onClick">
4
- <Icon
5
- name="arrow-left"
6
- fill="#AFA2BA"
7
- stroke="transparent"
8
- class="back-button"
9
- />
10
- </div>
11
-
12
- <div class="steppers" v-if="breadcrumbs" @click="onClick">
13
- <Stepper :routes="breadcrumbs" />
3
+ <div class="steppers" v-if="breadcrumbs">
4
+ <Stepper :routes="breadcrumbs" :color="color" @click="onClick" />
14
5
  </div>
15
6
  </div>
16
7
  </template>
@@ -20,7 +11,7 @@
20
11
  import Heading from "../Typography/Heading.vue";
21
12
  import Paragraph from "../Typography/Paragraph.vue";
22
13
  import Icon from "../Icons/Icon.vue";
23
- import Stepper from "../Navigation/Stepper.vue";
14
+ import Stepper from "./Stepper.vue";
24
15
 
25
16
  export default {
26
17
  name: "TopBar",
@@ -30,34 +21,15 @@
30
21
  type: Array,
31
22
  required: true,
32
23
  },
24
+ color: {
25
+ type: String,
26
+ required: true,
27
+ default: "#AFA2BA",
28
+ },
33
29
  },
34
-
35
- data() {
36
- return {
37
- // routes: [
38
- // {
39
- // path: "index",
40
- // stepperName: "Etapa 2",
41
- // },
42
- // {
43
- // path: "second",
44
- // stepperName: "5 - Próximos personagens",
45
- // },
46
- // // {
47
- // // path: "index",
48
- // // stepperName: "Etapa 2",
49
- // // },
50
- // // {
51
- // // path: "first",
52
- // // stepperName: "first",
53
- // // },
54
- // ],
55
- };
56
- },
57
-
58
30
  methods: {
59
- onClick() {
60
- this.$emit("click");
31
+ onClick(payload) {
32
+ this.$emit("click", payload);
61
33
  },
62
34
  },
63
35
  computed: {
@@ -90,23 +62,6 @@
90
62
  align-items: center;
91
63
  //max-width: px-size("lg", );
92
64
  padding-left: columns("lg", 1);
93
-
94
- .preview-button {
95
- width: px-size("lg", $icon-width-md);
96
- height: px-size("lg", $icon-width-md);
97
- margin-right: px-size("lg", $spacing-inline-sm);
98
-
99
- .icon {
100
- width: px-size("lg", $icon-width-md);
101
- height: px-size("lg", $icon-width-md);
102
- display: block;
103
-
104
- svg {
105
- width: px-size("lg", $icon-width-md);
106
- height: px-size("lg", $icon-width-md);
107
- }
108
- }
109
- }
110
65
  }
111
66
 
112
67
  .preview-button {
@@ -8,18 +8,39 @@
8
8
  <div class="stepper-links-item-area">
9
9
  <Paragraph
10
10
  :size="'sm'"
11
- color="#AFA2BA"
11
+ :color="color"
12
12
  class="stepper-link-text"
13
- :class="routes.length - 1 == indexRoute ? 'is-current' : null"
14
- @click="routes.length - 1 == indexRoute ? click() : null"
15
- >{{ option.stepperName }}</Paragraph
13
+ :class="
14
+ routes.length - 1 == indexRoute ? 'is-current' : 'not-current'
15
+ "
16
+ @click="
17
+ routes.length - 1 == indexRoute ? onClick(option) : onClick(option)
18
+ "
19
+ >
20
+ <div
21
+ class="preview-button"
22
+ @click="onClick(option)"
23
+ :style="'color:' + color"
24
+ >
25
+ <Icon
26
+ v-if="indexRoute == 0"
27
+ name="arrow-left"
28
+ :fill="color"
29
+ :color="color"
30
+ size="sm"
31
+ stroke="transparent"
32
+ class="back-button"
33
+ />
34
+ </div>
35
+
36
+ {{ option.stepperName }}</Paragraph
16
37
  >
17
38
  </div>
18
39
 
19
40
  <Paragraph
20
41
  v-if="routes.length - 1 != indexRoute"
21
42
  :size="'sm'"
22
- color="#AFA2BA"
43
+ :color="color"
23
44
  v-html="'/'"
24
45
  class="stepper-link-divider"
25
46
  ></Paragraph>
@@ -49,38 +70,16 @@
49
70
  type: Array,
50
71
  required: true,
51
72
  },
52
- // size: {
53
- // type: String,
54
- // default: "xl",
55
- // },
56
- // heading: {
57
- // type: String,
58
- // required: true,
59
- // },
60
- // headingSize: {
61
- // type: String,
62
- // default: "sm",
63
- // },
64
- // headingColor: {
65
- // type: String,
66
- // default: "#68596E",
67
- // },
68
- // paragraph: {
69
- // type: String,
70
- // },
71
- // paragraphSize: {
72
- // type: String,
73
- // default: "lg",
74
- // },
75
- // haveClose: {
76
- // type: Boolean,
77
- // default: true,
78
- // },
73
+ color: {
74
+ type: String,
75
+ required: true,
76
+ default: "#68596E",
77
+ },
79
78
  },
80
79
 
81
80
  methods: {
82
- onClick() {
83
- this.$emit("click");
81
+ onClick(payload) {
82
+ this.$emit("click", payload);
84
83
  },
85
84
 
86
85
  action() {
@@ -126,8 +125,10 @@
126
125
  cursor: pointer;
127
126
 
128
127
  &:hover {
129
- p {
130
- color: $color-brand-primary-medium !important;
128
+ .preview-button {
129
+ .icon {
130
+ color: $color-brand-primary-medium !important;
131
+ }
131
132
  }
132
133
 
133
134
  .icon {
@@ -168,23 +169,28 @@
168
169
  }
169
170
 
170
171
  .stepper-link-text {
171
- // &:hover {
172
- // color: $color-brand-primary-medium !important;
173
- // }
172
+ display: flex;
173
+ flex-wrap: wrap;
174
+ align-content: center;
175
+ align-items: center;
174
176
 
175
177
  &.is-current {
176
178
  cursor: default;
177
- color: $color-neutral-darkest !important;
179
+ font-weight: bold;
180
+ }
181
+
182
+ &:hover {
183
+ &.not-current {
184
+ color: $color-brand-primary-medium !important;
185
+ }
178
186
  }
179
187
  }
180
188
 
181
189
  .icon {
182
- width: px-size("md", $icon-width-sm);
183
- height: px-size("md", $icon-width-sm);
184
- position: relative;
185
- svg {
186
- width: px-size("md", $icon-width-sm);
187
- height: px-size("md", $icon-width-sm);
190
+ margin-right: px-size("lg", $spacing-inline-xs);
191
+
192
+ @include media-breakpoint-down("sm") {
193
+ margin-right: px-size("lg", $spacing-inline-sm);
188
194
  }
189
195
  }
190
196
  }
@@ -0,0 +1,69 @@
1
+ import { action } from "@storybook/addon-actions";
2
+ import { linkTo } from "@storybook/addon-links";
3
+ import { withKnobs, text, object } from "@storybook/addon-knobs";
4
+
5
+ import TopBar from "./TopBar";
6
+
7
+ export default {
8
+ title: "Navigation/TopBar",
9
+ decorators: [withKnobs],
10
+ component: TopBar,
11
+ };
12
+
13
+ const routes = [
14
+ {
15
+ name: "index",
16
+ stepperName: "Etapa 2",
17
+ },
18
+ {
19
+ name: "second",
20
+ stepperName: "5 - Resumo do pedido",
21
+ },
22
+ ];
23
+
24
+ const color = "#ffffff";
25
+
26
+ export const Basic = () => ({
27
+ components: { TopBar },
28
+ props: {
29
+ breadcrumbs: {
30
+ default: routes,
31
+ },
32
+ },
33
+ template: `<div>
34
+ <div class="storybook-18">
35
+ <TopBar :breadcrumbs="breadcrumbs" />
36
+ </div>
37
+ <br>
38
+
39
+ </div>`,
40
+ methods: {
41
+ updateData(payload) {
42
+ console.log(payload);
43
+ },
44
+ },
45
+ });
46
+
47
+ export const BasicColor = () => ({
48
+ components: { TopBar },
49
+ props: {
50
+ breadcrumbs: {
51
+ default: routes,
52
+ },
53
+ color: {
54
+ default: color,
55
+ },
56
+ },
57
+ template: `<div>
58
+ <div class="storybook-18" style="background-color:#923FDA">
59
+ <TopBar :breadcrumbs="breadcrumbs" :color="color" />
60
+ </div>
61
+ <br>
62
+
63
+ </div>`,
64
+ methods: {
65
+ updateData(payload) {
66
+ console.log(payload);
67
+ },
68
+ },
69
+ });
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div class="top-bar">
3
+ <div class="steppers" v-if="breadcrumbs">
4
+ <Stepper :routes="breadcrumbs" :color="color" @click="onClick" />
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import Button from "../Buttons/Button.vue";
11
+ import Heading from "../Typography/Heading.vue";
12
+ import Paragraph from "../Typography/Paragraph.vue";
13
+ import Icon from "../Icons/Icon.vue";
14
+ import Stepper from "./Stepper.vue";
15
+
16
+ export default {
17
+ name: "TopBar",
18
+ components: { Button, Heading, Paragraph, Icon, Stepper },
19
+ props: {
20
+ breadcrumbs: {
21
+ type: Array,
22
+ required: true,
23
+ },
24
+ color: {
25
+ type: String,
26
+ required: true,
27
+ default: "#AFA2BA",
28
+ },
29
+ },
30
+ methods: {
31
+ onClick(payload) {
32
+ this.$emit("click", payload);
33
+ },
34
+ },
35
+ computed: {
36
+ shadowVar() {
37
+ return {
38
+ "--shadow-color": this.shadowColor,
39
+ };
40
+ },
41
+ },
42
+ };
43
+ </script>
44
+
45
+ <style lang="scss" scoped>
46
+ @import "./node_modules/@tiddh/brave-tokens/dist/styles/style.scss";
47
+
48
+ .top-bar {
49
+ /* color / surface / neutral / light */
50
+
51
+ // background: #ffffff;
52
+ /* shadow / level 02 */
53
+ position: relative;
54
+ width: 100%;
55
+ top: 0;
56
+ left: 0;
57
+ // box-shadow: 0px 10px 26px rgba(104, 89, 110, 0.24);
58
+ padding-top: px-size("lg", $spacing-stack-md);
59
+ padding-bottom: px-size("lg", $spacing-stack-md);
60
+ display: flex;
61
+ flex-wrap: wrap;
62
+ align-items: center;
63
+ //max-width: px-size("lg", );
64
+ padding-left: columns("lg", 1);
65
+ }
66
+
67
+ .preview-button {
68
+ cursor: pointer;
69
+ }
70
+ </style>
@@ -68,7 +68,7 @@
68
68
  import Preview from "./Preview.vue";
69
69
  import PreviewMobile from "./PreviewMobile.vue";
70
70
  import PreviewTools from "./PreviewTools.vue";
71
- import TopBar from "./TopBar.vue";
71
+ import TopBar from "../Navigation/TopBar.vue";
72
72
  import BottomBar from "./BottomBar.vue";
73
73
 
74
74
  //const $ = jQuery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiddh/brave-vue",
3
- "version": "1.92.20",
3
+ "version": "1.92.21",
4
4
  "private": false,
5
5
  "main": "dist/brave-vue.ssr.js",
6
6
  "browser": "dist/brave-vue.esm.js",