File tree Expand file tree Collapse file tree 2 files changed +76
-57
lines changed
packages/react-toggle-file-tree/src/toggle-file-tree Expand file tree Collapse file tree 2 files changed +76
-57
lines changed Original file line number Diff line number Diff line change
1
+ import styled from '@emotion/styled' ;
2
+
3
+ const Container = styled . div `
4
+ & * {
5
+ margin: 0px;
6
+ padding: 0px;
7
+ }
8
+ ` ;
9
+ const DepthContainer = styled . div `
10
+ padding-left: 22px;
11
+ ` ;
12
+ const CheckboxContainer = styled . label `
13
+ display: block;
14
+ line-height: 15px;
15
+ font-size: 14px;
16
+ & > p {
17
+ cursor: pointer;
18
+ }
19
+ ` ;
20
+ const Checkbox = styled . input `
21
+ width: 1px;
22
+ height: 1px;
23
+ visibility: hidden;
24
+ &:checked ~ div {
25
+ display: block;
26
+ }
27
+ & ~ div {
28
+ display: none;
29
+ }
30
+ ` ;
31
+ const FileContainer = styled . div `
32
+ padding-left: 22px;
33
+ padding-bottom: 5px;
34
+ & > p {
35
+ line-height: 24px;
36
+ padding-bottom: 20px;
37
+ }
38
+ ` ;
39
+ const File = styled . div `
40
+ display: flex;
41
+ flex-direction: row;
42
+ padding-bottom: 15px;
43
+ cursor: pointer;
44
+ p {
45
+ font-size: 15px;
46
+ margin-left: 6px;
47
+ }
48
+ ` ;
49
+ const Locale = styled . span `
50
+ padding: 1px 5px;
51
+ background-color: #959dad;
52
+ color: white;
53
+ border-radius: 4px;
54
+ margin-left: 8px;
55
+ font-size: 12px;
56
+ font-weight: bold;
57
+ ` ;
58
+
59
+ export {
60
+ Container ,
61
+ DepthContainer ,
62
+ CheckboxContainer ,
63
+ Checkbox ,
64
+ FileContainer ,
65
+ File ,
66
+ Locale ,
67
+ } ;
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
2
3
3
import React , { MouseEventHandler } from 'react' ;
4
- import styled from '@emotion/styled' ;
5
4
import { IMG } from './icons/imgs' ;
6
5
import { Directory } from '../utils/createFileTree' ;
7
-
8
- const Container = styled . div `
9
- & * {
10
- margin: 0px;
11
- padding: 0px;
12
- }
13
- ` ;
14
- const DepthContainer = styled . div `
15
- padding-left: 22px;
16
- ` ;
17
- const CheckboxContainer = styled . label `
18
- display: block;
19
- line-height: 15px;
20
- font-size: 14px;
21
- & > p {
22
- cursor: pointer;
23
- }
24
- ` ;
25
- const Checkbox = styled . input `
26
- width: 1px;
27
- height: 1px;
28
- visibility: hidden;
29
- &:checked ~ div {
30
- display: block;
31
- }
32
- & ~ div {
33
- display: none;
34
- }
35
- ` ;
36
- const FileContainer = styled . div `
37
- padding-left: 22px;
38
- padding-bottom: 5px;
39
- & > p {
40
- line-height: 24px;
41
- padding-bottom: 20px;
42
- }
43
- ` ;
44
- const File = styled . div `
45
- display: flex;
46
- flex-direction: row;
47
- padding-bottom: 15px;
48
- cursor: pointer;
49
- p {
50
- font-size: 15px;
51
- margin-left: 6px;
52
- }
53
- ` ;
54
- const Locale = styled . span `
55
- padding: 1px 5px;
56
- background-color: #959dad;
57
- color: white;
58
- border-radius: 4px;
59
- margin-left: 8px;
60
- font-size: 12px;
61
- font-weight: bold;
62
- ` ;
6
+ import {
7
+ Container ,
8
+ DepthContainer ,
9
+ CheckboxContainer ,
10
+ Checkbox ,
11
+ FileContainer ,
12
+ File ,
13
+ Locale ,
14
+ } from './index.css' ;
63
15
64
16
function renderIcon ( _fileName : string ) {
65
17
const fileExtension = String ( _fileName . split ( '.' ) . pop ( ) ) . toLowerCase ( ) ;
You can’t perform that action at this time.
0 commit comments