@spesia/ui 1.0.5 → 1.8.17

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 (46) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Logo/Logo.d.ts +1 -1
  3. package/dist/components/Logo3d/Logo3d.d.ts +7 -0
  4. package/dist/components/TrendingChip/TrendingChip.d.ts +2 -1
  5. package/dist/components/checkbox/Checked.d.ts +2 -0
  6. package/dist/components/checkbox/Unchecked.d.ts +2 -0
  7. package/dist/components/chip-list/ChipList.d.ts +18 -0
  8. package/dist/components/container-grid/ContainerGrid.d.ts +31 -0
  9. package/dist/components/date-picker/DatePicker/DatePicker.d.ts +33 -0
  10. package/dist/components/date-picker/PeriodPicker/PeriodPicker.d.ts +36 -0
  11. package/dist/components/date-picker/utils.d.ts +2 -0
  12. package/dist/components/filters/Checked.d.ts +2 -0
  13. package/dist/components/filters/FilterList.d.ts +15 -0
  14. package/dist/components/filters/Unchecked.d.ts +3 -0
  15. package/dist/components/index.d.ts +7 -0
  16. package/dist/components/radio/Checked.d.ts +3 -0
  17. package/dist/components/radio/Unchecked.d.ts +3 -0
  18. package/dist/fonts/F37August/F37August-Medium.woff +0 -0
  19. package/dist/fonts/F37August/F37August-Medium.woff2 +0 -0
  20. package/dist/fonts/F37August/F37August-Regular.ttf +0 -0
  21. package/dist/fonts/F37August/F37August-Regular.woff +0 -0
  22. package/dist/fonts/F37August/F37August-Regular.woff2 +0 -0
  23. package/dist/fonts/F37August/F37August-SemiBold.woff +0 -0
  24. package/dist/fonts/F37August/F37August-SemiBold.woff2 +0 -0
  25. package/dist/fonts/FeatureDeck/FeatureDeck-Bold-Web.woff2 +0 -0
  26. package/dist/fonts/GTPressura/GT-Pressura-Mono-Bold.woff +0 -0
  27. package/dist/fonts/GTPressura/GT-Pressura-Mono-Bold.woff2 +0 -0
  28. package/dist/fonts/GTPressura/GT-Pressura-Mono-Regular.woff +0 -0
  29. package/dist/fonts/GTPressura/GT-Pressura-Mono-Regular.woff2 +0 -0
  30. package/dist/fonts.scss +44 -18
  31. package/dist/helpers/__tests__/suitCx.test.d.ts +1 -0
  32. package/dist/hooks/useContainerDimension.d.ts +7 -0
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +35866 -2364
  35. package/dist/logo-3d.svg +9 -0
  36. package/dist/logo-icon.svg +6 -0
  37. package/dist/logo-text.svg +14 -0
  38. package/dist/styles/button/button.d.ts +5 -2
  39. package/dist/styles/checkbox/checkbox.d.ts +3 -0
  40. package/dist/styles/colors.d.ts +308 -57
  41. package/dist/styles/palette.d.ts +39 -4
  42. package/dist/styles/radio/radio.d.ts +3 -0
  43. package/dist/styles/switch/switch.d.ts +3 -0
  44. package/dist/styles/tab/tab.d.ts +2 -1
  45. package/dist/styles/typography.d.ts +235 -2
  46. package/package.json +33 -28
package/README.md CHANGED
@@ -25,7 +25,7 @@ Create your own provider file, i.e. SpesiaThemeProvider in your app:
25
25
 
26
26
  import { theme } from '@spesia/ui';
27
27
  import { CssBaseline, ThemeProvider } from '@mui/material';
28
- import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'
28
+ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
29
29
  import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
30
30
 
31
31
  import { ReactNode } from 'react';
@@ -122,7 +122,7 @@ Example:
122
122
  ```javascript
123
123
  import { color } from "@spesia/ui";
124
124
 
125
- const chartColor = colors.primary.blue[400];
125
+ const chartColor = colors.primary.brown[70];
126
126
  ```
127
127
 
128
128
  ### CSS
@@ -3,7 +3,7 @@ export type LogoProps = {
3
3
  alt?: string;
4
4
  height?: number;
5
5
  width?: number;
6
- color?: "blue" | "black" | "white";
6
+ color?: "brown" | "coral" | "black" | "light";
7
7
  };
8
8
  declare const Logo: ({ withText, color, height, width, ...rest }: LogoProps) => import("react/jsx-runtime").JSX.Element | null;
9
9
  export default Logo;
@@ -0,0 +1,7 @@
1
+ export type LogoProps = {
2
+ alt?: string;
3
+ height?: number;
4
+ width?: number;
5
+ };
6
+ declare const Logo3d: ({ height, width }: LogoProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default Logo3d;
@@ -1,7 +1,8 @@
1
1
  export type TrendingChipProps = {
2
2
  value: number;
3
+ iconOnly?: boolean;
3
4
  size?: "small" | "medium";
4
5
  className?: string;
5
6
  };
6
- declare const TrendingChip: ({ value, size, className, }: TrendingChipProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TrendingChip: ({ value, size, iconOnly, className, }: TrendingChipProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default TrendingChip;
@@ -0,0 +1,2 @@
1
+ declare const Checked: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Checked;
@@ -0,0 +1,2 @@
1
+ declare const Unchecked: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Unchecked;
@@ -0,0 +1,18 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ export type PeriodPickerDate = Date | string | null | undefined;
3
+ type Props = {
4
+ options: {
5
+ value: string;
6
+ label?: ReactNode;
7
+ tooltip?: ReactNode;
8
+ icon?: ReactElement;
9
+ }[];
10
+ onSelect: (value: any) => void;
11
+ initialValue?: string;
12
+ disabled?: boolean;
13
+ dataTestId?: string;
14
+ size?: "small";
15
+ className?: string;
16
+ };
17
+ export declare const ChipList: ({ options, onSelect, initialValue, disabled, dataTestId, size, className, }: Props) => import("react/jsx-runtime").JSX.Element;
18
+ export default ChipList;
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+ import { GridSpacing, SxProps } from '@mui/material';
3
+ type ContainerGridSize = {
4
+ xs?: number | string;
5
+ sm?: number | string;
6
+ md?: number | string;
7
+ lg?: number | string;
8
+ };
9
+ type ContainerBreakpointSize = {
10
+ sm?: number | string;
11
+ md?: number | string;
12
+ lg?: number | string;
13
+ };
14
+ type ContainerGridProps = {
15
+ container?: boolean;
16
+ spacing?: GridSpacing;
17
+ size?: ContainerGridSize;
18
+ breakpoints?: ContainerBreakpointSize;
19
+ className?: string;
20
+ children: ReactNode;
21
+ sx?: SxProps;
22
+ };
23
+ /**
24
+ * Custom Container Grid system, using MUI components, which is responsive within a parent container, instead of within a window/viewport
25
+ * Author: Tinna Karen
26
+ *
27
+ * @param param0
28
+ * @returns
29
+ */
30
+ export declare function ContainerGrid({ container, spacing, size, breakpoints, className, children, sx, }: ContainerGridProps): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,33 @@
1
+ import { SxProps } from '@mui/material/styles';
2
+ export interface IDatePickerProps {
3
+ /**
4
+ * Modifiers
5
+ */
6
+ disabled?: boolean;
7
+ /**
8
+ * DatePicker label
9
+ */
10
+ label?: string;
11
+ className?: string;
12
+ /**
13
+ * MUI system (https://mui.com/system/getting-started/the-sx-prop/)
14
+ */
15
+ sx?: SxProps;
16
+ dataTestId?: string;
17
+ /**
18
+ * Error to show when using 'minDate' and the user types in a date before that
19
+ */
20
+ minDateErrorText?: string;
21
+ /**
22
+ * Error to show when using 'maxDate' and the user types in a date after that
23
+ */
24
+ maxDateErrorText?: string;
25
+ /**
26
+ * Default error text to show when the date is invalid
27
+ */
28
+ errorText?: string;
29
+ value?: Date;
30
+ size?: "small";
31
+ }
32
+ export declare const DatePicker: ({ label, disabled, dataTestId, className, value, minDateErrorText, maxDateErrorText, errorText, size, sx, ...rest }: IDatePickerProps) => import("react/jsx-runtime").JSX.Element;
33
+ export default DatePicker;
@@ -0,0 +1,36 @@
1
+ import { ReactElement } from 'react';
2
+ export type PeriodPickerDate = Date | string | null | undefined;
3
+ type Props = {
4
+ inline?: boolean;
5
+ format?: string;
6
+ yearFormat?: string;
7
+ options: {
8
+ value: string;
9
+ key: string;
10
+ label?: string;
11
+ tooltip?: string;
12
+ icon?: ReactElement;
13
+ }[];
14
+ onSelect: (item: any) => void;
15
+ initialFromDate?: PeriodPickerDate;
16
+ initialToDate?: PeriodPickerDate;
17
+ initialPeriod?: string;
18
+ maxDate?: Date | string | number | null;
19
+ minDate?: Date | string | number | null;
20
+ onClose?: any;
21
+ id?: string;
22
+ block?: boolean;
23
+ size?: "small";
24
+ required?: boolean;
25
+ disabled?: boolean;
26
+ label?: string;
27
+ dataTestId?: string;
28
+ className?: string;
29
+ placeholder?: string;
30
+ cancelButtonText?: string;
31
+ saveButtonText?: string;
32
+ invalidPeriodHelperText?: string;
33
+ validation?: (item: any) => boolean;
34
+ };
35
+ export declare const PeriodPicker: ({ inline, format, yearFormat, options, onSelect, initialFromDate, initialToDate, initialPeriod, required, onClose, disabled, block, maxDate, size, minDate, id, dataTestId, placeholder, cancelButtonText, saveButtonText, invalidPeriodHelperText, validation, className, }: Props) => import("react/jsx-runtime").JSX.Element;
36
+ export default PeriodPicker;
@@ -0,0 +1,2 @@
1
+ import { PeriodPickerDate } from './PeriodPicker/PeriodPicker';
2
+ export declare const setInitialValue: (period: any, fromDate: PeriodPickerDate, toDate: PeriodPickerDate, format: string, yearFormat: string) => string;
@@ -0,0 +1,2 @@
1
+ declare const Checked: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Checked;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ options: {
4
+ value: string;
5
+ label?: ReactNode;
6
+ tooltip?: ReactNode;
7
+ }[];
8
+ initialValues?: string | string[];
9
+ onSelect: (value: string[]) => void;
10
+ disabled?: boolean;
11
+ dataTestId?: string;
12
+ className?: string;
13
+ };
14
+ export declare const FilterList: ({ options, onSelect, disabled, initialValues, dataTestId, className, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export default FilterList;
@@ -0,0 +1,3 @@
1
+ import { ComponentType, HTMLAttributes } from 'react';
2
+ declare const Unchecked: ComponentType<HTMLAttributes<HTMLSpanElement>>;
3
+ export default Unchecked;
@@ -1,2 +1,9 @@
1
1
  export { default as Logo } from './Logo/Logo';
2
+ export { default as Logo3d } from './Logo3d/Logo3d';
2
3
  export { type LogoProps } from './Logo/Logo';
4
+ export { ContainerGrid } from './container-grid/ContainerGrid';
5
+ export { PeriodPicker } from './date-picker/PeriodPicker/PeriodPicker';
6
+ export { DatePicker } from './date-picker/DatePicker/DatePicker';
7
+ export { ChipList } from './chip-list/ChipList';
8
+ export { FilterList } from './filters/FilterList';
9
+ export { TrendingChip } from './TrendingChip/TrendingChip';
@@ -0,0 +1,3 @@
1
+ import { ComponentType, HTMLAttributes } from 'react';
2
+ declare const Checked: ComponentType<HTMLAttributes<HTMLSpanElement>>;
3
+ export default Checked;
@@ -0,0 +1,3 @@
1
+ import { ComponentType, HTMLAttributes } from 'react';
2
+ declare const Unchecked: ComponentType<HTMLAttributes<HTMLSpanElement>>;
3
+ export default Unchecked;
package/dist/fonts.scss CHANGED
@@ -1,33 +1,59 @@
1
1
  @font-face {
2
- font-family: "Montserrat";
3
- src: url("/fonts/Montserrat/Montserrat-VariableFont_wght.ttf")
4
- format("truetype");
2
+ font-family: "GT Pressura";
3
+ src: url("/fonts/GTPressura/GT-Pressura-Mono-Regular.woff2") format("woff2");
5
4
  font-weight: normal;
6
5
  font-style: normal;
7
6
  }
8
7
 
9
8
  @font-face {
10
- font-family: "Montserrat";
11
- src: url("/fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf")
12
- format("truetype");
13
- font-weight: normal;
14
- font-style: italic;
9
+ font-family: "GT Pressura";
10
+ src: url("/fonts/GTPressura/GT-Pressura-Mono-Bold.woff2") format("woff2");
11
+ font-weight: bold;
12
+ font-style: normal;
13
+ }
14
+
15
+ @font-face {
16
+ font-family: "F37 August";
17
+ src: url("/fonts/F37August/F37August-SemiBold.woff2") format("woff2");
18
+ font-weight: bold;
19
+ font-style: normal;
20
+ }
21
+
22
+ @font-face {
23
+ font-family: "F37 August";
24
+ src: url("/fonts/F37August/F37August-Medium.woff2") format("woff2");
25
+ font-weight: 500;
26
+ font-style: normal;
15
27
  }
16
28
 
17
29
  @font-face {
18
- font-family: "Montserrat Fallback";
19
- src: local("Arial");
20
- ascent-override: 85.79%;
21
- descent-override: 22.25%;
22
- line-gap-override: 0%;
23
- size-adjust: 112.83%;
30
+ font-family: "F37 August";
31
+ src: url("/fonts/F37August/F37August-Regular.woff2") format("woff2");
32
+ font-weight: 400;
33
+ font-style: normal;
34
+ }
35
+
36
+ @font-face {
37
+ font-family: "Feature Deck Web";
38
+ src: url("/fonts/FeatureDeck/FeatureDeck-Bold-Web.woff2") format("woff2");
39
+ font-weight: 700;
40
+ font-style: normal;
24
41
  }
25
42
 
26
- .montserrat-font {
27
- font-family: "Montserrat", "Montserrat Fallback";
43
+ .spesia-serif {
44
+ font-family: "Feature Deck Web";
45
+ font-weight: 700;
28
46
  font-style: normal;
29
47
  }
30
48
 
31
- .montserrat-font-variable {
32
- --font-spesia: "Montserrat", "Montserrat Fallback";
49
+ .spesia-sans {
50
+ font-family: "F37 August";
51
+ font-weight: 400;
52
+ font-style: normal;
53
+ }
54
+
55
+ .spesia-mono {
56
+ font-family: "GT Pressura";
57
+ font-weight: normal;
58
+ font-style: normal;
33
59
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { RefObject } from 'react';
2
+ type ContainerDimensions = {
3
+ width: number | undefined;
4
+ height: number | undefined;
5
+ };
6
+ export declare const useContainerDimensions: <_T = unknown>(ref: RefObject<HTMLFormElement | null>) => ContainerDimensions;
7
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { theme } from './styles';
2
- export { colors } from './styles/colors';
2
+ export { colors, tokens, primitives } from './styles/colors';
3
3
  export { themes, defaultTheme } from './themes';
4
4
  export { suitCx } from './helpers/suitCx';
5
5
  export * from './components';