norma-library 0.4.3 → 0.4.5
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/.babelrc.json +18 -0
- package/buildcache/front-end +1 -0
- package/dist/esm/components/Accordion.d.ts +3 -0
- package/dist/esm/components/Accordion.js +24 -0
- package/dist/esm/components/Accordion.js.map +1 -0
- package/dist/esm/components/Button.d.ts +3 -0
- package/dist/esm/components/Button.js +22 -0
- package/dist/esm/components/Button.js.map +1 -0
- package/dist/esm/components/Card.d.ts +7 -0
- package/dist/esm/components/Card.js +31 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/CheckBox.d.ts +3 -0
- package/dist/esm/components/CheckBox.js +13 -0
- package/dist/esm/components/CheckBox.js.map +1 -0
- package/dist/esm/components/DropDown.d.ts +3 -0
- package/dist/esm/components/DropDown.js +17 -0
- package/dist/esm/components/DropDown.js.map +1 -0
- package/dist/esm/components/IconButton.d.ts +3 -0
- package/dist/esm/components/IconButton.js +31 -0
- package/dist/esm/components/IconButton.js.map +1 -0
- package/dist/esm/components/Icons.d.ts +7 -0
- package/dist/esm/components/Icons.js +49 -0
- package/dist/esm/components/Icons.js.map +1 -0
- package/dist/esm/components/Modal.d.ts +4 -0
- package/dist/esm/components/Modal.js +32 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/Paper.d.ts +3 -0
- package/dist/esm/components/Paper.js +14 -0
- package/dist/esm/components/Paper.js.map +1 -0
- package/dist/esm/components/ProgressBar.d.ts +6 -0
- package/dist/esm/components/ProgressBar.js +31 -0
- package/dist/esm/components/ProgressBar.js.map +1 -0
- package/dist/esm/components/RadioGroup.d.ts +3 -0
- package/dist/esm/components/RadioGroup.js +18 -0
- package/dist/esm/components/RadioGroup.js.map +1 -0
- package/dist/esm/components/RangerSlider.d.ts +3 -0
- package/dist/esm/components/RangerSlider.js +64 -0
- package/dist/esm/components/RangerSlider.js.map +1 -0
- package/dist/esm/components/Select.d.ts +3 -0
- package/dist/esm/components/Select.js +45 -0
- package/dist/esm/components/Select.js.map +1 -0
- package/dist/{components/icon/norma.d.ts → esm/components/Svgs.d.ts} +29 -30
- package/dist/esm/components/Svgs.js +102 -0
- package/dist/esm/components/Svgs.js.map +1 -0
- package/dist/esm/components/Tabs.d.ts +3 -0
- package/dist/esm/components/Tabs.js +78 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Tag.d.ts +3 -0
- package/dist/esm/components/Tag.js +27 -0
- package/dist/esm/components/Tag.js.map +1 -0
- package/dist/esm/components/TextField.d.ts +3 -0
- package/dist/esm/components/TextField.js +18 -0
- package/dist/esm/components/TextField.js.map +1 -0
- package/dist/esm/components/button/index.d.ts +3 -0
- package/dist/esm/components/button/index.js +22 -0
- package/dist/esm/components/button/index.js.map +1 -0
- package/dist/esm/components/checkbox/index.d.ts +3 -0
- package/dist/esm/components/checkbox/index.js +13 -0
- package/dist/esm/components/checkbox/index.js.map +1 -0
- package/dist/esm/components/icons/index.d.ts +7 -0
- package/dist/esm/components/icons/index.js +49 -0
- package/dist/esm/components/icons/index.js.map +1 -0
- package/dist/esm/components/icons/svgs.d.ts +29 -0
- package/dist/esm/components/icons/svgs.js +102 -0
- package/dist/esm/components/icons/svgs.js.map +1 -0
- package/dist/esm/components/index.d.ts +16 -0
- package/dist/esm/components/index.js +17 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/components/textfield/index.d.ts +3 -0
- package/dist/esm/components/textfield/index.js +18 -0
- package/dist/esm/components/textfield/index.js.map +1 -0
- package/dist/esm/helpers/alignments.d.ts +2 -0
- package/dist/esm/helpers/alignments.js +14 -0
- package/dist/esm/helpers/alignments.js.map +1 -0
- package/dist/esm/helpers/borders.d.ts +2 -0
- package/dist/esm/helpers/borders.js +18 -0
- package/dist/esm/helpers/borders.js.map +1 -0
- package/dist/{helpers → esm/helpers}/colors.d.ts +172 -174
- package/dist/esm/helpers/colors.js +156 -0
- package/dist/esm/helpers/colors.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +5 -0
- package/dist/esm/helpers/index.js +6 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/radios.d.ts +2 -0
- package/dist/esm/helpers/radios.js +24 -0
- package/dist/esm/helpers/radios.js.map +1 -0
- package/dist/esm/helpers/sizes.d.ts +11 -0
- package/dist/esm/helpers/sizes.js +67 -0
- package/dist/esm/helpers/sizes.js.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/Accordion.d.ts +12 -0
- package/dist/esm/interfaces/Accordion.js +2 -0
- package/dist/esm/interfaces/Accordion.js.map +1 -0
- package/dist/esm/interfaces/Button.d.ts +14 -0
- package/dist/esm/interfaces/Button.js +2 -0
- package/dist/esm/interfaces/Button.js.map +1 -0
- package/dist/esm/interfaces/Card.d.ts +11 -0
- package/dist/esm/interfaces/Card.js +2 -0
- package/dist/esm/interfaces/Card.js.map +1 -0
- package/dist/esm/interfaces/CheckBox.d.ts +19 -0
- package/dist/esm/interfaces/CheckBox.js +2 -0
- package/dist/esm/interfaces/CheckBox.js.map +1 -0
- package/dist/esm/interfaces/DropDown.d.ts +11 -0
- package/dist/esm/interfaces/DropDown.js +2 -0
- package/dist/esm/interfaces/DropDown.js.map +1 -0
- package/dist/esm/interfaces/Icon.d.ts +15 -0
- package/dist/esm/interfaces/Icon.js +2 -0
- package/dist/esm/interfaces/Icon.js.map +1 -0
- package/dist/esm/interfaces/IconButton.d.ts +14 -0
- package/dist/esm/interfaces/IconButton.js +2 -0
- package/dist/esm/interfaces/IconButton.js.map +1 -0
- package/dist/esm/interfaces/Icons.d.ts +15 -0
- package/dist/esm/interfaces/Icons.js +2 -0
- package/dist/esm/interfaces/Icons.js.map +1 -0
- package/dist/esm/interfaces/Modal.d.ts +15 -0
- package/dist/esm/interfaces/Modal.js +2 -0
- package/dist/esm/interfaces/Modal.js.map +1 -0
- package/dist/esm/interfaces/Paper.d.ts +12 -0
- package/dist/esm/interfaces/Paper.js +2 -0
- package/dist/esm/interfaces/Paper.js.map +1 -0
- package/dist/esm/interfaces/ProgressBar.d.ts +17 -0
- package/dist/esm/interfaces/ProgressBar.js +2 -0
- package/dist/esm/interfaces/ProgressBar.js.map +1 -0
- package/dist/esm/interfaces/RadioGroup.d.ts +15 -0
- package/dist/esm/interfaces/RadioGroup.js +2 -0
- package/dist/esm/interfaces/RadioGroup.js.map +1 -0
- package/dist/esm/interfaces/RangerSlider.d.ts +18 -0
- package/dist/esm/interfaces/RangerSlider.js +2 -0
- package/dist/esm/interfaces/RangerSlider.js.map +1 -0
- package/dist/esm/interfaces/Select.d.ts +17 -0
- package/dist/esm/interfaces/Select.js +2 -0
- package/dist/esm/interfaces/Select.js.map +1 -0
- package/dist/esm/interfaces/Tabs.d.ts +18 -0
- package/dist/esm/interfaces/Tabs.js +2 -0
- package/dist/esm/interfaces/Tabs.js.map +1 -0
- package/dist/esm/interfaces/Tag.d.ts +18 -0
- package/dist/esm/interfaces/Tag.js +2 -0
- package/dist/esm/interfaces/Tag.js.map +1 -0
- package/dist/esm/interfaces/TextField.d.ts +40 -0
- package/dist/esm/interfaces/TextField.js +2 -0
- package/dist/esm/interfaces/TextField.js.map +1 -0
- package/dist/esm/interfaces/index.d.ts +17 -0
- package/dist/esm/interfaces/index.js +18 -0
- package/dist/esm/interfaces/index.js.map +1 -0
- package/dist/esm/types/index.d.ts +78 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/index.css +8363 -0
- package/norma-library.tar +0 -0
- package/package.json +75 -90
- package/postcss.config.js +6 -0
- package/src/components/Accordion.tsx +64 -0
- package/src/components/Button.tsx +38 -0
- package/src/components/Card.tsx +47 -0
- package/src/components/CheckBox.tsx +35 -0
- package/src/components/DropDown.tsx +38 -0
- package/src/components/IconButton.tsx +58 -0
- package/src/components/Icons.tsx +87 -0
- package/src/components/Modal.tsx +123 -0
- package/src/components/Paper.tsx +22 -0
- package/src/components/ProgressBar.tsx +62 -0
- package/src/components/RadioGroup.tsx +55 -0
- package/src/components/RangerSlider.tsx +81 -0
- package/src/components/Select.tsx +98 -0
- package/src/components/{icon/norma.tsx → Svgs.tsx} +54 -55
- package/src/components/Tabs.tsx +140 -0
- package/src/components/Tag.tsx +45 -0
- package/src/components/TextField.tsx +35 -0
- package/src/components/index.ts +16 -8
- package/src/helpers/alignments.ts +14 -0
- package/src/helpers/borders.ts +18 -0
- package/src/helpers/colors.ts +173 -209
- package/src/helpers/index.ts +5 -3
- package/src/helpers/radios.ts +24 -0
- package/src/helpers/sizes.ts +79 -26
- package/src/index.css +2 -0
- package/src/index.ts +36 -0
- package/src/interfaces/Accordion.ts +12 -0
- package/src/interfaces/Button.ts +27 -0
- package/src/interfaces/Card.ts +11 -0
- package/src/interfaces/CheckBox.ts +33 -0
- package/src/interfaces/DropDown.ts +14 -0
- package/src/interfaces/IconButton.ts +27 -0
- package/src/interfaces/Icons.ts +17 -0
- package/src/interfaces/Modal.ts +15 -0
- package/src/interfaces/Paper.ts +12 -0
- package/src/interfaces/ProgressBar.ts +25 -0
- package/src/interfaces/RadioGroup.ts +28 -0
- package/src/interfaces/RangerSlider.ts +32 -0
- package/src/interfaces/Select.ts +17 -0
- package/src/interfaces/Tabs.ts +24 -0
- package/src/interfaces/Tag.ts +17 -0
- package/src/interfaces/TextField.ts +63 -0
- package/src/interfaces/index.ts +17 -0
- package/src/stories/Accordion.stories.tsx +65 -0
- package/src/stories/Button.stories.tsx +99 -0
- package/src/stories/Card.stories.tsx +55 -0
- package/src/stories/CheckBox.stories.tsx +94 -0
- package/src/stories/Colors.stories.mdx +127 -0
- package/src/stories/DropDown.stories.tsx +57 -0
- package/src/stories/IconButton.stories.tsx +114 -0
- package/src/stories/Icons.stories.mdx +27 -0
- package/src/stories/Modal.stories.tsx +190 -0
- package/src/stories/Paper.stories.tsx +53 -0
- package/src/stories/ProgressBar.stories.tsx +139 -0
- package/src/stories/RadioGroup.stories.tsx +94 -0
- package/src/stories/RangerSlider.stories.tsx +68 -0
- package/src/stories/Select.stories.tsx +128 -0
- package/src/stories/Tabs.stories.tsx +62 -0
- package/src/stories/Tag.stories.tsx +76 -0
- package/src/{components/textfield/textfield.stories.tsx → stories/TextField.stories.tsx} +445 -376
- package/src/styles/custom.css +5 -0
- package/src/styles/globals.css +21 -0
- package/src/types/index.ts +220 -0
- package/tailwind.config.js +58 -0
- package/tsconfig.json +32 -0
- package/README.md +0 -160
- package/dist/components/button/button.d.ts +0 -3
- package/dist/components/button/index.d.ts +0 -1
- package/dist/components/button/types.d.ts +0 -18
- package/dist/components/card/card-header.d.ts +0 -3
- package/dist/components/card/card.d.ts +0 -3
- package/dist/components/card/index.d.ts +0 -1
- package/dist/components/card/styles.d.ts +0 -811
- package/dist/components/card/types.d.ts +0 -12
- package/dist/components/checkbox/checkbox.d.ts +0 -3
- package/dist/components/checkbox/index.d.ts +0 -1
- package/dist/components/checkbox/types.d.ts +0 -23
- package/dist/components/icon/default.d.ts +0 -210
- package/dist/components/icon/defaultIcon.d.ts +0 -5
- package/dist/components/icon/icons-ia.d.ts +0 -71
- package/dist/components/icon/index.d.ts +0 -234
- package/dist/components/icon/normaIcon.d.ts +0 -13
- package/dist/components/icon/styles.d.ts +0 -481
- package/dist/components/icon/svg.d.ts +0 -6
- package/dist/components/icon/types.d.ts +0 -12
- package/dist/components/index.d.ts +0 -8
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/modal.d.ts +0 -3
- package/dist/components/modal/modalFooter.d.ts +0 -3
- package/dist/components/modal/modalHeader.d.ts +0 -3
- package/dist/components/modal/styles.d.ts +0 -540
- package/dist/components/modal/types.d.ts +0 -27
- package/dist/components/progress-bar/index.d.ts +0 -1
- package/dist/components/progress-bar/progress-bar.d.ts +0 -7
- package/dist/components/progress-bar/styles.d.ts +0 -272
- package/dist/components/progress-bar/types.d.ts +0 -22
- package/dist/components/radio/index.d.ts +0 -1
- package/dist/components/radio/radio.d.ts +0 -3
- package/dist/components/radio/types.d.ts +0 -16
- package/dist/components/tag/index.d.ts +0 -1
- package/dist/components/tag/tag.d.ts +0 -3
- package/dist/components/tag/types.d.ts +0 -25
- package/dist/components/textfield/index.d.ts +0 -1
- package/dist/components/textfield/textfield.d.ts +0 -3
- package/dist/components/textfield/types.d.ts +0 -42
- package/dist/helpers/clients.d.ts +0 -5
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/sizes.d.ts +0 -6
- package/dist/helpers/variants.d.ts +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -8
- package/dist/norma-library.cjs.development.js +0 -1286
- package/dist/norma-library.cjs.development.js.map +0 -1
- package/dist/norma-library.cjs.production.min.js +0 -2
- package/dist/norma-library.cjs.production.min.js.map +0 -1
- package/dist/norma-library.esm.js +0 -1274
- package/dist/norma-library.esm.js.map +0 -1
- package/src/components/button/button.stories.tsx +0 -44
- package/src/components/button/button.tsx +0 -18
- package/src/components/button/index.ts +0 -1
- package/src/components/button/types.ts +0 -48
- package/src/components/card/card-header.tsx +0 -8
- package/src/components/card/card.stories.tsx +0 -28
- package/src/components/card/card.tsx +0 -13
- package/src/components/card/index.ts +0 -1
- package/src/components/card/styles.tsx +0 -29
- package/src/components/card/types.ts +0 -14
- package/src/components/checkbox/checkbox.stories.tsx +0 -66
- package/src/components/checkbox/checkbox.tsx +0 -13
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/checkbox/types.ts +0 -30
- package/src/components/icon/default.tsx +0 -1459
- package/src/components/icon/defaultIcon.tsx +0 -82
- package/src/components/icon/icon.stories.tsx +0 -44
- package/src/components/icon/icons-ia.tsx +0 -107
- package/src/components/icon/index.ts +0 -11
- package/src/components/icon/normaIcon.tsx +0 -94
- package/src/components/icon/styles.ts +0 -11
- package/src/components/icon/svg.tsx +0 -24
- package/src/components/icon/types.ts +0 -14
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.stories.tsx +0 -55
- package/src/components/modal/modal.tsx +0 -42
- package/src/components/modal/modalFooter.tsx +0 -32
- package/src/components/modal/modalHeader.tsx +0 -46
- package/src/components/modal/styles.tsx +0 -13
- package/src/components/modal/types.ts +0 -47
- package/src/components/progress-bar/index.ts +0 -1
- package/src/components/progress-bar/progress-bar.stories.tsx +0 -68
- package/src/components/progress-bar/progress-bar.tsx +0 -38
- package/src/components/progress-bar/styles.tsx +0 -27
- package/src/components/progress-bar/types.ts +0 -35
- package/src/components/radio/index.ts +0 -1
- package/src/components/radio/radio.stories.tsx +0 -150
- package/src/components/radio/radio.tsx +0 -13
- package/src/components/radio/types.ts +0 -27
- package/src/components/tag/index.ts +0 -1
- package/src/components/tag/tag.stories.tsx +0 -80
- package/src/components/tag/tag.tsx +0 -13
- package/src/components/tag/types.ts +0 -47
- package/src/components/textfield/index.ts +0 -1
- package/src/components/textfield/textfield.tsx +0 -23
- package/src/components/textfield/types.ts +0 -93
- package/src/helpers/clients.ts +0 -6
- package/src/helpers/variants.ts +0 -3
- package/src/index.tsx +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Modal, ModalProps as MuiModalProps, SxProps } from '@mui/material';
|
|
2
|
-
import { Theme } from '@emotion/react';
|
|
3
|
-
|
|
4
|
-
type RenderProps<E extends HTMLElement = HTMLElement> = {
|
|
5
|
-
focusRef?: React.MutableRefObject<E | null>;
|
|
6
|
-
id?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type MuiModalBaseProps = Pick<MuiModalProps, 'sx' | 'children' | 'onClose'>;
|
|
10
|
-
|
|
11
|
-
export interface ModalBaseProps extends MuiModalBaseProps {
|
|
12
|
-
sx?: SxProps<Theme>;
|
|
13
|
-
title?: string;
|
|
14
|
-
open: boolean;
|
|
15
|
-
children: React.ReactElement;
|
|
16
|
-
onConfirm?: (
|
|
17
|
-
event?: React.MouseEvent | React.KeyboardEvent | React.TouchEvent,
|
|
18
|
-
contextId?: string
|
|
19
|
-
) => void;
|
|
20
|
-
onClose?: {
|
|
21
|
-
bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void;
|
|
22
|
-
}['bivarianceHack'];
|
|
23
|
-
onCancel?: (
|
|
24
|
-
event?: React.MouseEvent | React.KeyboardEvent | React.TouchEvent,
|
|
25
|
-
contextId?: string
|
|
26
|
-
) => void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ModalHeaderProps {
|
|
30
|
-
title?: string;
|
|
31
|
-
onClose?: {
|
|
32
|
-
bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void;
|
|
33
|
-
}['bivarianceHack'];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ModalFooterProps {
|
|
37
|
-
onCancel?: (
|
|
38
|
-
event?: React.MouseEvent | React.KeyboardEvent | React.TouchEvent,
|
|
39
|
-
contextId?: string
|
|
40
|
-
) => void;
|
|
41
|
-
onConfirm: (
|
|
42
|
-
event?: React.MouseEvent | React.KeyboardEvent | React.TouchEvent,
|
|
43
|
-
contextId?: string
|
|
44
|
-
) => void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type ModalType = keyof typeof Modal;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './progress-bar';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import type { StoryDefault, Story } from '@ladle/react'
|
|
3
|
-
import { ProgressBar } from './progress-bar'
|
|
4
|
-
import { Fragment } from 'react'
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Data / ProgressBar',
|
|
8
|
-
meta: {
|
|
9
|
-
key: 'button',
|
|
10
|
-
},
|
|
11
|
-
} satisfies StoryDefault
|
|
12
|
-
|
|
13
|
-
export const ProgressBarVariant: Story = () => (
|
|
14
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
15
|
-
<div style={{ position: 'relative', width: '100%' }}>
|
|
16
|
-
<ProgressBar value={10} usage={23} total={100} />
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
ProgressBarVariant.storyName = 'Progressbar Simple'
|
|
22
|
-
|
|
23
|
-
export const ProgressBarTitle: Story = () => (
|
|
24
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
25
|
-
<div style={{ position: 'relative', width: '100%' }}>
|
|
26
|
-
<ProgressBar value={10} label="Progress" usage={23} total={100} />
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
ProgressBarTitle.storyName = 'Progressbar Title'
|
|
32
|
-
|
|
33
|
-
export const ProgressBarColors: Story = () => (
|
|
34
|
-
<Fragment>
|
|
35
|
-
<div style={{ display: 'flex', gap: '1rem', marginBottom: 15 }}>
|
|
36
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
37
|
-
<ProgressBar value={60} usage={23} total={100} color="inherit" label="Progress Inherit" />
|
|
38
|
-
</div>
|
|
39
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
40
|
-
<ProgressBar
|
|
41
|
-
value={60}
|
|
42
|
-
usage={23}
|
|
43
|
-
total={100}
|
|
44
|
-
color="secondary"
|
|
45
|
-
label="Progress secondary"
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div style={{ display: 'flex', gap: '1rem', marginBottom: 15 }}>
|
|
50
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
51
|
-
<ProgressBar value={60} usage={23} total={100} color="error" label="Progress error" />
|
|
52
|
-
</div>
|
|
53
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
54
|
-
<ProgressBar value={60} usage={23} total={100} color="info" label="Progress info" />
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div style={{ display: 'flex', gap: '1rem', marginBottom: 15 }}>
|
|
58
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
59
|
-
<ProgressBar value={60} usage={23} total={100} color="success" label="Progress success" />
|
|
60
|
-
</div>
|
|
61
|
-
<div style={{ position: 'relative', flex: 1, width: '100%' }}>
|
|
62
|
-
<ProgressBar value={60} usage={23} total={100} color="warning" label="Progress warning" />
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</Fragment>
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
ProgressBarColors.storyName = 'Progressbar Colors'
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider } from '@emotion/react';
|
|
2
|
-
import { themes } from '../../helpers/colors';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ProgressBarBaseProps } from './types';
|
|
5
|
-
import { StyledProgressBarLabel, StyledProgressBar } from './styles';
|
|
6
|
-
|
|
7
|
-
export const ProgressBar: React.FC<ProgressBarBaseProps & {
|
|
8
|
-
usage?: number;
|
|
9
|
-
total?: number;
|
|
10
|
-
colorCustom?: string;
|
|
11
|
-
}> = ({
|
|
12
|
-
value = 0,
|
|
13
|
-
label,
|
|
14
|
-
variant = 'determinate',
|
|
15
|
-
usage,
|
|
16
|
-
total,
|
|
17
|
-
...props
|
|
18
|
-
}) => {
|
|
19
|
-
const percentage = usage && total ? (usage / total) * 100 : 0;
|
|
20
|
-
return (
|
|
21
|
-
<ThemeProvider theme={themes.light}>
|
|
22
|
-
{label && (
|
|
23
|
-
<StyledProgressBarLabel>
|
|
24
|
-
{label}
|
|
25
|
-
<span style={{ right: 0 }}>
|
|
26
|
-
{total} ({percentage.toFixed(2)}%)
|
|
27
|
-
</span>
|
|
28
|
-
</StyledProgressBarLabel>
|
|
29
|
-
)}
|
|
30
|
-
<StyledProgressBar
|
|
31
|
-
value={value}
|
|
32
|
-
variant={variant}
|
|
33
|
-
sx={{ height: 10 }}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
</ThemeProvider>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LinearProgress as MuiProgressBar,
|
|
3
|
-
linearProgressClasses,
|
|
4
|
-
} from '@mui/material';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import { StyledProgressBarProps } from './types';
|
|
7
|
-
|
|
8
|
-
export const StyledProgressBar = styled(MuiProgressBar)<StyledProgressBarProps>`
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 5px;
|
|
11
|
-
border-radius: 10px;
|
|
12
|
-
position: relative;
|
|
13
|
-
|
|
14
|
-
&.${linearProgressClasses.determinate} {
|
|
15
|
-
background-color: #e0e0e0;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const StyledProgressBarLabel = styled.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
align-items: center;
|
|
23
|
-
margin-bottom: 8px;
|
|
24
|
-
position: relative;
|
|
25
|
-
text-align: left;
|
|
26
|
-
font: normal normal normal 16px/20px Source Sans Pro;
|
|
27
|
-
`;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SxProps, LinearProgressProps } from '@mui/material';
|
|
2
|
-
import { Theme } from '@emotion/react';
|
|
3
|
-
import { OverridableStringUnion } from '@mui/types';
|
|
4
|
-
import { ProgressBar } from './progress-bar';
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
7
|
-
export interface LinearProgressPropsColorOverrides {}
|
|
8
|
-
|
|
9
|
-
type MuiProgressBarBaseProps = Pick<LinearProgressProps, 'sx'>;
|
|
10
|
-
|
|
11
|
-
export interface ProgressBarBaseProps extends MuiProgressBarBaseProps {
|
|
12
|
-
sx?: SxProps<Theme>;
|
|
13
|
-
usage?: number;
|
|
14
|
-
value?: number;
|
|
15
|
-
total?: number;
|
|
16
|
-
label?: string;
|
|
17
|
-
colorCustom?: string;
|
|
18
|
-
variant?: 'determinate' | 'indeterminate' | 'buffer' | 'query';
|
|
19
|
-
color?: OverridableStringUnion<
|
|
20
|
-
| 'primary'
|
|
21
|
-
| 'secondary'
|
|
22
|
-
| 'error'
|
|
23
|
-
| 'info'
|
|
24
|
-
| 'success'
|
|
25
|
-
| 'warning'
|
|
26
|
-
| 'inherit',
|
|
27
|
-
LinearProgressPropsColorOverrides
|
|
28
|
-
>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type StyledProgressBarProps = {
|
|
32
|
-
colorCustom?: string;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type ProgressBarType = keyof typeof ProgressBar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './radio';
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { StoryDefault, Story } from '@ladle/react'
|
|
3
|
-
import { Radiobox } from './radio'
|
|
4
|
-
import { FormControl, FormControlLabel, FormLabel, RadioGroup } from '@mui/material'
|
|
5
|
-
import { pink } from '@mui/material/colors'
|
|
6
|
-
import { ChangeEvent, useState } from 'react'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Form / Radiobox',
|
|
10
|
-
meta: {
|
|
11
|
-
key: 'radiobox',
|
|
12
|
-
},
|
|
13
|
-
} satisfies StoryDefault
|
|
14
|
-
|
|
15
|
-
export const RadioboxBasic: Story = () => {
|
|
16
|
-
const [selectedValue, setSelectedValue] = useState('b')
|
|
17
|
-
|
|
18
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
19
|
-
setSelectedValue(event.target.value)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
24
|
-
<Radiobox
|
|
25
|
-
checked={selectedValue === 'a'}
|
|
26
|
-
onChange={handleChange}
|
|
27
|
-
value="a"
|
|
28
|
-
name="radio-buttons"
|
|
29
|
-
inputProps={{ 'aria-label': 'A' }}
|
|
30
|
-
/>
|
|
31
|
-
<Radiobox
|
|
32
|
-
checked={selectedValue === 'b'}
|
|
33
|
-
onChange={handleChange}
|
|
34
|
-
value="b"
|
|
35
|
-
name="radio-buttons"
|
|
36
|
-
inputProps={{ 'aria-label': 'B' }}
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
RadioboxBasic.storyName = 'Radiobox Basic'
|
|
43
|
-
|
|
44
|
-
export const RadioboxGroup: Story = () => (
|
|
45
|
-
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
46
|
-
<FormControl>
|
|
47
|
-
<FormLabel id="demo-radio-buttons-group-label">Gender</FormLabel>
|
|
48
|
-
<RadioGroup
|
|
49
|
-
aria-labelledby="demo-radio-buttons-group-label"
|
|
50
|
-
defaultValue="female"
|
|
51
|
-
name="radio-buttons-group"
|
|
52
|
-
>
|
|
53
|
-
<FormControlLabel value="female" control={<Radiobox />} label="Female" />
|
|
54
|
-
<FormControlLabel value="male" control={<Radiobox />} label="Male" />
|
|
55
|
-
<FormControlLabel value="other" control={<Radiobox />} label="Other" />
|
|
56
|
-
</RadioGroup>
|
|
57
|
-
</FormControl>
|
|
58
|
-
</div>
|
|
59
|
-
)
|
|
60
|
-
RadioboxGroup.storyName = 'Radiobox Group'
|
|
61
|
-
|
|
62
|
-
export const RadioboxDirection: Story = () => (
|
|
63
|
-
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
64
|
-
<FormControl>
|
|
65
|
-
<FormLabel id="demo-row-radio-buttons-group-label">Gender</FormLabel>
|
|
66
|
-
<RadioGroup
|
|
67
|
-
row
|
|
68
|
-
aria-labelledby="demo-row-radio-buttons-group-label"
|
|
69
|
-
name="row-radio-buttons-group"
|
|
70
|
-
>
|
|
71
|
-
<FormControlLabel value="female" control={<Radiobox />} label="Female" />
|
|
72
|
-
<FormControlLabel value="male" control={<Radiobox />} label="Male" />
|
|
73
|
-
<FormControlLabel value="other" control={<Radiobox />} label="Other" />
|
|
74
|
-
<FormControlLabel value="disabled" disabled control={<Radiobox />} label="other" />
|
|
75
|
-
</RadioGroup>
|
|
76
|
-
</FormControl>
|
|
77
|
-
</div>
|
|
78
|
-
)
|
|
79
|
-
RadioboxDirection.storyName = 'Radiobox Direction'
|
|
80
|
-
|
|
81
|
-
export const RadioboxSize: Story = () => {
|
|
82
|
-
const [selectedValue, setSelectedValue] = useState('a')
|
|
83
|
-
|
|
84
|
-
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
85
|
-
setSelectedValue(event.target.value)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const controlProps = (item: string) => ({
|
|
89
|
-
checked: selectedValue === item,
|
|
90
|
-
onChange: handleChange,
|
|
91
|
-
value: item,
|
|
92
|
-
name: 'size-radio-button-demo',
|
|
93
|
-
inputProps: { 'aria-label': item },
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
98
|
-
<Radiobox {...controlProps('a')} size="small" />
|
|
99
|
-
<Radiobox {...controlProps('b')} />
|
|
100
|
-
<Radiobox
|
|
101
|
-
{...controlProps('c')}
|
|
102
|
-
sx={{
|
|
103
|
-
'& .MuiSvgIcon-root': {
|
|
104
|
-
fontSize: 28,
|
|
105
|
-
},
|
|
106
|
-
}}
|
|
107
|
-
/>
|
|
108
|
-
</div>
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
RadioboxSize.storyName = 'Radiobox Size'
|
|
113
|
-
|
|
114
|
-
export const RadioboxColors: Story = () => (
|
|
115
|
-
<div style={{ display: 'flex', gap: '1rem', margin: 16 }}>
|
|
116
|
-
<FormControl>
|
|
117
|
-
<FormLabel id="demo-row-radio-buttons-group-label">Colors</FormLabel>
|
|
118
|
-
<RadioGroup
|
|
119
|
-
row
|
|
120
|
-
aria-labelledby="demo-row-radio-buttons-group-label"
|
|
121
|
-
name="row-radio-buttons-group"
|
|
122
|
-
>
|
|
123
|
-
<FormControlLabel value="Primary" control={<Radiobox />} label="Primary" />
|
|
124
|
-
<FormControlLabel
|
|
125
|
-
value="secondary"
|
|
126
|
-
control={<Radiobox color="secondary" />}
|
|
127
|
-
label="Secondary"
|
|
128
|
-
/>
|
|
129
|
-
<FormControlLabel value="success" control={<Radiobox color="success" />} label="Success" />
|
|
130
|
-
<FormControlLabel value="default" control={<Radiobox color="default" />} label="Default" />
|
|
131
|
-
<FormControlLabel
|
|
132
|
-
value="pink"
|
|
133
|
-
label="Pink"
|
|
134
|
-
control={
|
|
135
|
-
<Radiobox
|
|
136
|
-
sx={{
|
|
137
|
-
color: pink[800],
|
|
138
|
-
'&.Mui-checked': {
|
|
139
|
-
color: pink[600],
|
|
140
|
-
},
|
|
141
|
-
}}
|
|
142
|
-
/>
|
|
143
|
-
}
|
|
144
|
-
/>
|
|
145
|
-
</RadioGroup>
|
|
146
|
-
</FormControl>
|
|
147
|
-
</div>
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
RadioboxColors.storyName = 'Radiobox Colors'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider } from '@emotion/react';
|
|
2
|
-
import { themes } from '../../helpers/colors';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { RadioBaseProps } from './types';
|
|
5
|
-
import { Radio as MuiRadio } from '@mui/material';
|
|
6
|
-
|
|
7
|
-
export const Radiobox: React.FC<RadioBaseProps> = ({ ...rest }) => {
|
|
8
|
-
return (
|
|
9
|
-
<ThemeProvider theme={themes.light}>
|
|
10
|
-
<MuiRadio {...rest} />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { OverridableStringUnion } from '@mui/types'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Radio,
|
|
6
|
-
ButtonBaseProps as MuiButtonBaseProps,
|
|
7
|
-
RadioPropsColorOverrides,
|
|
8
|
-
RadioPropsSizeOverrides,
|
|
9
|
-
} from '@mui/material'
|
|
10
|
-
|
|
11
|
-
type MuiRadioBaseProps = Pick<MuiButtonBaseProps, 'sx'>
|
|
12
|
-
|
|
13
|
-
export interface RadioBaseProps extends MuiRadioBaseProps {
|
|
14
|
-
name?: string
|
|
15
|
-
disabled?: boolean
|
|
16
|
-
required?: boolean
|
|
17
|
-
tabIndex?: number
|
|
18
|
-
value?: unknown
|
|
19
|
-
size?: OverridableStringUnion<'small' | 'medium', RadioPropsSizeOverrides>
|
|
20
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement>
|
|
21
|
-
color?: OverridableStringUnion<
|
|
22
|
-
'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default',
|
|
23
|
-
RadioPropsColorOverrides
|
|
24
|
-
>
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type RadioType = keyof typeof Radio
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tag';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import type { StoryDefault, Story } from '@ladle/react'
|
|
3
|
-
import { Tag } from './tag'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Data / Tag',
|
|
7
|
-
meta: {
|
|
8
|
-
key: 'tag',
|
|
9
|
-
},
|
|
10
|
-
} satisfies StoryDefault
|
|
11
|
-
|
|
12
|
-
export const TagBasic: Story = () => (
|
|
13
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
14
|
-
<Tag label="Tag Filled" />
|
|
15
|
-
<Tag label="Tag Outlined" variant="outlined" />
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
TagBasic.storyName = 'Tag Basic'
|
|
20
|
-
|
|
21
|
-
export const TagClickable: Story = () => {
|
|
22
|
-
const handleClick = () => {
|
|
23
|
-
console.info('You clicked the Chip.')
|
|
24
|
-
}
|
|
25
|
-
return (
|
|
26
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
27
|
-
<Tag label="Clickable" onClick={handleClick} />
|
|
28
|
-
<Tag label="Clickable" variant="outlined" onClick={handleClick} />
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
TagClickable.storyName = 'Tag Clickable'
|
|
34
|
-
|
|
35
|
-
export const TagDeletable: Story = () => {
|
|
36
|
-
const handleDelete = () => {
|
|
37
|
-
console.info('You clicked the delete icon.')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
42
|
-
<Tag label="Deletable" onDelete={handleDelete} />
|
|
43
|
-
<Tag label="Deletable" variant="outlined" onDelete={handleDelete} />
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
TagDeletable.storyName = 'Tag Deletable'
|
|
49
|
-
|
|
50
|
-
export const TagColor: Story = () => {
|
|
51
|
-
const handleDelete = () => {
|
|
52
|
-
console.info('You clicked the delete icon.')
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
57
|
-
<Tag label="Deletable" onDelete={handleDelete} color="primary" />
|
|
58
|
-
<Tag label="Deletable" onDelete={handleDelete} color="success" />
|
|
59
|
-
<Tag label="Deletable" variant="outlined" onDelete={handleDelete} color="primary" />
|
|
60
|
-
<Tag label="Deletable" variant="outlined" onDelete={handleDelete} color="success" />
|
|
61
|
-
</div>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
TagColor.storyName = 'Tag Color'
|
|
66
|
-
|
|
67
|
-
export const TagSize: Story = () => {
|
|
68
|
-
const handleDelete = () => {
|
|
69
|
-
console.info('You clicked the delete icon.')
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<div style={{ display: 'flex', gap: '1rem' }}>
|
|
74
|
-
<Tag label="Small" onDelete={handleDelete} size="small" />
|
|
75
|
-
<Tag label="Small outlined" variant="outlined" onDelete={handleDelete} size="small" />
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
TagSize.storyName = 'Tag Size'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { themes } from '../../helpers/colors';
|
|
2
|
-
import { ThemeProvider } from '@mui/material';
|
|
3
|
-
import { Chip as MuiChip } from '@mui/material';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { TagBaseProps } from './types';
|
|
6
|
-
|
|
7
|
-
export const Tag: React.FC<TagBaseProps> = ({ ...rest }) => {
|
|
8
|
-
return (
|
|
9
|
-
<ThemeProvider theme={themes.light}>
|
|
10
|
-
<MuiChip {...rest} />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChipProps,
|
|
3
|
-
ChipPropsColorOverrides,
|
|
4
|
-
ChipPropsSizeOverrides,
|
|
5
|
-
ChipPropsVariantOverrides,
|
|
6
|
-
SxProps,
|
|
7
|
-
} from '@mui/material';
|
|
8
|
-
import { OverridableStringUnion } from '@mui/types';
|
|
9
|
-
import { Theme } from '@emotion/react';
|
|
10
|
-
import Tag from './tag';
|
|
11
|
-
|
|
12
|
-
type MuiTagBaseProps = Pick<ChipProps, 'sx'>;
|
|
13
|
-
|
|
14
|
-
export interface TagBaseProps extends MuiTagBaseProps {
|
|
15
|
-
sx?: SxProps<Theme>;
|
|
16
|
-
avatar?: React.ReactElement;
|
|
17
|
-
children?: null;
|
|
18
|
-
clickable?: boolean;
|
|
19
|
-
deleteIcon?: React.ReactElement;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
icon?: React.ReactElement;
|
|
22
|
-
label?: React.ReactNode;
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
onDelete?: React.EventHandler<any>;
|
|
25
|
-
size?: OverridableStringUnion<'small' | 'medium', ChipPropsSizeOverrides>;
|
|
26
|
-
skipFocusWhenDisabled?: boolean;
|
|
27
|
-
tabIndex?: number;
|
|
28
|
-
variant?: OverridableStringUnion<
|
|
29
|
-
'filled' | 'outlined',
|
|
30
|
-
ChipPropsVariantOverrides
|
|
31
|
-
>;
|
|
32
|
-
onClick?: (
|
|
33
|
-
event: React.MouseEvent | React.KeyboardEvent | React.TouchEvent
|
|
34
|
-
) => void;
|
|
35
|
-
color?: OverridableStringUnion<
|
|
36
|
-
| 'default'
|
|
37
|
-
| 'primary'
|
|
38
|
-
| 'secondary'
|
|
39
|
-
| 'error'
|
|
40
|
-
| 'info'
|
|
41
|
-
| 'success'
|
|
42
|
-
| 'warning',
|
|
43
|
-
ChipPropsColorOverrides
|
|
44
|
-
>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type TagType = keyof typeof Tag;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './textfield';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextFieldBaseProps } from './types';
|
|
3
|
-
import {
|
|
4
|
-
FormControl,
|
|
5
|
-
ThemeProvider,
|
|
6
|
-
TextField as MuiTextField,
|
|
7
|
-
} from '@mui/material';
|
|
8
|
-
import { themes } from '../../helpers/colors';
|
|
9
|
-
|
|
10
|
-
export const TextField: React.FC<TextFieldBaseProps> = ({
|
|
11
|
-
label,
|
|
12
|
-
disabled = false,
|
|
13
|
-
onChange,
|
|
14
|
-
...rest
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<ThemeProvider theme={themes.light}>
|
|
18
|
-
<FormControl sx={{ width: '100%' }}>
|
|
19
|
-
<MuiTextField {...rest} label={label} disabled={disabled} />
|
|
20
|
-
</FormControl>
|
|
21
|
-
</ThemeProvider>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
TextFieldProps as MuiTextFieldProps,
|
|
5
|
-
TextFieldPropsColorOverrides,
|
|
6
|
-
TextFieldPropsSizeOverrides,
|
|
7
|
-
} from '@mui/material/TextField'
|
|
8
|
-
import {
|
|
9
|
-
FormHelperTextProps,
|
|
10
|
-
InputBaseProps,
|
|
11
|
-
InputLabelProps,
|
|
12
|
-
OutlinedInputProps,
|
|
13
|
-
SelectProps,
|
|
14
|
-
} from '@mui/material'
|
|
15
|
-
import { InputProps as StandardInputProps } from '@mui/material/Input'
|
|
16
|
-
import { OverridableStringUnion } from '@mui/types'
|
|
17
|
-
import { TextField } from '@mui/material'
|
|
18
|
-
|
|
19
|
-
export type TextFieldValue = string | number
|
|
20
|
-
export type TextFieldVariant = 'standard' | 'outlined' | 'filled'
|
|
21
|
-
|
|
22
|
-
type MuiTextFieldBaseProps = Pick<
|
|
23
|
-
MuiTextFieldProps,
|
|
24
|
-
| 'onChange'
|
|
25
|
-
| 'onBlur'
|
|
26
|
-
| 'onFocus'
|
|
27
|
-
| 'defaultValue'
|
|
28
|
-
| 'size'
|
|
29
|
-
| 'value'
|
|
30
|
-
| 'id'
|
|
31
|
-
| 'fullWidth'
|
|
32
|
-
| 'helperText'
|
|
33
|
-
| 'type'
|
|
34
|
-
| 'InputProps'
|
|
35
|
-
| 'InputLabelProps'
|
|
36
|
-
| 'autoComplete'
|
|
37
|
-
| 'label'
|
|
38
|
-
| 'helperText'
|
|
39
|
-
| 'InputLabelProps'
|
|
40
|
-
| 'margin'
|
|
41
|
-
| 'maxRows'
|
|
42
|
-
| 'minRows'
|
|
43
|
-
| 'multiline'
|
|
44
|
-
| 'name'
|
|
45
|
-
| 'placeholder'
|
|
46
|
-
| 'rows'
|
|
47
|
-
| 'select'
|
|
48
|
-
| 'SelectProps'
|
|
49
|
-
| 'sx'
|
|
50
|
-
| 'autoFocus'
|
|
51
|
-
| 'error'
|
|
52
|
-
| 'classes'
|
|
53
|
-
| 'children'
|
|
54
|
-
| 'color'
|
|
55
|
-
| 'variant'
|
|
56
|
-
>
|
|
57
|
-
|
|
58
|
-
export interface TextFieldBaseProps extends MuiTextFieldBaseProps {
|
|
59
|
-
id?: string
|
|
60
|
-
name?: string
|
|
61
|
-
defaultValue?: string
|
|
62
|
-
disabled?: boolean
|
|
63
|
-
required?: boolean
|
|
64
|
-
type?: React.InputHTMLAttributes<unknown>['type']
|
|
65
|
-
hasError?: boolean
|
|
66
|
-
label?: ReactNode
|
|
67
|
-
children?: ReactNode
|
|
68
|
-
error?: boolean
|
|
69
|
-
variant?: TextFieldVariant
|
|
70
|
-
helperText?: React.ReactNode
|
|
71
|
-
InputLabelProps?: Partial<InputLabelProps>
|
|
72
|
-
InputProps?: Partial<OutlinedInputProps>
|
|
73
|
-
autoComplete?: string
|
|
74
|
-
placeholder?: string
|
|
75
|
-
multiline?: boolean
|
|
76
|
-
rows?: string | number
|
|
77
|
-
maxRows?: string | number
|
|
78
|
-
minRows?: string | number
|
|
79
|
-
select?: boolean
|
|
80
|
-
SelectProps?: Partial<SelectProps>
|
|
81
|
-
onClick?: InputBaseProps['onClick']
|
|
82
|
-
onBlur?: InputBaseProps['onBlur']
|
|
83
|
-
onFocus?: StandardInputProps['onFocus']
|
|
84
|
-
size?: OverridableStringUnion<'small' | 'medium', TextFieldPropsSizeOverrides>
|
|
85
|
-
FormHelperTextProps?: Partial<FormHelperTextProps>
|
|
86
|
-
color?: OverridableStringUnion<
|
|
87
|
-
'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
|
|
88
|
-
TextFieldPropsColorOverrides
|
|
89
|
-
>
|
|
90
|
-
value?: unknown
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type TextFieldType = keyof typeof TextField
|