@veeqo/ui 9.0.1 → 9.1.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 (31) hide show
  1. package/dist/components/SelectDropdown/ListItem/ListItem.d.ts +3 -0
  2. package/dist/components/SelectDropdown/ListItem/components/CheckboxIndicator.d.ts +2 -0
  3. package/dist/components/SelectDropdown/ListItem/components/ListItemContent.d.ts +3 -0
  4. package/dist/components/SelectDropdown/ListItem/components/RadioIndicator.d.ts +2 -0
  5. package/dist/components/SelectDropdown/ListItem/components/SelectionType.d.ts +8 -0
  6. package/dist/components/SelectDropdown/ListItem/components/types.d.ts +11 -0
  7. package/dist/components/SelectDropdown/ListItem/index.d.ts +1 -0
  8. package/dist/components/SelectDropdown/ListItem/styled.d.ts +21 -0
  9. package/dist/components/SelectDropdown/ListItem/types.d.ts +22 -0
  10. package/dist/components/SelectDropdown/ListItemSection/ListItemSection.d.ts +10 -0
  11. package/dist/components/SelectDropdown/ListItemSection/index.d.ts +1 -0
  12. package/dist/components/SelectDropdown/ListItemSection/styled.d.ts +3 -0
  13. package/dist/components/SelectDropdown/SelectDropdown.d.ts +3 -0
  14. package/dist/components/SelectDropdown/components/SelectDropdownState.d.ts +7 -0
  15. package/dist/components/SelectDropdown/components/SelectedOption.d.ts +9 -0
  16. package/dist/components/SelectDropdown/index.d.ts +27 -0
  17. package/dist/components/SelectDropdown/styled.d.ts +19 -0
  18. package/dist/components/SelectDropdown/types.d.ts +35 -0
  19. package/dist/components/SelectDropdown/utils.d.ts +4 -0
  20. package/dist/hoc/withLabels/withLabels.cjs +5 -2
  21. package/dist/hoc/withLabels/withLabels.cjs.map +1 -1
  22. package/dist/hoc/withLabels/withLabels.js +5 -2
  23. package/dist/hoc/withLabels/withLabels.js.map +1 -1
  24. package/dist/tempIcons/ActiveCheckboxIcon.d.ts +2 -0
  25. package/dist/tempIcons/ActiveRadioIcon.d.ts +2 -0
  26. package/dist/tempIcons/DestructiveIcon.d.ts +2 -0
  27. package/dist/tempIcons/DragIndicatorIcon.d.ts +2 -0
  28. package/dist/tempIcons/InactiveCheckboxIcon.d.ts +2 -0
  29. package/dist/tempIcons/InactiveRadioIcon.d.ts +2 -0
  30. package/dist/tempIcons/PlusIcon.d.ts +2 -0
  31. package/package.json +3 -2
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ListItemProps } from './types';
3
+ export declare const ListItem: ({ id, label, href, ...props }: ListItemProps) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CheckboxIndicator: ({ checked, ...otherProps }: any) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ListItemContentProps } from './types';
3
+ export declare const ListItemContent: ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging, selectionMode, isLink, isSelected, }: ListItemContentProps) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const RadioIndicator: ({ checked, ...otherProps }: any) => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type SelectionTypeProps = {
3
+ selectionMode: 'single' | 'multiple' | 'none';
4
+ isSelected: boolean;
5
+ isLink?: boolean;
6
+ };
7
+ export declare const SelectionType: ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => React.JSX.Element | null;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { BasicListItemProps } from '../types';
2
+ export type ListItemContentProps = BasicListItemProps & {
3
+ /** renders a drag icon */
4
+ allowsDragging?: boolean;
5
+ /** renders a checkbox or radio depending on state, default is radio */
6
+ selectionMode?: 'single' | 'multiple' | 'none';
7
+ /** shows item in selected state */
8
+ isSelected?: boolean;
9
+ /** Renders icon to indicate item is a link */
10
+ isLink?: boolean;
11
+ };
@@ -0,0 +1 @@
1
+ export { ListItem } from './ListItem';
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledListItem: import("styled-components").StyledComponent<(<T extends object>(props: import("react-aria-components").ListBoxItemProps<T> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>), any, {
3
+ appearance?: "primary" | "secondary" | undefined;
4
+ }, never>;
5
+ export declare const StyledListBox: import("styled-components").StyledComponent<(<T extends object>(props: import("react-aria-components").ListBoxProps<T> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>), any, {}, never>;
6
+ export declare const LinkIcon: import("styled-components").StyledComponent<(props: any) => import("react").JSX.Element, any, {
7
+ width: string;
8
+ height: string;
9
+ }, "height" | "width">;
10
+ export declare const HorizontalContainer: import("styled-components").StyledComponent<"div", any, import("../../Stack/types").StackProps & {
11
+ direction: string;
12
+ alignY: string;
13
+ }, "direction" | "alignY">;
14
+ export declare const VerticalContainer: import("styled-components").StyledComponent<"div", any, import("../../Stack/types").StackProps & {
15
+ spacing: string;
16
+ }, "spacing">;
17
+ export declare const InfoContainer: import("styled-components").StyledComponent<"div", any, {
18
+ hasItemInfoSlot: boolean;
19
+ hasEndInfoSlot: boolean;
20
+ }, never>;
21
+ export declare const ItemInfoContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,22 @@
1
+ import { ReactElement } from 'react';
2
+ import { ListBoxItemProps } from 'react-aria-components';
3
+ export type BasicListItemProps = {
4
+ id?: string;
5
+ /** Label for the item */
6
+ label: string;
7
+ /** Renders the media provided, e.g Image or Icon */
8
+ mediaSlot?: ReactElement;
9
+ /** Hint text for the item */
10
+ hint?: string;
11
+ /** Slot for extra info for the item, e.g (Tooltip, mini-tag) */
12
+ itemInfoSlot?: ReactElement;
13
+ endInfoSlot?: ReactElement;
14
+ /** Renders mini alert, e.g (Low stock) */
15
+ alert?: {
16
+ title: string;
17
+ variant: 'success' | 'error' | 'warning' | 'info' | 'default' | 'recommend';
18
+ };
19
+ /** Used to differentiate between items */
20
+ appearance?: 'primary' | 'secondary';
21
+ };
22
+ export type ListItemProps = ListBoxItemProps & BasicListItemProps;
@@ -0,0 +1,10 @@
1
+ import React, { ReactElement } from 'react';
2
+ import { SectionProps } from 'react-aria-components';
3
+ import { ListItemProps } from '../ListItem/types';
4
+ export type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {
5
+ label: string;
6
+ hint?: string;
7
+ itemInfoSlot?: ReactElement;
8
+ items?: ListItemProps[];
9
+ };
10
+ export declare const ListItemSection: ({ label, hint, itemInfoSlot, items, children, ...props }: ListItemSectionProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { ListItemSection } from './ListItemSection';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const InfoContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const StyledSection: import("styled-components").StyledComponent<(<T extends object>(props: import("react-aria-components").SectionProps<T> & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>), any, {}, never>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { SelectDropdownProps } from './types';
3
+ export declare const SelectDropdown: ({ id, className, placeholder, multiple, compact, hasError, options, value, actions, isLoading, searchValue, emptyStateSlot, onSearchChange, onChange, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...otherProps }: SelectDropdownProps) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React, { ReactElement } from 'react';
2
+ type SelectDropdownStateProps = {
3
+ isLoading: boolean;
4
+ emptyStateSlot?: ReactElement;
5
+ };
6
+ export declare const SelectDropdownState: ({ isLoading, emptyStateSlot }: SelectDropdownStateProps) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { SelectDropdownItem } from '../types';
3
+ type SelectedOptionProps = {
4
+ placeholder: string;
5
+ options: SelectDropdownItem[];
6
+ selectionMode: 'single' | 'multiple';
7
+ };
8
+ export declare const SelectedOption: ({ placeholder, options, selectionMode }: SelectedOptionProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ export declare const SelectDropdown: import("react").FC<{
3
+ children?: import("react").ReactNode | ((item: import("./types").SelectDropdownItem) => import("react").ReactNode);
4
+ onScroll?: ((e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void) | undefined;
5
+ disabledKeys?: Iterable<import("react-aria").Key> | undefined;
6
+ dragAndDropHooks?: import("react-aria-components").DragAndDropHooks | undefined;
7
+ } & {
8
+ id?: string | undefined;
9
+ className?: string | undefined;
10
+ multiple?: boolean | undefined;
11
+ compact?: boolean | undefined;
12
+ hasError?: boolean | undefined;
13
+ options: import("./types").SelectDropdownItem[];
14
+ emptyStateSlot?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
15
+ isLoading?: boolean | undefined;
16
+ onChange: (selectedItems: import("./types").SelectDropdownItem[]) => void;
17
+ value?: import("react-aria").Key[] | undefined;
18
+ placeholder?: string | undefined;
19
+ actions?: (Omit<import("../Button/types").ButtonProps, "variant"> & {
20
+ label: string;
21
+ })[] | undefined;
22
+ searchValue?: string | undefined;
23
+ onSearchChange?: ((value: string) => void) | undefined;
24
+ 'aria-label'?: string | undefined;
25
+ 'aria-labelledby'?: string | undefined;
26
+ 'aria-describedby'?: string | undefined;
27
+ } & import("../../hoc/withLabels/withLabels").WithLabelsProps>;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { DropdownProps } from '../Dropdown/types';
3
+ export declare const StyledListBox: import("styled-components").StyledComponent<(<T extends object>(props: import("react-aria-components").ListBoxProps<T> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>), any, {}, never>;
4
+ export declare const StyledDropdown: React.FC<DropdownProps & {
5
+ hasError: boolean;
6
+ }>;
7
+ export declare const StyledSearch: import("styled-components").StyledComponent<({ type, disabled, onClearClick, onChange, onBlur, onFocus, onKeyUp, onKeyDown, onKeyPress, value, error, placeholder, className, name, isLoading, fill, reversed, autoComplete, size, }: import("../Search/types").SearchProps) => import("react").JSX.Element, any, {}, never>;
8
+ export declare const Separator: import("styled-components").StyledComponent<"hr", any, {}, never>;
9
+ export declare const CTAButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
10
+ children?: import("react").ReactNode;
11
+ variant?: import("../Button/types").ButtonVariant | undefined;
12
+ size?: "base" | "sm" | undefined;
13
+ iconSlot?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
14
+ dropdown?: boolean | undefined;
15
+ loading?: boolean | undefined;
16
+ contentStyles?: import("react").CSSProperties | undefined;
17
+ } & import("react").RefAttributes<HTMLButtonElement>>, any, {
18
+ variant: "flat";
19
+ }, "variant">;
@@ -0,0 +1,35 @@
1
+ import { Key, ListBoxProps } from 'react-aria-components';
2
+ import { ReactElement } from 'react';
3
+ import { ButtonProps } from '../Button/types';
4
+ import { ListItemProps } from './ListItem/types';
5
+ import { ListItemSectionProps } from './ListItemSection/ListItemSection';
6
+ export type SelectDropdownProps = ImportedListBoxProps & {
7
+ id?: string;
8
+ className?: string;
9
+ multiple?: boolean;
10
+ compact?: boolean;
11
+ hasError?: boolean;
12
+ options: SelectDropdownItem[];
13
+ emptyStateSlot?: ReactElement;
14
+ isLoading?: boolean;
15
+ onChange: (selectedItems: SelectDropdownItem[]) => void;
16
+ value?: Key[];
17
+ placeholder?: string;
18
+ actions?: CTAButtonProps[];
19
+ searchValue?: string;
20
+ onSearchChange?: (value: string) => void;
21
+ 'aria-label'?: string;
22
+ 'aria-labelledby'?: string;
23
+ 'aria-describedby'?: string;
24
+ };
25
+ type CTAButtonProps = Omit<ButtonProps, 'variant'> & {
26
+ label: string;
27
+ };
28
+ export type SelectDropdownItem = ListItemProps | ListItemSectionProps;
29
+ type ImportedListBoxProps = Pick<ListBoxProps<SelectDropdownItem>, 'children' | 'dragAndDropHooks' | 'onScroll' | 'disabledKeys'>;
30
+ export type ClassNamesReturnPayload = {
31
+ button?: string;
32
+ optionsContainer?: string;
33
+ popover?: string;
34
+ };
35
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Key } from 'react-aria-components';
2
+ import { ClassNamesReturnPayload, SelectDropdownItem } from './types';
3
+ export declare const getValuesFromKeys: (items: SelectDropdownItem[], hasSection: boolean, keys?: Key[]) => SelectDropdownItem[];
4
+ export declare const generateClassNames: (prefix?: string) => ClassNamesReturnPayload;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var AttentionIcon = require('../../tempIcons/AttentionIcon.cjs');
4
5
  var index = require('../../theme/index.cjs');
5
6
  var Stack = require('../../components/Stack/Stack.cjs');
6
7
  var styled = require('./styled.cjs');
@@ -21,9 +22,11 @@ const withLabels = (Component) => ({ label, hint, error, tooltip, ...otherProps
21
22
  React__default.default.createElement(styled.Label, { id: `${componentId}-label`, htmlFor: componentId }, label),
22
23
  tooltip && (React__default.default.createElement(styled.BlockTooltip, { text: tooltip },
23
24
  React__default.default.createElement(HelpIcon.HelpIcon, { width: index.theme.sizes.base, height: index.theme.sizes.base, color: index.theme.colors.neutral.ink.light })))),
24
- hint && React__default.default.createElement(styled.Hint, null, hint)),
25
+ hint && React__default.default.createElement(styled.Hint, { id: `${componentId}-hint` }, hint)),
25
26
  React__default.default.createElement(Component, { id: componentId, hasError: !!error, ...otherProps }),
26
- error && React__default.default.createElement(styled.Error, null, error)));
27
+ error && (React__default.default.createElement(Stack.Stack, { direction: "horizontal", alignY: "center", spacing: "xs" },
28
+ React__default.default.createElement(AttentionIcon.AttentionIcon, { width: 16, height: 16, color: index.theme.colors.secondary.red.base }),
29
+ React__default.default.createElement(styled.Error, null, error)))));
27
30
  };
28
31
 
29
32
  exports.withLabels = withLabels;
@@ -1 +1 @@
1
- {"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, FC } from 'react';\nimport { theme } from '../../theme';\nimport { Stack } from '../../components/Stack';\n\nimport { RootStack, Label, Hint, Error, BlockTooltip } from './styled';\nimport { HelpIcon } from '../../tempIcons/HelpIcon';\nimport { useId } from '../../hooks/useId';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: string;\n hint?: string | React.ReactNode;\n error?: string;\n tooltip?: string;\n}\n\nexport const withLabels =\n <P extends object>(Component: ComponentType<P>): FC<P & WithLabelsProps> =>\n ({ label, hint, error, tooltip, ...otherProps }: WithLabelsProps) => {\n const componentId = useId({ id: otherProps?.id, prefix: Component.name });\n\n if (!label) return <Component hasError={!!error} {...(otherProps as P)} />;\n\n return (\n <RootStack spacing=\"sm\" alignX=\"stretch\">\n <div style={{ marginBottom: theme.sizes.xs }}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n <Label id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Label>\n {tooltip && (\n <BlockTooltip text={tooltip}>\n <HelpIcon\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </Stack>\n {hint && <Hint>{hint}</Hint>}\n </div>\n <Component id={componentId} hasError={!!error} {...(otherProps as P)} />\n {error && <Error>{error}</Error>}\n </RootStack>\n );\n };\n"],"names":["useId","React","RootStack","theme","Stack","Label","BlockTooltip","HelpIcon","Hint","Error"],"mappings":";;;;;;;;;;;;;MAgBa,UAAU,GACrB,CAAmB,SAA2B,KAC9C,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAAmB,KAAI;IAClE,MAAM,WAAW,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,SAAA,GAAA,SAAA,GAAV,UAAU,CAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzE,IAAA,IAAI,CAAC,KAAK;QAAE,OAAOC,sBAAA,CAAA,aA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AA,EAAE,KAAK,CAAS,CACtB;AAEhB;;;;"}
1
+ {"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, FC } from 'react';\nimport { AttentionIcon } from '../../tempIcons/AttentionIcon';\nimport { theme } from '../../theme';\nimport { Stack } from '../../components/Stack';\n\nimport { RootStack, Label, Hint, Error, BlockTooltip } from './styled';\nimport { HelpIcon } from '../../tempIcons/HelpIcon';\nimport { useId } from '../../hooks/useId';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: string;\n hint?: string | React.ReactNode;\n error?: string;\n tooltip?: string;\n}\n\nexport const withLabels =\n <P extends object>(Component: ComponentType<P>): FC<P & WithLabelsProps> =>\n ({ label, hint, error, tooltip, ...otherProps }: WithLabelsProps) => {\n const componentId = useId({ id: otherProps?.id, prefix: Component.name });\n\n if (!label) return <Component hasError={!!error} {...(otherProps as P)} />;\n\n return (\n <RootStack spacing=\"sm\" alignX=\"stretch\">\n <div style={{ marginBottom: theme.sizes.xs }}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n <Label id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Label>\n {tooltip && (\n <BlockTooltip text={tooltip}>\n <HelpIcon\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </Stack>\n {hint && <Hint id={`${componentId}-hint`}>{hint}</Hint>}\n </div>\n <Component id={componentId} hasError={!!error} {...(otherProps as P)} />\n {error && (\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"xs\">\n <AttentionIcon width={16} height={16} color={theme.colors.secondary.red.base} />\n <Error>{error}</Error>\n </Stack>\n )}\n </RootStack>\n );\n };\n"],"names":["useId","React","RootStack","theme","Stack","Label","BlockTooltip","HelpIcon","Hint","AttentionIcon","Error"],"mappings":";;;;;;;;;;;;;;MAiBa,UAAU,GACrB,CAAmB,SAA2B,KAC9C,CAAC,EAAE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AAC,KAAK,EACrC,CAAA,CACW,CAChB,CACK;AACP,YAAA,IAAI,IAAIF,sBAAA,CAAA,aAAA,CAACO,WAAI,EAAA,EAAC,EAAE,EAAE,CAAG,EAAA,WAAW,CAAO,KAAA,CAAA,EAAA,EAAG,IAAI,CAAQ,CACnD;AACN,QAAAP,sBAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAA,GAAO,UAAgB,EAAI,CAAA;AACvE,QAAA,KAAK,KACJA,sBAAC,CAAA,aAAA,CAAAG,WAAK,IAAC,SAAS,EAAC,YAAY,EAAC,MAAM,EAAC,QAAQ,EAAC,OAAO,EAAC,IAAI,EAAA;YACxDH,sBAAC,CAAA,aAAA,CAAAQ,2BAAa,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAEN,WAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAI,CAAA;YAChFF,sBAAC,CAAA,aAAA,CAAAS,YAAK,QAAE,KAAK,CAAS,CAChB,CACT,CACS;AAEhB;;;;"}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { AttentionIcon } from '../../tempIcons/AttentionIcon.js';
2
3
  import { theme } from '../../theme/index.js';
3
4
  import { Stack } from '../../components/Stack/Stack.js';
4
5
  import { RootStack, Label, BlockTooltip, Hint, Error } from './styled.js';
@@ -15,9 +16,11 @@ const withLabels = (Component) => ({ label, hint, error, tooltip, ...otherProps
15
16
  React.createElement(Label, { id: `${componentId}-label`, htmlFor: componentId }, label),
16
17
  tooltip && (React.createElement(BlockTooltip, { text: tooltip },
17
18
  React.createElement(HelpIcon, { width: theme.sizes.base, height: theme.sizes.base, color: theme.colors.neutral.ink.light })))),
18
- hint && React.createElement(Hint, null, hint)),
19
+ hint && React.createElement(Hint, { id: `${componentId}-hint` }, hint)),
19
20
  React.createElement(Component, { id: componentId, hasError: !!error, ...otherProps }),
20
- error && React.createElement(Error, null, error)));
21
+ error && (React.createElement(Stack, { direction: "horizontal", alignY: "center", spacing: "xs" },
22
+ React.createElement(AttentionIcon, { width: 16, height: 16, color: theme.colors.secondary.red.base }),
23
+ React.createElement(Error, null, error)))));
21
24
  };
22
25
 
23
26
  export { withLabels };
@@ -1 +1 @@
1
- {"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, FC } from 'react';\nimport { theme } from '../../theme';\nimport { Stack } from '../../components/Stack';\n\nimport { RootStack, Label, Hint, Error, BlockTooltip } from './styled';\nimport { HelpIcon } from '../../tempIcons/HelpIcon';\nimport { useId } from '../../hooks/useId';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: string;\n hint?: string | React.ReactNode;\n error?: string;\n tooltip?: string;\n}\n\nexport const withLabels =\n <P extends object>(Component: ComponentType<P>): FC<P & WithLabelsProps> =>\n ({ label, hint, error, tooltip, ...otherProps }: WithLabelsProps) => {\n const componentId = useId({ id: otherProps?.id, prefix: Component.name });\n\n if (!label) return <Component hasError={!!error} {...(otherProps as P)} />;\n\n return (\n <RootStack spacing=\"sm\" alignX=\"stretch\">\n <div style={{ marginBottom: theme.sizes.xs }}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n <Label id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Label>\n {tooltip && (\n <BlockTooltip text={tooltip}>\n <HelpIcon\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </Stack>\n {hint && <Hint>{hint}</Hint>}\n </div>\n <Component id={componentId} hasError={!!error} {...(otherProps as P)} />\n {error && <Error>{error}</Error>}\n </RootStack>\n );\n };\n"],"names":[],"mappings":";;;;;;;MAgBa,UAAU,GACrB,CAAmB,SAA2B,KAC9C,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAA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A,CAAA,IAAI,EAAE,IAAA,EAAA,IAAI,CAAQ,CACxB;AACN,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAA,GAAO,UAAgB,EAAI,CAAA;QACvE,KAAK,IAAI,oBAAC,KAAK,EAAA,IAAA,EAAE,KAAK,CAAS,CACtB;AAEhB;;;;"}
1
+ {"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, FC } from 'react';\nimport { AttentionIcon } from '../../tempIcons/AttentionIcon';\nimport { theme } from '../../theme';\nimport { Stack } from '../../components/Stack';\n\nimport { RootStack, Label, Hint, Error, BlockTooltip } from './styled';\nimport { HelpIcon } from '../../tempIcons/HelpIcon';\nimport { useId } from '../../hooks/useId';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: string;\n hint?: string | React.ReactNode;\n error?: string;\n tooltip?: string;\n}\n\nexport const withLabels =\n <P extends object>(Component: ComponentType<P>): FC<P & WithLabelsProps> =>\n ({ label, hint, error, tooltip, ...otherProps }: WithLabelsProps) => {\n const componentId = useId({ id: otherProps?.id, prefix: Component.name });\n\n if (!label) return <Component hasError={!!error} {...(otherProps as P)} />;\n\n return (\n <RootStack spacing=\"sm\" alignX=\"stretch\">\n <div style={{ marginBottom: theme.sizes.xs }}>\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"sm\">\n <Label id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Label>\n {tooltip && (\n <BlockTooltip text={tooltip}>\n <HelpIcon\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </Stack>\n {hint && <Hint id={`${componentId}-hint`}>{hint}</Hint>}\n </div>\n <Component id={componentId} hasError={!!error} {...(otherProps as P)} />\n {error && (\n <Stack direction=\"horizontal\" alignY=\"center\" spacing=\"xs\">\n <A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AC,KAAK,CAAC,IAAI,EACvB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EACxB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EACrC,CAAA,CACW,CAChB,CACK;AACP,YAAA,IAAI,IAAI,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,EAAE,EAAE,CAAG,EAAA,WAAW,CAAO,KAAA,CAAA,EAAA,EAAG,IAAI,CAAQ,CACnD;AACN,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAA,GAAO,UAAgB,EAAI,CAAA;AACvE,QAAA,KAAK,KACJ,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,SAAS,EAAC,YAAY,EAAC,MAAM,EAAC,QAAQ,EAAC,OAAO,EAAC,IAAI,EAAA;YACxD,KAAC,CAAA,aAAA,CAAA,aAAa,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAI,CAAA;YAChF,KAAC,CAAA,aAAA,CAAA,KAAK,QAAE,KAAK,CAAS,CAChB,CACT,CACS;AAEhB;;;;"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ActiveCheckboxIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ActiveRadioIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const DestructiveIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DragIndicatorIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const InactiveCheckboxIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const InactiveRadioIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const PlusIcon: (props: any) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "9.0.1",
3
+ "version": "9.1.0",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",
@@ -113,7 +113,8 @@
113
113
  "ts-jest": "^29.1.1",
114
114
  "tsc-alias": "^1.8.8",
115
115
  "typescript": "^5.2.2",
116
- "typescript-plugin-styled-components": "^3.0.0"
116
+ "typescript-plugin-styled-components": "^3.0.0",
117
+ "storybook-addon-deep-controls": "^0.9.2"
117
118
  },
118
119
  "peerDependencies": {
119
120
  "@internationalized/date": "^3.5.4",