@everchron/ec-shards 0.6.27 → 0.6.31

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.27",
3
+ "version": "0.6.31",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"><line vector-effect="non-scaling-stroke" x1="20" x2="20" y1="23.5" y2="6.5" stroke="currentColor"/><line vector-effect="non-scaling-stroke" x1="10" x2="10" y1="23.5" y2="6.5" stroke="currentColor"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><rect vector-effect="non-scaling-stroke" width="17" height="17" x="6.5" y="6.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" rx="2"/></svg>
@@ -80,6 +80,7 @@
80
80
  margin-bottom: $alert-margin-bottom;
81
81
  border-radius: 3px;
82
82
  font-size: 13px;
83
+ text-align: left;
83
84
 
84
85
  &-inset{
85
86
  margin: 0;
@@ -96,31 +97,55 @@
96
97
  > *:last-child{
97
98
  margin-bottom: 0;
98
99
  }
100
+
101
+ a{
102
+ text-decoration: underline;
103
+ }
99
104
  }
100
105
 
101
106
  &-info{
102
- background-color: #F5F7FA;
103
- 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
+ }
104
113
  }
105
114
 
106
115
  &-error{
107
116
  background-color: $red-3;
108
- color: $red-12;
117
+ color: rgba($red-14, .8);
118
+
119
+ a{
120
+ color: rgba($red-14, .8);
121
+ }
109
122
  }
110
123
 
111
124
  &-success{
112
125
  background-color: $green-3;
113
- color: $green-13;
126
+ color: rgba($green-14, .8);
127
+
128
+ a{
129
+ color: rgba($green-14, .8);
130
+ }
114
131
  }
115
132
 
116
133
  &-warning{
117
134
  background-color: $yellow-2;
118
- color: $yellow-13;
135
+ color: rgba($yellow-14, .9);
136
+
137
+ a{
138
+ color: rgba($yellow-14, .9);
139
+ }
119
140
  }
120
141
 
121
142
  &-important{
122
143
  background-color: $blue-3;
123
- color: $blue-14;
144
+ color: rgba($blue-15, .8);
145
+
146
+ a{
147
+ color: rgba($blue-15, .8);
148
+ }
124
149
  }
125
150
 
126
151
  .action{
@@ -170,7 +195,7 @@
170
195
  font-weight: 500;
171
196
  display: flex;
172
197
  align-items: center;
173
- filter: brightness(75%);
198
+ filter: brightness(90%);
174
199
  margin-bottom: 8px;
175
200
 
176
201
  .icon{
@@ -114,6 +114,10 @@
114
114
  font-family: $mono;
115
115
  font-size: 13px;
116
116
  }
117
+
118
+ .ecs-alert{
119
+ margin: 0 -10px;
120
+ }
117
121
  }
118
122
 
119
123
  &-user{
@@ -183,4 +187,4 @@
183
187
  }
184
188
  }
185
189
  }
186
- </style>
190
+ </style>
@@ -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
22
  <div class="ecs-overlay-content-inner" :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" 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,12 +191,21 @@
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{
@@ -164,6 +221,24 @@
164
221
  flex-shrink: 0;
165
222
  }
166
223
 
224
+ &-sidebar-static{
225
+ padding: 0 15px 0 30px;
226
+ width: 20%;
227
+ min-width: 360px;
228
+ }
229
+
230
+ &-sidebar-float{
231
+ padding: 0 15px 0 20px;
232
+ width: 30vw;
233
+ min-width: 380px;
234
+ position: absolute;
235
+ right: 0;
236
+ top: 0;
237
+ bottom: 0;
238
+ background: #FFF;
239
+ box-shadow: 0 0 20px rgba(0,0,0,.12);
240
+ }
241
+
167
242
  &-footer{
168
243
  flex-shrink: 0;
169
244
  background: #FFF;
@@ -175,11 +250,16 @@
175
250
  padding: 30px;
176
251
  }
177
252
 
178
- .spacer{
253
+ .spacer-tabs{
179
254
  width: 260px;
180
255
  flex-shrink: 0;
181
256
  }
182
257
 
258
+ .spacer-sidebar{
259
+ width: 20%;
260
+ min-width: 320px;
261
+ }
262
+
183
263
  &-content{
184
264
  margin: 0 auto;
185
265
  display: flex;
@@ -231,5 +311,20 @@
231
311
  .fade-leave-to{
232
312
  opacity: 0;
233
313
  }
314
+
315
+ .slide-enter-active,
316
+ .slide-leave-active{
317
+ transition: all .3s;
318
+ }
319
+
320
+ .slide-enter{
321
+ opacity: 0;
322
+ transform: translateX(100%);
323
+ }
324
+
325
+ .slide-leave-to{
326
+ opacity: 0;
327
+ transform: translateX(100%);
328
+ }
234
329
  </style>
235
330
 
@@ -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} />