@sveltia/ui 0.15.0 → 0.15.1

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.
@@ -89,6 +89,16 @@
89
89
  * @type {Modal}
90
90
  */
91
91
  let modal;
92
+ /**
93
+ * @type {HTMLElement | undefined}
94
+ */
95
+ let content;
96
+
97
+ $: {
98
+ if (open && content) {
99
+ /** @type {HTMLElement} */ (content.querySelector('input, button.primary'))?.focus();
100
+ }
101
+ }
92
102
  </script>
93
103
 
94
104
  <Modal
@@ -111,7 +121,7 @@
111
121
  on:close
112
122
  >
113
123
  <slot name="extra-content" slot="extra-content" />
114
- <div role="none" class="content {className} {size}">
124
+ <div role="none" class="content {className} {size}" bind:this={content}>
115
125
  {#if title || showClose || $$slots.header || $$slots['header-extra']}
116
126
  <div role="none" class="header">
117
127
  {#if $$slots.header}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {