@sveltia/ui 0.26.11 → 0.27.0

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.
@@ -31,8 +31,10 @@
31
31
  showOk = true,
32
32
  showCancel = true,
33
33
  okLabel = '',
34
+ okShortcuts = undefined,
34
35
  okDisabled = false,
35
36
  cancelLabel = '',
37
+ cancelShortcuts = undefined,
36
38
  cancelDisabled = false,
37
39
  focusInput = true,
38
40
  children,
@@ -138,6 +140,7 @@
138
140
  <Button
139
141
  variant="primary"
140
142
  label={okLabel || $_('_sui.ok')}
143
+ keyShortcuts={okShortcuts}
141
144
  disabled={okDisabled}
142
145
  onclick={() => {
143
146
  modal?.close('ok');
@@ -148,6 +151,7 @@
148
151
  <Button
149
152
  variant="secondary"
150
153
  label={cancelLabel || $_('_sui.cancel')}
154
+ keyShortcuts={cancelShortcuts}
151
155
  disabled={cancelDisabled}
152
156
  onclick={() => {
153
157
  modal?.close('cancel');
@@ -226,6 +226,12 @@ export type DialogProps = {
226
226
  * Text label displayed on the OK button.
227
227
  */
228
228
  okLabel?: string | undefined;
229
+ /**
230
+ * Keyboard shortcuts for the OK button. An alias of the
231
+ * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
232
+ * `Control` or `Meta` depending on the user’s operating system.
233
+ */
234
+ okShortcuts?: string | undefined;
229
235
  /**
230
236
  * Whether to disable the OK button.
231
237
  */
@@ -234,6 +240,12 @@ export type DialogProps = {
234
240
  * Text label displayed on the Cancel button.
235
241
  */
236
242
  cancelLabel?: string | undefined;
243
+ /**
244
+ * Keyboard shortcuts for the Cancel button. An alias of the
245
+ * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
246
+ * `Control` or `Meta` depending on the user’s operating system.
247
+ */
248
+ cancelShortcuts?: string | undefined;
237
249
  /**
238
250
  * Whether to disable the Cancel button.
239
251
  */
package/dist/typedefs.js CHANGED
@@ -78,8 +78,14 @@
78
78
  * @property {boolean} [showOk] Whether to show the OK button on the footer.
79
79
  * @property {boolean} [showCancel] Whether to show the Cancel button on the footer.
80
80
  * @property {string} [okLabel] Text label displayed on the OK button.
81
+ * @property {string} [okShortcuts] Keyboard shortcuts for the OK button. An alias of the
82
+ * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
83
+ * `Control` or `Meta` depending on the user’s operating system.
81
84
  * @property {boolean} [okDisabled] Whether to disable the OK button.
82
85
  * @property {string} [cancelLabel] Text label displayed on the Cancel button.
86
+ * @property {string} [cancelShortcuts] Keyboard shortcuts for the Cancel button. An alias of the
87
+ * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
88
+ * `Control` or `Meta` depending on the user’s operating system.
83
89
  * @property {boolean} [cancelDisabled] Whether to disable the Cancel button.
84
90
  * @property {boolean} [focusInput] Whether to automatically focus the first input field or primary
85
91
  * action button. Default: `true`. If `false`, the `<dialog>` gets focused.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.26.11",
3
+ "version": "0.27.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -56,9 +56,9 @@
56
56
  "eslint-config-airbnb-base": "^15.0.0",
57
57
  "eslint-config-prettier": "^10.1.5",
58
58
  "eslint-plugin-import": "^2.31.0",
59
- "eslint-plugin-jsdoc": "^51.0.1",
59
+ "eslint-plugin-jsdoc": "^51.0.3",
60
60
  "eslint-plugin-svelte": "^2.46.1",
61
- "postcss": "^8.5.5",
61
+ "postcss": "^8.5.6",
62
62
  "postcss-html": "^1.8.0",
63
63
  "prettier": "^3.5.3",
64
64
  "prettier-plugin-svelte": "^3.4.0",
@@ -66,13 +66,13 @@
66
66
  "stylelint": "^16.20.0",
67
67
  "stylelint-config-recommended-scss": "^15.0.1",
68
68
  "stylelint-scss": "^6.12.1",
69
- "svelte": "5.34.3",
69
+ "svelte": "5.34.5",
70
70
  "svelte-check": "^4.2.1",
71
71
  "svelte-i18n": "^4.0.1",
72
72
  "svelte-preprocess": "^6.0.3",
73
73
  "tslib": "^2.8.1",
74
74
  "vite": "^6.3.5",
75
- "vitest": "^3.2.3"
75
+ "vitest": "^3.2.4"
76
76
  },
77
77
  "exports": {
78
78
  ".": {