@digdir/designsystemet-react 0.0.0-test-20250715115803 → 0.0.0-test-20250715121200

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.
@@ -24,70 +24,11 @@ var suggestionOption = require('./suggestion-option.js');
24
24
  * </Suggestion>
25
25
  */
26
26
  const EXPERIMENTAL_Suggestion = Object.assign(suggestion.Suggestion, {
27
- /**
28
- * @deprecated Suggestion.Chips is deprecated, use `renderSelected` on `Suggestion` instead
29
- */
30
27
  Chips: suggestionChips.SuggestionChips,
31
- /**
32
- * Component that provides a Suggestion list.
33
- *
34
- * Place as a descendant of `Suggestion`
35
- *
36
- * @example
37
- * <Suggestion>
38
- * <Suggestion.Input />
39
- * <Suggestion.List />
40
- * </Suggestion>
41
- */
42
28
  List: suggestionList.SuggestionList,
43
- /**
44
- * Component that provides an input field for the Suggestion list.
45
- *
46
- * Place as a descendant of `Suggestion`
47
- *
48
- * @example
49
- * <Suggestion>
50
- * <Suggestion.Input />
51
- * <Suggestion.List />
52
- * </Suggestion>
53
- */
54
29
  Input: suggestionInput.SuggestionInput,
55
- /**
56
- * Component that provides an empty Suggestion list.
57
- *
58
- * Place as a descendant of `Suggestion.List`
59
- *
60
- * @example
61
- * <Suggestion.List>
62
- * <Suggestion.Empty>Tomt</Suggestion.Empty>
63
- * </Suggestion.List>
64
- */
65
30
  Empty: suggestionEmpty.SuggestionEmpty,
66
- /**
67
- * A component for rendering individual options in the Suggestion list.
68
- *
69
- * @example
70
- * <Suggestion>
71
- * <Suggestion.Input />
72
- * <Suggestion.List>
73
- * <Suggestion.Option value='Option 1'>Option 1</Suggestion.Option>
74
- * <Suggestion.Option value='Option 2'>Option 2</Suggestion.Option>
75
- * </Suggestion.List>
76
- * </Suggestion>
77
- */
78
31
  Option: suggestionOption.SuggestionOption,
79
- /**
80
- * Component that provides a clear button for the Suggestion input.
81
- *
82
- * Place as a descendant of `Suggestion`
83
- *
84
- * @example
85
- * <Suggestion>
86
- * <Suggestion.Input />
87
- * <Suggestion.Clear />
88
- * <Suggestion.List />
89
- * </Suggestion>
90
- */
91
32
  Clear: suggestionClear.SuggestionClear,
92
33
  });
93
34
  EXPERIMENTAL_Suggestion.displayName = 'EXPERIMENTAL_Suggestion';
@@ -22,70 +22,11 @@ import { SuggestionOption } from './suggestion-option.js';
22
22
  * </Suggestion>
23
23
  */
24
24
  const EXPERIMENTAL_Suggestion = Object.assign(Suggestion, {
25
- /**
26
- * @deprecated Suggestion.Chips is deprecated, use `renderSelected` on `Suggestion` instead
27
- */
28
25
  Chips: SuggestionChips,
29
- /**
30
- * Component that provides a Suggestion list.
31
- *
32
- * Place as a descendant of `Suggestion`
33
- *
34
- * @example
35
- * <Suggestion>
36
- * <Suggestion.Input />
37
- * <Suggestion.List />
38
- * </Suggestion>
39
- */
40
26
  List: SuggestionList,
41
- /**
42
- * Component that provides an input field for the Suggestion list.
43
- *
44
- * Place as a descendant of `Suggestion`
45
- *
46
- * @example
47
- * <Suggestion>
48
- * <Suggestion.Input />
49
- * <Suggestion.List />
50
- * </Suggestion>
51
- */
52
27
  Input: SuggestionInput,
53
- /**
54
- * Component that provides an empty Suggestion list.
55
- *
56
- * Place as a descendant of `Suggestion.List`
57
- *
58
- * @example
59
- * <Suggestion.List>
60
- * <Suggestion.Empty>Tomt</Suggestion.Empty>
61
- * </Suggestion.List>
62
- */
63
28
  Empty: SuggestionEmpty,
64
- /**
65
- * A component for rendering individual options in the Suggestion list.
66
- *
67
- * @example
68
- * <Suggestion>
69
- * <Suggestion.Input />
70
- * <Suggestion.List>
71
- * <Suggestion.Option value='Option 1'>Option 1</Suggestion.Option>
72
- * <Suggestion.Option value='Option 2'>Option 2</Suggestion.Option>
73
- * </Suggestion.List>
74
- * </Suggestion>
75
- */
76
29
  Option: SuggestionOption,
77
- /**
78
- * Component that provides a clear button for the Suggestion input.
79
- *
80
- * Place as a descendant of `Suggestion`
81
- *
82
- * @example
83
- * <Suggestion>
84
- * <Suggestion.Input />
85
- * <Suggestion.Clear />
86
- * <Suggestion.List />
87
- * </Suggestion>
88
- */
89
30
  Clear: SuggestionClear,
90
31
  });
91
32
  EXPERIMENTAL_Suggestion.displayName = 'EXPERIMENTAL_Suggestion';
@@ -6,11 +6,70 @@ import { SuggestionInput } from './suggestion-input';
6
6
  import { SuggestionList } from './suggestion-list';
7
7
  import { SuggestionOption } from './suggestion-option';
8
8
  type SuggestionCompound = typeof SuggestionRoot & {
9
+ /**
10
+ * @deprecated Suggestion.Chips is deprecated, use `renderSelected` on `Suggestion` instead
11
+ */
9
12
  Chips: typeof SuggestionChips;
13
+ /**
14
+ * Component that provides a Suggestion list.
15
+ *
16
+ * Place as a descendant of `Suggestion`
17
+ *
18
+ * @example
19
+ * <Suggestion>
20
+ * <Suggestion.Input />
21
+ * <Suggestion.List />
22
+ * </Suggestion>
23
+ */
10
24
  List: typeof SuggestionList;
25
+ /**
26
+ * Component that provides an input field for the Suggestion list.
27
+ *
28
+ * Place as a descendant of `Suggestion`
29
+ *
30
+ * @example
31
+ * <Suggestion>
32
+ * <Suggestion.Input />
33
+ * <Suggestion.List />
34
+ * </Suggestion>
35
+ */
11
36
  Input: typeof SuggestionInput;
37
+ /**
38
+ * Component that provides an empty Suggestion list.
39
+ *
40
+ * Place as a descendant of `Suggestion.List`
41
+ *
42
+ * @example
43
+ * <Suggestion.List>
44
+ * <Suggestion.Empty>Tomt</Suggestion.Empty>
45
+ * </Suggestion.List>
46
+ */
12
47
  Empty: typeof SuggestionEmpty;
48
+ /**
49
+ * A component for rendering individual options in the Suggestion list.
50
+ *
51
+ * @example
52
+ * <Suggestion>
53
+ * <Suggestion.Input />
54
+ * <Suggestion.List>
55
+ * <Suggestion.Option value='Option 1'>Option 1</Suggestion.Option>
56
+ * <Suggestion.Option value='Option 2'>Option 2</Suggestion.Option>
57
+ * </Suggestion.List>
58
+ * </Suggestion>
59
+ */
13
60
  Option: typeof SuggestionOption;
61
+ /**
62
+ * Component that provides a clear button for the Suggestion input.
63
+ *
64
+ * Place as a descendant of `Suggestion`
65
+ *
66
+ * @example
67
+ * <Suggestion>
68
+ * <Suggestion.Input />
69
+ * <Suggestion.Clear />
70
+ * <Suggestion.List />
71
+ * </Suggestion>
72
+ */
14
73
  Clear: typeof SuggestionClear;
15
74
  };
16
75
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,KAAK,kBAAkB,GAAG,OAAO,cAAc,GAAG;IAChD,KAAK,EAAE,OAAO,eAAe,CAAC;IAC9B,IAAI,EAAE,OAAO,cAAc,CAAC;IAC5B,KAAK,EAAE,OAAO,eAAe,CAAC;IAC9B,KAAK,EAAE,OAAO,eAAe,CAAC;IAC9B,MAAM,EAAE,OAAO,gBAAgB,CAAC;IAChC,KAAK,EAAE,OAAO,eAAe,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,uBAAuB,EAAE,kBAkE7B,CAAC;AAUH,OAAO,EACL,uBAAuB,EACvB,eAAe,IAAI,4BAA4B,EAC/C,cAAc,IAAI,2BAA2B,EAC7C,eAAe,IAAI,4BAA4B,EAC/C,eAAe,IAAI,4BAA4B,EAC/C,gBAAgB,IAAI,6BAA6B,EACjD,eAAe,IAAI,4BAA4B,GAChD,CAAC;AACF,YAAY,EACV,eAAe,EACf,kB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CAC/B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,uBAAuB,EAAE,kBAO7B,CAAC;AAUH,OAAO,EACL,uBAAuB,EACvB,eAAe,IAAI,4BAA4B,EAC/C,cAAc,IAAI,2BAA2B,EAC7C,eAAe,IAAI,4BAA4B,EAC/C,eAAe,IAAI,4BAA4B,EAC/C,gBAAgB,IAAI,6BAA6B,EACjD,eAAe,IAAI,4BAA4B,GAChD,CAAC;AACF,YAAY,EACV,eAAe,EACf,kBAAkB,EAAE,8CAA8C;AAClE,kBAAkB,IAAI,gBAAgB,GACvC,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -100,9 +100,9 @@ export type SuggestionProps = {
100
100
  */
101
101
  name?: string;
102
102
  /**
103
- * Allows the user to select multiple items
103
+ * Change how the selected options are rendered inside the `Chip`.
104
104
  *
105
- * @default false
105
+ * @default ({ label }) => label
106
106
  */
107
107
  renderSelected?: (args: {
108
108
  label: string;
@@ -168,9 +168,9 @@ export declare const Suggestion: React.ForwardRefExoticComponent<{
168
168
  */
169
169
  name?: string;
170
170
  /**
171
- * Allows the user to select multiple items
171
+ * Change how the selected options are rendered inside the `Chip`.
172
172
  *
173
- * @default false
173
+ * @default ({ label }) => label
174
174
  */
175
175
  renderSelected?: (args: {
176
176
  label: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet-react",
3
3
  "type": "module",
4
- "version": "0.0.0-test-20250715115803",
4
+ "version": "0.0.0-test-20250715121200",
5
5
  "description": "React components for Designsystemet",
6
6
  "author": "Designsystemet team",
7
7
  "repository": {
@@ -67,7 +67,7 @@
67
67
  "storybook": "^9.0.15",
68
68
  "tsx": "4.20.3",
69
69
  "typescript": "^5.8.3",
70
- "@digdir/designsystemet-css": "^0.0.0-test-20250715115803"
70
+ "@digdir/designsystemet-css": "^0.0.0-test-20250715121200"
71
71
  },
72
72
  "scripts": {
73
73
  "build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",