@danske/sapphire-react-lab 0.99.3 → 0.101.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.
Files changed (58) hide show
  1. package/build/cjs/index.js +1139 -801
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/esm/Accordion/src/AccordionHeading.js.map +1 -1
  4. package/build/esm/Alert/src/Alert.js.map +1 -1
  5. package/build/esm/Autocomplete/i18n/da-DK.js +6 -0
  6. package/build/esm/Autocomplete/i18n/da-DK.js.map +1 -0
  7. package/build/esm/Autocomplete/i18n/de-DE.js +6 -0
  8. package/build/esm/Autocomplete/i18n/de-DE.js.map +1 -0
  9. package/build/esm/Autocomplete/i18n/en-US.js +6 -0
  10. package/build/esm/Autocomplete/i18n/en-US.js.map +1 -0
  11. package/build/esm/Autocomplete/i18n/fi-FI.js +6 -0
  12. package/build/esm/Autocomplete/i18n/fi-FI.js.map +1 -0
  13. package/build/esm/Autocomplete/i18n/index.js +20 -0
  14. package/build/esm/Autocomplete/i18n/index.js.map +1 -0
  15. package/build/esm/Autocomplete/i18n/nb-NO.js +6 -0
  16. package/build/esm/Autocomplete/i18n/nb-NO.js.map +1 -0
  17. package/build/esm/Autocomplete/i18n/pl-PL.js +6 -0
  18. package/build/esm/Autocomplete/i18n/pl-PL.js.map +1 -0
  19. package/build/esm/Autocomplete/i18n/sv-SE.js +6 -0
  20. package/build/esm/Autocomplete/i18n/sv-SE.js.map +1 -0
  21. package/build/esm/Autocomplete/src/Autocomplete.js +89 -0
  22. package/build/esm/Autocomplete/src/Autocomplete.js.map +1 -0
  23. package/build/esm/Breadcrumbs/src/BreadcrumbItemLink.js +6 -0
  24. package/build/esm/Breadcrumbs/src/BreadcrumbItemLink.js.map +1 -1
  25. package/build/esm/Breadcrumbs/src/BreadcrumbItemStatic.js +36 -0
  26. package/build/esm/Breadcrumbs/src/BreadcrumbItemStatic.js.map +1 -0
  27. package/build/esm/Filtering/src/FilterDropdown.js +3 -2
  28. package/build/esm/Filtering/src/FilterDropdown.js.map +1 -1
  29. package/build/esm/Filtering/src/SearchableSelectFilter.js +14 -11
  30. package/build/esm/Filtering/src/SearchableSelectFilter.js.map +1 -1
  31. package/build/esm/LabeledValue/src/LabeledValue.js.map +1 -1
  32. package/build/esm/NumberField/src/StepperButton.js.map +1 -1
  33. package/build/esm/TagGroup/src/Tag.js.map +1 -1
  34. package/build/esm/TagGroup/src/TagGroup.js.map +1 -1
  35. package/build/esm/TimeField/i18n/da-DK.js +7 -0
  36. package/build/esm/TimeField/i18n/da-DK.js.map +1 -0
  37. package/build/esm/TimeField/i18n/de-DE.js +7 -0
  38. package/build/esm/TimeField/i18n/de-DE.js.map +1 -0
  39. package/build/esm/TimeField/i18n/en-US.js +7 -0
  40. package/build/esm/TimeField/i18n/en-US.js.map +1 -0
  41. package/build/esm/TimeField/i18n/fi-FI.js +7 -0
  42. package/build/esm/TimeField/i18n/fi-FI.js.map +1 -0
  43. package/build/esm/TimeField/i18n/index.js +20 -0
  44. package/build/esm/TimeField/i18n/index.js.map +1 -0
  45. package/build/esm/TimeField/i18n/nb-NO.js +7 -0
  46. package/build/esm/TimeField/i18n/nb-NO.js.map +1 -0
  47. package/build/esm/TimeField/i18n/pl-PL.js +7 -0
  48. package/build/esm/TimeField/i18n/pl-PL.js.map +1 -0
  49. package/build/esm/TimeField/i18n/sv-SE.js +7 -0
  50. package/build/esm/TimeField/i18n/sv-SE.js.map +1 -0
  51. package/build/esm/TimeField/src/TimeField.js +106 -0
  52. package/build/esm/TimeField/src/TimeField.js.map +1 -0
  53. package/build/esm/TimeField/src/TimeFieldSegment.js +48 -0
  54. package/build/esm/TimeField/src/TimeFieldSegment.js.map +1 -0
  55. package/build/esm/index.js +9 -7
  56. package/build/esm/index.js.map +1 -1
  57. package/build/index.d.ts +246 -133
  58. package/package.json +8 -5
package/build/index.d.ts CHANGED
@@ -1,95 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode, ReactElement, RefObject, Key } from 'react';
3
- import { SapphireStyleProps, PopoverTriggerProps, SearchFieldPropsWithRef, ListBoxProps, TypographyHeadingProps, FieldProps, ButtonProps } from '@danske/sapphire-react';
4
3
  import * as _react_types_shared from '@react-types/shared';
5
4
  import { CollectionBase, DOMProps, Expandable, ItemProps, AriaLabelingProps, FocusableRefValue, PressEvents } from '@react-types/shared';
5
+ import { SapphireStyleProps, TypographyHeadingProps, ListBoxProps, ButtonProps, PopoverTriggerProps, SearchFieldPropsWithRef, FieldProps } from '@danske/sapphire-react';
6
+ import { ComboBoxProps } from '@react-types/combobox';
7
+ import { BreadcrumbProps, BreadcrumbsProps as BreadcrumbsProps$1, SliderProps as SliderProps$1, SliderThumbProps, TimeValue } from 'react-aria-components';
6
8
  import { HoverProps } from '@react-aria/interactions';
7
9
  import { DropOptions } from '@react-aria/dnd';
8
10
  import { AriaNumberFieldProps } from '@react-aria/numberfield';
9
- import { SliderProps as SliderProps$1, SliderThumbProps, BreadcrumbProps, BreadcrumbsProps as BreadcrumbsProps$1 } from 'react-aria-components';
11
+ import { AriaTimeFieldProps } from '@react-aria/datepicker';
10
12
  export { useLocale } from '@react-aria/i18n';
11
13
 
12
- interface FilterDropdownProps extends SapphireStyleProps, Pick<PopoverTriggerProps, 'defaultOpen' | 'isOpen' | 'onOpenChange' | 'noMaxWidth'> {
13
- /**
14
- * "Filter by" label, shown inside the trigger button.
15
- */
16
- label: ReactNode;
17
- /**
18
- * Filter value, shown inside the trigger button. `null`, `undefined` and empty string are
19
- * considered as unset value.
20
- */
21
- value: ReactNode;
22
- /**
23
- * Filtering UI controls, rendered in a popover.
24
- */
25
- children: ReactNode;
26
- /**
27
- * Called when:
28
- * - `Enter` is pressed on form fields rendered inside the popover.
29
- * - 'Apply' button is pressed (if `hasApplyButton` is true)
30
- */
31
- onApply?: () => void;
32
- /**
33
- * Whether to show the 'Apply' button.
34
- */
35
- hasApplyButton?: boolean;
36
- /**
37
- * Called when 'Clear' button is pressed.
38
- */
39
- onClear?: () => void;
40
- /**
41
- * Whether the button is disabled.
42
- */
43
- isDisabled?: boolean;
44
- /**
45
- * Whether the 'Apply' button is disabled.
46
- */
47
- isApplyDisabled?: boolean;
48
- /**
49
- * Whether the 'Clear' button is disabled.
50
- */
51
- isClearDisabled?: boolean;
52
- /**
53
- * The label of the 'Clear' button.
54
- * @default "Clear"
55
- */
56
- clearButtonLabel?: ReactNode;
57
- /**
58
- * The label of the 'Apply' button.
59
- * @default "Apply"
60
- */
61
- applyButtonLabel?: ReactNode;
62
- /**
63
- * The size of the buttons incl. the trigger itself.
64
- * @default 'md'
65
- */
66
- buttonSize?: 'sm' | 'md' | 'lg';
67
- }
68
- /**
69
- * A button with a dropdown, used for filtering UI.
70
- */
71
- declare function FilterDropdown({ children, label, value, isDisabled, isApplyDisabled, isClearDisabled, isOpen: isOpenProp, applyButtonLabel, clearButtonLabel, defaultOpen, hasApplyButton, noMaxWidth, onApply, onClear, onOpenChange, buttonSize, }: FilterDropdownProps): JSX.Element;
72
-
73
- interface SearchableSelectFilterProps extends SapphireStyleProps, Omit<FilterDropdownProps, 'children'> {
74
- /**
75
- * The SearchField to search items with.
76
- */
77
- searchField: ReactElement<SearchFieldPropsWithRef<object>>;
78
- /**
79
- * The ListBox to select items from.
80
- */
81
- listBox: ReactElement<ListBoxProps<object>>;
82
- /**
83
- * The Button size of the trigger
84
- * @default 'md'
85
- */
86
- size?: 'sm' | 'md' | 'lg';
87
- }
88
- /**
89
- * A button with a dropdown, used for filtering UI.
90
- */
91
- declare function SearchableSelectFilter(props: SearchableSelectFilterProps): JSX.Element;
92
-
93
14
  declare type TreeExpansionMode = 'single' | 'multiple';
94
15
 
95
16
  interface AccordionProps<T> extends SapphireStyleProps, CollectionBase<T>, DOMProps, Expandable {
@@ -147,6 +68,71 @@ declare const _Accordion: (<T extends object>(props: AccordionProps<T> & {
147
68
  Item: <T_1>(props: AccordionItemProps<T_1>) => JSX.Element;
148
69
  };
149
70
 
71
+ interface SapphireAlertProps extends SapphireStyleProps {
72
+ /**
73
+ * The content of the alert.
74
+ */
75
+ children?: ReactNode;
76
+ /**
77
+ * The title of the alert.
78
+ */
79
+ title?: ReactNode;
80
+ /**
81
+ * @default 'info'
82
+ */
83
+ variant?: 'info' | 'positive' | 'negative' | 'warning';
84
+ }
85
+ declare function Alert({ children, title, variant, ...props }: SapphireAlertProps): React__default.JSX.Element;
86
+
87
+ declare type AutocompleteProps<T extends object> = SapphireStyleProps & Pick<ComboBoxProps<T>, 'items' | 'children' | 'inputValue' | 'defaultInputValue' | 'onInputChange' | 'onSelectionChange' | 'isDisabled'> & Pick<ListBoxProps<T>, 'loadingState' | 'loadingSkeletonRowsCount'> & {
88
+ /**
89
+ * Render function for the input element.
90
+ * Receives props that should be spread onto the input component.
91
+ */
92
+ renderInput: (inputProps: any) => ReactElement;
93
+ /**
94
+ * Accessible label for the suggestions listbox.
95
+ */
96
+ listboxAriaLabel?: string;
97
+ /**
98
+ * Controlled selected value.
99
+ */
100
+ value?: React__default.Key | null;
101
+ /**
102
+ * Decide what items to display in the dropdown menu.
103
+ * @default 'String.includes'
104
+ */
105
+ defaultFilter?: (textValue: string, inputValue: string) => boolean;
106
+ };
107
+ declare function Autocomplete<T extends object>(props: AutocompleteProps<T>): ReactElement;
108
+
109
+ declare type BreadcrumbItemProps = {
110
+ isDisabled?: boolean;
111
+ } & SapphireStyleProps & Pick<BreadcrumbProps, 'children'>;
112
+ declare const BreadcrumbItem: ({ children, isDisabled: individualDisabled, ...props }: BreadcrumbItemProps) => JSX.Element;
113
+
114
+ declare type BreadcrumbsProps<T extends object> = Pick<BreadcrumbsProps$1<T>, 'aria-label' | 'isDisabled'> & {
115
+ children: React__default.ReactElement<BreadcrumbItemProps>[];
116
+ /**
117
+ * The size of the breadcrumbs component.
118
+ *
119
+ * @default 'md'
120
+ */
121
+ size?: 'sm' | 'md' | 'lg';
122
+ /**
123
+ * Maximum width for the breadcrumbs container. When content overflows,
124
+ * it will show an overflow menu with the first and last items.
125
+ */
126
+ maxWidth?: React__default.CSSProperties['maxWidth'];
127
+ } & SapphireStyleProps;
128
+ /**
129
+ * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
130
+ */
131
+ declare const Breadcrumbs: <T extends object>({ size, children, maxWidth, ...props }: BreadcrumbsProps<T>) => JSX.Element;
132
+
133
+ declare type BreadcrumbItemLinkProps = Omit<ButtonProps<'a'>, 'variant' | 'iconAlign'> & SapphireStyleProps;
134
+ declare const BreadcrumbItemLink: React__default.ForwardRefExoticComponent<Omit<ButtonProps<"a">, "variant" | "iconAlign"> & SapphireStyleProps & React__default.RefAttributes<_react_types_shared.FocusableRefValue<HTMLAnchorElement, HTMLAnchorElement>>>;
135
+
150
136
  interface FileSelectProps {
151
137
  /**
152
138
  * List of file types that are allowed to be selected using the file select.
@@ -192,6 +178,87 @@ interface FileDropzoneProps extends SapphireStyleProps, Pick<DropOptions, 'getDr
192
178
  }
193
179
  declare const FileDropzone: React__default.ForwardRefExoticComponent<FileDropzoneProps & React__default.RefAttributes<HTMLDivElement>>;
194
180
 
181
+ interface FilterDropdownProps extends SapphireStyleProps, Pick<PopoverTriggerProps, 'defaultOpen' | 'isOpen' | 'onOpenChange' | 'noMaxWidth'> {
182
+ /**
183
+ * "Filter by" label, shown inside the trigger button.
184
+ */
185
+ label: ReactNode;
186
+ /**
187
+ * Filter value, shown inside the trigger button. `null`, `undefined` and empty string are
188
+ * considered as unset value.
189
+ */
190
+ value: ReactNode;
191
+ /**
192
+ * Filtering UI controls, rendered in a popover.
193
+ */
194
+ children: ReactNode;
195
+ /**
196
+ * Called when:
197
+ * - `Enter` is pressed on form fields rendered inside the popover.
198
+ * - 'Apply' button is pressed (if `hasApplyButton` is true)
199
+ */
200
+ onApply?: () => void;
201
+ /**
202
+ * Whether to show the 'Apply' button.
203
+ */
204
+ hasApplyButton?: boolean;
205
+ /**
206
+ * Called when 'Clear' button is pressed.
207
+ */
208
+ onClear?: () => void;
209
+ /**
210
+ * Whether the button is disabled.
211
+ */
212
+ isDisabled?: boolean;
213
+ /**
214
+ * Whether the 'Apply' button is disabled.
215
+ */
216
+ isApplyDisabled?: boolean;
217
+ /**
218
+ * Whether the 'Clear' button is disabled.
219
+ */
220
+ isClearDisabled?: boolean;
221
+ /**
222
+ * The label of the 'Clear' button.
223
+ * @default "Clear"
224
+ */
225
+ clearButtonLabel?: ReactNode;
226
+ /**
227
+ * The label of the 'Apply' button.
228
+ * @default "Apply"
229
+ */
230
+ applyButtonLabel?: ReactNode;
231
+ /**
232
+ * The size of the buttons incl. the trigger itself.
233
+ * @default 'md'
234
+ */
235
+ buttonSize?: 'sm' | 'md' | 'lg';
236
+ }
237
+ /**
238
+ * A button with a dropdown, used for filtering UI.
239
+ */
240
+ declare function FilterDropdown({ children, label, value, isDisabled, isApplyDisabled, isClearDisabled, isOpen: isOpenProp, applyButtonLabel, clearButtonLabel, defaultOpen, hasApplyButton, noMaxWidth, onApply, onClear, onOpenChange, buttonSize, }: FilterDropdownProps): JSX.Element;
241
+
242
+ interface SearchableSelectFilterProps extends SapphireStyleProps, Omit<FilterDropdownProps, 'children'> {
243
+ /**
244
+ * The SearchField to search items with.
245
+ */
246
+ searchField: ReactElement<SearchFieldPropsWithRef<object>>;
247
+ /**
248
+ * The ListBox to select items from.
249
+ */
250
+ listBox: ReactElement<ListBoxProps<object>>;
251
+ /**
252
+ * The Button size of the trigger
253
+ * @default 'md'
254
+ */
255
+ size?: 'sm' | 'md' | 'lg';
256
+ }
257
+ /**
258
+ * A button with a dropdown, used for filtering UI.
259
+ */
260
+ declare function SearchableSelectFilter(props: SearchableSelectFilterProps): JSX.Element;
261
+
195
262
  declare type FlagProps = SapphireStyleProps & {
196
263
  'aria-label'?: string;
197
264
  /**
@@ -213,7 +280,7 @@ declare const Flag: React__default.ForwardRefExoticComponent<SapphireStyleProps
213
280
  * The size of the flag.
214
281
  * @default 'lg'
215
282
  */
216
- size?: "sm" | "md" | "lg" | "xs" | "xl" | undefined;
283
+ size?: "lg" | "sm" | "md" | "xl" | "xs" | undefined;
217
284
  /**
218
285
  * Flags come in square or rounded shapes. Square flags are used for display purposes, ensuring a clean and consistent look.
219
286
  * Rounded flags are reserved for actionable elements like buttons or selectors, providing a more interactive and approachable feel.
@@ -223,6 +290,28 @@ declare const Flag: React__default.ForwardRefExoticComponent<SapphireStyleProps
223
290
  children: React__default.ReactNode;
224
291
  } & React__default.RefAttributes<HTMLSpanElement>>;
225
292
 
293
+ interface LabeledValueProps extends DOMProps, SapphireStyleProps {
294
+ children?: React__default.ReactNode;
295
+ /**
296
+ * A HelpButton element to place next to the label.
297
+ */
298
+ contextualHelp?: ReactNode;
299
+ /**
300
+ * The content to display as a label.
301
+ */
302
+ label: ReactNode;
303
+ /**
304
+ * Places the label either above (default) or on the left side of tags.
305
+ * @default 'above'
306
+ */
307
+ labelPlacement?: 'above' | 'side';
308
+ /**
309
+ * @default 'lg'
310
+ */
311
+ size?: 'lg' | 'md';
312
+ }
313
+ declare function LabeledValue({ children, contextualHelp, label, labelPlacement, size, ...otherProps }: LabeledValueProps): React__default.JSX.Element;
314
+
226
315
  interface SapphireNumberFieldProps extends Pick<AriaNumberFieldProps, 'label' | 'isDisabled' | 'isRequired' | 'value' | 'defaultValue' | 'onChange' | 'incrementAriaLabel' | 'decrementAriaLabel' | 'onFocus' | 'onBlur' | 'formatOptions' | 'step' | 'minValue' | 'maxValue' | 'placeholder' | 'isReadOnly' | 'autoFocus' | 'onFocusChange' | 'onKeyUp' | 'onKeyDown'> {
227
316
  /**
228
317
  * Whether the input should render as having an error and an error message.
@@ -326,33 +415,6 @@ declare const _Slider: (({ label, labelPlacement, note, name, ...props }: Slider
326
415
  } & React.HTMLAttributes<HTMLElement>) => React.JSX.Element;
327
416
  };
328
417
 
329
- declare type BreadcrumbItemProps = {
330
- isDisabled?: boolean;
331
- } & SapphireStyleProps & Pick<BreadcrumbProps, 'children'>;
332
- declare const BreadcrumbItem: ({ children, isDisabled: individualDisabled, ...props }: BreadcrumbItemProps) => JSX.Element;
333
-
334
- declare type BreadcrumbsProps<T extends object> = Pick<BreadcrumbsProps$1<T>, 'aria-label' | 'isDisabled'> & {
335
- children: React__default.ReactElement<BreadcrumbItemProps>[];
336
- /**
337
- * The size of the breadcrumbs component.
338
- *
339
- * @default 'md'
340
- */
341
- size?: 'sm' | 'md' | 'lg';
342
- /**
343
- * Maximum width for the breadcrumbs container. When content overflows,
344
- * it will show an overflow menu with the first and last items.
345
- */
346
- maxWidth?: React__default.CSSProperties['maxWidth'];
347
- } & SapphireStyleProps;
348
- /**
349
- * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
350
- */
351
- declare const Breadcrumbs: <T extends object>({ size, children, maxWidth, ...props }: BreadcrumbsProps<T>) => JSX.Element;
352
-
353
- declare type BreadcrumbItemLinkProps = Omit<ButtonProps<'a'>, 'variant' | 'iconAlign'> & SapphireStyleProps;
354
- declare const BreadcrumbItemLink: React__default.ForwardRefExoticComponent<Omit<ButtonProps<"a">, "variant" | "iconAlign"> & SapphireStyleProps & React__default.RefAttributes<_react_types_shared.FocusableRefValue<HTMLAnchorElement, HTMLAnchorElement>>>;
355
-
356
418
  interface TagGroupProps<T> extends CollectionBase<T>, DOMProps, Pick<AriaLabelingProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-details'>, SapphireStyleProps {
357
419
  /**
358
420
  * A HelpButton element to place next to the label.
@@ -410,42 +472,93 @@ interface TagItemProps<T> extends ItemProps<T> {
410
472
  }
411
473
  declare const TagItem: <T>(props: TagItemProps<T>) => JSX.Element;
412
474
 
413
- interface LabeledValueProps extends DOMProps, SapphireStyleProps {
414
- children?: React__default.ReactNode;
475
+ declare type TimeFieldProps<T extends TimeValue> = Pick<AriaTimeFieldProps<T>, 'isDisabled' | 'isRequired' | 'isReadOnly' | 'label' | 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'shouldForceLeadingZeros'> & SapphireStyleProps & {
415
476
  /**
416
- * A HelpButton element to place next to the label.
477
+ * @default 'lg'
417
478
  */
418
- contextualHelp?: ReactNode;
479
+ size?: 'lg' | 'md';
419
480
  /**
420
- * The content to display as a label.
481
+ * To visually indicate if this field is required or optional.
482
+ * @default false
421
483
  */
422
- label: ReactNode;
484
+ necessityIndicator?: boolean;
423
485
  /**
424
- * Places the label either above (default) or on the left side of tags.
486
+ * Places the label either above (default) or on the side of the control.
425
487
  * @default 'above'
426
488
  */
427
- labelPlacement?: 'above' | 'side';
489
+ labelPlacement?: 'side' | 'above';
490
+ /**
491
+ * If it should hide the "clear" button when input is not empty.
492
+ *
493
+ * @default false
494
+ */
495
+ noClearButton?: boolean;
496
+ /**
497
+ * Whether the input should render as having an error and an error message.
498
+ * This also sets the appropriate `aria` attributes on the input.
499
+ *
500
+ * A `boolean` sets the error state. Can be paired with the "note" prop with Field.Note variant="error"
501
+ * A `ReactNode` sets the error state with an additional error message.
502
+ *
503
+ * **An error message is strongly recommended because an error should
504
+ * always have an explanation about how to fix it.**
505
+ */
506
+ error?: boolean | ReactNode;
507
+ /**
508
+ * A note to show below the input.
509
+ * If the input has an error message, this note will be replaced by that.
510
+ * Use {@Link Field.Note} to render the note.
511
+ */
512
+ note?: ReactNode;
513
+ /**
514
+ * A HelpButton to render next to the label.
515
+ */
516
+ contextualHelp?: ReactNode;
517
+ };
518
+ declare const TimeField: <T extends TimeValue>(props: Pick<AriaTimeFieldProps<T>, "value" | "label" | "onFocus" | "onBlur" | "onChange" | "isDisabled" | "isReadOnly" | "isRequired" | "defaultValue" | "shouldForceLeadingZeros"> & SapphireStyleProps & {
428
519
  /**
429
520
  * @default 'lg'
430
521
  */
431
- size?: 'lg' | 'md';
432
- }
433
- declare function LabeledValue({ children, contextualHelp, label, labelPlacement, size, ...otherProps }: LabeledValueProps): React__default.JSX.Element;
434
-
435
- interface SapphireAlertProps extends SapphireStyleProps {
522
+ size?: "lg" | "md" | undefined;
436
523
  /**
437
- * The content of the alert.
524
+ * To visually indicate if this field is required or optional.
525
+ * @default false
438
526
  */
439
- children?: ReactNode;
527
+ necessityIndicator?: boolean | undefined;
440
528
  /**
441
- * The title of the alert.
529
+ * Places the label either above (default) or on the side of the control.
530
+ * @default 'above'
442
531
  */
443
- title?: ReactNode;
532
+ labelPlacement?: "above" | "side" | undefined;
444
533
  /**
445
- * @default 'info'
534
+ * If it should hide the "clear" button when input is not empty.
535
+ *
536
+ * @default false
446
537
  */
447
- variant?: 'info' | 'positive' | 'negative' | 'warning';
448
- }
449
- declare function Alert({ children, title, variant, ...props }: SapphireAlertProps): React__default.JSX.Element;
538
+ noClearButton?: boolean | undefined;
539
+ /**
540
+ * Whether the input should render as having an error and an error message.
541
+ * This also sets the appropriate `aria` attributes on the input.
542
+ *
543
+ * A `boolean` sets the error state. Can be paired with the "note" prop with Field.Note variant="error"
544
+ * A `ReactNode` sets the error state with an additional error message.
545
+ *
546
+ * **An error message is strongly recommended because an error should
547
+ * always have an explanation about how to fix it.**
548
+ */
549
+ error?: boolean | ReactNode;
550
+ /**
551
+ * A note to show below the input.
552
+ * If the input has an error message, this note will be replaced by that.
553
+ * Use {@Link Field.Note} to render the note.
554
+ */
555
+ note?: ReactNode;
556
+ /**
557
+ * A HelpButton to render next to the label.
558
+ */
559
+ contextualHelp?: ReactNode;
560
+ } & {
561
+ ref?: React__default.RefObject<HTMLDivElement> | undefined;
562
+ }) => React__default.ReactElement;
450
563
 
451
- export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionProps, Alert, BreadcrumbItem, BreadcrumbItemLink, BreadcrumbItemLinkProps, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, Flag, FlagProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, ProgressIndicator, ProgressIndicatorProps, SapphireAlertProps, SearchableSelectFilter, SearchableSelectFilterProps, _Slider as Slider, SliderProps, TagGroup, TagGroupProps, TagItem };
564
+ export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionProps, Alert, Autocomplete, AutocompleteProps, BreadcrumbItem, BreadcrumbItemLink, BreadcrumbItemLinkProps, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, Flag, FlagProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, ProgressIndicator, ProgressIndicatorProps, SapphireAlertProps, SearchableSelectFilter, SearchableSelectFilterProps, _Slider as Slider, SliderProps, TagGroup, TagGroupProps, TagItem, TimeField, TimeFieldProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danske/sapphire-react-lab",
3
- "version": "0.99.3",
3
+ "version": "0.101.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Experimental React components of the Sapphire Design System from Danske Bank A/S",
6
6
  "exports": {
@@ -25,23 +25,24 @@
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@danske/sapphire-icons": "^3.1.0",
28
- "@danske/sapphire-react": "^5.6.1",
28
+ "@danske/sapphire-react": "^5.7.0",
29
29
  "react": ">=16.8.0",
30
30
  "react-dom": ">=16.8.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@danske/sapphire-icons": "^3.1.0",
34
- "@danske/sapphire-react": "^5.6.1",
34
+ "@danske/sapphire-react": "^5.7.0",
35
35
  "@types/react-transition-group": "^4.4.5",
36
36
  "cross-env": "^7.0.3"
37
37
  },
38
38
  "dependencies": {
39
- "@danske/sapphire-css": "^44.0.0",
39
+ "@danske/sapphire-css": "^45.0.0",
40
40
  "@internationalized/date": "^3.10.0",
41
41
  "@internationalized/string": "^3.2.7",
42
42
  "@react-aria/accordion": "3.0.0-alpha.37",
43
43
  "@react-aria/button": "^3.14.2",
44
44
  "@react-aria/combobox": "^3.14.0",
45
+ "@react-aria/datepicker": "^3.15.2",
45
46
  "@react-aria/dialog": "^3.5.31",
46
47
  "@react-aria/dnd": "^3.11.3",
47
48
  "@react-aria/focus": "^3.21.2",
@@ -57,8 +58,10 @@
57
58
  "@react-spectrum/utils": "^3.12.5",
58
59
  "@react-stately/collections": "^3.12.8",
59
60
  "@react-stately/combobox": "^3.12.0",
61
+ "@react-stately/datepicker": "^3.15.2",
60
62
  "@react-stately/list": "^3.13.1",
61
63
  "@react-stately/numberfield": "^3.10.2",
64
+ "@react-stately/overlays": "^3.6.20",
62
65
  "@react-stately/toggle": "^3.9.2",
63
66
  "@react-stately/tree": "^3.9.3",
64
67
  "@react-stately/utils": "^3.10.8",
@@ -68,5 +71,5 @@
68
71
  "react-aria-components": "^1.13.0",
69
72
  "react-transition-group": "^4.4.5"
70
73
  },
71
- "gitHead": "631da638aac08cb1982daad7b49c1237525d8efb"
74
+ "gitHead": "956d65c795c2bffc1e4cc153c7721e94c35827c9"
72
75
  }