You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updating readme files of priority components (#129)
* updating readme files of priority components
Fixes#21
* fixing slots formatting
* more readme updates
* fix prettier editor integration link
* fixing issues with readmes
* element README updates, add syntax coloring and base class descriptions
Copy file name to clipboardExpand all lines: elements/rh-card/README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,27 @@
1
1
# WIP 🐣: RHElements Card Element
2
2
3
+
## Usage
4
+
5
+
```html
6
+
<rh-card>
7
+
<h2slot="header">RH Card</h2>
8
+
This is the rh-card body.
9
+
<divslot="footer">Text in footer</div>
10
+
</rh-card>
11
+
```
12
+
13
+
## Slots
14
+
15
+
### header
16
+
If this slot is used, we expect a heading level tag (h1, h2, h3, h4, h5, h6) to
17
+
be used here.
18
+
19
+
### Default slot (body)
20
+
Any content that is not designated for the header or footer slot, will go to this slot.
21
+
22
+
### footer
23
+
Use this slot for anything that you want in the footer of the card.
24
+
3
25
## Test
4
26
5
27
npm run test
@@ -19,5 +41,5 @@ From the RHElements root directory, run:
19
41
Card (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
Copy file name to clipboardExpand all lines: elements/rh-cta/README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,18 @@
1
1
# WIP 🐣: RHElements Cta Element
2
2
3
+
## Usage
4
+
```html
5
+
<rh-cta>
6
+
<ahref="https://rhelements.github.io/">Learn more about RHElements</a>
7
+
</rh-cta>
8
+
```
9
+
10
+
## Slots
11
+
12
+
### Default slot
13
+
14
+
We expect an anchor tag, `<a>`, to be the first child inside rh-cta element.
15
+
3
16
## Test
4
17
5
18
npm run test
@@ -19,5 +32,5 @@ From the RHElements root directory, run:
19
32
Cta (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
This RHElement enables developers to get a lot of the features from the [Intl Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) just by using attributes to set the format of the date and time they'd like to display.
4
+
5
+
## Usage
6
+
7
+
### Just the date: January 2, 2006
8
+
```html
9
+
<rh-datetime
10
+
datetime="Mon Jan 2 15:04:05 EST 2006"
11
+
type="local"
12
+
day="numeric"
13
+
month="long"
14
+
year="numeric">
15
+
Mon Jan 2 15:04:05 EST 2006
16
+
</rh-datetime>
17
+
```
18
+
19
+
### With time: Monday, Jan 02, 2006, 3:04:05 PM
20
+
```html
21
+
<rh-datetime
22
+
datetime="Mon Jan 2 15:04:05 EST 2006"
23
+
type="local"
24
+
weekday="long"
25
+
month="short"
26
+
day="2-digit"
27
+
year="numeric"
28
+
hour="2-digit"
29
+
minute="2-digit"
30
+
second="2-digit">
31
+
Mon Jan 2 15:04:05 EST 2006
32
+
</rh-datetime>
33
+
```
34
+
35
+
### With an en-GB locale: Monday, 02 Jan 2006, 15:04:05
36
+
You can use any locale here.
37
+
```html
38
+
<rh-datetime
39
+
datetime="Mon Jan 2 15:04:05 EST 2006"
40
+
type="local"
41
+
weekday="long"
42
+
month="short"
43
+
day="2-digit"
44
+
year="numeric"
45
+
hour="2-digit"
46
+
minute="2-digit"
47
+
second="2-digit"
48
+
locale="en-GB">
49
+
Mon Jan 2 15:04:05 EST 2006
50
+
</rh-datetime>
51
+
```
52
+
53
+
### Time adverbial: 13 years ago
54
+
```html
55
+
<rh-datetime
56
+
type="relative"
57
+
datetime="Mon Jan 2 15:04:05 EST 2006">
58
+
Mon Jan 2 15:04:05 EST 2006
59
+
</rh-datetime>
60
+
```
61
+
62
+
## Attributes
63
+
64
+
### datetime (observed)
65
+
66
+
The value of this should be the same timestamp that you add to the light DOM.
67
+
68
+
### type (observed)
69
+
70
+
The options for type are:
71
+
-`local`: Shows a formatted time for the indicated locale if provided
72
+
-`relative`: Shows a relative time (1 hour ago, 2 hours until)
73
+
74
+
### weekday
75
+
76
+
Possible values: `narrow`, `short`, `long`
77
+
78
+
### month
79
+
80
+
Possible values: `numeric`, `2-digit`, `narrow`, `short`, `long`
81
+
82
+
### day
83
+
84
+
Possible values: `numeric`, `2-digit`
85
+
86
+
### year
87
+
88
+
Possible values: `numeric`, `2-digit`
89
+
90
+
### hour
91
+
92
+
Possible values: `numeric`, `2-digit`
93
+
94
+
### minute
95
+
96
+
Possible values: `numeric`, `2-digit`
97
+
98
+
### second
99
+
100
+
Possible values: `numeric`, `2-digit`
4
101
5
102
## Test
6
103
@@ -18,8 +115,8 @@ From the RHElements root directory, run:
18
115
19
116
## Code style
20
117
21
-
Accordion (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
118
+
Datetime (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
| --rhe-c-icon-panel\_\_footer--MarginTop | Margin top of footer content | $rh-global--FontSize |
24
-
25
46
## Code style
26
47
27
-
Search (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
48
+
Icon Panel (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
@@ -19,5 +67,5 @@ From the RHElements root directory, run:
19
67
Icon (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
Copy file name to clipboardExpand all lines: elements/rh-number/README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,33 @@
1
1
# RHElements Number Element
2
2
3
+
## Usage
4
+
5
+
```html
6
+
<rh-numbertype="ordinal">4</rh-number>
7
+
```
8
+
9
+
## Attributes
10
+
11
+
### number (observed)
12
+
13
+
Reflects the number that is in the light DOM.
14
+
15
+
### format (observed)
16
+
17
+
Reflects the format that is being used to display the number.
18
+
19
+
### type (observed)
20
+
21
+
The type of display you want to show.
22
+
23
+
The options for type are:
24
+
-`ordinal`: (1st, 2nd, 3rd, 4th)
25
+
-`bytes`: (2 KiB, 9.54 Mib, 93 Gib)
26
+
-`abbrev`: (1k, 1m, 1b)
27
+
-`percent`: (10%, 50%, 100%)
28
+
-`e`: (2.000e+6)
29
+
-`thousands`: (97 654 321.123)
30
+
3
31
## Build
4
32
5
33
npm run build
@@ -15,4 +43,4 @@ From the RHElements root directory, run:
15
43
Number (and all RHElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
0 commit comments