@everchron/ec-shards 0.6.29 → 0.6.33

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "0.6.29",
3
+ "version": "0.6.33",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -97,31 +97,55 @@
97
97
  > *:last-child{
98
98
  margin-bottom: 0;
99
99
  }
100
+
101
+ a{
102
+ text-decoration: underline;
103
+ }
100
104
  }
101
105
 
102
106
  &-info{
103
- background-color: #F5F7FA;
104
- color: #384D68;
107
+ background-color: rgba($gray-4, .25);
108
+ color: rgba($gray-14, .8);
109
+
110
+ a{
111
+ color: rgba($gray-14, .8);
112
+ }
105
113
  }
106
114
 
107
115
  &-error{
108
116
  background-color: $red-3;
109
- color: $red-12;
117
+ color: rgba($red-14, .8);
118
+
119
+ a{
120
+ color: rgba($red-14, .8);
121
+ }
110
122
  }
111
123
 
112
124
  &-success{
113
125
  background-color: $green-3;
114
- color: $green-13;
126
+ color: rgba($green-14, .8);
127
+
128
+ a{
129
+ color: rgba($green-14, .8);
130
+ }
115
131
  }
116
132
 
117
133
  &-warning{
118
134
  background-color: $yellow-2;
119
- color: $yellow-13;
135
+ color: rgba($yellow-14, .9);
136
+
137
+ a{
138
+ color: rgba($yellow-14, .9);
139
+ }
120
140
  }
121
141
 
122
142
  &-important{
123
143
  background-color: $blue-3;
124
- color: $blue-14;
144
+ color: rgba($blue-15, .8);
145
+
146
+ a{
147
+ color: rgba($blue-15, .8);
148
+ }
125
149
  }
126
150
 
127
151
  .action{
@@ -171,7 +195,7 @@
171
195
  font-weight: 500;
172
196
  display: flex;
173
197
  align-items: center;
174
- filter: brightness(75%);
198
+ filter: brightness(90%);
175
199
  margin-bottom: 8px;
176
200
 
177
201
  .icon{
@@ -12,21 +12,33 @@
12
12
  <div v-if="$slots.headercontrols" class="ecs-overlay-header-controls">
13
13
  <slot name="headercontrols"></slot>
14
14
  </div>
15
+ <ecs-button-toolbar v-if="$slots.sidebar && width <= 1400" @click="sidebarToggle" :icon="sidebarIcon" :title="showSidebar ? 'Hide ' + sidebarTitle : 'Show ' + sidebarTitle" :active="showSidebar" class="sidebar-button" />
15
16
  <ecs-button-toolbar @click="$emit('close')" icon="close">{{ closeText }}</ecs-button-toolbar>
16
17
  </div>
17
- <div class="ecs-overlay-content scrollbar">
18
+ <div ref="content" class="ecs-overlay-content scrollbar">
18
19
  <div v-if="$slots.tabs" class="ecs-overlay-tabs scrollbar scrollbar-sml">
19
20
  <slot name="tabs"></slot>
20
21
  </div>
21
- <div class="ecs-overlay-content-inner" :style="{ width: contentWidth, maxWidth: contentMaxWidth, minWidth: contentMinWidth }">
22
+ <div class="ecs-overlay-content-inner" :class="$slots.sidebar && !fullWidth ? 'has-sidebar' : ' '" :style="{ width: contentWidth, maxWidth: contentMaxWidth, minWidth: contentMinWidth }">
22
23
  <slot></slot>
23
24
  </div>
25
+ <div v-if="$slots.sidebar" class="ecs-overlay-sidebar">
26
+ <div v-if="width > 1400" class="ecs-overlay-sidebar-static scrollbar scrollbar-sml">
27
+ <slot name="sidebar"></slot>
28
+ </div>
29
+ <transition name="slide">
30
+ <div v-if="width <= 1400 && showSidebar" class="ecs-overlay-sidebar-float scrollbar scrollbar-sml">
31
+ <slot name="sidebar"></slot>
32
+ </div>
33
+ </transition>
34
+ </div>
24
35
  </div>
25
36
  <div v-if="$slots.footer" class="ecs-overlay-footer">
26
- <div v-if="$slots.tabs && !fullWidth" class="spacer" />
37
+ <div v-if="$slots.tabs && !fullWidth" class="spacer-tabs" />
27
38
  <div class="ecs-overlay-footer-content" :style="{ width: contentWidth, maxWidth: contentMaxWidth }">
28
39
  <slot name="footer"></slot>
29
40
  </div>
41
+ <div v-if="$slots.sidebar && !fullWidth && width > 1400" class="spacer-sidebar" />
30
42
  </div>
31
43
  </div>
32
44
  </transition>
@@ -68,12 +80,23 @@
68
80
  offsetTop: {
69
81
  type: Number,
70
82
  default: 41
71
- }
83
+ },
84
+ //Props for additional slide-in sidbar
85
+ sidebarIcon: {
86
+ type: String,
87
+ default: 'bell'
88
+ },
89
+ sidebarTitle: {
90
+ type: String,
91
+ default: 'Notifications'
92
+ },
72
93
  },
73
94
 
74
95
  data () {
75
96
  return {
76
- isShown: this.show
97
+ isShown: this.show,
98
+ showSidebar: false,
99
+ width: window.innerWidth,
77
100
  }
78
101
  },
79
102
 
@@ -95,7 +118,9 @@
95
118
  },
96
119
 
97
120
  contentMinWidth(){
98
- if(this.fullWidth && this.$slots.tabs){
121
+ if(this.fullWidth && this.$slots.tabs && this.$slots.sidebar){
122
+ return 'calc(100% - 260px - 360px)'
123
+ } else if(this.fullWidth && this.$slots.tabs){
99
124
  return 'calc(100% - 260px)'
100
125
  } else {
101
126
  return '780px'
@@ -103,11 +128,34 @@
103
128
  }
104
129
  },
105
130
 
106
- methods : {
131
+ mounted(){
132
+ this.$nextTick(() => {
133
+ window.addEventListener('resize', this.windowWidth)
134
+ })
135
+ },
136
+
137
+ beforeDestroy() {
138
+ window.removeEventListener('resize', this.windowWidth)
139
+ },
140
+
141
+ methods :{
107
142
  toggleShow(){
108
143
  this.isShown = !this.isShown
109
144
  this.$emit('toggled', this.id, this.isShown)
110
- }
145
+ },
146
+
147
+ windowWidth() {
148
+ this.width = window.innerWidth
149
+ },
150
+
151
+ sidebarToggle(){
152
+ this.showSidebar = !this.showSidebar
153
+ this.$refs.content.classList.add('overflow-hidden')
154
+ setTimeout(() => {
155
+ this.$refs.content.classList.remove('overflow-hidden')
156
+ }, 320);
157
+
158
+ },
111
159
  },
112
160
 
113
161
  watch: {
@@ -143,16 +191,29 @@
143
191
  &-controls{
144
192
  margin-right: 24px;
145
193
  }
194
+
195
+ .sidebar-button{
196
+ margin-right: 24px;
197
+ }
146
198
  }
147
199
 
148
200
  &-content{
149
201
  flex: 1;
150
202
  display: flex;
151
203
  overflow: auto;
204
+ position: relative;
205
+
206
+ &.overflow-hidden{
207
+ overflow: hidden;
208
+ }
152
209
  }
153
210
 
154
211
  &-content-inner{
155
212
  margin: 0 auto;
213
+
214
+ &.has-sidebar{
215
+ margin: 0 0 0 auto;
216
+ }
156
217
  }
157
218
 
158
219
  &-tabs{
@@ -164,6 +225,26 @@
164
225
  flex-shrink: 0;
165
226
  }
166
227
 
228
+ &-sidebar{
229
+ margin: 0 auto 0 0;
230
+ }
231
+
232
+ &-sidebar-static{
233
+ padding: 0 15px 0 30px;
234
+ min-width: 360px;
235
+ }
236
+
237
+ &-sidebar-float{
238
+ padding: 0 15px 0 20px;
239
+ min-width: 380px;
240
+ position: absolute;
241
+ right: 0;
242
+ top: 0;
243
+ bottom: 0;
244
+ background: #FFF;
245
+ box-shadow: 0 0 20px rgba(0,0,0,.12);
246
+ }
247
+
167
248
  &-footer{
168
249
  flex-shrink: 0;
169
250
  background: #FFF;
@@ -175,11 +256,16 @@
175
256
  padding: 30px;
176
257
  }
177
258
 
178
- .spacer{
259
+ .spacer-tabs{
179
260
  width: 260px;
180
261
  flex-shrink: 0;
181
262
  }
182
263
 
264
+ .spacer-sidebar{
265
+ width: 20%;
266
+ min-width: 320px;
267
+ }
268
+
183
269
  &-content{
184
270
  margin: 0 auto;
185
271
  display: flex;
@@ -231,5 +317,20 @@
231
317
  .fade-leave-to{
232
318
  opacity: 0;
233
319
  }
320
+
321
+ .slide-enter-active,
322
+ .slide-leave-active{
323
+ transition: all .3s;
324
+ }
325
+
326
+ .slide-enter{
327
+ opacity: 0;
328
+ transform: translateX(100%);
329
+ }
330
+
331
+ .slide-leave-to{
332
+ opacity: 0;
333
+ transform: translateX(100%);
334
+ }
234
335
  </style>
235
336
 
@@ -73,13 +73,13 @@ export default {
73
73
  }
74
74
  }
75
75
 
76
- .expansion-enter-active {
77
- animation: expansion-in .25s;
76
+ .expansion-enter-active{
77
+ animation: expansion-in .3s ease;
78
78
  overflow: hidden;
79
79
  }
80
80
 
81
- .expansion-leave-active {
82
- animation: expansion-in .25s reverse;
81
+ .expansion-leave-active{
82
+ animation: expansion-in .3s ease reverse;
83
83
  overflow: hidden;
84
84
  }
85
85
 
@@ -88,7 +88,7 @@ export default {
88
88
  max-height: 0;
89
89
  }
90
90
  100% {
91
- max-height: 55px;
91
+ max-height: 46px;
92
92
  }
93
93
  }
94
94
  </style>
@@ -106,6 +106,23 @@ export default {
106
106
  }
107
107
 
108
108
  .ecs-sidebar-header-row{
109
+ > *{
110
+ opacity: 1;
111
+ transition: opacity .2s ease;
112
+ }
113
+
114
+ &.expansion-enter-active{
115
+ > *{
116
+ opacity: 0;
117
+ }
118
+ }
119
+
120
+ &.expansion-leave-active{
121
+ > *{
122
+ opacity: 0;
123
+ }
124
+ }
125
+
109
126
  .ecs-tab-bar{
110
127
  width: 100%;
111
128
  }
@@ -78,3 +78,42 @@ export const overlayFullWidthTabs = () => ({
78
78
  </ecs-overlay>
79
79
  </div>`,
80
80
  });
81
+
82
+ export const overlaySidebar = () => ({
83
+ components: { EcsOverlay },
84
+ data() {
85
+ return {
86
+ showOverlay: false
87
+ }
88
+ },
89
+ template: `<div>
90
+ <button @click="showOverlay = true">Show Overlay</button>
91
+ <ecs-overlay :show="showOverlay" @close="showOverlay = false" icon="archive" header-title="Title" header-title-emphasized="Overlay:" header-title-subline="John G. Deposition (10/12/2020) – Pages 1 - 321" >
92
+
93
+ content area
94
+
95
+ <template slot="footer">footer area</template>
96
+ <template slot="sidebar">sidebar area</template>
97
+ </ecs-overlay>
98
+ </div>`,
99
+ });
100
+
101
+ export const overlayTabsSidebar = () => ({
102
+ components: { EcsOverlay },
103
+ data() {
104
+ return {
105
+ showOverlay: false
106
+ }
107
+ },
108
+ template: `<div>
109
+ <button @click="showOverlay = true">Show Overlay</button>
110
+ <ecs-overlay :show="showOverlay" @close="showOverlay = false" icon="archive" header-title="Title" header-title-emphasized="Overlay:" header-title-subline="John G. Deposition (10/12/2020) – Pages 1 - 321">
111
+
112
+ content area
113
+
114
+ <template slot="tabs">tab area</template>
115
+ <template slot="sidebar">sidebar area</template>
116
+ <template slot="footer">footer area</template>
117
+ </ecs-overlay>
118
+ </div>`,
119
+ });
@@ -28,7 +28,7 @@ export const headerWithSubheaderExpanded = () => ({
28
28
  <ecs-button type="secondary" icon-only icon="search" />
29
29
  <ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
30
30
  </template>
31
- <template slot="sub-header">
31
+ <template slot="subheader">
32
32
  <ecs-tab-bar type="segment">
33
33
  <ecs-tab-button show>Locations</ecs-tab-button>
34
34
  <ecs-tab-button>Family</ecs-tab-button>
@@ -40,13 +40,18 @@ export const headerWithSubheaderExpanded = () => ({
40
40
 
41
41
  export const headerWithSubheader = () => ({
42
42
  components: { EcsSidebarHeader, EcsButton, EcsTabBar, EcsTabButton },
43
- template: `<ecs-sidebar-header>
43
+ data() {
44
+ return {
45
+ expand: false
46
+ }
47
+ },
48
+ template: `<ecs-sidebar-header :sub-header-expanded="expand">
44
49
  <h3 class="headline-2">Sidebar</h3>
45
50
  <template slot="primary-controls">
46
- <ecs-button type="secondary" icon-only icon="search" />
51
+ <ecs-button @click="expand = !expand" type="secondary" icon-only icon="search" />
47
52
  <ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
48
53
  </template>
49
- <template slot="sub-header">
54
+ <template slot="subheader">
50
55
  <ecs-tab-bar type="segment">
51
56
  <ecs-tab-button show>Locations</ecs-tab-button>
52
57
  <ecs-tab-button>Family</ecs-tab-button>
@@ -35,13 +35,13 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
35
35
  </Canvas>
36
36
 
37
37
  ```js
38
- <ecs-sidebar-header>
38
+ <ecs-sidebar-header :sub-header-expanded="expand">
39
39
  <h3 class="headline-2">Sidebar</h3>
40
40
  <template slot="primary-controls">
41
- <ecs-button type="secondary" icon-only icon="search" />
41
+ <ecs-button @click="expand = !expand" type="secondary" icon-only icon="search" />
42
42
  <ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
43
43
  </template>
44
- <template slot="sub-header">
44
+ <template slot="subheader">
45
45
  <ecs-tab-bar type="segment">
46
46
  <ecs-tab-button show>Locations</ecs-tab-button>
47
47
  <ecs-tab-button>Family</ecs-tab-button>
@@ -66,7 +66,7 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
66
66
  <ecs-button type="secondary" icon-only icon="search" />
67
67
  <ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
68
68
  </template>
69
- <template slot="sub-header">
69
+ <template slot="subheader">
70
70
  <ecs-tab-bar type="segment">
71
71
  <ecs-tab-button show>Locations</ecs-tab-button>
72
72
  <ecs-tab-button>Family</ecs-tab-button>
@@ -78,4 +78,4 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
78
78
 
79
79
  ## Props and Slots
80
80
 
81
- <ArgsTable of={EcsSidebarHeader} />
81
+ <ArgsTable of={EcsSidebarHeader} />