@entropix/react 0.1.1 → 0.2.0
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/index.cjs +468 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +410 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +183 -2
- package/dist/index.d.ts +183 -2
- package/dist/index.js +462 -4
- package/dist/index.js.map +1 -1
- package/dist/styles/checkbox.css +113 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/input.css +167 -0
- package/dist/styles/radio.css +123 -0
- package/dist/styles/select.css +145 -0
- package/package.json +4 -4
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* Input & Textarea — @entropix/react */
|
|
2
|
+
|
|
3
|
+
.entropix-input-wrapper {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--entropix-spacing-1);
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* === Label === */
|
|
11
|
+
|
|
12
|
+
.entropix-input-label {
|
|
13
|
+
display: block;
|
|
14
|
+
font-family: var(--entropix-font-family-sans);
|
|
15
|
+
font-size: var(--entropix-font-size-sm);
|
|
16
|
+
font-weight: var(--entropix-font-weight-medium);
|
|
17
|
+
color: var(--entropix-color-text-primary);
|
|
18
|
+
line-height: var(--entropix-line-height-normal);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.entropix-input-required {
|
|
22
|
+
color: var(--entropix-color-text-danger);
|
|
23
|
+
margin-left: var(--entropix-spacing-1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* === Shared Input / Textarea base === */
|
|
27
|
+
|
|
28
|
+
.entropix-input,
|
|
29
|
+
.entropix-textarea {
|
|
30
|
+
display: block;
|
|
31
|
+
width: 100%;
|
|
32
|
+
border: 1px solid var(--entropix-color-border-default);
|
|
33
|
+
border-radius: var(--entropix-radius-md);
|
|
34
|
+
background: var(--entropix-color-bg-primary);
|
|
35
|
+
color: var(--entropix-color-text-primary);
|
|
36
|
+
font-family: var(--entropix-font-family-sans);
|
|
37
|
+
font-size: var(--entropix-font-size-sm);
|
|
38
|
+
line-height: var(--entropix-line-height-normal);
|
|
39
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
40
|
+
transition:
|
|
41
|
+
border-color var(--entropix-duration-fast) var(--entropix-easing-default),
|
|
42
|
+
box-shadow var(--entropix-duration-fast) var(--entropix-easing-default),
|
|
43
|
+
background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.entropix-input::placeholder,
|
|
47
|
+
.entropix-textarea::placeholder {
|
|
48
|
+
color: var(--entropix-color-text-tertiary);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* === Focus === */
|
|
52
|
+
|
|
53
|
+
.entropix-input:focus,
|
|
54
|
+
.entropix-textarea:focus {
|
|
55
|
+
outline: none;
|
|
56
|
+
border-color: var(--entropix-color-border-focus);
|
|
57
|
+
box-shadow: 0 0 0 1px var(--entropix-color-border-focus);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.entropix-input:focus-visible,
|
|
61
|
+
.entropix-textarea:focus-visible {
|
|
62
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
63
|
+
outline-offset: 2px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* === Hover === */
|
|
67
|
+
|
|
68
|
+
.entropix-input:hover:not(:disabled):not(:focus),
|
|
69
|
+
.entropix-textarea:hover:not(:disabled):not(:focus) {
|
|
70
|
+
border-color: var(--entropix-color-border-hover);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* === Variants === */
|
|
74
|
+
|
|
75
|
+
.entropix-input[data-variant="filled"],
|
|
76
|
+
.entropix-textarea[data-variant="filled"] {
|
|
77
|
+
background: var(--entropix-color-bg-secondary);
|
|
78
|
+
border-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.entropix-input[data-variant="filled"]:focus,
|
|
82
|
+
.entropix-textarea[data-variant="filled"]:focus {
|
|
83
|
+
background: var(--entropix-color-bg-primary);
|
|
84
|
+
border-color: var(--entropix-color-border-focus);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* === Sizes === */
|
|
88
|
+
|
|
89
|
+
.entropix-input[data-size="sm"],
|
|
90
|
+
.entropix-textarea[data-size="sm"] {
|
|
91
|
+
padding: var(--entropix-spacing-1) var(--entropix-spacing-2);
|
|
92
|
+
font-size: var(--entropix-font-size-xs);
|
|
93
|
+
border-radius: var(--entropix-radius-sm);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.entropix-input[data-size="md"],
|
|
97
|
+
.entropix-textarea[data-size="md"] {
|
|
98
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
99
|
+
font-size: var(--entropix-font-size-sm);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.entropix-input[data-size="lg"],
|
|
103
|
+
.entropix-textarea[data-size="lg"] {
|
|
104
|
+
padding: var(--entropix-spacing-3) var(--entropix-spacing-4);
|
|
105
|
+
font-size: var(--entropix-font-size-base);
|
|
106
|
+
border-radius: var(--entropix-radius-lg);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* === States === */
|
|
110
|
+
|
|
111
|
+
.entropix-input[data-state="invalid"],
|
|
112
|
+
.entropix-textarea[data-state="invalid"] {
|
|
113
|
+
border-color: var(--entropix-color-border-danger);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.entropix-input[data-state="invalid"]:focus,
|
|
117
|
+
.entropix-textarea[data-state="invalid"]:focus {
|
|
118
|
+
border-color: var(--entropix-color-border-danger);
|
|
119
|
+
box-shadow: 0 0 0 1px var(--entropix-color-border-danger);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.entropix-input:disabled,
|
|
123
|
+
.entropix-textarea:disabled,
|
|
124
|
+
.entropix-input[data-state="disabled"],
|
|
125
|
+
.entropix-textarea[data-state="disabled"] {
|
|
126
|
+
opacity: 0.5;
|
|
127
|
+
cursor: not-allowed;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* === Helper & Error text === */
|
|
132
|
+
|
|
133
|
+
.entropix-input-helper {
|
|
134
|
+
font-family: var(--entropix-font-family-sans);
|
|
135
|
+
font-size: var(--entropix-font-size-xs);
|
|
136
|
+
color: var(--entropix-color-text-secondary);
|
|
137
|
+
line-height: var(--entropix-line-height-normal);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.entropix-input-error {
|
|
141
|
+
font-family: var(--entropix-font-family-sans);
|
|
142
|
+
font-size: var(--entropix-font-size-xs);
|
|
143
|
+
color: var(--entropix-color-text-danger);
|
|
144
|
+
line-height: var(--entropix-line-height-normal);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* === Textarea specific === */
|
|
148
|
+
|
|
149
|
+
.entropix-textarea {
|
|
150
|
+
min-height: 80px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* === Responsive — Touch-friendly sizing on mobile === */
|
|
154
|
+
|
|
155
|
+
@media (max-width: 767px) {
|
|
156
|
+
.entropix-input,
|
|
157
|
+
.entropix-textarea {
|
|
158
|
+
min-height: 44px;
|
|
159
|
+
font-size: var(--entropix-font-size-base);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.entropix-input[data-size="sm"],
|
|
163
|
+
.entropix-textarea[data-size="sm"] {
|
|
164
|
+
min-height: 36px;
|
|
165
|
+
font-size: var(--entropix-font-size-sm);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* Radio — @entropix/react */
|
|
2
|
+
|
|
3
|
+
.entropix-radio-group {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: var(--entropix-spacing-2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.entropix-radio-group[data-orientation="vertical"] {
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.entropix-radio-group[data-orientation="horizontal"] {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* === Radio Item === */
|
|
18
|
+
|
|
19
|
+
.entropix-radio-item {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--entropix-spacing-2);
|
|
23
|
+
padding: var(--entropix-spacing-1) 0;
|
|
24
|
+
border: none;
|
|
25
|
+
background: transparent;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
font-family: var(--entropix-font-family-sans);
|
|
29
|
+
font-size: var(--entropix-font-size-sm);
|
|
30
|
+
color: var(--entropix-color-text-primary);
|
|
31
|
+
line-height: var(--entropix-line-height-normal);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* === Indicator (circle) === */
|
|
35
|
+
|
|
36
|
+
.entropix-radio-item__indicator {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
width: 18px;
|
|
41
|
+
height: 18px;
|
|
42
|
+
border: 2px solid var(--entropix-color-border-default);
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
background: var(--entropix-color-bg-primary);
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
transition:
|
|
47
|
+
border-color var(--entropix-duration-fast) var(--entropix-easing-default),
|
|
48
|
+
background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.entropix-radio-item__indicator[data-state="checked"] {
|
|
52
|
+
border-color: var(--entropix-color-action-primary-default);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Inner filled circle via ::after */
|
|
56
|
+
.entropix-radio-item__indicator[data-state="checked"]::after {
|
|
57
|
+
content: "";
|
|
58
|
+
display: block;
|
|
59
|
+
width: 8px;
|
|
60
|
+
height: 8px;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
background: var(--entropix-color-action-primary-default);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* === Label === */
|
|
66
|
+
|
|
67
|
+
.entropix-radio-item__label {
|
|
68
|
+
font-family: var(--entropix-font-family-sans);
|
|
69
|
+
font-size: var(--entropix-font-size-sm);
|
|
70
|
+
color: var(--entropix-color-text-primary);
|
|
71
|
+
line-height: var(--entropix-line-height-normal);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* === Hover === */
|
|
75
|
+
|
|
76
|
+
.entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator {
|
|
77
|
+
border-color: var(--entropix-color-border-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.entropix-radio-item:hover:not(:disabled)
|
|
81
|
+
.entropix-radio-item__indicator[data-state="checked"] {
|
|
82
|
+
border-color: var(--entropix-color-action-primary-hover);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.entropix-radio-item:hover:not(:disabled)
|
|
86
|
+
.entropix-radio-item__indicator[data-state="checked"]::after {
|
|
87
|
+
background: var(--entropix-color-action-primary-hover);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* === Focus === */
|
|
91
|
+
|
|
92
|
+
.entropix-radio-item:focus-visible {
|
|
93
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
border-radius: var(--entropix-radius-sm);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* === Disabled === */
|
|
99
|
+
|
|
100
|
+
.entropix-radio-item:disabled,
|
|
101
|
+
.entropix-radio-item[data-disabled] {
|
|
102
|
+
opacity: 0.5;
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* === Responsive — Touch-friendly sizing on mobile === */
|
|
108
|
+
|
|
109
|
+
@media (max-width: 767px) {
|
|
110
|
+
.entropix-radio-item {
|
|
111
|
+
min-height: 44px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.entropix-radio-item__indicator {
|
|
115
|
+
width: 22px;
|
|
116
|
+
height: 22px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.entropix-radio-item__indicator[data-state="checked"]::after {
|
|
120
|
+
width: 10px;
|
|
121
|
+
height: 10px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* Select — @entropix/react */
|
|
2
|
+
|
|
3
|
+
.entropix-select {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--entropix-spacing-1);
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* === Label === */
|
|
12
|
+
|
|
13
|
+
.entropix-select-label {
|
|
14
|
+
display: block;
|
|
15
|
+
font-family: var(--entropix-font-family-sans);
|
|
16
|
+
font-size: var(--entropix-font-size-sm);
|
|
17
|
+
font-weight: var(--entropix-font-weight-medium);
|
|
18
|
+
color: var(--entropix-color-text-primary);
|
|
19
|
+
line-height: var(--entropix-line-height-normal);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* === Trigger === */
|
|
23
|
+
|
|
24
|
+
.entropix-select-trigger {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: var(--entropix-spacing-2);
|
|
29
|
+
width: 100%;
|
|
30
|
+
border: 1px solid var(--entropix-color-border-default);
|
|
31
|
+
border-radius: var(--entropix-radius-md);
|
|
32
|
+
background: var(--entropix-color-bg-primary);
|
|
33
|
+
color: var(--entropix-color-text-primary);
|
|
34
|
+
font-family: var(--entropix-font-family-sans);
|
|
35
|
+
font-size: var(--entropix-font-size-sm);
|
|
36
|
+
line-height: var(--entropix-line-height-normal);
|
|
37
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
user-select: none;
|
|
40
|
+
text-align: left;
|
|
41
|
+
transition:
|
|
42
|
+
border-color var(--entropix-duration-fast) var(--entropix-easing-default),
|
|
43
|
+
box-shadow var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.entropix-select-trigger__value {
|
|
47
|
+
flex: 1;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.entropix-select-trigger__chevron {
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
font-size: var(--entropix-font-size-xs);
|
|
56
|
+
color: var(--entropix-color-text-secondary);
|
|
57
|
+
line-height: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* === Trigger Hover === */
|
|
61
|
+
|
|
62
|
+
.entropix-select-trigger:hover:not(:disabled) {
|
|
63
|
+
border-color: var(--entropix-color-border-hover);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* === Trigger Focus === */
|
|
67
|
+
|
|
68
|
+
.entropix-select-trigger:focus-visible {
|
|
69
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
70
|
+
outline-offset: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* === Trigger Disabled === */
|
|
74
|
+
|
|
75
|
+
.entropix-select-trigger:disabled {
|
|
76
|
+
opacity: 0.5;
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* === Content (Dropdown) === */
|
|
82
|
+
|
|
83
|
+
.entropix-select-content {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 100%;
|
|
86
|
+
left: 0;
|
|
87
|
+
right: 0;
|
|
88
|
+
z-index: 50;
|
|
89
|
+
margin-top: var(--entropix-spacing-1);
|
|
90
|
+
border: 1px solid var(--entropix-color-border-default);
|
|
91
|
+
border-radius: var(--entropix-radius-md);
|
|
92
|
+
background: var(--entropix-color-bg-primary);
|
|
93
|
+
box-shadow:
|
|
94
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
95
|
+
0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
96
|
+
padding: var(--entropix-spacing-1) 0;
|
|
97
|
+
max-height: 240px;
|
|
98
|
+
overflow-y: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* === Option === */
|
|
102
|
+
|
|
103
|
+
.entropix-select-option {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
107
|
+
font-family: var(--entropix-font-family-sans);
|
|
108
|
+
font-size: var(--entropix-font-size-sm);
|
|
109
|
+
color: var(--entropix-color-text-primary);
|
|
110
|
+
line-height: var(--entropix-line-height-normal);
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
user-select: none;
|
|
113
|
+
transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.entropix-select-option:hover:not([data-disabled]) {
|
|
117
|
+
background: var(--entropix-color-action-secondary-hover);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.entropix-select-option[data-state="selected"] {
|
|
121
|
+
background: var(--entropix-color-action-secondary-default);
|
|
122
|
+
font-weight: var(--entropix-font-weight-medium);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.entropix-select-option[data-state="selected"]:hover {
|
|
126
|
+
background: var(--entropix-color-action-secondary-hover);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.entropix-select-option[data-disabled] {
|
|
130
|
+
opacity: 0.5;
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* === Responsive — Touch-friendly sizing on mobile === */
|
|
136
|
+
|
|
137
|
+
@media (max-width: 767px) {
|
|
138
|
+
.entropix-select-trigger {
|
|
139
|
+
min-height: 44px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.entropix-select-option {
|
|
143
|
+
min-height: 44px;
|
|
144
|
+
}
|
|
145
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entropix/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React (Web) components for the Entropix design system — styled with CSS custom properties and design tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dist"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@entropix/core": "0.
|
|
54
|
+
"@entropix/core": "0.2.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"tsup": "^8.4.0",
|
|
71
71
|
"typescript": "5.9.2",
|
|
72
72
|
"vitest": "^3.2.1",
|
|
73
|
-
"@entropix/
|
|
74
|
-
"@entropix/
|
|
73
|
+
"@entropix/eslint-config": "0.0.0",
|
|
74
|
+
"@entropix/typescript-config": "0.0.0"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsup",
|