@fpkit/acss 0.5.8 → 0.5.9

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.
@@ -1,54 +1,53 @@
1
1
  // import FP from '../fp'
2
- import React from 'react'
3
- import UI from '#components/ui'
2
+ import React from "react";
3
+ import UI from "#components/ui";
4
4
 
5
- type InheritedProps = React.ComponentProps<typeof UI>
5
+ type InheritedProps = React.ComponentProps<typeof UI>;
6
6
 
7
7
  type TextElements =
8
- | 'a'
9
- | 'b'
10
- | 'blockquote'
11
- | 'b'
12
- | 'blockquote'
13
- | 'cite'
14
- | 'code'
15
- | 'em'
16
- | 'i'
17
- | 'em'
18
- | 'i'
19
- | 'kbd'
20
- | 'mark'
21
- | 'p'
22
- | 's'
23
- | 'small'
24
- | 'span'
25
- | 'span'
26
- | 'strong'
27
- | 'mark'
28
- | 'p'
29
- | 's'
30
- | 'small'
31
- | 'span'
32
- | 'span'
33
- | 'strong'
34
- | 'sub'
35
- | 'sup'
36
- | 'time'
37
- | 'time'
38
- | 'u'
8
+ | "a"
9
+ | "b"
10
+ | "blockquote"
11
+ | "b"
12
+ | "blockquote"
13
+ | "cite"
14
+ | "code"
15
+ | "em"
16
+ | "i"
17
+ | "em"
18
+ | "i"
19
+ | "kbd"
20
+ | "mark"
21
+ | "p"
22
+ | "s"
23
+ | "small"
24
+ | "span"
25
+ | "span"
26
+ | "strong"
27
+ | "mark"
28
+ | "p"
29
+ | "s"
30
+ | "small"
31
+ | "span"
32
+ | "span"
33
+ | "strong"
34
+ | "sub"
35
+ | "sup"
36
+ | "time"
37
+ | "time"
38
+ | "u";
39
39
 
40
40
  export type TextProps = {
41
41
  /**
42
- * Text element to to use
43
- * Text element to to use
42
+ * Pass a text element
44
43
  */
45
- elm?: TextElements
44
+ elm?: TextElements;
46
45
  /** Pass a text element or string */
47
- text?: string
48
- } & InheritedProps
46
+ text?: string;
47
+ } & InheritedProps;
49
48
 
50
49
  export const Text = ({
51
- elm = 'p',
50
+ elm = "p",
52
51
  id,
53
52
  text,
54
53
  styles,
@@ -62,18 +61,18 @@ export const Text = ({
62
61
  {children || text}
63
62
  </UI>
64
63
  </UI>
65
- )
66
- }
64
+ );
65
+ };
67
66
 
68
67
  type TitleProps = {
69
68
  /**
70
69
  * HTML headings
71
70
  */
72
- elm?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
73
- } & InheritedProps
71
+ elm?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
72
+ } & InheritedProps;
74
73
 
75
74
  export const Title = ({
76
- elm = 'h3',
75
+ elm = "h3",
77
76
  id,
78
77
  children,
79
78
  styles,
@@ -84,10 +83,10 @@ export const Title = ({
84
83
  <Text as={elm} id={id} styles={styles} className={classes} {...props}>
85
84
  {children}
86
85
  </Text>
87
- )
88
- }
86
+ );
87
+ };
89
88
 
90
- export default Text
89
+ export default Text;
91
90
 
92
- Text.displayName = 'Text'
93
- Title.displayName = 'Title'
91
+ Text.displayName = "Text";
92
+ Title.displayName = "Title";
@@ -1,80 +0,0 @@
1
-
2
- # Card Component
3
-
4
- The Card component is a versatile and reusable React component for creating card-like UI elements. It's part of the FPKit React component library.
5
-
6
- ## Usage
7
-
8
- ```tsx
9
- import Card from 'libs/react/fpkit/src/components/cards/card';
10
-
11
- <Card>
12
- <Card.Title>Card Title</Card.Title>
13
- <Card.Content>
14
- This is the content of the card.
15
- </Card.Content>
16
- </Card>
17
- ```
18
-
19
- ## Components
20
-
21
- ### Card
22
-
23
- The main container component for the card.
24
-
25
- #### Props
26
-
27
- - `elm?: 'div' | 'aside' | 'section' | 'article'` - HTML element to render as (default: 'div')
28
- - `title?: React.ReactNode` - Card title
29
- - `footer?: React.ReactNode` - Card footer
30
- - `styles?: React.CSSProperties` - Inline styles
31
- - `classes?: string` - Additional CSS classes
32
- - `id?: string` - Unique ID for the card
33
-
34
- All other props are passed through to the underlying UI component.
35
-
36
- ### Card.Title
37
-
38
- A sub-component for rendering the card's title.
39
-
40
- #### Props
41
-
42
- - `as?: React.ElementType` - HTML element to render as (default: 'h3')
43
- - `className?: string` - Additional CSS classes
44
- - `styles?: React.CSSProperties` - Inline styles
45
-
46
- ### Card.Content
47
-
48
- A sub-component for rendering the card's main content.
49
-
50
- #### Props
51
-
52
- - `className?: string` - Additional CSS classes
53
- - `styles?: React.CSSProperties` - Inline styles
54
-
55
- ## Styling
56
-
57
- The component uses CSS classes for styling:
58
-
59
- - `.card-title` for the title
60
- - `.card-content` for the content
61
-
62
- You can override these classes or provide additional styling through the `className` and `styles` props.
63
-
64
- ## Accessibility
65
-
66
- The Card component is designed with accessibility in mind:
67
-
68
- - It uses semantic HTML elements (`div`, `aside`, `section`, or `article`) for the main container.
69
- - The Title component defaults to using an `h3` element, which can be changed if needed.
70
- - The Content component uses an `article` element for semantic structure.
71
-
72
- ## TypeScript
73
-
74
- This component is written in TypeScript and provides type definitions for all props and sub-components.
75
-
76
- ## Contributing
77
-
78
- When contributing to this component, please follow the established code style and conventions. Ensure all changes are well-tested and documented.
79
-
80
- This README provides an overview of the Card component, its usage, available props, styling information, and accessibility considerations. It also mentions that the component is written in TypeScript and provides guidance for contributors.