@loja-integrada/admin-components 0.16.2 → 0.17.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 (55) hide show
  1. package/dist/Forms/Dropdown/Dropdown.d.ts +32 -3
  2. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.d.ts +10 -0
  3. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.spec.d.ts +1 -0
  4. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.stories.d.ts +10 -0
  5. package/dist/Forms/FloatingLabelInput/index.d.ts +1 -0
  6. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.d.ts +49 -0
  7. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.d.ts +1 -0
  8. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.d.ts +10 -0
  9. package/dist/Forms/FloatingLabelInputCurrency/index.d.ts +1 -0
  10. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.d.ts +18 -0
  11. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.d.ts +1 -0
  12. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.d.ts +19 -0
  13. package/dist/Forms/FloatingLabelInputMask/index.d.ts +1 -0
  14. package/dist/Forms/index.d.ts +3 -0
  15. package/dist/Icons/icons-path/Camera.d.ts +2 -0
  16. package/dist/Icons/icons-path/Lightbulb.d.ts +2 -0
  17. package/dist/Icons/icons-path/Nav.d.ts +2 -0
  18. package/dist/Icons/icons-path/ShoppingCart.d.ts +2 -0
  19. package/dist/Icons/icons-path/index.d.ts +4 -0
  20. package/dist/Indicators/InformationBox/InformationBox.d.ts +25 -0
  21. package/dist/Indicators/InformationBox/InformationBox.spec.d.ts +1 -0
  22. package/dist/Indicators/InformationBox/InformationBoxt.stories.d.ts +4 -0
  23. package/dist/Indicators/InformationBox/index.d.ts +1 -0
  24. package/dist/Indicators/index.d.ts +1 -0
  25. package/dist/admin-components.cjs.development.js +401 -15
  26. package/dist/admin-components.cjs.development.js.map +1 -1
  27. package/dist/admin-components.cjs.production.min.js +1 -1
  28. package/dist/admin-components.cjs.production.min.js.map +1 -1
  29. package/dist/admin-components.esm.js +396 -16
  30. package/dist/admin-components.esm.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/Forms/Dropdown/Dropdown.tsx +50 -15
  33. package/src/Forms/FloatingLabelInput/FloatingLabelInput.spec.tsx +25 -0
  34. package/src/Forms/FloatingLabelInput/FloatingLabelInput.stories.tsx +72 -0
  35. package/src/Forms/FloatingLabelInput/FloatingLabelInput.tsx +80 -0
  36. package/src/Forms/FloatingLabelInput/index.ts +1 -0
  37. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.tsx +15 -0
  38. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.tsx +72 -0
  39. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.tsx +251 -0
  40. package/src/Forms/FloatingLabelInputCurrency/index.ts +1 -0
  41. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.tsx +65 -0
  42. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.tsx +148 -0
  43. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.tsx +56 -0
  44. package/src/Forms/FloatingLabelInputMask/index.ts +1 -0
  45. package/src/Forms/index.ts +3 -0
  46. package/src/Icons/icons-path/Camera.tsx +9 -0
  47. package/src/Icons/icons-path/Lightbulb.tsx +9 -0
  48. package/src/Icons/icons-path/Nav.tsx +11 -0
  49. package/src/Icons/icons-path/ShoppingCart.tsx +11 -0
  50. package/src/Icons/icons-path/index.ts +8 -0
  51. package/src/Indicators/InformationBox/InformationBox.spec.tsx +27 -0
  52. package/src/Indicators/InformationBox/InformationBox.tsx +86 -0
  53. package/src/Indicators/InformationBox/InformationBoxt.stories.tsx +24 -0
  54. package/src/Indicators/InformationBox/index.tsx +1 -0
  55. package/src/Indicators/index.ts +1 -0
@@ -6,25 +6,47 @@ export declare const sizeClasses: {
6
6
  large: string;
7
7
  xlarge: string;
8
8
  };
9
+ export declare const valueFontSizesClasses: {
10
+ default: string;
11
+ small: string;
12
+ large: string;
13
+ xlarge: string;
14
+ };
9
15
  export declare const variantControlClasses: {
10
16
  default: string;
11
17
  secondary: string;
18
+ simple: string;
12
19
  };
13
20
  export declare const variantValueClasses: {
14
21
  default: string;
15
22
  secondary: string;
23
+ simple: string;
16
24
  };
17
25
  export declare const variantSelectedClasses: {
18
26
  default: string;
19
27
  secondary: string;
28
+ simple: string;
20
29
  };
21
30
  export declare const variantDisabledClasses: {
22
31
  default: string;
23
32
  secondary: string;
33
+ simple: string;
24
34
  };
25
35
  export declare const varianErrorClasses: {
26
36
  default: string;
27
37
  secondary: string;
38
+ simple: string;
39
+ };
40
+ export declare const valueContainerStyles: {
41
+ default: {
42
+ paddingLeft: number;
43
+ };
44
+ secondary: {
45
+ paddingLeft: number;
46
+ };
47
+ simple: {
48
+ paddingLeft: number;
49
+ };
28
50
  };
29
51
  export interface CustomOptionProps {
30
52
  value: string | number;
@@ -36,7 +58,9 @@ export interface CustomGroupedOptionsProps {
36
58
  label: string;
37
59
  options: CustomOptionProps[];
38
60
  }
39
- export declare type DropdownVariant = 'default' | 'secondary';
61
+ export declare type DropdownVariant = 'default' | 'secondary' | 'simple';
62
+ export declare type DropdownSizes = keyof typeof sizeClasses;
63
+ export declare type DropdownValueFontSizes = keyof typeof valueFontSizesClasses;
40
64
  export declare const Dropdown: React.MemoExoticComponent<React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<any>>>;
41
65
  export interface DropdownProps {
42
66
  /**
@@ -50,9 +74,14 @@ export interface DropdownProps {
50
74
  * Changes the size of dropdown
51
75
  * @default default
52
76
  * */
53
- size?: keyof typeof sizeClasses;
77
+ size?: DropdownSizes;
54
78
  /**
55
- * Changes the size of dropdown
79
+ * Changes the size of selected value
80
+ * @default default
81
+ * */
82
+ valueFontSize?: DropdownValueFontSizes;
83
+ /**
84
+ * Changes the variant of dropdown
56
85
  * @default default
57
86
  * */
58
87
  variant?: DropdownVariant;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export declare const FloatingLabelInput: React.MemoExoticComponent<React.ForwardRefExoticComponent<FloatingLabelInputProps & React.RefAttributes<HTMLInputElement>>>;
3
+ export interface FloatingLabelInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'sufix'> {
4
+ prefix?: React.ReactNode;
5
+ sufix?: React.ReactNode;
6
+ label?: string;
7
+ showLabel?: boolean;
8
+ className?: string;
9
+ textArea?: false;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { FloatingLabelInputProps } from './FloatingLabelInput';
2
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
5
+ export declare const Error: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
6
+ export declare const Prefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
7
+ export declare const IconPrefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
8
+ export declare const Sufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
9
+ export declare const IconSufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
10
+ export declare const WithBoth: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputProps>;
@@ -0,0 +1 @@
1
+ export * from './FloatingLabelInput';
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { defaultIntlConfig } from '../InputCurrency/utils';
3
+ export declare const FloatingLabelInputCurrency: React.MemoExoticComponent<React.ForwardRefExoticComponent<FloatingLabelInputCurrencyProps & React.RefAttributes<HTMLInputElement>>>;
4
+ export interface FloatingLabelInputCurrencyProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'sufix' | 'onChange' | 'onBlur' | 'onFocus' | 'onKeyPress'> {
5
+ prefix?: React.ReactNode;
6
+ sufix?: React.ReactNode;
7
+ label?: string;
8
+ showLabel?: boolean;
9
+ /** Currency to format value to
10
+ * @default 'BRL'
11
+ * */
12
+ currency?: keyof typeof defaultIntlConfig;
13
+ /** Max value allowed
14
+ * @default 1000000000000000
15
+ * */
16
+ max?: number | string;
17
+ /** Custom Intl config
18
+ * @deprecated Don't use, component already has its default config
19
+ * */
20
+ config?: any;
21
+ /** Should auto focus
22
+ * @default false
23
+ * */
24
+ autoFocus?: boolean;
25
+ /** Should auto select
26
+ * @default false
27
+ * */
28
+ autoSelect?: boolean;
29
+ /** Should auto reset
30
+ * @default false
31
+ * */
32
+ autoReset?: boolean;
33
+ /**
34
+ * onChange with additional params: (event, value, maskedValue)
35
+ * */
36
+ onChange?: (arg0: InputEvent, arg1: string | number, arg2: string | number) => void;
37
+ /**
38
+ * onBlur with additional params: (event, value, maskedValue)
39
+ * */
40
+ onBlur?: (arg0: InputEvent, arg1: string | number, arg2: string | number) => void;
41
+ /**
42
+ * onFocus with additional params: (event, value, maskedValue)
43
+ * */
44
+ onFocus?: (arg0: InputEvent, arg1: string | number, arg2: string | number) => void;
45
+ /**
46
+ * onKeyPress with additional params: (event, key, keyCode)
47
+ * */
48
+ onKeyPress?: (arg0: InputEvent, arg1: string | number, arg2: string | number) => void;
49
+ }
@@ -0,0 +1,10 @@
1
+ import { FloatingLabelInputCurrencyProps } from './FloatingLabelInputCurrency';
2
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
5
+ export declare const Error: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
6
+ export declare const Prefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
7
+ export declare const IconPrefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
8
+ export declare const Sufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
9
+ export declare const IconSufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
10
+ export declare const WithBoth: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputCurrencyProps>;
@@ -0,0 +1 @@
1
+ export * from './FloatingLabelInputCurrency';
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { MaskedInputProps as ReactMaskedInputProps } from 'react-text-mask';
3
+ import { FloatingLabelInputProps } from '../FloatingLabelInput/FloatingLabelInput';
4
+ import { formatValuePatterns } from '../InputMask/utils';
5
+ export declare const FloatingLabelInputMask: React.ForwardRefExoticComponent<FloatingLabelInputMaskProps & React.RefAttributes<HTMLInputElement>>;
6
+ export interface FloatingLabelInputMaskProps extends FloatingLabelInputProps {
7
+ /**
8
+ * Predefined masks. When used, will replace passed `mask` attr
9
+ * */
10
+ formatValue?: keyof typeof formatValuePatterns;
11
+ mask?: ReactMaskedInputProps['mask'];
12
+ guide?: ReactMaskedInputProps['guide'];
13
+ placeholderChar?: ReactMaskedInputProps['placeholderChar'];
14
+ keepCharPositions?: ReactMaskedInputProps['keepCharPositions'];
15
+ pipe?: ReactMaskedInputProps['pipe'];
16
+ showMask?: ReactMaskedInputProps['showMask'];
17
+ }
18
+ export declare type FloatingLabelInputMaskType = ReactMaskedInputProps['mask'];
@@ -0,0 +1,19 @@
1
+ import { FloatingLabelInputMaskProps } from './FloatingLabelInputMask';
2
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
5
+ export declare const Error: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
6
+ export declare const Prefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
7
+ export declare const IconPrefix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
8
+ export declare const Sufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
9
+ export declare const IconSufix: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
10
+ export declare const WithBoth: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
11
+ export declare const OnlyNumbers: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
12
+ export declare const OnlyText: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
13
+ export declare const ZipCode: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
14
+ export declare const Nfe: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
15
+ export declare const Phone: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
16
+ export declare const Cellphone: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
17
+ export declare const PhoneOrCellphone: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
18
+ export declare const CPF: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
19
+ export declare const CNPJ: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, FloatingLabelInputMaskProps>;
@@ -0,0 +1 @@
1
+ export * from './FloatingLabelInputMask';
@@ -7,3 +7,6 @@ export * from './Select';
7
7
  export * from './Toggle';
8
8
  export * from './Dropdown';
9
9
  export * from './Checkbox';
10
+ export * from './FloatingLabelInput';
11
+ export * from './FloatingLabelInputMask';
12
+ export * from './FloatingLabelInputCurrency';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Camera: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Lightbulb: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Nav: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ShoppingCart: () => JSX.Element;
@@ -17,6 +17,7 @@ export declare const icons: {
17
17
  blog: () => JSX.Element;
18
18
  bullhorn: () => JSX.Element;
19
19
  calendarAlt: () => JSX.Element;
20
+ camera: () => JSX.Element;
20
21
  check: () => JSX.Element;
21
22
  cog: () => JSX.Element;
22
23
  copy: () => JSX.Element;
@@ -35,14 +36,17 @@ export declare const icons: {
35
36
  halfBack: () => JSX.Element;
36
37
  home: () => JSX.Element;
37
38
  image: () => JSX.Element;
39
+ lightbulb: () => JSX.Element;
38
40
  moneyBill: () => JSX.Element;
39
41
  move: () => JSX.Element;
42
+ nav: () => JSX.Element;
40
43
  order: () => JSX.Element;
41
44
  pagali: () => JSX.Element;
42
45
  paperList: () => JSX.Element;
43
46
  pieChart: () => JSX.Element;
44
47
  plusCircle: () => JSX.Element;
45
48
  print: () => JSX.Element;
49
+ shoppingCart: () => JSX.Element;
46
50
  infoCircle: () => JSX.Element;
47
51
  link: () => JSX.Element;
48
52
  loading: () => JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { IconProps } from '../../Icons';
3
+ declare type InformationBoxTypesOptions = 'tip' | 'warning' | 'danger';
4
+ declare const InformationBoxTypes: Record<InformationBoxTypesOptions, {
5
+ title: string;
6
+ class: string;
7
+ icon: IconProps['icon'];
8
+ iconClass: string;
9
+ }>;
10
+ export declare const InformationBox: React.MemoExoticComponent<({ type, subtitle, }: InformationBoxProps) => JSX.Element>;
11
+ export interface InformationBoxProps {
12
+ /** InformationBox color
13
+ * @default info
14
+ * */
15
+ type?: keyof typeof InformationBoxTypes;
16
+ /**
17
+ * @default true
18
+ */
19
+ title?: string | React.ReactNode;
20
+ /**
21
+ * InformationBox text below title
22
+ */
23
+ subtitle?: string | React.ReactNode;
24
+ }
25
+ export {};
@@ -0,0 +1,4 @@
1
+ import { InformationBoxProps } from './InformationBox';
2
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, InformationBoxProps>;
@@ -0,0 +1 @@
1
+ export * from './InformationBox';
@@ -4,3 +4,4 @@ export * from './Tag';
4
4
  export * from './Toast';
5
5
  export * from './Badge';
6
6
  export * from './Tooltip';
7
+ export * from './InformationBox';