@fattureincloud/fic-design-system 0.4.31 → 0.5.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/common/components/typography/Typography.d.ts +13 -0
  3. package/dist/common/components/typography/index.d.ts +1 -0
  4. package/dist/common/components/typography/types.d.ts +21 -0
  5. package/dist/common/components/typography/utils.d.ts +2 -0
  6. package/dist/common/types/dateTypes.d.ts +5 -0
  7. package/dist/common/utils/dateUtils.d.ts +3 -0
  8. package/dist/common/utils/dsUtils.d.ts +8 -0
  9. package/dist/components/avatar/Avatar.d.ts +1 -1
  10. package/dist/components/avatar/avatar.stories.d.ts +2 -2
  11. package/dist/components/avatar/index.d.ts +2 -2
  12. package/dist/components/avatar/styled.d.ts +3 -0
  13. package/dist/components/avatar/types.d.ts +18 -6
  14. package/dist/components/avatar/utils.d.ts +4 -0
  15. package/dist/components/badge/Badge.d.ts +2 -2
  16. package/dist/components/dropdown/types.d.ts +1 -2
  17. package/dist/components/form/datepicker/hooks/useFormattedDate.d.ts +1 -1
  18. package/dist/components/form/datepicker/types.d.ts +0 -3
  19. package/dist/components/form/datepicker/utils.d.ts +1 -1
  20. package/dist/components/inlineMessage/InlineMessage.d.ts +1 -1
  21. package/dist/components/segmentButton/SegmentButton.d.ts +4 -0
  22. package/dist/components/segmentButton/index.d.ts +3 -0
  23. package/dist/components/segmentButton/segmentButton.stories.d.ts +5 -0
  24. package/dist/components/segmentButton/segmentButtonPalette.d.ts +3 -0
  25. package/dist/components/segmentButton/styled.d.ts +7 -0
  26. package/dist/components/segmentButton/types.d.ts +26 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.esm.js +5 -5
  29. package/dist/index.esm.js.map +1 -1
  30. package/dist/index.js +4 -4
  31. package/dist/index.js.map +1 -1
  32. package/dist/styles/theme.d.ts +2 -0
  33. package/dist/styles/types.d.ts +6 -4
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.1 - 25/10/2022
4
+
5
+ ### 🐛 Bug Fix
6
+
7
+ - DatePicker format
8
+ - InlineMessage onActionClick
9
+ - Confirmation modal buttons position
10
+
11
+ ### 💅 Enhancement
12
+
13
+ - Avatar refactor
14
+
15
+ ## v0.5.0 - 18/10/2022
16
+
17
+ ### 🚀 Added
18
+
19
+ - A completely new typography
20
+ - SegmentButton
21
+
22
+ ### 💅 Enhancement
23
+
24
+ - Datepicker input controls
25
+
3
26
  ## v0.4.31 - 11/10/2022
4
27
 
5
28
  ### 🚀 Added
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { MapTextColorReturn, TextProps } from './types';
3
+ export declare const Body: ({ children, type, ...otherProps }: TextProps) => JSX.Element;
4
+ export declare const TextImpl: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, MapTextColorReturn & TextProps, "color">;
5
+ export declare const Title1: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const Title2: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const Title3: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const Title4: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const Title5: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const Title6: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
11
+ export declare const Headline: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
12
+ export declare const Caption: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const TableText: import("styled-components").StyledComponent<({ children, type, ...otherProps }: TextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1 @@
1
+ export { Body, Caption, Headline, Title1, Title2, Title3, Title4, Title5, Title6 } from './Typography';
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { DefaultTheme } from 'styled-components';
3
+ import { colors } from '../../../styles/types';
4
+ import { paletteColor } from '../../../styles/types';
5
+ export declare type TextProps = {
6
+ bold?: boolean;
7
+ centered?: boolean;
8
+ children: React.ReactNode | React.ReactNode[] | undefined | null;
9
+ clamp?: number;
10
+ className?: string;
11
+ color?: colors | paletteColor;
12
+ type?: 'date' | 'currency';
13
+ style?: React.CSSProperties;
14
+ };
15
+ export declare type MapTextColorParams = {
16
+ color?: TextProps['color'];
17
+ theme: DefaultTheme;
18
+ };
19
+ export declare type MapTextColorReturn = {
20
+ color: paletteColor | undefined;
21
+ };
@@ -0,0 +1,2 @@
1
+ import { MapTextColorParams, MapTextColorReturn } from './types';
2
+ export declare const mapTextColor: ({ color, theme }: MapTextColorParams) => MapTextColorReturn;
@@ -0,0 +1,5 @@
1
+ export declare const dateFormatsArray: [string, ...string[]];
2
+ export declare const timeFormat = "HH:mm:ss";
3
+ export declare const datetimeFormatsArray: [string, ...string[]];
4
+ export declare type DateFormat = typeof dateFormatsArray[number];
5
+ export declare type DateFormats = [DateFormat, ...DateFormat[]];
@@ -0,0 +1,3 @@
1
+ export declare const parseDate: (date: string) => Date | null;
2
+ export declare const format: (date: string, format: string) => string;
3
+ export declare const formatITDate: (date: string) => string;
@@ -1,3 +1,11 @@
1
1
  export declare const isNumber: (n: number | string | undefined) => boolean;
2
2
  export declare const parseDimension: (d: number | string) => string;
3
3
  export declare const generateRandomId: () => string;
4
+ export declare const stringToFloat: (n: string) => number;
5
+ export declare const isNumeric: (n: string) => boolean;
6
+ /**
7
+ * Convert a number into italian currency value with euro symbol
8
+ * @param {number} number
9
+ * @returns {string} string
10
+ */
11
+ export declare const currency: (number: number | string) => string;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AvatarProps } from './types';
3
- declare const Avatar: import("styled-components").StyledComponent<(props: AvatarProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
3
+ declare const Avatar: ({ backgroundColor, className, icon, image, onClick, placeholder, randomColor, size, style, text, textColor, }: AvatarProps) => JSX.Element;
4
4
  export default Avatar;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { Meta } from '@storybook/react';
3
3
  import { AvatarProps } from './types';
4
- export declare const Generic: () => JSX.Element;
5
4
  export declare const Initials: () => JSX.Element;
6
- export declare const Placeholder: () => JSX.Element;
5
+ export declare const RandomColor: () => JSX.Element;
7
6
  export declare const Image: () => JSX.Element;
7
+ export declare const Icon: () => JSX.Element;
8
8
  declare const AvatarStories: Meta<AvatarProps>;
9
9
  export default AvatarStories;
@@ -1,2 +1,2 @@
1
- import Avatar from './Avatar';
2
- export { Avatar };
1
+ export { default as Avatar } from './Avatar';
2
+ export { AvatarProps } from './types';
@@ -0,0 +1,3 @@
1
+ export declare const AvatarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<import("./types").AvatarProps, "size" | "backgroundColor" | "image" | "placeholder" | "onClick" | "textColor"> & {
2
+ textLenght: number;
3
+ }, never>;
@@ -1,8 +1,20 @@
1
- export interface AvatarProps {
1
+ import { MouseEvent } from 'react';
2
+ import { CSSObject } from 'styled-components';
3
+ import { paletteColor } from '../../styles/types';
4
+ import { IconProps } from '../icon';
5
+ export declare type AvatarProps = {
6
+ backgroundColor?: paletteColor;
2
7
  className?: string;
3
- initials?: string;
4
- size: AvatarAllowedSizes;
5
- placeholder?: string;
8
+ icon?: IconProps;
6
9
  image?: string;
7
- }
8
- export declare type AvatarAllowedSizes = 'xs' | 's' | 'm' | 'l';
10
+ onClick?: (e: MouseEvent) => void;
11
+ placeholder?: string;
12
+ randomColor?: boolean;
13
+ size: number;
14
+ style?: CSSObject;
15
+ text?: string;
16
+ textColor?: paletteColor;
17
+ };
18
+ export declare type AvatarContainerProps = Pick<AvatarProps, 'backgroundColor' | 'image' | 'onClick' | 'placeholder' | 'size' | 'textColor'> & {
19
+ textLenght: number;
20
+ };
@@ -0,0 +1,4 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ import { paletteColor } from '../../styles/types';
3
+ export declare const scalingFactor: (l: number) => number;
4
+ export declare const pseudoRandomColor: (text: string | undefined, theme: DefaultTheme) => paletteColor;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { BadgeProps } from './';
3
3
  /**
4
4
  * Component Props:
@@ -10,4 +10,4 @@ import { BadgeProps } from './';
10
10
  * @param {IconProps} rightIcon Configuration of the right icon
11
11
  * @param {function} handleRightIconClick Callback called on right icon click
12
12
  */
13
- export declare const Badge: (props: BadgeProps) => JSX.Element;
13
+ export declare const Badge: React.FC<BadgeProps>;
@@ -1,6 +1,5 @@
1
1
  import { Placement } from '@popperjs/core/lib/enums';
2
2
  import React, { CSSProperties, MouseEventHandler } from 'react';
3
- import { AvatarAllowedSizes } from '../avatar/types';
4
3
  import { IconProps } from '../icon';
5
4
  export declare type TitleProps = {
6
5
  text: string;
@@ -42,7 +41,7 @@ export interface DropdownItemProps {
42
41
  export interface UserListItemProps {
43
42
  img?: string;
44
43
  placeholder?: string;
45
- avatarSize?: AvatarAllowedSizes;
44
+ avatarSize?: number;
46
45
  noText?: string;
47
46
  text?: string;
48
47
  renderText?: JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { DateFormats } from '../types';
2
+ import { DateFormats } from '../../../../common/types/dateTypes';
3
3
  declare type ReturnType = [Date | null, Dispatch<SetStateAction<Date | null>>, string | null, string];
4
4
  /**
5
5
  * Hook to manage a date in string format
@@ -3,9 +3,6 @@ import { ReactDatePickerProps } from 'react-datepicker';
3
3
  import { CommonFormTypes } from '../common/types';
4
4
  import { LabelProps } from '../label';
5
5
  export declare type DatePickerStatus = 'dayPicker' | 'monthPicker' | 'yearPicker';
6
- export declare const dateFormatsArray: [string, ...string[]];
7
- export declare type DateFormat = typeof dateFormatsArray[number];
8
- export declare type DateFormats = [DateFormat, ...DateFormat[]];
9
6
  export declare type RenderCustomFooterType = (props: RenderCustomFooterProps) => ReactChild;
10
7
  export declare type CustomButtonProps = {
11
8
  text: string;
@@ -1,3 +1,3 @@
1
- import { DateFormats } from './types';
1
+ import { DateFormats } from '../../../common/types/dateTypes';
2
2
  export declare const timeConversionOptions: Intl.DateTimeFormatOptions;
3
3
  export declare const findFormat: (value: string | null | undefined, formats: DateFormats) => string;
@@ -18,5 +18,5 @@ import { InlineMessageProps } from './types';
18
18
  * @param {'medium' | 'large'} size fake size support
19
19
  *
20
20
  */
21
- declare const InlineMessage: (props: InlineMessageProps) => JSX.Element;
21
+ declare const InlineMessage: ({ onActionClick, ...props }: InlineMessageProps) => JSX.Element;
22
22
  export default InlineMessage;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SegmentButtonProps } from './types';
3
+ declare const SegmentButton: ({ onChange, preselected, segments }: SegmentButtonProps) => JSX.Element;
4
+ export default SegmentButton;
@@ -0,0 +1,3 @@
1
+ export { default as segmentButtonPalette } from './segmentButtonPalette';
2
+ export { SegmentButtonPalette, SegmentButtonProps, Segment } from './types';
3
+ export { default as SegmentButton } from './SegmentButton';
@@ -0,0 +1,5 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { SegmentButtonProps } from './types';
3
+ export declare const Standard: Story<SegmentButtonProps>;
4
+ declare const SegmentButtonStories: Meta<SegmentButtonProps>;
5
+ export default SegmentButtonStories;
@@ -0,0 +1,3 @@
1
+ import { SegmentButtonPalette } from './types';
2
+ declare const segmentButtonPalette: SegmentButtonPalette;
3
+ export default segmentButtonPalette;
@@ -0,0 +1,7 @@
1
+ declare type Props = {
2
+ active: boolean;
3
+ };
4
+ export declare const SegmentButtonContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const Segment: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Props, never>;
6
+ export declare const Badge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Props, never>;
7
+ export {};
@@ -0,0 +1,26 @@
1
+ import { paletteColor } from '../../styles/types';
2
+ import { IconProps } from '../icon';
3
+ export declare type SegmentButtonPalette = {
4
+ selected: {
5
+ background: paletteColor;
6
+ border: paletteColor;
7
+ primary: paletteColor;
8
+ secondary: paletteColor;
9
+ };
10
+ unselected: {
11
+ background: paletteColor;
12
+ border: paletteColor;
13
+ primary: paletteColor;
14
+ secondary: paletteColor;
15
+ };
16
+ };
17
+ export declare type Segment = {
18
+ counter?: number;
19
+ icon?: IconProps;
20
+ text: string;
21
+ };
22
+ export declare type SegmentButtonProps = {
23
+ onChange?: (i: number, s: Segment) => void;
24
+ preselected?: number;
25
+ segments: Segment[];
26
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import Spinner from './common/components/Spinner';
2
+ export { Body, Caption, Headline, Title1, Title2, Title3, Title4, Title5, Title6 } from './common/components/typography';
2
3
  import { Accordion } from './components/accordions';
3
4
  import { Avatar } from './components/avatar';
4
5
  import { Button, ButtonPalette, ButtonProps, IconButton, IconButtonPalette, IconButtonProps } from './components/buttons';
@@ -40,6 +41,7 @@ export { LabelPalette } from './components/form/label';
40
41
  export { CustomSidebarItemProps, SidebarBadgeConfigProps, SidebarBadgeConfigType, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, } from './components/layout';
41
42
  export { Pagination, PaginationPalette, PaginationType } from './components/pagination';
42
43
  export { ProgressBar, ProgressBarPalette, ProgressBarProps, ProgressBarType } from './components/progressbar';
44
+ export { Segment, SegmentButton, SegmentButtonPalette, SegmentButtonProps } from './components/segmentButton';
43
45
  export { ShortcutTip, ShortcutTipProps, Tip, TipPalette, TipProps, TipType } from './components/tip';
44
46
  export { bwColor } from './styles/types';
45
47
  export { autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, Table, TableProps, TableData, useTableValues, Row, Column, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Checkbox, useCheckboxValue, CheckboxProps, CheckboxPalette, CheckboxStatus, Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, useSelectSimpleValue, isSimpleValue, simpleValue, CreatableSelectProps, useSelectValue, useSelectMultiValues, SelectPalette, SelectComponentsType, OptionType, PageEmptySet, Modal, ModalBody, ModalSearchable, Tooltip, TooltipProps, TooltipPalette, Accordion, Drawer, Radio, useRadioValue, RadioProps, RadioPalette, RadioStatus, RadioGroup, RadioGroupProps, RadioGroupOptions, InlineMessage, InlineMessageProps, InlineMessagePalette, InlineMessageType, Dropdown, DropdownItemProps, DropdownPalette, DropdownItemType, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, TabsItem, Stepper, StepperProps, StepperPalette, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, Toast, ToastProps, toastPalette, ToastPalette, ToastType, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, tagTypes, InputText, InputTextProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };