@norges-domstoler/dds-components 10.3.2 → 10.4.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.
- package/dist/cjs/components/FormGenerator/FormGenerator.types.d.ts +58 -28
- package/dist/cjs/components/InputMessage/InputMessage.d.ts +1 -1
- package/dist/cjs/components/Table/collapsible/CollapsibleRow.d.ts +1 -1
- package/dist/cjs/components/Table/collapsible/CollapsibleTable.stories.d.ts +1 -1
- package/dist/cjs/hooks/useFloatPosition.d.ts +2 -0
- package/dist/cjs/index.js +162 -90
- package/dist/components/FileUploader/useFileUploader.js +54 -58
- package/dist/components/FormGenerator/FormGenerator.js +77 -32
- package/dist/components/FormGenerator/FormGenerator.types.d.ts +58 -28
- package/dist/components/FormGenerator/FormGenerator.types.js +33 -0
- package/dist/components/InputMessage/InputMessage.d.ts +1 -1
- package/dist/components/Table/collapsible/CollapsibleRow.d.ts +1 -1
- package/dist/components/Table/collapsible/CollapsibleTable.stories.d.ts +1 -1
- package/dist/components/TextInput/TextInput.styles.js +1 -1
- package/dist/hooks/useFloatPosition.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +5 -3
|
@@ -28,164 +28,194 @@ export type FormGeneratorRow = {
|
|
|
28
28
|
breakpoint?: ScreenSize;
|
|
29
29
|
fields: FormGeneratorField[];
|
|
30
30
|
};
|
|
31
|
+
export declare enum FormGeneratorSupportedFields {
|
|
32
|
+
Button = "Button",
|
|
33
|
+
Card = "Card",
|
|
34
|
+
Checkbox = "Checkbox",
|
|
35
|
+
CheckboxGroup = "CheckboxGroup",
|
|
36
|
+
Datepicker = "Datepicker",
|
|
37
|
+
DescriptionList = "DescriptionList",
|
|
38
|
+
DescriptionListGroup = "DescriptionListGroup",
|
|
39
|
+
DescriptionListDesc = "DescriptionListDesc",
|
|
40
|
+
DescriptionListTerm = "DescriptionListTerm",
|
|
41
|
+
Divider = "Divider",
|
|
42
|
+
GlobalMessage = "GlobalMessage",
|
|
43
|
+
Heading = "Heading",
|
|
44
|
+
InputMessage = "InputMessage",
|
|
45
|
+
Label = "Label",
|
|
46
|
+
Link = "Link",
|
|
47
|
+
List = "List",
|
|
48
|
+
ListItem = "ListItem",
|
|
49
|
+
LocalMessage = "LocalMessage",
|
|
50
|
+
Paragraph = "Paragraph",
|
|
51
|
+
RadioButton = "RadioButton",
|
|
52
|
+
RadioButtonGroup = "RadioButtonGroup",
|
|
53
|
+
Select = "Select",
|
|
54
|
+
Spinner = "Spinner",
|
|
55
|
+
TextInput = "TextInput",
|
|
56
|
+
ToggleButton = "ToggleButton",
|
|
57
|
+
ToggleButtonGroup = "ToggleButtonGroup",
|
|
58
|
+
Typography = "Typography",
|
|
59
|
+
VisuallyHidden = "VisuallyHidden"
|
|
60
|
+
}
|
|
31
61
|
export type FormGeneratorField = FieldWithChildren | FieldWithoutChildren;
|
|
32
62
|
type FieldWithChildren = CheckboxGroupField | DescriptionListField | DescriptionListGroupField | ListField | RadioButtonGroupField | ToggleButtonGroupField;
|
|
33
63
|
type FieldWithoutChildren = ButtonField | CardField | CheckboxField | DatepickerField | DescriptionListTermField | DescriptionListDescField | DividerField | GlobalMessageField | HeadingField | InputMessageField | LabelField | LinkField | ListItemField | LocalMessageField | ParagraphField | RadioButtonField | SelectField | SpinnerField | TextInputField | ToggleButtonField | TypographyField | VisuallyHiddenField;
|
|
34
64
|
type ButtonField = {
|
|
35
|
-
component:
|
|
65
|
+
component: FormGeneratorSupportedFields.Button;
|
|
36
66
|
props: ButtonProps;
|
|
37
67
|
hide?: boolean;
|
|
38
68
|
};
|
|
39
69
|
type CardField = {
|
|
40
|
-
component:
|
|
70
|
+
component: FormGeneratorSupportedFields.Card;
|
|
41
71
|
props: CardProps;
|
|
42
72
|
hide?: boolean;
|
|
43
73
|
innerHTML: JSX.Element | string;
|
|
44
74
|
};
|
|
45
75
|
type CheckboxField = {
|
|
46
|
-
component:
|
|
76
|
+
component: FormGeneratorSupportedFields.Checkbox;
|
|
47
77
|
props: CheckboxProps;
|
|
48
78
|
hide?: boolean;
|
|
49
79
|
};
|
|
50
80
|
type CheckboxGroupField = {
|
|
51
|
-
component:
|
|
81
|
+
component: FormGeneratorSupportedFields.CheckboxGroup;
|
|
52
82
|
props: CheckboxGroupProps;
|
|
53
83
|
hide?: boolean;
|
|
54
84
|
children: CheckboxField[];
|
|
55
85
|
};
|
|
56
86
|
type DatepickerField = {
|
|
57
|
-
component:
|
|
87
|
+
component: FormGeneratorSupportedFields.Datepicker;
|
|
58
88
|
props: DatepickerProps;
|
|
59
89
|
hide?: boolean;
|
|
60
90
|
};
|
|
61
91
|
type DescriptionListField = {
|
|
62
|
-
component:
|
|
92
|
+
component: FormGeneratorSupportedFields.DescriptionList;
|
|
63
93
|
props: DescriptionListProps;
|
|
64
94
|
hide?: boolean;
|
|
65
95
|
children: DescriptionListGroupField[];
|
|
66
96
|
};
|
|
67
97
|
type DescriptionListGroupField = {
|
|
68
|
-
component:
|
|
98
|
+
component: FormGeneratorSupportedFields.DescriptionListGroup;
|
|
69
99
|
props: DescriptionListGroupProps;
|
|
70
100
|
hide?: boolean;
|
|
71
101
|
children: (DescriptionListTermField | DescriptionListDescField)[];
|
|
72
102
|
};
|
|
73
103
|
type DescriptionListTermField = {
|
|
74
|
-
component:
|
|
104
|
+
component: FormGeneratorSupportedFields.DescriptionListTerm;
|
|
75
105
|
props: DescriptionListTermProps;
|
|
76
106
|
hide?: boolean;
|
|
77
107
|
innerHTML: JSX.Element | string;
|
|
78
108
|
};
|
|
79
109
|
type DescriptionListDescField = {
|
|
80
|
-
component:
|
|
110
|
+
component: FormGeneratorSupportedFields.DescriptionListDesc;
|
|
81
111
|
props: DescriptionListDescProps;
|
|
82
112
|
hide?: boolean;
|
|
83
113
|
innerHTML: JSX.Element | string;
|
|
84
114
|
};
|
|
85
115
|
type DividerField = {
|
|
86
|
-
component:
|
|
116
|
+
component: FormGeneratorSupportedFields.Divider;
|
|
87
117
|
props: DividerProps;
|
|
88
118
|
hide?: boolean;
|
|
89
119
|
};
|
|
90
120
|
type GlobalMessageField = {
|
|
91
|
-
component:
|
|
121
|
+
component: FormGeneratorSupportedFields.GlobalMessage;
|
|
92
122
|
props: GlobalMessageProps;
|
|
93
123
|
hide?: boolean;
|
|
94
124
|
innerHTML?: JSX.Element | string;
|
|
95
125
|
};
|
|
96
126
|
type HeadingField = {
|
|
97
|
-
component:
|
|
127
|
+
component: FormGeneratorSupportedFields.Heading;
|
|
98
128
|
props: HeadingProps;
|
|
99
129
|
hide?: boolean;
|
|
100
130
|
innerHTML?: JSX.Element | string;
|
|
101
131
|
};
|
|
102
132
|
type InputMessageField = {
|
|
103
|
-
component:
|
|
133
|
+
component: FormGeneratorSupportedFields.InputMessage;
|
|
104
134
|
props: InputMessageProps;
|
|
105
135
|
hide?: boolean;
|
|
106
136
|
};
|
|
107
137
|
type LabelField = {
|
|
108
|
-
component:
|
|
138
|
+
component: FormGeneratorSupportedFields.Label;
|
|
109
139
|
props: LabelProps;
|
|
110
140
|
hide?: boolean;
|
|
111
141
|
innerHTML?: JSX.Element | string;
|
|
112
142
|
};
|
|
113
143
|
type LinkField = {
|
|
114
|
-
component:
|
|
144
|
+
component: FormGeneratorSupportedFields.Link;
|
|
115
145
|
props: LinkProps;
|
|
116
146
|
hide?: boolean;
|
|
117
147
|
innerHTML?: JSX.Element | string;
|
|
118
148
|
};
|
|
119
149
|
type ListItemField = {
|
|
120
|
-
component:
|
|
150
|
+
component: FormGeneratorSupportedFields.ListItem;
|
|
121
151
|
props?: ListItemProps;
|
|
122
152
|
hide?: boolean;
|
|
123
153
|
innerHTML?: JSX.Element | string;
|
|
124
154
|
};
|
|
125
155
|
type ListField = {
|
|
126
|
-
component:
|
|
156
|
+
component: FormGeneratorSupportedFields.List;
|
|
127
157
|
props?: ListProps;
|
|
128
158
|
hide?: boolean;
|
|
129
159
|
children: ListItemField[];
|
|
130
160
|
};
|
|
131
161
|
type LocalMessageField = {
|
|
132
|
-
component:
|
|
162
|
+
component: FormGeneratorSupportedFields.LocalMessage;
|
|
133
163
|
props: LocalMessageProps;
|
|
134
164
|
hide?: boolean;
|
|
135
165
|
innerHTML?: JSX.Element | string;
|
|
136
166
|
};
|
|
137
167
|
type ParagraphField = {
|
|
138
|
-
component:
|
|
168
|
+
component: FormGeneratorSupportedFields.Paragraph;
|
|
139
169
|
props: ParagraphProps;
|
|
140
170
|
hide?: boolean;
|
|
141
171
|
innerHTML?: JSX.Element | string;
|
|
142
172
|
};
|
|
143
173
|
type RadioButtonField = {
|
|
144
|
-
component:
|
|
174
|
+
component: FormGeneratorSupportedFields.RadioButton;
|
|
145
175
|
props: RadioButtonProps;
|
|
146
176
|
hide?: boolean;
|
|
147
177
|
};
|
|
148
178
|
type RadioButtonGroupField = {
|
|
149
|
-
component:
|
|
179
|
+
component: FormGeneratorSupportedFields.RadioButtonGroup;
|
|
150
180
|
props: RadioButtonGroupProps<string | number>;
|
|
151
181
|
hide?: boolean;
|
|
152
182
|
children: RadioButtonField[];
|
|
153
183
|
};
|
|
154
184
|
type SelectField = {
|
|
155
|
-
component:
|
|
185
|
+
component: FormGeneratorSupportedFields.Select;
|
|
156
186
|
props: SelectProps<SelectOption<unknown>, boolean>;
|
|
157
187
|
name: string;
|
|
158
188
|
hide?: boolean;
|
|
159
189
|
};
|
|
160
190
|
type SpinnerField = {
|
|
161
|
-
component:
|
|
191
|
+
component: FormGeneratorSupportedFields.Spinner;
|
|
162
192
|
props: SpinnerProps;
|
|
163
193
|
hide?: boolean;
|
|
164
194
|
};
|
|
165
195
|
type TextInputField = {
|
|
166
|
-
component:
|
|
196
|
+
component: FormGeneratorSupportedFields.TextInput;
|
|
167
197
|
props: TextInputProps;
|
|
168
198
|
hide?: boolean;
|
|
169
199
|
};
|
|
170
200
|
type ToggleButtonField = {
|
|
171
|
-
component:
|
|
201
|
+
component: FormGeneratorSupportedFields.ToggleButton;
|
|
172
202
|
props: ToggleButtonProps;
|
|
173
203
|
hide?: boolean;
|
|
174
204
|
};
|
|
175
205
|
type ToggleButtonGroupField = {
|
|
176
|
-
component:
|
|
206
|
+
component: FormGeneratorSupportedFields.ToggleButtonGroup;
|
|
177
207
|
props: ToggleButtonGroupProps;
|
|
178
208
|
hide?: boolean;
|
|
179
209
|
children: ToggleButtonField[];
|
|
180
210
|
};
|
|
181
211
|
type TypographyField = {
|
|
182
|
-
component:
|
|
212
|
+
component: FormGeneratorSupportedFields.Typography;
|
|
183
213
|
props: TypographyProps;
|
|
184
214
|
hide?: boolean;
|
|
185
215
|
innerHTML: JSX.Element | string;
|
|
186
216
|
};
|
|
187
217
|
type VisuallyHiddenField = {
|
|
188
|
-
component:
|
|
218
|
+
component: FormGeneratorSupportedFields.VisuallyHidden;
|
|
189
219
|
props: VisuallyHiddenProps;
|
|
190
220
|
hide?: boolean;
|
|
191
221
|
innerHTML: JSX.Element | string;
|
|
@@ -12,5 +12,5 @@ export declare const InputMessage: import("react").ForwardRefExoticComponent<Pic
|
|
|
12
12
|
/** Formålet med meldingen. Påvirker styling. */
|
|
13
13
|
messageType: InputMessageType;
|
|
14
14
|
} & {
|
|
15
|
-
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
|
|
15
|
+
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined; /** Meldingen som vises til brukeren. */
|
|
16
16
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CollapsibleRow: import("react").ForwardRefExoticComponent<{
|
|
2
|
-
type?: import("
|
|
2
|
+
type?: import("..").TableRowType | undefined;
|
|
3
3
|
mode?: import("../Table.types").RowMode | undefined;
|
|
4
4
|
selected?: boolean | undefined;
|
|
5
5
|
hoverable?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ export default _default;
|
|
|
39
39
|
export declare const SingleDefiningColumn: (args: CollapsibleTableProps) => JSX.Element;
|
|
40
40
|
export declare const MultipleDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
41
41
|
export declare const PrioritizedDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const WithDividers: (args: CollapsibleTableProps) => JSX.Element;
|
|
43
43
|
export declare const Compact: (args: CollapsibleTableProps) => JSX.Element;
|
|
44
44
|
export declare const StickyHeader: (args: CollapsibleTableProps) => JSX.Element;
|
|
45
45
|
export declare const WithButtonAndIcons: (args: CollapsibleTableProps) => JSX.Element;
|
|
@@ -26,6 +26,8 @@ export declare const useFloatPosition: (arrowRef: HTMLElement | null, options?:
|
|
|
26
26
|
refs: {
|
|
27
27
|
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
28
28
|
floating: import("react").MutableRefObject<HTMLElement | null>;
|
|
29
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
30
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
29
31
|
};
|
|
30
32
|
styles: {
|
|
31
33
|
floating: {
|