@sveltia/ui 0.37.3 → 0.38.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.
@@ -66,7 +66,7 @@
66
66
  }}
67
67
  onToggle={(event) => {
68
68
  hidden = event.detail.hidden;
69
- selected = false;
69
+ if (hidden) selected = false;
70
70
  onToggle?.(event);
71
71
  }}
72
72
  >
@@ -15,6 +15,7 @@
15
15
  * @typedef {object} Props
16
16
  * @property {string} [value] Input value.
17
17
  * @property {boolean} [flex] Make the text input container flexible.
18
+ * @property {'ltr' | 'rtl' | 'auto'} [dir] The `dir` attribute on the `<textarea>` element.
18
19
  * @property {string} [name] The `name` attribute on the `<textarea>` element.
19
20
  * @property {boolean} [autoResize] Whether to automatically resize the `<textarea>` based on the
20
21
  * content.
@@ -38,6 +39,7 @@
38
39
  /* eslint-disable prefer-const */
39
40
  value = $bindable(''),
40
41
  flex = false,
42
+ dir = undefined,
41
43
  name = undefined,
42
44
  autoResize = false,
43
45
  class: className,
@@ -62,9 +64,9 @@
62
64
  >
63
65
  <textarea
64
66
  {...restProps}
67
+ {dir}
65
68
  {name}
66
69
  bind:value
67
- dir="auto"
68
70
  disabled={disabled || undefined}
69
71
  readonly={readonly || undefined}
70
72
  aria-hidden={hidden}
@@ -75,7 +77,7 @@
75
77
  class:auto-resize={autoResize}
76
78
  ></textarea>
77
79
  {#if autoResize}
78
- <div class="clone" aria-hidden="true">{value}</div>
80
+ <div class="clone" aria-hidden="true" {dir}>{value}</div>
79
81
  {/if}
80
82
  </div>
81
83
 
@@ -18,6 +18,10 @@ declare const TextArea: import("svelte").Component<import("../../typedefs").Keyb
18
18
  * Make the text input container flexible.
19
19
  */
20
20
  flex?: boolean | undefined;
21
+ /**
22
+ * The `dir` attribute on the `<textarea>` element.
23
+ */
24
+ dir?: "ltr" | "rtl" | "auto" | undefined;
21
25
  /**
22
26
  * The `name` attribute on the `<textarea>` element.
23
27
  */
@@ -69,6 +73,10 @@ type Props = {
69
73
  * Make the text input container flexible.
70
74
  */
71
75
  flex?: boolean | undefined;
76
+ /**
77
+ * The `dir` attribute on the `<textarea>` element.
78
+ */
79
+ dir?: "ltr" | "rtl" | "auto" | undefined;
72
80
  /**
73
81
  * The `name` attribute on the `<textarea>` element.
74
82
  */
@@ -26,6 +26,7 @@
26
26
  element = $bindable(),
27
27
  role = 'textbox',
28
28
  keyShortcuts = undefined,
29
+ dir = undefined,
29
30
  name = undefined,
30
31
  showInlineLabel = false,
31
32
  inputmode = 'text',
@@ -102,8 +103,8 @@
102
103
  {value}
103
104
  type="text"
104
105
  {role}
105
- dir="auto"
106
- name={name || undefined}
106
+ {dir}
107
+ {name}
107
108
  tabindex={disabled ? -1 : 0}
108
109
  disabled={disabled || undefined}
109
110
  readonly={readonly || undefined}
@@ -207,14 +207,14 @@
207
207
  --sui-font-size-default: 14px;
208
208
  --sui-font-size-small: 12px;
209
209
  --sui-font-size-x-small: 10px;
210
- --sui-font-weight-normal: 325;
211
- --sui-font-weight-bold: 625;
210
+ --sui-font-weight-normal: 300;
211
+ --sui-font-weight-bold: 600;
212
212
  --sui-font-family-monospace: "Noto Sans Mono", monospace;
213
213
  --sui-font-size-monospace: 0.95em;
214
214
  --sui-line-height-default: 1.25;
215
215
  --sui-line-height-compact: 1.5;
216
216
  --sui-line-height-comfortable: 1.75;
217
- --sui-word-spacing-normal: 0.1ex;
217
+ --sui-word-spacing-normal: 1px;
218
218
  --sui-heading-margin: 0;
219
219
  --sui-heading-font-family: var(--sui-font-family-default);
220
220
  --sui-heading-font-weight: var(--sui-font-weight-bold);
@@ -159,14 +159,14 @@
159
159
  --sui-font-size-default: 14px;
160
160
  --sui-font-size-small: 12px;
161
161
  --sui-font-size-x-small: 10px;
162
- --sui-font-weight-normal: 325; // Merriweather Sans is a little bit bold, so we need to adjust the weight
163
- --sui-font-weight-bold: 625; // ditto
162
+ --sui-font-weight-normal: 300; // Merriweather Sans is a little bit bold, so we need to adjust the weight
163
+ --sui-font-weight-bold: 600; // ditto
164
164
  --sui-font-family-monospace: "Noto Sans Mono", monospace;
165
165
  --sui-font-size-monospace: 0.95em;
166
166
  --sui-line-height-default: 1.25;
167
167
  --sui-line-height-compact: 1.5;
168
168
  --sui-line-height-comfortable: 1.75;
169
- --sui-word-spacing-normal: 0.1ex;
169
+ --sui-word-spacing-normal: 1px;
170
170
  --sui-heading-margin: 0;
171
171
  --sui-heading-font-family: var(--sui-font-family-default);
172
172
  --sui-heading-font-weight: var(--sui-font-weight-bold);
@@ -426,6 +426,10 @@ export type TextInputProps = {
426
426
  * depending on the user’s operating system.
427
427
  */
428
428
  keyShortcuts?: string | undefined;
429
+ /**
430
+ * The `dir` attribute on the `<input>` element.
431
+ */
432
+ dir?: "ltr" | "rtl" | "auto" | undefined;
429
433
  /**
430
434
  * The `name` attribute on the `<input>` element.
431
435
  */
package/dist/typedefs.js CHANGED
@@ -152,6 +152,7 @@
152
152
  * @property {string} [keyShortcuts] Keyboard shortcuts. An alias of the `aria-keyshortcuts`
153
153
  * attribute. Accepts the special `Accel` key, which will be replaced with `Control` or `Meta`
154
154
  * depending on the user’s operating system.
155
+ * @property {'ltr' | 'rtl' | 'auto'} [dir] The `dir` attribute on the `<input>` element.
155
156
  * @property {string} [name] The `name` attribute on the `<input>` element.
156
157
  * @property {boolean} [showInlineLabel] Whether to display `aria-label` over the `<input>` element
157
158
  * if it’s empty, just like how the HTML `placeholder` attribute works.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.37.3",
3
+ "version": "0.38.0",
4
4
  "description": "A collection of Svelte components and utilities for building user interfaces.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,13 +49,13 @@
49
49
  "@sveltia/utils": "^0.10.6",
50
50
  "lexical": "^0.44.0",
51
51
  "prismjs": "^1.30.0",
52
- "yaml": "^2.8.3"
52
+ "yaml": "^2.8.4"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@sveltejs/adapter-auto": "^7.0.1",
56
- "@sveltejs/kit": "^2.58.0",
56
+ "@sveltejs/kit": "^2.59.1",
57
57
  "@sveltejs/package": "^2.5.7",
58
- "@sveltejs/vite-plugin-svelte": "^7.0.0",
58
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
59
59
  "@vitest/coverage-v8": "^4.1.5",
60
60
  "cspell": "^10.0.0",
61
61
  "eslint": "^9.39.4",
@@ -65,22 +65,22 @@
65
65
  "eslint-plugin-jsdoc": "^62.9.0",
66
66
  "eslint-plugin-package-json": "^0.91.2",
67
67
  "eslint-plugin-svelte": "^3.17.1",
68
- "globals": "^17.5.0",
68
+ "globals": "^17.6.0",
69
69
  "happy-dom": "^20.9.0",
70
- "oxlint": "^1.62.0",
71
- "postcss": "^8.5.12",
70
+ "oxlint": "^1.63.0",
71
+ "postcss": "^8.5.14",
72
72
  "postcss-html": "^1.8.1",
73
73
  "prettier": "^3.8.3",
74
74
  "prettier-plugin-svelte": "^3.5.1",
75
75
  "sass": "^1.99.0",
76
- "stylelint": "^17.9.1",
76
+ "stylelint": "^17.11.0",
77
77
  "stylelint-config-recommended-scss": "^17.0.1",
78
78
  "stylelint-scss": "^7.0.0",
79
79
  "svelte": "^5.55.5",
80
- "svelte-check": "^4.4.6",
80
+ "svelte-check": "^4.4.8",
81
81
  "svelte-preprocess": "^6.0.3",
82
82
  "tslib": "^2.8.1",
83
- "vite": "^8.0.10",
83
+ "vite": "^8.0.11",
84
84
  "vitest": "^4.1.5"
85
85
  },
86
86
  "peerDependencies": {