norma-library 0.4.1 → 0.4.3
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/dist/components/button/button.d.ts +3 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/{Button → button}/types.d.ts +18 -18
- package/dist/components/card/card-header.d.ts +3 -0
- package/dist/components/card/card.d.ts +3 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/styles.d.ts +811 -0
- package/dist/components/{Card → card}/types.d.ts +12 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/{Checkbox → checkbox}/types.d.ts +23 -23
- package/dist/components/icon/default.d.ts +210 -0
- package/dist/components/icon/defaultIcon.d.ts +5 -0
- package/dist/components/icon/icons-ia.d.ts +71 -0
- package/dist/components/icon/index.d.ts +234 -0
- package/dist/components/icon/norma.d.ts +30 -0
- package/dist/components/{Icon/NormaIcon.d.ts → icon/normaIcon.d.ts} +13 -13
- package/dist/components/icon/styles.d.ts +481 -0
- package/dist/components/{Icon → icon}/svg.d.ts +6 -6
- package/dist/components/{Icon → icon}/types.d.ts +12 -12
- package/dist/components/index.d.ts +8 -19
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/{Modal/Modal.d.ts → modal/modal.d.ts} +3 -4
- package/dist/components/modal/modalFooter.d.ts +3 -0
- package/dist/components/modal/modalHeader.d.ts +3 -0
- package/dist/components/modal/styles.d.ts +540 -0
- package/dist/components/{Modal → modal}/types.d.ts +27 -24
- package/dist/components/progress-bar/index.d.ts +1 -0
- package/dist/components/{ProgressBar/ProgressBar.d.ts → progress-bar/progress-bar.d.ts} +7 -8
- package/dist/components/progress-bar/styles.d.ts +272 -0
- package/dist/components/{ProgressBar → progress-bar}/types.d.ts +22 -22
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/radio.d.ts +3 -0
- package/dist/components/{Radio → radio}/types.d.ts +16 -16
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/{Tag/Tag.d.ts → tag/tag.d.ts} +3 -4
- package/dist/components/{Tag → tag}/types.d.ts +25 -25
- package/dist/components/textfield/index.d.ts +1 -0
- package/dist/components/textfield/textfield.d.ts +3 -0
- package/dist/components/{TextField → textfield}/types.d.ts +42 -42
- package/dist/helpers/clients.d.ts +5 -0
- package/dist/helpers/colors.d.ts +174 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/sizes.d.ts +6 -0
- package/dist/helpers/variants.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -0
- package/dist/norma-library.cjs.development.js +1286 -0
- package/dist/norma-library.cjs.development.js.map +1 -0
- package/dist/norma-library.cjs.production.min.js +2 -0
- package/dist/norma-library.cjs.production.min.js.map +1 -0
- package/dist/norma-library.esm.js +1274 -0
- package/dist/norma-library.esm.js.map +1 -0
- package/package.json +55 -86
- package/src/components/button/button.stories.tsx +44 -0
- package/src/components/button/button.tsx +18 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button/types.ts +48 -0
- package/src/components/card/card-header.tsx +8 -0
- package/src/components/card/card.stories.tsx +28 -0
- package/src/components/card/card.tsx +13 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/card/styles.tsx +29 -0
- package/src/components/card/types.ts +14 -0
- package/src/components/checkbox/checkbox.stories.tsx +66 -0
- package/src/components/checkbox/checkbox.tsx +13 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/types.ts +30 -0
- package/src/components/icon/default.tsx +1459 -0
- package/src/components/icon/defaultIcon.tsx +82 -0
- package/src/components/icon/icon.stories.tsx +44 -0
- package/src/components/icon/icons-ia.tsx +107 -0
- package/src/components/icon/index.ts +11 -0
- package/src/components/icon/norma.tsx +523 -0
- package/src/components/icon/normaIcon.tsx +94 -0
- package/src/components/icon/styles.ts +11 -0
- package/src/components/icon/svg.tsx +24 -0
- package/src/components/icon/types.ts +14 -0
- package/src/components/index.ts +8 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal.stories.tsx +55 -0
- package/src/components/modal/modal.tsx +42 -0
- package/src/components/modal/modalFooter.tsx +32 -0
- package/src/components/modal/modalHeader.tsx +46 -0
- package/src/components/modal/styles.tsx +13 -0
- package/src/components/modal/types.ts +47 -0
- package/src/components/progress-bar/index.ts +1 -0
- package/src/components/progress-bar/progress-bar.stories.tsx +68 -0
- package/src/components/progress-bar/progress-bar.tsx +38 -0
- package/src/components/progress-bar/styles.tsx +27 -0
- package/src/components/progress-bar/types.ts +35 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/radio/radio.stories.tsx +150 -0
- package/src/components/radio/radio.tsx +13 -0
- package/src/components/radio/types.ts +27 -0
- package/src/components/tag/index.ts +1 -0
- package/src/components/tag/tag.stories.tsx +80 -0
- package/src/components/tag/tag.tsx +13 -0
- package/src/components/tag/types.ts +47 -0
- package/src/components/textfield/index.ts +1 -0
- package/src/components/textfield/textfield.stories.tsx +376 -0
- package/src/components/textfield/textfield.tsx +23 -0
- package/src/components/textfield/types.ts +93 -0
- package/src/helpers/clients.ts +6 -0
- package/src/helpers/colors.ts +209 -0
- package/src/helpers/index.ts +3 -0
- package/src/helpers/sizes.ts +26 -0
- package/src/helpers/variants.ts +3 -0
- package/src/index.tsx +1 -0
- package/dist/components/Button/Button.d.ts +0 -4
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/Card.d.ts +0 -4
- package/dist/components/Card/CardHeader.d.ts +0 -4
- package/dist/components/Card/index.d.ts +0 -4
- package/dist/components/Card/styles.d.ts +0 -818
- package/dist/components/Checkbox/Checkbox.d.ts +0 -4
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/Icon/DefaultIcon.d.ts +0 -5
- package/dist/components/Icon/default.d.ts +0 -209
- package/dist/components/Icon/index.d.ts +0 -233
- package/dist/components/Icon/norma.d.ts +0 -29
- package/dist/components/Icon/styles.d.ts +0 -485
- package/dist/components/Modal/ModalFooter.d.ts +0 -4
- package/dist/components/Modal/ModalHeader.d.ts +0 -4
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/Modal/styles.d.ts +0 -274
- package/dist/components/ProgressBar/index.d.ts +0 -2
- package/dist/components/ProgressBar/styles.d.ts +0 -276
- package/dist/components/Radio/Radio.d.ts +0 -4
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Tag/index.d.ts +0 -2
- package/dist/components/TextField/TextField.d.ts +0 -4
- package/dist/components/TextField/index.d.ts +0 -2
- package/dist/index.es.js +0 -15023
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -419
- package/dist/index.umd.js.map +0 -1
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { StoryDefault, Story } from '@ladle/react'
|
|
3
|
+
import { Card } from './card'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Layout / Card',
|
|
7
|
+
meta: {
|
|
8
|
+
key: 'card',
|
|
9
|
+
},
|
|
10
|
+
} satisfies StoryDefault
|
|
11
|
+
|
|
12
|
+
export const CardSimple: Story = () => (
|
|
13
|
+
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
14
|
+
<Card>Card content children</Card>
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
CardSimple.storyName = 'Card'
|
|
19
|
+
|
|
20
|
+
export const CardHeader: Story = () => (
|
|
21
|
+
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
22
|
+
<Card title="Card with title" sx={{ minHeight: 120, width: 480 }}>
|
|
23
|
+
Card content children
|
|
24
|
+
</Card>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
CardHeader.storyName = 'Card with title'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CardBaseProps } from './types';
|
|
3
|
+
import { StyledCardContainer, StyledCardBody } from './styles';
|
|
4
|
+
import { CardHeader } from './card-header';
|
|
5
|
+
|
|
6
|
+
export const Card = ({ children, title }: CardBaseProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<StyledCardContainer>
|
|
9
|
+
{title && <CardHeader title={title} />}
|
|
10
|
+
<StyledCardBody>{children}</StyledCardBody>
|
|
11
|
+
</StyledCardContainer>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './card';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const StyledCardContainer = styled.div`
|
|
4
|
+
background: var(--high-pure) 0% 0% no-repeat padding-box;
|
|
5
|
+
background: #ffffff 0% 0% no-repeat padding-box;
|
|
6
|
+
box-shadow: 0px 2px 8px #00000053;
|
|
7
|
+
border-radius: 5px;
|
|
8
|
+
opacity: 1;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const StyledCardBody = styled.div`
|
|
12
|
+
padding: 16px;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
const StyledCardHeader = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
text-align: left;
|
|
20
|
+
font: normal normal 600 18px/30px Source Sans Pro;
|
|
21
|
+
letter-spacing: 0px;
|
|
22
|
+
color: #292929;
|
|
23
|
+
height: 25px;
|
|
24
|
+
padding: 10px 16px;
|
|
25
|
+
border-bottom: 1px solid #e9ecef;
|
|
26
|
+
position: relative;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { StyledCardContainer, StyledCardBody, StyledCardHeader };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Card, CardProps as MuiCardProps } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
type MuiCardBaseProps = Pick<MuiCardProps, 'sx'>;
|
|
4
|
+
|
|
5
|
+
export interface CardBaseProps extends MuiCardBaseProps {
|
|
6
|
+
title?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CardHeaderProps {
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type CardType = keyof typeof Card;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { StoryDefault, Story } from '@ladle/react'
|
|
3
|
+
import { Checkbox } from './checkbox'
|
|
4
|
+
import { FormControlLabel } from '@mui/material'
|
|
5
|
+
import { pink } from '@mui/material/colors'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Form / Checkbox',
|
|
9
|
+
meta: {
|
|
10
|
+
key: 'checkbox',
|
|
11
|
+
},
|
|
12
|
+
} satisfies StoryDefault
|
|
13
|
+
|
|
14
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
15
|
+
|
|
16
|
+
export const CheckboxVariant: Story = () => (
|
|
17
|
+
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
18
|
+
<Checkbox {...label} defaultChecked />
|
|
19
|
+
<Checkbox {...label} defaultChecked />
|
|
20
|
+
<Checkbox {...label} disabled />
|
|
21
|
+
<Checkbox {...label} disabled checked />
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
CheckboxVariant.storyName = 'Checkbox Basic'
|
|
26
|
+
|
|
27
|
+
export const CheckboxLabel: Story = () => (
|
|
28
|
+
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
29
|
+
<FormControlLabel control={<Checkbox defaultChecked />} label="Label" />
|
|
30
|
+
<FormControlLabel required control={<Checkbox />} label="Required" />
|
|
31
|
+
<FormControlLabel disabled control={<Checkbox />} label="Disabled" />
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
CheckboxLabel.storyName = 'Checkbox Label'
|
|
36
|
+
|
|
37
|
+
export const CheckboxSizes: Story = () => (
|
|
38
|
+
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
39
|
+
<Checkbox {...label} defaultChecked size="small" />
|
|
40
|
+
<Checkbox {...label} defaultChecked />
|
|
41
|
+
<Checkbox {...label} defaultChecked sx={{ '& .MuiSvgIcon-root': { fontSize: 28 } }} />
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
CheckboxSizes.storyName = 'Checkbox sizes'
|
|
46
|
+
|
|
47
|
+
export const CheckboxColors: Story = () => (
|
|
48
|
+
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
49
|
+
<Checkbox {...label} defaultChecked />
|
|
50
|
+
<Checkbox {...label} defaultChecked color="secondary" />
|
|
51
|
+
<Checkbox {...label} defaultChecked color="success" />
|
|
52
|
+
<Checkbox {...label} defaultChecked color="default" />
|
|
53
|
+
<Checkbox
|
|
54
|
+
{...label}
|
|
55
|
+
defaultChecked
|
|
56
|
+
sx={{
|
|
57
|
+
color: pink[800],
|
|
58
|
+
'&.Mui-checked': {
|
|
59
|
+
color: pink[600],
|
|
60
|
+
},
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
CheckboxColors.storyName = 'Checkbox colors'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckBoxBaseProps } from './types';
|
|
3
|
+
import { ThemeProvider } from '@mui/material';
|
|
4
|
+
import { Checkbox as MuiCheckbox } from '@mui/material';
|
|
5
|
+
import { themes } from '../../helpers/colors';
|
|
6
|
+
|
|
7
|
+
export const Checkbox: React.FC<CheckBoxBaseProps> = ({ ...rest }) => {
|
|
8
|
+
return (
|
|
9
|
+
<ThemeProvider theme={themes.light}>
|
|
10
|
+
<MuiCheckbox {...rest} />
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OverridableStringUnion } from '@mui/types'
|
|
2
|
+
import { Checkbox, CheckboxProps as MuiCheckBoxProps, SxProps, Theme } from '@mui/material'
|
|
3
|
+
import { SwitchBaseProps } from '@mui/material/internal/SwitchBase'
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
6
|
+
export interface CheckboxPropsSizeOverrides {}
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
9
|
+
export interface CheckboxPropsColorOverrides {}
|
|
10
|
+
|
|
11
|
+
type MuiCheckBoxBaseProps = Pick<MuiCheckBoxProps, 'sx'>
|
|
12
|
+
|
|
13
|
+
export interface CheckBoxBaseProps extends MuiCheckBoxBaseProps {
|
|
14
|
+
sx?: SxProps<Theme>
|
|
15
|
+
name?: string
|
|
16
|
+
checked?: SwitchBaseProps['checked']
|
|
17
|
+
color?: OverridableStringUnion<
|
|
18
|
+
'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default',
|
|
19
|
+
CheckboxPropsColorOverrides
|
|
20
|
+
>
|
|
21
|
+
disabled?: SwitchBaseProps['disabled']
|
|
22
|
+
id?: SwitchBaseProps['id']
|
|
23
|
+
onChange?: SwitchBaseProps['onChange']
|
|
24
|
+
required?: SwitchBaseProps['required']
|
|
25
|
+
size?: OverridableStringUnion<'small' | 'medium', CheckboxPropsSizeOverrides>
|
|
26
|
+
value?: SwitchBaseProps['value']
|
|
27
|
+
defaultChecked?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type CheckboxType = keyof typeof Checkbox
|