@vcita/design-system 1.3.13 → 1.3.15

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.
@@ -11,6 +11,19 @@
11
11
  </template>
12
12
  </VcButton>
13
13
  {{ title }}
14
+ <span v-if="chipLabel"
15
+ :data-qa="`${dataQa}-titleChip`"
16
+ class="title-chip" :class="`title-chip--${chipFlavor}`"
17
+ >{{ chipLabel }}</span>
18
+ <VcButton v-if="buttonLabel || buttonPrependIcon" flavor="secondary"
19
+ class="title-button"
20
+ :data-qa="`${dataQa}-titleButton`"
21
+ @click="$emit('onTitleButtonClick')">
22
+ <template #prepend v-if="buttonPrependIcon">
23
+ <VcIcon color="black" size="var(--font-size-small)" class="me-2">{{ buttonPrependIcon }}</VcIcon>
24
+ </template>
25
+ {{ buttonLabel }}
26
+ </VcButton>
14
27
  </span>
15
28
  <span v-if="subtitle && subtitle.length > 0" class="VcHeader--subtitle">
16
29
  {{ subtitle }}
@@ -35,10 +48,11 @@ import VcBreadcrumbs from "@/components/VcBreadcrumbs/VcBreadcrumbs.vue";
35
48
  import VcLayout from "@/components/VcLayout/VcLayout.vue";
36
49
  import VcIcon from "@/components/VcIcon/VcIcon.vue";
37
50
  import VcButton from "@/components/VcButton/VcButton.vue";
51
+ import VcChip from "@/components/VcChip/VcChip.vue";
38
52
 
39
53
  export default {
40
54
  name: "VcPageHeader",
41
- components: {VcButton, VcIcon, VcLayout, VcBreadcrumbs},
55
+ components: {VcChip, VcButton, VcIcon, VcLayout, VcBreadcrumbs},
42
56
  props: {
43
57
  breadcrumbs: {
44
58
  type: Array,
@@ -63,12 +77,29 @@ export default {
63
77
  dataQa: {
64
78
  type: String,
65
79
  default: 'VcPageHeader'
80
+ },
81
+ chipLabel: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ chipFlavor: {
86
+ type: String,
87
+ default: 'beta',
88
+ validator: (type) => ['beta'].includes(type)
89
+ },
90
+ buttonLabel: {
91
+ type: String,
92
+ default: ''
93
+ },
94
+ buttonPrependIcon: {
95
+ type: String,
96
+ default: ''
66
97
  }
67
98
  },
68
99
  computed: {
69
100
  saveButtonLabel() {
70
101
  return this.buttonData.save?.label || this.$dst('ds.page.saveButton.label')
71
- },
102
+ }
72
103
  },
73
104
  }
74
105
  </script>
@@ -85,6 +116,24 @@ export default {
85
116
  line-height: var(--size-value8);
86
117
  color: var(--gray-darken-5);
87
118
  margin-top: var(--size-value1);
119
+
120
+ .title-chip {
121
+ padding: var(--size-value1) var(--size-value2);
122
+ margin-inline-start: var(--size-value3);
123
+ border-radius: var(--size-value6);
124
+ font-weight: var(--font-weight-large2);
125
+ font-size: var(--font-size-xx-small);
126
+ height: var(--size-value5);
127
+
128
+ &--beta {
129
+ background-color: var(--orange);
130
+ color: white;
131
+ }
132
+ }
133
+
134
+ .title-button {
135
+ margin-inline-start: var(--size-value3);
136
+ }
88
137
  }
89
138
 
90
139
  .VcHeader--subtitle {
@@ -41,4 +41,7 @@ $color-picker-swatch-color-height: 24px;
41
41
  $color-picker-swatch-color-margin: 5px;
42
42
  $color-picker-controls-padding: 8px;
43
43
  $color-picker-swatch-color-border-radius: 50%;
44
- $color-picker-border-radius: 4px;
44
+ $color-picker-border-radius: 4px;
45
+
46
+ // VcMenuItem - skeleton
47
+ $skeleton-loader-text-border-radius: 4px;
@@ -1,166 +0,0 @@
1
- import VcLayout from "@/components/VcLayout/VcLayout";
2
- import VcPageHeader from "@/components/page/elements/VcPageHeader";
3
- import VcImage from "@/components/VcImage/VcImage";
4
- import VcButton from "@/components/VcButton/VcButton";
5
-
6
- const Template = (args, {argTypes}) => ({
7
- components: {VcLayout, VcPageHeader, VcImage, VcButton},
8
- props: Object.keys(argTypes),
9
- template: `
10
- <div :style="{maxHeight: '80%', overflow: 'hidden'}">
11
- <VcLayout justify-center align-start :style="{margin: 'var(--size-value5)' }">
12
- <VcLayout column fill-height
13
- :style="{minWidth: 'var(--centered-layout-min-width)',
14
- maxWidth: 'var(--centered-layout-max-width)',
15
- flexBasis: 'var(--centered-layout-min-width)'}">
16
- <VcPageHeader :title="title"
17
- :subtitle="subtitle"
18
- :show-back-button="showBackButton"
19
- :breadcrumbs="breadcrumbs"
20
- :button-data="headerButtonData"
21
- @onSaveClicked="onSaveClicked"
22
- @onBackClicked="onBackClicked"/>
23
- <VcLayout fill-height column
24
- :style="{ maxHeight: '100vh', backgroundColor: 'var(--green-lighten-2)', padding: '20px'}">
25
- <VcLayout id="header" :style="{height: '50px'}">title</VcLayout>
26
- <VcLayout id="content" column justify-center
27
- :style="{backgroundColor: 'var(--red-lighten-2)', flexGrow: 0, overflowY: 'auto'}">
28
- <div :style="{width:'100%', minHeight: '1000px'}"> Your overflowing content goes here</div>
29
- <!-- <div :style="{width:'100%', minHeight: '20px', backgroundColor: 'var(&#45;&#45;green-lighten-2)'}"> last item </div>-->
30
- </VcLayout>
31
- </VcLayout>
32
- </VcLayout>
33
- </VcLayout>
34
- </div>`,
35
- })
36
-
37
- // export const InnerScrollPage = Template.bind({});
38
-
39
- // Set default values
40
- InnerScrollPage.args = {
41
- breadcrumbs: [{text: 'Settings', href: 'settings'}, {text: 'Payments', href: 'payments'}],
42
- title: 'Payments',
43
- subtitle: '',
44
- showBackButton: true,
45
- headerButtonData: {save: {disabled: false}},
46
- }
47
-
48
- InnerScrollPage.parameters = {
49
- docs: {
50
- source: {
51
- code: `
52
- <template>
53
- <VcLayout justify-center align-start class="LayoutContainer">
54
- <VcLayout column class="MainLayout">
55
- <VcPageHeader :title="$t([YourPageTitle])"
56
- :subtitle="$t([YourPageSubtitle])"
57
- :breadcrumbs="breadcrumbs"
58
- :button-data="headerButtonData"
59
- @onSaveClicked="onSaveClicked"
60
- @onBackClicked="onBackClicked"/>
61
- <VcLayout>
62
- <!-- Set the content for your page -->
63
- Your content goes here
64
- </VcLayout>
65
- </VcLayout>
66
- </VcLayout>
67
- </template>
68
-
69
- <script>
70
-
71
- /**
72
- To get this code running:
73
- 1. [YourPageTitle] [[YourPageSubtitle] - set your page title and subtitle
74
- 2. [SettingsPageName] - Name the page
75
- 3. breadcrumbs data - set the breadcrumbs leading to this page
76
- 4. menu navigation groups - set the content
77
- 5. populate the content for the page
78
- 4. Mapping to YourStoreModule for data to display
79
- 5. Mapping to YourStoreModule for save action
80
- 6. Handle the logic to enable/disable the header save button
81
- */
82
-
83
- import {mapActions, mapGetters} from "vuex";
84
-
85
- export default {
86
- name: "[SettingsPageName]",
87
- data() {
88
- return {
89
- selectedIdx: '0',
90
- isSaveEnabled: false,
91
- breadcrumbs: [
92
- {
93
- text: 'item 1',
94
- disabled: false,
95
- href: 'item_1',
96
- },
97
- ],
98
- navGroups: [
99
- {
100
- id: 1,
101
- label: '[Group 1]',
102
- items: [
103
- {id: '0', label: 'item 1'},
104
- {id: '1', label: 'item 2'},
105
- ]
106
- },
107
- ],
108
- };
109
- },
110
- computed: {
111
- ...mapGetters("[YourStoreModule]", ["data"]),
112
- headerButtonData() {
113
- return {save: { disabled: !this.isSaveEnabled }};
114
- }
115
- },
116
- methods: {
117
- ...mapActions("YourStoreModule", ["SaveAction"]),
118
- onSaveClicked() {
119
- // Your save logic, probably sending action to store
120
- },
121
- onBackClicked() {
122
- this.$router.go(-1); // Or other logic
123
- },
124
- },
125
- }
126
- </script>
127
-
128
- <style lang="scss" scoped>
129
- .LayoutContainer {
130
- margin: var(--size-value5);
131
- height: 100%;
132
- }
133
-
134
- .MainLayout {
135
- // Need to get the actual values from Slavko
136
- min-width: var(--centered-layout-min-width);
137
- max-width: var(--centered-layout-max-width);
138
- flex-basis: var(--centered-layout-min-width);
139
- }
140
- </style>
141
-
142
- `,
143
- type: "auto",
144
- }
145
- }
146
- }
147
-
148
- export default {
149
- title: 'Page / layouts', // This will control the story sidebar position
150
- id: 'CenteredPage', // This will be the permanent link to this component
151
- component: VcPageHeader,
152
- argTypes: {
153
- buttonData: {table: {disable: true}},
154
- buttons: {table: {disable: true}},
155
- dataQa: {table: {disable: true}},
156
- },
157
- parameters: {
158
- design: {
159
- type: 'figma',
160
- url: 'https://www.figma.com/file/SD2qQZXfTJVxKHEqQgp2wt/New-settings-layout?node-id=43%3A101625',
161
- },
162
- status: {
163
- type: 'pattern',
164
- },
165
- },
166
- };