@tiddh/brave-vue 1.92.19 → 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.
Files changed (31) hide show
  1. package/dist/brave-vue.esm.js +31 -31
  2. package/dist/brave-vue.min.js +1 -1
  3. package/dist/brave-vue.ssr.js +25 -25
  4. package/dist/src/Button.vue +23 -22
  5. package/dist/src/ButtonWithIcon.stories.js +12 -12
  6. package/dist/src/Buttons/Button.vue +23 -22
  7. package/dist/src/Buttons/ButtonWithIcon.stories.js +12 -12
  8. package/dist/src/Buttons/Primary.stories.js +2 -2
  9. package/dist/src/Buttons/ProgressiveLoading.stories.js +4 -4
  10. package/dist/src/Buttons/Secondary.stories.js +2 -2
  11. package/dist/src/Navigation/Stepper.vue +52 -46
  12. package/dist/src/Navigation/TopBar.stories.js +69 -0
  13. package/dist/src/Navigation/TopBar.vue +70 -0
  14. package/dist/src/Preview/PreviewWithTools.vue +1 -1
  15. package/dist/src/PreviewWithTools.vue +1 -1
  16. package/dist/src/Primary.stories.js +2 -2
  17. package/dist/src/ProgressiveLoading.stories.js +4 -4
  18. package/dist/src/Secondary.stories.js +2 -2
  19. package/dist/src/Stepper.vue +52 -46
  20. package/dist/src/TopBar.stories.js +69 -0
  21. package/dist/src/TopBar.vue +10 -55
  22. package/dist/src/components/Buttons/Button.vue +23 -22
  23. package/dist/src/components/Buttons/ButtonWithIcon.stories.js +12 -12
  24. package/dist/src/components/Buttons/Primary.stories.js +2 -2
  25. package/dist/src/components/Buttons/ProgressiveLoading.stories.js +4 -4
  26. package/dist/src/components/Buttons/Secondary.stories.js +2 -2
  27. package/dist/src/components/Navigation/Stepper.vue +52 -46
  28. package/dist/src/components/Navigation/TopBar.stories.js +69 -0
  29. package/dist/src/components/Navigation/TopBar.vue +70 -0
  30. package/dist/src/components/Preview/PreviewWithTools.vue +1 -1
  31. package/package.json +1 -1
@@ -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
@@ -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
@@ -34,7 +34,7 @@ export const Primary = () => ({
34
34
  <div class="storybook-12">
35
35
  <Button kind="primary" size="xl" width="fluid" icon="right" :disabled="disabled" :inverted="inverted" :shadow-color="shadowColor" @click="action">
36
36
  <span>Fluid - Cols 12</span>
37
- <Icon name="collapse" size="md" fill="#fff" stroke="transparent" />
37
+ <Icon name="collapse" size="md" stroke="transparent" />
38
38
  </Button>
39
39
  </div>
40
40
  <br>
@@ -64,7 +64,7 @@ export const Primary = () => ({
64
64
  <br>
65
65
  <div>
66
66
  <Button kind="primary" size="xl" width="circle" :disabled="disabled" :inverted="inverted" :shadow-color="shadowColor" @click="action">
67
- <Icon name="chevron-right" fill="#fff" stroke="transparent" size="md" />
67
+ <Icon name="chevron-right" stroke="transparent" size="md" />
68
68
  </Button>
69
69
  </div>
70
70
  </div>`,
@@ -46,7 +46,7 @@ export const ProgressiveLoading = () => ({
46
46
  <div class="storybook-12">
47
47
  <Button kind="secondary" size="xl" width="liquid" :isLoadingCompleted="isLoadingCompleted" :loadingProgress="loadingProgress" icon="right" :disabled="disabled" :loadingType="loadingType" :loadingText="loadingText" :isLoading="isLoading" :inverted="inverted" :shadow-color="shadowColor" @click="action">
48
48
  <span>Fluid - Cols 12</span>
49
- <Icon name="collapse" fill="#fff" stroke="transparent" />
49
+ <Icon name="collapse" stroke="transparent" />
50
50
  </Button>
51
51
  </div>
52
52
  <br>
@@ -55,7 +55,7 @@ export const ProgressiveLoading = () => ({
55
55
  <div class="storybook-12">
56
56
  <Button kind="primary" size="xl" width="liquid" :isLoadingCompleted="isLoadingCompleted" :loadingProgress="loadingProgress" icon="right" :disabled="disabled" :loadingType="loadingType" :loadingText="loadingText" :isLoading="isLoading" :inverted="inverted" :shadow-color="shadowColor" @click="action">
57
57
  <span>Fluid - Cols 12</span>
58
- <Icon name="collapse" fill="#fff" stroke="transparent" />
58
+ <Icon name="collapse" stroke="transparent" />
59
59
  </Button>
60
60
  </div>
61
61
  <br>
@@ -69,14 +69,14 @@ export const ProgressiveLoading = () => ({
69
69
  <div class="storybook-12">
70
70
  <Button kind="primary" size="xl" width="liquid" :loadingProgress="loadingProgress" icon="right" :disabled="disabled" :loadingType="loadingType" :loadingText="loadingText" :isLoading="isLoading" :inverted="inverted" :shadow-color="shadowColor" @click="action">
71
71
  <span>Fluid - Cols 12</span>
72
- <Icon name="collapse" fill="#fff" stroke="transparent" />
72
+ <Icon name="collapse" stroke="transparent" />
73
73
  </Button>
74
74
  </div>
75
75
  <br>
76
76
  <div class="storybook-12">
77
77
  <Button kind="ghost" size="xl" width="liquid" :loadingProgress="loadingProgress" icon="right" :disabled="disabled" :loadingType="loadingType" :loadingText="loadingText" :isLoading="isLoading" :inverted="inverted" :shadow-color="shadowColor" @click="action">
78
78
  <span>Fluid - Cols 12</span>
79
- <Icon name="collapse" fill="#fff" stroke="transparent" />
79
+ <Icon name="collapse" stroke="transparent" />
80
80
  </Button>
81
81
  </div>
82
82
  <br>
@@ -40,7 +40,7 @@ export const Secondary = () => ({
40
40
  <br>
41
41
  <div class="storybook-12">
42
42
  <Button kind="secondary" :size="sizes" icon="right" width="fluid" :disabled="disabled" :inverted="inverted"@click="action">
43
- <Icon name="collapse" fill="#fff" stroke="transparent" />
43
+ <Icon name="collapse" stroke="transparent" />
44
44
  Fluid - Cols 12
45
45
  </Button>
46
46
  </div>
@@ -71,7 +71,7 @@ export const Secondary = () => ({
71
71
  <br>
72
72
  <div>
73
73
  <Button kind="secondary" size="md" width="circle" :disabled="disabled" :inverted="inverted" @click="action">
74
- <Icon name="chevron-right" fill="#fff" size="md" stroke="transparent" />
74
+ <Icon name="chevron-right" size="md" stroke="transparent" />
75
75
  </Button>
76
76
  </div>
77
77
  </div>`,
@@ -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
+ });
@@ -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 {