@axium/client 0.9.4 → 0.9.6

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/assets/styles.css CHANGED
@@ -189,3 +189,66 @@ h6 {
189
189
  content: 'v';
190
190
  color: #888;
191
191
  }
192
+
193
+ .inline-button {
194
+ display: inline-flex;
195
+ width: fit-content;
196
+ }
197
+
198
+ .inline-button-container {
199
+ margin-top: 2em;
200
+ display: flex;
201
+ gap: 1em;
202
+ }
203
+
204
+ @media (width >= 700px) {
205
+ .mobile-only {
206
+ display: none;
207
+ }
208
+ }
209
+
210
+ @media (width < 700px) {
211
+ .mobile-hide {
212
+ display: none !important;
213
+ }
214
+
215
+ .mobile-button {
216
+ border-radius: 0.5em;
217
+ border: 1px solid var(--border-accent);
218
+ background-color: var(--bg-normal);
219
+ padding: 0.5em 1em;
220
+ cursor: pointer;
221
+ }
222
+
223
+ .mobile-button:hover {
224
+ background-color: hsl(var(--hue) 15 calc(var(--bg-light) + (var(--light-step) * 2)));
225
+ }
226
+
227
+ .mobile-float-left {
228
+ position: fixed;
229
+ bottom: 1em;
230
+ left: 1em;
231
+ z-index: 4;
232
+ font-size: 1.25em;
233
+ }
234
+
235
+ .mobile-float-right {
236
+ position: fixed;
237
+ bottom: 1em;
238
+ right: 1em;
239
+ z-index: 4;
240
+ font-size: 1.25em;
241
+ }
242
+
243
+ .inline-button {
244
+ width: 80%;
245
+ align-self: center;
246
+ display: flex;
247
+ justify-content: center;
248
+ }
249
+
250
+ .inline-button-container {
251
+ flex-direction: column;
252
+ align-items: center;
253
+ }
254
+ }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import Icon from './Icon.svelte';
3
- const { children, toggle }: { children(): any; toggle?(): any } = $props();
3
+ const { children, toggle, showToggle }: { children(): any; toggle?(): any; showToggle?: 'hover' | 'always' } = $props();
4
4
 
5
5
  let popover = $state<HTMLDivElement>();
6
6
 
@@ -17,7 +17,7 @@
17
17
  {#if toggle}
18
18
  {@render toggle()}
19
19
  {:else}
20
- <span class="popover-toggle">
20
+ <span class={['popover-toggle', showToggle == 'hover' && 'toggle-hover']}>
21
21
  <Icon i="ellipsis" />
22
22
  </span>
23
23
  {/if}
@@ -32,9 +32,21 @@
32
32
  cursor: pointer;
33
33
  }
34
34
 
35
+ @media (width > 700px) {
36
+ .toggle-hover {
37
+ visibility: hidden;
38
+ }
39
+
40
+ :global(:hover) > div > .toggle-hover {
41
+ visibility: visible;
42
+ }
43
+ }
44
+
35
45
  .popover-toggle + [popover] {
36
- position-area: bottom right;
37
- position-try: most-width flip-inline;
46
+ position-try: flip-inline;
47
+ position-visibility: always;
48
+ left: anchor(left);
49
+ top: anchor(bottom);
38
50
  }
39
51
 
40
52
  [popover] :global(.menu-item) {
@@ -23,10 +23,11 @@
23
23
  <span class="elevated">Elevated</span>
24
24
  {/if}
25
25
  </p>
26
- <p>Created {session.created.toLocaleString()}</p>
27
- <p>Expires {session.expires.toLocaleString()}</p>
28
- <button style:display="contents" command="show-modal" commandfor={'logout-session:' + session.id}>
26
+ <p class="timestamp">Created {session.created.toLocaleString()}</p>
27
+ <p class="timestamp">Expires {session.expires.toLocaleString()}</p>
28
+ <button command="show-modal" commandfor={'logout-session:' + session.id} class="logout icon-text">
29
29
  <Icon i="right-from-bracket" --size="16px" />
30
+ <span class="mobile-only">Logout</span>
30
31
  </button>
31
32
  </div>
32
33
  <FormDialog
@@ -41,9 +42,7 @@
41
42
  <p>Are you sure you want to log out this session?</p>
42
43
  </FormDialog>
43
44
  {/each}
44
- <span>
45
- <button command="show-modal" commandfor="logout-all" class="danger">Logout All</button>
46
- </span>
45
+ <button command="show-modal" commandfor="logout-all" class="danger inline-button">Logout All</button>
47
46
  <FormDialog
48
47
  id="logout-all"
49
48
  submit={() => logoutAll(user.id).then(() => (redirectAfterLogoutAll ? (window.location.href = '/') : null))}
@@ -52,3 +51,10 @@
52
51
  >
53
52
  <p>Are you sure you want to log out all sessions?</p>
54
53
  </FormDialog>
54
+
55
+ <style>
56
+ button.logout {
57
+ width: fit-content;
58
+ text-align: center;
59
+ }
60
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -1,12 +1,16 @@
1
1
  .section {
2
2
  width: 50%;
3
- padding-top: 4em;
3
+ padding-top: 2em;
4
4
 
5
5
  /* This is causing duplicate separators when removing sessions/passkeys
6
- > div:has(+ div) {
7
- border-bottom: 1px solid #8888;
8
- }
9
- */
6
+ > div:has(+ div) {
7
+ border-bottom: 1px solid #8888;
8
+ }
9
+ */
10
+ }
11
+
12
+ .section:last-child {
13
+ margin-bottom: 2em;
10
14
  }
11
15
 
12
16
  .section .item {
@@ -54,4 +58,40 @@
54
58
  padding: 0 0.5em;
55
59
  background-color: #733;
56
60
  }
61
+
62
+ .logout {
63
+ display: contents;
64
+ }
65
+ }
66
+
67
+ @media (width < 700px) {
68
+ .inline-button-container {
69
+ margin-top: 0;
70
+ }
71
+
72
+ .section {
73
+ width: calc(100% - 2em);
74
+ }
75
+
76
+ .session.item {
77
+ grid-template-columns: 1fr 2fr;
78
+ gap: 1em 2em;
79
+ padding-top: 1em;
80
+
81
+ p {
82
+ margin: 0;
83
+ }
84
+
85
+ .timestamp {
86
+ grid-column: 2;
87
+ text-align: right;
88
+ }
89
+
90
+ .logout {
91
+ margin-top: 0;
92
+ display: flex;
93
+ grid-row: 2;
94
+ grid-column: 1;
95
+ }
96
+ }
57
97
  }
package/styles/list.css CHANGED
@@ -27,7 +27,6 @@
27
27
 
28
28
  .list-item {
29
29
  display: grid;
30
- grid-template-columns: 1em 4fr 15em 5em repeat(3, 1em);
31
30
  align-items: center;
32
31
  gap: 1em;
33
32
  padding: 0.5em;
@@ -59,3 +58,9 @@ p.list-empty {
59
58
  visibility: visible;
60
59
  cursor: pointer;
61
60
  }
61
+
62
+ @media (width < 700px) {
63
+ .list-header {
64
+ display: none;
65
+ }
66
+ }