@spesia/ui 1.0.4 → 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.
- package/README.md +2 -2
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo3d/Logo3d.d.ts +7 -0
- package/dist/components/TrendingChip/TrendingChip.d.ts +2 -1
- package/dist/components/checkbox/Checked.d.ts +2 -0
- package/dist/components/checkbox/Unchecked.d.ts +2 -0
- package/dist/components/chip-list/ChipList.d.ts +18 -0
- package/dist/components/container-grid/ContainerGrid.d.ts +31 -0
- package/dist/components/date-picker/DatePicker/DatePicker.d.ts +33 -0
- package/dist/components/date-picker/PeriodPicker/PeriodPicker.d.ts +36 -0
- package/dist/components/date-picker/utils.d.ts +2 -0
- package/dist/components/filters/Checked.d.ts +2 -0
- package/dist/components/filters/FilterList.d.ts +15 -0
- package/dist/components/filters/Unchecked.d.ts +3 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/radio/Checked.d.ts +3 -0
- package/dist/components/radio/Unchecked.d.ts +3 -0
- package/dist/fonts/F37August/F37August-Medium.woff +0 -0
- package/dist/fonts/F37August/F37August-Medium.woff2 +0 -0
- package/dist/fonts/F37August/F37August-Regular.ttf +0 -0
- package/dist/fonts/F37August/F37August-Regular.woff +0 -0
- package/dist/fonts/F37August/F37August-Regular.woff2 +0 -0
- package/dist/fonts/F37August/F37August-SemiBold.woff +0 -0
- package/dist/fonts/F37August/F37August-SemiBold.woff2 +0 -0
- package/dist/fonts/FeatureDeck/FeatureDeck-Bold-Web.woff2 +0 -0
- package/dist/fonts/GTPressura/GT-Pressura-Mono-Bold.woff +0 -0
- package/dist/fonts/GTPressura/GT-Pressura-Mono-Bold.woff2 +0 -0
- package/dist/fonts/GTPressura/GT-Pressura-Mono-Regular.woff +0 -0
- package/dist/fonts/GTPressura/GT-Pressura-Mono-Regular.woff2 +0 -0
- package/dist/fonts.scss +44 -18
- package/dist/helpers/__tests__/suitCx.test.d.ts +1 -0
- package/dist/hooks/useContainerDimension.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +35868 -2343
- package/dist/logo-3d.svg +9 -0
- package/dist/logo-icon.svg +6 -0
- package/dist/logo-text.svg +14 -0
- package/dist/styles/button/button.d.ts +5 -2
- package/dist/styles/checkbox/checkbox.d.ts +3 -0
- package/dist/styles/colors.d.ts +308 -56
- package/dist/styles/palette.d.ts +39 -4
- package/dist/styles/radio/radio.d.ts +3 -0
- package/dist/styles/switch/switch.d.ts +3 -0
- package/dist/styles/tab/tab.d.ts +4 -0
- package/dist/styles/typography.d.ts +235 -2
- 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/
|
|
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.
|
|
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?: "
|
|
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;
|
|
@@ -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,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,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;
|
|
@@ -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';
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/fonts.scss
CHANGED
|
@@ -1,33 +1,59 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family: "
|
|
3
|
-
src: url("/fonts/
|
|
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: "
|
|
11
|
-
src: url("/fonts/
|
|
12
|
-
|
|
13
|
-
font-
|
|
14
|
-
|
|
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: "
|
|
19
|
-
src:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
.
|
|
27
|
-
font-family: "
|
|
43
|
+
.spesia-serif {
|
|
44
|
+
font-family: "Feature Deck Web";
|
|
45
|
+
font-weight: 700;
|
|
28
46
|
font-style: normal;
|
|
29
47
|
}
|
|
30
48
|
|
|
31
|
-
.
|
|
32
|
-
|
|
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