@fattureincloud/fic-design-system 0.4.30 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.0 - 18/10/2022
4
+
5
+ ### 🚀 Added
6
+
7
+ - A completely new typography
8
+ - SegmentButton
9
+
10
+ ### 💅 Enhancement
11
+
12
+ - Datepicker input controls
13
+
14
+ ## v0.4.31 - 11/10/2022
15
+
16
+ ### 🚀 Added
17
+
18
+ - exports:
19
+ • ButtonPalette,
20
+ • DropdownItemType,
21
+ • iconColors,
22
+ • tagTypes,
23
+ • BadgePalette,
24
+ • BannerPalette,
25
+ • ChipPalette,
26
+ • FloatingBadgePalette,
27
+ • LabelPalette,
28
+ • PaginationPalette,
29
+ • ProgressBarPalette,
30
+ • bwColor,
31
+ • IconButtonPalette
32
+
3
33
  ## v0.4.30 - 29/09/2022
4
34
 
5
35
  ### 🚀 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,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
  import Dropdown from './dropdown';
2
2
  import dropdownPalette, { DropdownPalette } from './dropdownPalette';
3
- import { closeDropdownType, DropdownItemProps, renderContentType } from './types';
4
- export { Dropdown, closeDropdownType, renderContentType, dropdownPalette, DropdownPalette, DropdownItemProps };
3
+ import { closeDropdownType, DropdownItemProps, DropdownItemType, renderContentType } from './types';
4
+ export { Dropdown, closeDropdownType, renderContentType, dropdownPalette, DropdownPalette, DropdownItemProps, DropdownItemType, };
@@ -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;
@@ -1,4 +1,4 @@
1
1
  import { IconBackground, IconBackgroundPalette, iconBackgroundPalette } from './components/iconBackground';
2
2
  import Icon, { IconProps } from './Icon';
3
- import iconPalette, { IconPalette } from './iconPalette';
4
- export { Icon, IconProps, IconPalette, iconPalette, IconBackground, iconBackgroundPalette, IconBackgroundPalette };
3
+ import iconPalette, { iconColors, IconPalette } from './iconPalette';
4
+ export { Icon, IconProps, IconPalette, iconPalette, IconBackground, iconBackgroundPalette, IconBackgroundPalette, iconColors, };
@@ -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 } 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
+ };
@@ -1,4 +1,4 @@
1
1
  import { Tag } from './Tag';
2
- import tagPalette, { TagPalette } from './tagPalette';
2
+ import tagPalette, { TagPalette, tagTypes } from './tagPalette';
3
3
  import { TagProps } from './types';
4
- export { Tag, TagProps, tagPalette, TagPalette };
4
+ export { Tag, TagProps, tagPalette, TagPalette, tagTypes };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,9 @@
1
1
  import Spinner from './common/components/Spinner';
2
2
  import { Accordion } from './components/accordions';
3
3
  import { Avatar } from './components/avatar';
4
- export { Banner, BannerProps, BannerType } from './components/banner';
5
- export { Badge, BadgeProps, BadgeType } from './components/badge';
6
- import { Button, ButtonProps, IconButton, IconButtonProps } from './components/buttons';
7
- export { Chip, ChipType } from './components/chip';
4
+ import { Button, ButtonPalette, ButtonProps, IconButton, IconButtonPalette, IconButtonProps } from './components/buttons';
8
5
  import { Drawer } from './components/drawer';
9
- import { closeDropdownType, Dropdown, DropdownItemProps, DropdownPalette, renderContentType } from './components/dropdown';
10
- export { NotificationBadge, WithBadge, FloatingBadgeType } from './components/floatingBadge';
6
+ import { closeDropdownType, Dropdown, DropdownItemProps, DropdownItemType, DropdownPalette, renderContentType } from './components/dropdown';
11
7
  import { Checkbox, CheckboxPalette, CheckboxProps, CheckboxStatus, useCheckboxValue } from './components/form/checkbox';
12
8
  import { DatePicker, DatePickerPalette, DatePickerProps, timeConversionOptions, useFormattedDate } from './components/form/datepicker';
13
9
  import { FileRejection, FileUploader, fileUploaderOnDrop, FileUploaderPalette, FileUploaderProps } from './components/form/fileUploader';
@@ -18,26 +14,33 @@ import { RadioGroup, RadioGroupOptions, RadioGroupProps } from './components/for
18
14
  import { AsyncCreatableSelect, AsyncCreatableSelectProps, AsyncSelect, AsyncSelectProps, CreatableSelect, CreatableSelectProps, isSimpleValue, OptionType, Select, SelectComponentsType, SelectPalette, SelectProps, simpleValue, useSelectMultiValues, useSelectSimpleValue, useSelectValue } from './components/form/select';
19
15
  import { TextArea, TextAreaPalette, TextAreaProps } from './components/form/textArea';
20
16
  import { GroupedList, GroupType, ItemType } from './components/groupedList';
21
- import { Icon, IconPalette, IconProps } from './components/icon';
17
+ import { Icon, iconColors, IconPalette, IconProps } from './components/icon';
22
18
  import { IconBackground, IconBackgroundPalette } from './components/icon/components/iconBackground';
23
19
  import { InlineMessage, InlineMessagePalette, InlineMessageProps, InlineMessageType } from './components/inlineMessage';
24
- export { CustomSidebarItemProps, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, SidebarBadgeConfigType, SidebarBadgeConfigProps, } from './components/layout';
25
20
  import { MicroTag, MicroTagPalette, MicroTagProps } from './components/microTag';
26
21
  import { Modal, ModalSearchable } from './components/modals';
27
22
  import { ConfirmationModal } from './components/modals/confirmationModal';
28
23
  import { ModalBody } from './components/modals/modalStyled';
29
24
  import { PageEmptySet } from './components/pageEmptySet';
30
- export { Pagination, PaginationType } from './components/pagination';
31
- export { ProgressBar, ProgressBarType } from './components/progressbar';
32
25
  import { Stepper, StepperPalette, StepperProps } from './components/stepper';
33
26
  import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/table';
34
27
  import { DropdownTabs, ScrollableTabs, TabsItem } from './components/tabs';
35
- import { Tag, TagPalette, TagProps } from './components/tag';
28
+ import { Tag, TagPalette, TagProps, tagTypes } from './components/tag';
36
29
  import { ThemeProvider } from './components/themeProvider';
37
- export { ShortcutTip, ShortcutTipProps, Tip, TipPalette, TipProps, TipType } from './components/tip';
38
30
  import { Toast, ToastPalette, toastPalette, ToastProps, ToastType } from './components/toast';
39
31
  import { Tooltip, TooltipPalette, TooltipProps } from './components/tooltip';
40
32
  import { autocompleteYellow } from './styles/defaultPalette/colors/others';
41
33
  import { Theme } from './styles/theme';
42
34
  import { Palette, paletteColor } from './styles/types';
43
- export { autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, IconButton, IconButtonProps, Icon, IconProps, IconPalette, 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, 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, InputText, InputTextProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };
35
+ export { Badge, BadgeProps, BadgeType, BadgePalette } from './components/badge';
36
+ export { Banner, BannerProps, BannerType, BannerPalette } from './components/banner';
37
+ export { Chip, ChipType, ChipPalette, ChipProps } from './components/chip';
38
+ export { FloatingBadgePalette, FloatingBadgeType, NotificationBadge, WithBadge } from './components/floatingBadge';
39
+ export { LabelPalette } from './components/form/label';
40
+ export { CustomSidebarItemProps, SidebarBadgeConfigProps, SidebarBadgeConfigType, SidebarItem, sidebarItemHeight, SidebarItemPalette, SidebarItemProps, } from './components/layout';
41
+ export { Pagination, PaginationPalette, PaginationType } from './components/pagination';
42
+ export { ProgressBar, ProgressBarPalette, ProgressBarProps, ProgressBarType } from './components/progressbar';
43
+ export { SegmentButton, SegmentButtonPalette } from './components/segmentButton';
44
+ export { ShortcutTip, ShortcutTipProps, Tip, TipPalette, TipProps, TipType } from './components/tip';
45
+ export { bwColor } from './styles/types';
46
+ 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, };