@tiny-server/design 0.0.0-pre202605241751
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/badge-group/BadgeGroup.d.ts +6 -0
- package/dist/components/badge-group/BadgeGroup.stories.d.ts +6 -0
- package/dist/components/badge-group/index.d.ts +1 -0
- package/dist/components/checkbox-card/CheckboxCard.d.ts +7 -0
- package/dist/components/checkbox-card/CheckboxCard.stories.d.ts +6 -0
- package/dist/components/checkbox-card/index.d.ts +1 -0
- package/dist/components/form/Form.d.ts +15 -0
- package/dist/components/form/Form.stories.d.ts +6 -0
- package/dist/components/form/FormAlert.d.ts +6 -0
- package/dist/components/form/FormFooter.d.ts +4 -0
- package/dist/components/form/FormSection.d.ts +4 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/image-cropper/ImageCropper.d.ts +11 -0
- package/dist/components/image-cropper/cropImage.d.ts +11 -0
- package/dist/components/image-cropper/index.d.ts +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/labeled-info/LabeledInfo.d.ts +19 -0
- package/dist/components/labeled-info/LabeledInfo.stories.d.ts +6 -0
- package/dist/components/labeled-info/index.d.ts +1 -0
- package/dist/components/section-card/Header.d.ts +18 -0
- package/dist/components/section-card/Section.d.ts +14 -0
- package/dist/components/section-card/SectionCard.d.ts +21 -0
- package/dist/components/section-card/SectionCard.stories.d.ts +7 -0
- package/dist/components/section-card/index.d.ts +3 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +312 -0
- package/package.json +52 -0
- package/src/components/badge-group/BadgeGroup.stories.tsx +24 -0
- package/src/components/badge-group/BadgeGroup.tsx +24 -0
- package/src/components/badge-group/index.ts +1 -0
- package/src/components/checkbox-card/CheckboxCard.stories.tsx +33 -0
- package/src/components/checkbox-card/CheckboxCard.tsx +22 -0
- package/src/components/checkbox-card/index.ts +1 -0
- package/src/components/form/Form.stories.tsx +30 -0
- package/src/components/form/Form.tsx +22 -0
- package/src/components/form/FormAlert.tsx +25 -0
- package/src/components/form/FormFooter.tsx +7 -0
- package/src/components/form/FormSection.tsx +7 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/image-cropper/ImageCropper.tsx +73 -0
- package/src/components/image-cropper/cropImage.ts +87 -0
- package/src/components/image-cropper/index.ts +1 -0
- package/src/components/index.ts +6 -0
- package/src/components/labeled-info/LabeledInfo.stories.tsx +27 -0
- package/src/components/labeled-info/LabeledInfo.tsx +54 -0
- package/src/components/labeled-info/index.ts +1 -0
- package/src/components/section-card/Header.tsx +81 -0
- package/src/components/section-card/Section.tsx +48 -0
- package/src/components/section-card/SectionCard.module.css +40 -0
- package/src/components/section-card/SectionCard.stories.tsx +61 -0
- package/src/components/section-card/SectionCard.tsx +52 -0
- package/src/components/section-card/index.ts +4 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
factory,
|
|
4
|
+
Paper,
|
|
5
|
+
Text,
|
|
6
|
+
useProps,
|
|
7
|
+
type BoxProps,
|
|
8
|
+
type ElementProps,
|
|
9
|
+
type Factory,
|
|
10
|
+
type PaperBaseProps,
|
|
11
|
+
type StylesApiProps,
|
|
12
|
+
} from '@mantine/core';
|
|
13
|
+
import { SectionCardSection } from './Section';
|
|
14
|
+
import { SectionCardHeader } from './Header';
|
|
15
|
+
import classes from './SectionCard.module.css';
|
|
16
|
+
|
|
17
|
+
export interface SectionCardProps
|
|
18
|
+
extends BoxProps, PaperBaseProps, StylesApiProps<SectionCardFactory>, ElementProps<'section'> {}
|
|
19
|
+
|
|
20
|
+
export type SectionCardFactory = Factory<{
|
|
21
|
+
props: SectionCardProps;
|
|
22
|
+
ref: HTMLDivElement;
|
|
23
|
+
staticComponents: {
|
|
24
|
+
Header: typeof SectionCardHeader;
|
|
25
|
+
Section: typeof SectionCardSection;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
|
|
29
|
+
const defaultSectionCardProps = {
|
|
30
|
+
radius: 'lg',
|
|
31
|
+
shadow: 'sm',
|
|
32
|
+
withBorder: false,
|
|
33
|
+
} satisfies Partial<SectionCardProps>;
|
|
34
|
+
|
|
35
|
+
export const SectionCard = factory<SectionCardFactory>((_props) => {
|
|
36
|
+
const { radius, shadow, withBorder, children, className, ...rest } = useProps(
|
|
37
|
+
'SectionCard',
|
|
38
|
+
defaultSectionCardProps,
|
|
39
|
+
_props,
|
|
40
|
+
);
|
|
41
|
+
return (
|
|
42
|
+
<Box component="section" className={`${classes['section-card']} ${className ?? ''}`} {...rest}>
|
|
43
|
+
<Paper radius={radius} shadow={shadow} withBorder={withBorder}>
|
|
44
|
+
<Text component="div">{children}</Text>
|
|
45
|
+
</Paper>
|
|
46
|
+
</Box>
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
SectionCard.displayName = 'SectionCard';
|
|
51
|
+
SectionCard.Header = SectionCardHeader;
|
|
52
|
+
SectionCard.Section = SectionCardSection;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|