lutra 0.1.46 → 0.1.48

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.
@@ -60,14 +60,20 @@
60
60
  <style>
61
61
  .Dialog {
62
62
  margin: auto;
63
- inset: 1rem;
64
63
  padding: 0;
65
64
  border: var(--modal-border-size) var(--modal-border-style) var(--modal-border-color);
65
+ width: var(--modal-width, fit-content);
66
66
  border-radius: var(--modal-border-radius, var(--surface-border-radius));
67
67
  background: var(--modal-background, var(--surface-background));
68
68
  color: var(--text-color-p);
69
- max-width: min(calc(100vw - 2rem), 32rem);
70
- max-height: min(calc(100vh - 2rem), 80vh);
69
+ max-width: min(
70
+ var(--modal-max-width, 40rem),
71
+ calc(100vw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
72
+ );
73
+ max-height: min(
74
+ var(--modal-max-height, 80vh),
75
+ calc(100vh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))
76
+ );
71
77
  box-shadow: var(--modal-shadow, var(--surface-shadow));
72
78
  }
73
79
 
@@ -177,7 +177,9 @@
177
177
  onclose={handleDialogClose}
178
178
  oncancel={handleDialogCancel}
179
179
  onclick={handleBackdropClick}
180
- style="--modal-width: {width}; --modal-max-width: {maxWidth}; --modal-max-height: {maxHeight};"
180
+ style:--modal-width={width}
181
+ style:--modal-max-width={maxWidth}
182
+ style:--modal-max-height={maxHeight}
181
183
  >
182
184
  <div class="ModalContent">
183
185
  {#if title}
@@ -213,15 +215,20 @@
213
215
 
214
216
  dialog.Modal {
215
217
  margin: auto;
216
- inset: 1rem;
217
218
  border: none;
218
219
  padding: 0;
219
220
  background: var(--modal-background, var(--surface-background));
220
221
  border-radius: var(--modal-border-radius, var(--surface-border-radius));
221
222
  box-shadow: var(--modal-shadow, var(--surface-shadow));
222
223
  width: var(--modal-width, fit-content);
223
- max-width: min(var(--modal-max-width, 40rem), calc(100vw - 2rem));
224
- max-height: min(var(--modal-max-height, 80vh), calc(100vh - 2rem));
224
+ max-width: min(
225
+ var(--modal-max-width, 40rem),
226
+ calc(100vw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
227
+ );
228
+ max-height: min(
229
+ var(--modal-max-height, 80vh),
230
+ calc(100vh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))
231
+ );
225
232
  overflow: hidden;
226
233
  gap: var(--modal-gap);
227
234
  }
@@ -112,8 +112,14 @@
112
112
  grid-template-rows: 1fr auto;
113
113
  gap: var(--modal-gap);
114
114
  width: var(--modal-width, fit-content);
115
- max-width: min(var(--modal-max-width, 40rem), calc(100svw - 2rem));
116
- max-height: min(var(--modal-max-height, 80svh), calc(100svh - 2rem));
115
+ max-width: min(
116
+ var(--modal-max-width, 40rem),
117
+ calc(100svw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
118
+ );
119
+ max-height: min(
120
+ var(--modal-max-height, 80svh),
121
+ calc(100svh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))
122
+ );
117
123
  background: var(--modal-background, var(--surface-background));
118
124
  border: var(--modal-border-size) var(--modal-border-style) var(--modal-border-color);
119
125
  border-radius: var(--modal-border-radius, var(--surface-border-radius));
@@ -66,7 +66,6 @@
66
66
  const anchorName = `--anchor-${id}`;
67
67
 
68
68
  let popoverEl: HTMLDivElement | null = $state(null);
69
- let triggerWrapperEl: HTMLElement | null = $state(null);
70
69
 
71
70
  // Handle external anchor (not using trigger snippet)
72
71
  $effect(() => {
@@ -197,21 +196,14 @@
197
196
 
198
197
  <style>
199
198
  .Popover {
200
- /* Anchor positioning requires position: fixed or absolute */
201
199
  position: fixed;
202
-
203
- /* Reset UA popover centering styles */
204
200
  inset: auto;
205
201
  margin: 0;
206
202
  padding: 0;
207
-
208
- /* Default surface styling */
209
- background: var(--popover-background, var(--surface-background, var(--background-body)));
210
- border: var(--popover-border, var(--surface-border, var(--border-size-thin) var(--border-style) var(--border-color)));
211
- border-radius: var(--popover-border-radius, var(--surface-border-radius, var(--border-radius-base)));
212
- box-shadow: var(--popover-shadow, var(--surface-shadow, 0 0.5rem 1rem var(--shadow-color)));
213
-
214
- /* Sizing */
203
+ background: var(--popover-background, var(--surface-background));
204
+ border: var(--popover-border, var(--surface-border));
205
+ border-radius: var(--popover-border-radius, var(--surface-border-radius));
206
+ box-shadow: var(--popover-shadow, var(--surface-shadow));
215
207
  width: var(--popover-width, max-content);
216
208
  max-width: var(--popover-max-width, calc(100vw - 2rem));
217
209
  max-height: var(--popover-max-height, calc(100vh - 2rem));
@@ -225,7 +217,6 @@
225
217
  box-shadow: none;
226
218
  }
227
219
 
228
- /* Animation */
229
220
  .Popover:popover-open {
230
221
  animation: popover-show 0.15s ease-out;
231
222
  }
@@ -81,26 +81,26 @@
81
81
  }
82
82
 
83
83
  .top-left {
84
- inset: var(--toast-offset, 1rem) auto auto var(--toast-offset, 1rem);
84
+ inset: calc(var(--toast-offset, 1rem) + env(safe-area-inset-top, 0px)) auto auto calc(var(--toast-offset, 1rem) + env(safe-area-inset-left, 0px));
85
85
  }
86
86
  .top-center {
87
- inset: var(--toast-offset, 1rem) auto auto 50%;
87
+ inset: calc(var(--toast-offset, 1rem) + env(safe-area-inset-top, 0px)) auto auto 50%;
88
88
  translate: -50% 0;
89
89
  }
90
90
  .top-right {
91
- inset: var(--toast-offset, 1rem) var(--toast-offset, 1rem) auto auto;
91
+ inset: calc(var(--toast-offset, 1rem) + env(safe-area-inset-top, 0px)) calc(var(--toast-offset, 1rem) + env(safe-area-inset-right, 0px)) auto auto;
92
92
  }
93
93
  .bottom-left {
94
- inset: auto auto var(--toast-offset, 1rem) var(--toast-offset, 1rem);
94
+ inset: auto auto calc(var(--toast-offset, 1rem) + env(safe-area-inset-bottom, 0px)) calc(var(--toast-offset, 1rem) + env(safe-area-inset-left, 0px));
95
95
  flex-direction: column-reverse;
96
96
  }
97
97
  .bottom-center {
98
- inset: auto auto var(--toast-offset, 1rem) 50%;
98
+ inset: auto auto calc(var(--toast-offset, 1rem) + env(safe-area-inset-bottom, 0px)) 50%;
99
99
  translate: -50% 0;
100
100
  flex-direction: column-reverse;
101
101
  }
102
102
  .bottom-right {
103
- inset: auto var(--toast-offset, 1rem) var(--toast-offset, 1rem) auto;
103
+ inset: auto calc(var(--toast-offset, 1rem) + env(safe-area-inset-right, 0px)) calc(var(--toast-offset, 1rem) + env(safe-area-inset-bottom, 0px)) auto;
104
104
  flex-direction: column-reverse;
105
105
  }
106
106
 
@@ -54,18 +54,15 @@
54
54
  }
55
55
 
56
56
  .TooltipContent {
57
- /* Anchor positioning */
58
57
  position: fixed;
59
58
  position-area: block-start center;
60
59
  position-try-fallbacks: flip-block;
61
60
  margin-block-end: 0.5rem;
62
-
63
- /* Styling */
64
61
  background: var(--tooltip-background, var(--surface-background));
65
- padding: 0.35rem 0.5rem;
66
- border-radius: var(--tooltip-border-radius, var(--surface-border-radius));
67
62
  border: var(--tooltip-border, var(--surface-border));
68
- box-shadow: var(--tooltip-shadow, 0 0.25rem 0.5rem var(--shadow-color));
63
+ border-radius: var(--tooltip-border-radius, var(--surface-border-radius));
64
+ box-shadow: var(--tooltip-shadow, var(--surface-shadow));
65
+ padding: 0.35rem 0.5rem;
69
66
  font-size: max(0.75rem, 11px);
70
67
  line-height: 1.35;
71
68
  font-weight: 500;
@@ -73,8 +70,6 @@
73
70
  max-width: 25ch;
74
71
  width: max-content;
75
72
  text-align: center;
76
-
77
- /* Hidden by default */
78
73
  opacity: 0;
79
74
  pointer-events: none;
80
75
  transition: opacity 0.15s ease-out;
@@ -94,19 +89,16 @@
94
89
  align-items: center;
95
90
  }
96
91
 
97
- /* Show on hover with delay */
98
92
  .Tooltip:has(.TooltipTrigger:hover):not(.open) .TooltipContent {
99
93
  opacity: 1;
100
94
  transition-delay: var(--delay, 0.5s);
101
95
  }
102
96
 
103
- /* Show on focus immediately */
104
97
  .Tooltip:has(.TooltipTrigger:focus-within) .TooltipContent {
105
98
  opacity: 1;
106
99
  transition-delay: 0s;
107
100
  }
108
101
 
109
- /* Force open */
110
102
  .Tooltip.open .TooltipContent {
111
103
  opacity: 1;
112
104
  }
@@ -482,9 +482,9 @@
482
482
 
483
483
  @property --modal-padding-inline { syntax: "<length>"; inherits: true; initial-value: 24px; }
484
484
  @property --modal-padding-block { syntax: "<length>"; inherits: true; initial-value: 24px; }
485
- @property --modal-width { syntax: "<length>"; inherits: true; initial-value: fit-content; }
486
- @property --modal-max-width { syntax: "<length>"; inherits: true; initial-value: 40rem; }
487
- @property --modal-max-height { syntax: "<length>"; inherits: true; initial-value: 80svh; }
485
+ @property --modal-width { syntax: "*"; inherits: true; initial-value: fit-content; }
486
+ @property --modal-max-width { syntax: "*"; inherits: true; initial-value: 40rem; }
487
+ @property --modal-max-height { syntax: "*"; inherits: true; initial-value: 80svh; }
488
488
  @property --modal-gap { syntax: "<length>"; inherits: true; initial-value: 0px; }
489
489
 
490
490
  @property --modal-actions-background { syntax: "<color>"; inherits: true; initial-value: #f8fafc; }
@@ -111,7 +111,7 @@
111
111
  --tooltip-color: var(--text-color-p);
112
112
  --tooltip-border: var(--surface-border);
113
113
  --tooltip-border-radius: var(--surface-border-radius);
114
- --tooltip-shadow: 0 0.25rem 0.5rem var(--shadow-color);
114
+ --tooltip-shadow: var(--surface-shadow);
115
115
 
116
116
  /* Table compound variables */
117
117
  --table-border: var(--table-border-size) var(--table-border-style) var(--table-border-color);
@@ -364,7 +364,6 @@ input:disabled, textarea:disabled, select:disabled {
364
364
  */
365
365
  dialog.ProgrammaticModal {
366
366
  margin: auto;
367
- inset: 1rem;
368
367
  border: none;
369
368
  padding: 0;
370
369
  background: transparent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lutra",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "bump-and-publish:patch": "pnpm version:patch && pnpm build && npm publish",