@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.
Files changed (54) hide show
  1. package/dist/components/badge-group/BadgeGroup.d.ts +6 -0
  2. package/dist/components/badge-group/BadgeGroup.stories.d.ts +6 -0
  3. package/dist/components/badge-group/index.d.ts +1 -0
  4. package/dist/components/checkbox-card/CheckboxCard.d.ts +7 -0
  5. package/dist/components/checkbox-card/CheckboxCard.stories.d.ts +6 -0
  6. package/dist/components/checkbox-card/index.d.ts +1 -0
  7. package/dist/components/form/Form.d.ts +15 -0
  8. package/dist/components/form/Form.stories.d.ts +6 -0
  9. package/dist/components/form/FormAlert.d.ts +6 -0
  10. package/dist/components/form/FormFooter.d.ts +4 -0
  11. package/dist/components/form/FormSection.d.ts +4 -0
  12. package/dist/components/form/index.d.ts +1 -0
  13. package/dist/components/image-cropper/ImageCropper.d.ts +11 -0
  14. package/dist/components/image-cropper/cropImage.d.ts +11 -0
  15. package/dist/components/image-cropper/index.d.ts +1 -0
  16. package/dist/components/index.d.ts +6 -0
  17. package/dist/components/labeled-info/LabeledInfo.d.ts +19 -0
  18. package/dist/components/labeled-info/LabeledInfo.stories.d.ts +6 -0
  19. package/dist/components/labeled-info/index.d.ts +1 -0
  20. package/dist/components/section-card/Header.d.ts +18 -0
  21. package/dist/components/section-card/Section.d.ts +14 -0
  22. package/dist/components/section-card/SectionCard.d.ts +21 -0
  23. package/dist/components/section-card/SectionCard.stories.d.ts +7 -0
  24. package/dist/components/section-card/index.d.ts +3 -0
  25. package/dist/index.css +1 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +312 -0
  28. package/package.json +52 -0
  29. package/src/components/badge-group/BadgeGroup.stories.tsx +24 -0
  30. package/src/components/badge-group/BadgeGroup.tsx +24 -0
  31. package/src/components/badge-group/index.ts +1 -0
  32. package/src/components/checkbox-card/CheckboxCard.stories.tsx +33 -0
  33. package/src/components/checkbox-card/CheckboxCard.tsx +22 -0
  34. package/src/components/checkbox-card/index.ts +1 -0
  35. package/src/components/form/Form.stories.tsx +30 -0
  36. package/src/components/form/Form.tsx +22 -0
  37. package/src/components/form/FormAlert.tsx +25 -0
  38. package/src/components/form/FormFooter.tsx +7 -0
  39. package/src/components/form/FormSection.tsx +7 -0
  40. package/src/components/form/index.ts +1 -0
  41. package/src/components/image-cropper/ImageCropper.tsx +73 -0
  42. package/src/components/image-cropper/cropImage.ts +87 -0
  43. package/src/components/image-cropper/index.ts +1 -0
  44. package/src/components/index.ts +6 -0
  45. package/src/components/labeled-info/LabeledInfo.stories.tsx +27 -0
  46. package/src/components/labeled-info/LabeledInfo.tsx +54 -0
  47. package/src/components/labeled-info/index.ts +1 -0
  48. package/src/components/section-card/Header.tsx +81 -0
  49. package/src/components/section-card/Section.tsx +48 -0
  50. package/src/components/section-card/SectionCard.module.css +40 -0
  51. package/src/components/section-card/SectionCard.stories.tsx +61 -0
  52. package/src/components/section-card/SectionCard.tsx +52 -0
  53. package/src/components/section-card/index.ts +4 -0
  54. 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;
@@ -0,0 +1,4 @@
1
+ export * from './SectionCard';
2
+
3
+ export type { SectionCardHeaderProps } from './Header';
4
+ export type { SectionCardSectionProps } from './Section';
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './components';