@r2digisolutions/components 0.14.8 → 0.14.10

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.
@@ -9,6 +9,8 @@
9
9
  gap?: ClusterGap;
10
10
  align?: ClusterAlign;
11
11
  justify?: ClusterJustify;
12
+ /** When false, items stay on one row (no wrap). Default true. */
13
+ wrap?: boolean;
12
14
  class?: string;
13
15
  children?: Snippet;
14
16
  }
@@ -17,6 +19,7 @@
17
19
  gap = 'sm',
18
20
  align = 'center',
19
21
  justify = 'start',
22
+ wrap = true,
20
23
  class: className = '',
21
24
  children
22
25
  }: ClusterProps = $props();
@@ -44,6 +47,15 @@
44
47
  };
45
48
  </script>
46
49
 
47
- <div class={['flex flex-wrap', gaps[gap], aligns[align], justifies[justify], className]}>
50
+ <div
51
+ class={[
52
+ 'flex',
53
+ wrap ? 'flex-wrap' : 'flex-nowrap',
54
+ gaps[gap],
55
+ aligns[align],
56
+ justifies[justify],
57
+ className
58
+ ]}
59
+ >
48
60
  {#if children}{@render children()}{/if}
49
61
  </div>
@@ -6,6 +6,8 @@ interface ClusterProps {
6
6
  gap?: ClusterGap;
7
7
  align?: ClusterAlign;
8
8
  justify?: ClusterJustify;
9
+ /** When false, items stay on one row (no wrap). Default true. */
10
+ wrap?: boolean;
9
11
  class?: string;
10
12
  children?: Snippet;
11
13
  }
@@ -59,8 +59,12 @@ export declare function getRemoteFormId(action: string | undefined | null): stri
59
59
  /**
60
60
  * Resolve HTML input props for a field inside a Kit remote form.
61
61
  * Prefer a precomputed `formId` string so fields never touch Kit proxies.
62
+ *
63
+ * Kit’s `fields.x.as(type)` uses plain names (`email`, `n:age`). Do **not** append
64
+ * `/formId` — remote ids look like `hash/name` and would produce invalid paths
65
+ * (`email/dp12ax/login_remote`) that break `convert_formdata`.
62
66
  */
63
- export declare function resolveRemoteInputProps(formId: string | null | undefined, logicalName: string | undefined, type?: string): ResolvedRemoteInputProps;
67
+ export declare function resolveRemoteInputProps(_formId: string | null | undefined, logicalName: string | undefined, type?: string): ResolvedRemoteInputProps;
64
68
  export type ParsedRemoteFieldName = {
65
69
  /** Field path for errors / `form.data` (`email`, `items[0].name`) */
66
70
  logicalName: string | undefined;
@@ -76,6 +80,9 @@ export type ParsedRemoteFieldName = {
76
80
  * When `formId` is known, uses Kit’s suffix rule (`/${formId}`).
77
81
  * Otherwise treats the first `/` after an optional `n:`/`b:` prefix as the form-id boundary
78
82
  * (logical paths use `.` / `[n]`, never `/`).
83
+ *
84
+ * Note: current Kit `.as()` emits plain names without `/formId`. Encoding with the
85
+ * full remote id (`hash/name`) must not be reintroduced — it breaks convert_formdata.
79
86
  */
80
87
  export declare function parseRemoteFieldName(name: string | undefined, formId?: string | null): ParsedRemoteFieldName;
81
88
  /**
@@ -20,18 +20,20 @@ export function getRemoteFormId(action) {
20
20
  /**
21
21
  * Resolve HTML input props for a field inside a Kit remote form.
22
22
  * Prefer a precomputed `formId` string so fields never touch Kit proxies.
23
+ *
24
+ * Kit’s `fields.x.as(type)` uses plain names (`email`, `n:age`). Do **not** append
25
+ * `/formId` — remote ids look like `hash/name` and would produce invalid paths
26
+ * (`email/dp12ax/login_remote`) that break `convert_formdata`.
23
27
  */
24
- export function resolveRemoteInputProps(formId, logicalName, type = 'text') {
28
+ export function resolveRemoteInputProps(_formId, logicalName, type = 'text') {
25
29
  if (!logicalName)
26
30
  return {};
27
- if (!formId)
28
- return { name: logicalName };
29
31
  let prefix = '';
30
32
  if (type === 'number' || type === 'range')
31
33
  prefix = 'n:';
32
34
  else if (type === 'checkbox' || type === 'boolean')
33
35
  prefix = 'b:';
34
- return { name: `${prefix}${logicalName}/${formId}` };
36
+ return { name: `${prefix}${logicalName}` };
35
37
  }
36
38
  /**
37
39
  * Split a Kit-encoded HTML `name` (`email/1p9kxmo/login_user`, `n:age/...`)
@@ -40,6 +42,9 @@ export function resolveRemoteInputProps(formId, logicalName, type = 'text') {
40
42
  * When `formId` is known, uses Kit’s suffix rule (`/${formId}`).
41
43
  * Otherwise treats the first `/` after an optional `n:`/`b:` prefix as the form-id boundary
42
44
  * (logical paths use `.` / `[n]`, never `/`).
45
+ *
46
+ * Note: current Kit `.as()` emits plain names without `/formId`. Encoding with the
47
+ * full remote id (`hash/name`) must not be reintroduced — it breaks convert_formdata.
43
48
  */
44
49
  export function parseRemoteFieldName(name, formId) {
45
50
  if (!name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.14.8",
3
+ "version": "0.14.10",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",