@marigold/components 5.2.0 → 5.4.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.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  export { useAsyncList, useListData } from '@react-stately/data';
2
- import { ThemeExtension, ThemeComponentProps, ResponsiveStyleValue, ThemeExtensionsWithParts, StateAttrProps, CSSObject, BoxOwnProps, Theme as Theme$1, ThemeProviderProps, GlobalProps, SVGProps } from '@marigold/system';
2
+ import { ThemeExtensionsWithParts, ThemeExtension, ThemeComponentProps, ResponsiveStyleValue, StateAttrProps, CSSObject, BoxOwnProps, Theme as Theme$1, ThemeProviderProps, GlobalProps, SVGProps } from '@marigold/system';
3
3
  export { Box, BoxOwnProps, BoxProps, ThemeProvider, useTheme } from '@marigold/system';
4
- import React, { ReactNode, HTMLAttributes, LabelHTMLAttributes, Key, ForwardRefExoticComponent, RefAttributes, ReactElement } from 'react';
5
- import { HtmlProps, PropsOf, PolymorphicComponent, NonZeroPercentage } from '@marigold/types';
6
4
  import * as _react_types_shared from '@react-types/shared';
7
5
  import { PressEvents, CollectionElement, StyleProps } from '@react-types/shared';
6
+ import React, { Key, ReactNode, HTMLAttributes, LabelHTMLAttributes, ReactElement, ForwardRefExoticComponent, RefAttributes } from 'react';
7
+ import { SearchAutocompleteProps } from '@react-types/autocomplete';
8
+ import { HtmlProps, PropsOf, PolymorphicComponent, NonZeroPercentage } from '@marigold/types';
8
9
  import { AriaCheckboxProps, AriaCheckboxGroupProps } from '@react-types/checkbox';
9
10
  import { AriaDialogProps } from '@react-types/dialog';
10
11
  import { SeparatorProps } from '@react-aria/separator';
@@ -20,13 +21,44 @@ import { AriaTextFieldProps } from '@react-types/textfield';
20
21
  import { PositionProps } from '@react-types/overlays';
21
22
  import { TooltipTriggerProps as TooltipTriggerProps$1 } from '@react-types/tooltip';
22
23
  import { aspect, size } from '@marigold/tokens';
23
- import { SearchAutocompleteProps } from '@react-types/autocomplete';
24
24
  import { CheckboxGroupState } from '@react-stately/checkbox';
25
25
  import { OverlayProps as OverlayProps$1, AriaPopoverProps, AriaModalOverlayProps } from '@react-aria/overlays';
26
26
  import { OverlayTriggerState } from '@react-stately/overlays';
27
27
  export { SSRProvider } from '@react-aria/ssr';
28
28
  export { VisuallyHidden } from '@react-aria/visually-hidden';
29
29
 
30
+ interface AutocompleteThemeExtension extends ThemeExtensionsWithParts<'Autocomplete', ['icon', 'clear']> {
31
+ }
32
+ interface AutocompleteProps extends Omit<SearchAutocompleteProps<object>, 'isDisabled' | 'isRequired' | 'isReadonly' | 'validationState' | 'icon' | 'onInputChange' | 'inputValue' | 'defaultInputValue'> {
33
+ disabled?: boolean;
34
+ required?: boolean;
35
+ readOnly?: boolean;
36
+ error?: boolean;
37
+ defaultValue?: SearchAutocompleteProps<object>['defaultInputValue'];
38
+ value?: SearchAutocompleteProps<object>['inputValue'];
39
+ /**
40
+ * Handler that is called when the input value changes.
41
+ */
42
+ onChange?: SearchAutocompleteProps<object>['onInputChange'];
43
+ /**
44
+ * Handler that is called when the SearchAutocomplete is submitted.
45
+ *
46
+ * A `key` will be passed if the submission is a selected item (e.g. a user
47
+ * clicks or presses enter on an option). If the input is a custom `value`, `key` will be `null`.
48
+ *
49
+ * A `value` will be passed if the submission is a custom value (e.g. a user
50
+ * types then presses enter). If the input is a selected item, `value` will be `null`.
51
+ */
52
+ onSubmit?: (key: Key | null, value: string | null) => void;
53
+ variant?: string;
54
+ size?: string;
55
+ width?: string;
56
+ }
57
+ declare const Autocomplete: {
58
+ ({ disabled, required, readOnly, error, onChange, value, defaultValue, variant, size, width, ...rest }: AutocompleteProps): JSX.Element;
59
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
60
+ };
61
+
30
62
  interface BadgeThemeExtension extends ThemeExtension<'Badge'> {
31
63
  }
32
64
  interface BadgeProps extends HtmlProps<'div'> {
@@ -236,24 +268,17 @@ interface ImageProps extends HtmlProps<'img'> {
236
268
  }
237
269
  declare const Image: ({ variant, size, fit, position, ...props }: ImageProps) => JSX.Element;
238
270
 
239
- interface InputFieldOwnProps extends Omit<HtmlProps<'input'>, 'size'> {
271
+ interface InputThemeExtension extends ThemeExtensionsWithParts<'Input', ['input', 'icon', 'container']> {
240
272
  }
241
- interface InputFieldProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'>, InputFieldOwnProps {
242
- }
243
- declare const InputField: React.ForwardRefExoticComponent<InputFieldOwnProps & React.RefAttributes<HTMLInputElement>>;
244
-
245
- interface InputThemeExtension extends ThemeExtension<'Input'> {
246
- }
247
- interface InputProps extends Omit<HtmlProps<'div'>, 'size'> {
248
- children: ReactNode;
249
- space?: ResponsiveStyleValue<string>;
273
+ interface InputOwnProps extends Omit<HtmlProps<'input'>, 'size'> {
274
+ icon?: ReactElement;
275
+ action?: ReactElement;
250
276
  variant?: string;
251
277
  size?: string;
252
278
  }
253
- declare const Input: {
254
- ({ space, children, variant, size, ...props }: InputProps): JSX.Element;
255
- Field: React.ForwardRefExoticComponent<InputFieldOwnProps & React.RefAttributes<HTMLInputElement>>;
256
- };
279
+ interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'>, InputOwnProps {
280
+ }
281
+ declare const Input: React.ForwardRefExoticComponent<InputOwnProps & React.RefAttributes<HTMLInputElement>>;
257
282
 
258
283
  interface LinkThemeExtension extends ThemeExtension<'Link'> {
259
284
  }
@@ -520,10 +545,11 @@ interface TextProps extends ThemeComponentProps, HtmlProps<'p'> {
520
545
  cursor?: string;
521
546
  fontSize?: string;
522
547
  fontWeight?: string;
548
+ fontStyle?: string;
523
549
  outline?: string;
524
550
  children?: React.ReactNode;
525
551
  }
526
- declare const Text: ({ variant, size, display, align, color, fontSize, fontWeight, cursor, outline, children, ...props }: TextProps) => JSX.Element;
552
+ declare const Text: ({ variant, size, display, align, color, fontSize, fontStyle, fontWeight, cursor, outline, children, ...props }: TextProps) => JSX.Element;
527
553
 
528
554
  interface TextAreaThemeExtension extends ThemeExtension<'TextArea'> {
529
555
  }
@@ -559,7 +585,7 @@ declare const Tooltip: {
559
585
  Trigger: ({ disabled, open, delay, placement, children, ...rest }: TooltipTriggerProps) => JSX.Element;
560
586
  };
561
587
 
562
- interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, BodyThemeExtension, DialogThemeExtension, DividerThemeExtension, FieldThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension, LinkThemeExtension, ListThemeExtension, ListBoxThemeExtension, MenuThemeExtension, MessageThemeExtension, NumberFieldThemeExtension, RadioThemeExtension, SelectThemeExtension, SliderThemeExtension, SwitchThemeExtension, TableThemeExtension, TextThemeExtension, TextAreaThemeExtension, TooltipThemeExtension, UnderlayThemeExtension {
588
+ interface ComponentStyles extends AutocompleteThemeExtension, BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, BodyThemeExtension, DialogThemeExtension, DividerThemeExtension, FieldThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension, LinkThemeExtension, ListThemeExtension, ListBoxThemeExtension, MenuThemeExtension, MessageThemeExtension, NumberFieldThemeExtension, RadioThemeExtension, SelectThemeExtension, SliderThemeExtension, SwitchThemeExtension, TableThemeExtension, TextThemeExtension, TextAreaThemeExtension, TooltipThemeExtension, UnderlayThemeExtension {
563
589
  }
564
590
  interface Theme extends Theme$1 {
565
591
  components: ComponentStyles;
@@ -590,34 +616,6 @@ interface AspectProps extends HtmlProps<'div'> {
590
616
  }
591
617
  declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => JSX.Element;
592
618
 
593
- interface AutocompleteProps extends Omit<SearchAutocompleteProps<object>, 'isDisabled' | 'isRequired' | 'isReadonly' | 'validationState' | 'icon' | 'onInputChange' | 'inputValue' | 'defaultInputValue'> {
594
- disabled?: boolean;
595
- required?: boolean;
596
- readOnly?: boolean;
597
- error?: boolean;
598
- defaultValue?: SearchAutocompleteProps<object>['defaultInputValue'];
599
- value?: SearchAutocompleteProps<object>['inputValue'];
600
- /**
601
- * Handler that is called when the input value changes.
602
- */
603
- onChange?: SearchAutocompleteProps<object>['onInputChange'];
604
- /**
605
- * Handler that is called when the SearchAutocomplete is submitted.
606
- *
607
- * A `key` will be passed if the submission is a selected item (e.g. a user
608
- * clicks or presses enter on an option). If the input is a custom `value`, `key` will be `null`.
609
- *
610
- * A `value` will be passed if the submission is a custom value (e.g. a user
611
- * types then presses enter). If the input is a selected item, `value` will be `null`.
612
- */
613
- onSubmit?: (key: Key | null, value: string | null) => void;
614
- width?: string;
615
- }
616
- declare const Autocomplete: {
617
- ({ disabled, required, readOnly, error, onChange, value, defaultValue, width, ...rest }: AutocompleteProps): JSX.Element;
618
- Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
619
- };
620
-
621
619
  interface BreakoutProps extends HtmlProps<'div'> {
622
620
  children?: ReactNode;
623
621
  alignY?: 'top' | 'bottom' | 'center';
@@ -742,4 +740,4 @@ declare const Tiles: ({ space, stretch, equalHeight, tilesWidth, children, ...pr
742
740
 
743
741
  declare const XLoader: React.ForwardRefExoticComponent<SVGProps & React.RefAttributes<SVGElement>>;
744
742
 
745
- export { ActionMenu, Aside, AsideProps, Aspect, AspectProps, Autocomplete, AutocompleteProps, Badge, BadgeProps, BadgeThemeExtension, Body, BodyProps, BodyThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupProps, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, CustomizedTheme, Dialog, DialogChildProps, DialogProps, DialogThemeExtension, Divider, DividerProps, DividerThemeExtension, FieldBase, FieldBaseProps, FieldGroup, FieldGroupContext, FieldGroupContextProps, FieldGroupProps, FieldThemeExtension, Footer, FooterProps, FooterThemeExtension, Header, HeaderProps, HeaderThemeExtension, Headline, HeadlineProps, HeadlineThemeExtension, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputField, InputFieldOwnProps, InputFieldProps, InputProps, InputThemeExtension, Inset, InsetProps, Label, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, List, ListProps, ListThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, Modal, ModalProps, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioComponent, RadioGroupProps, RadioProps, RadioThemeExtension, RowProps, Select, SelectComponent, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Split, SplitProps, Stack, StackProps, Switch, SwitchProps, SwitchThemeExtension, Table, TableProps, TableThemeExtension, Text, TextArea, TextAreaProps, TextAreaThemeExtension, TextField, TextFieldProps, TextProps, TextThemeExtension, Theme, Tiles, TilesProps, Tooltip, TooltipProps, TooltipThemeExtension, Tray, TrayProps, TrayWrapper, Underlay, UnderlayProps, UnderlayThemeExtension, XLoader, extendTheme, useCheckboxGroupContext, useFieldGroupContext };
743
+ export { ActionMenu, Aside, AsideProps, Aspect, AspectProps, Autocomplete, AutocompleteProps, AutocompleteThemeExtension, Badge, BadgeProps, BadgeThemeExtension, Body, BodyProps, BodyThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupProps, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, CustomizedTheme, Dialog, DialogChildProps, DialogProps, DialogThemeExtension, Divider, DividerProps, DividerThemeExtension, FieldBase, FieldBaseProps, FieldGroup, FieldGroupContext, FieldGroupContextProps, FieldGroupProps, FieldThemeExtension, Footer, FooterProps, FooterThemeExtension, Header, HeaderProps, HeaderThemeExtension, Headline, HeadlineProps, HeadlineThemeExtension, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputOwnProps, InputProps, InputThemeExtension, Inset, InsetProps, Label, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, List, ListProps, ListThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, Modal, ModalProps, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioComponent, RadioGroupProps, RadioProps, RadioThemeExtension, RowProps, Select, SelectComponent, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Split, SplitProps, Stack, StackProps, Switch, SwitchProps, SwitchThemeExtension, Table, TableProps, TableThemeExtension, Text, TextArea, TextAreaProps, TextAreaThemeExtension, TextField, TextFieldProps, TextProps, TextThemeExtension, Theme, Tiles, TilesProps, Tooltip, TooltipProps, TooltipThemeExtension, Tray, TrayProps, TrayWrapper, Underlay, UnderlayProps, UnderlayThemeExtension, XLoader, extendTheme, useCheckboxGroupContext, useFieldGroupContext };