@entropix/react 0.2.0 → 0.3.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.
@@ -1,123 +1,130 @@
1
1
  /* Radio — @entropix/react */
2
2
 
3
- .entropix-radio-group {
4
- display: flex;
5
- gap: var(--entropix-spacing-2);
6
- }
3
+ @layer entropix {
4
+ .entropix-radio-group {
5
+ display: flex;
6
+ gap: var(--entropix-spacing-2);
7
+ }
7
8
 
8
- .entropix-radio-group[data-orientation="vertical"] {
9
- flex-direction: column;
10
- }
9
+ .entropix-radio-group[data-orientation="vertical"] {
10
+ flex-direction: column;
11
+ }
11
12
 
12
- .entropix-radio-group[data-orientation="horizontal"] {
13
- flex-direction: row;
14
- flex-wrap: wrap;
15
- }
13
+ .entropix-radio-group[data-orientation="horizontal"] {
14
+ flex-direction: row;
15
+ flex-wrap: wrap;
16
+ }
16
17
 
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
- }
18
+ /* === Radio Item === */
33
19
 
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
- }
20
+ .entropix-radio-item {
21
+ --radio-size: 20px;
22
+ --radio-border-color: var(--entropix-color-border-default);
23
+ --radio-checked-color: var(--entropix-color-action-primary-default);
24
+ --radio-dot-size: 10px;
25
+
26
+ display: inline-flex;
27
+ align-items: center;
28
+ gap: var(--entropix-spacing-2);
29
+ padding: var(--entropix-spacing-1) 0;
30
+ border: none;
31
+ background: transparent;
32
+ cursor: pointer;
33
+ user-select: none;
34
+ font-family: var(--entropix-font-family-sans);
35
+ font-size: var(--entropix-font-size-sm);
36
+ color: var(--entropix-color-text-primary);
37
+ line-height: var(--entropix-line-height-normal);
38
+ }
50
39
 
51
- .entropix-radio-item__indicator[data-state="checked"] {
52
- border-color: var(--entropix-color-action-primary-default);
53
- }
40
+ /* === Indicator (circle) === */
54
41
 
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
- }
42
+ .entropix-radio-item__indicator {
43
+ display: inline-flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ width: var(--radio-size);
47
+ height: var(--radio-size);
48
+ border: 2px solid var(--radio-border-color);
49
+ border-radius: 50%;
50
+ background: var(--entropix-color-bg-primary);
51
+ flex-shrink: 0;
52
+ transition:
53
+ border-color var(--entropix-duration-fast) var(--entropix-easing-default),
54
+ background var(--entropix-duration-fast) var(--entropix-easing-default);
55
+ }
64
56
 
65
- /* === Label === */
57
+ .entropix-radio-item__indicator[data-state="checked"] {
58
+ border-color: var(--radio-checked-color);
59
+ }
66
60
 
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
- }
61
+ /* Inner filled circle via ::after */
62
+ .entropix-radio-item__indicator[data-state="checked"]::after {
63
+ content: "";
64
+ display: block;
65
+ width: var(--radio-dot-size);
66
+ height: var(--radio-dot-size);
67
+ border-radius: 50%;
68
+ background: var(--radio-checked-color);
69
+ }
73
70
 
74
- /* === Hover === */
71
+ /* === Label === */
75
72
 
76
- .entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator {
77
- border-color: var(--entropix-color-border-hover);
78
- }
73
+ .entropix-radio-item__label {
74
+ font-family: var(--entropix-font-family-sans);
75
+ font-size: var(--entropix-font-size-sm);
76
+ color: var(--entropix-color-text-primary);
77
+ line-height: var(--entropix-line-height-normal);
78
+ }
79
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
- }
80
+ /* === Hover === */
84
81
 
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
- }
82
+ .entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator {
83
+ border-color: var(--entropix-color-border-hover);
84
+ }
89
85
 
90
- /* === Focus === */
86
+ .entropix-radio-item:hover:not(:disabled)
87
+ .entropix-radio-item__indicator[data-state="checked"] {
88
+ border-color: var(--entropix-color-action-primary-hover);
89
+ }
91
90
 
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
- }
91
+ .entropix-radio-item:hover:not(:disabled)
92
+ .entropix-radio-item__indicator[data-state="checked"]::after {
93
+ background: var(--entropix-color-action-primary-hover);
94
+ }
97
95
 
98
- /* === Disabled === */
96
+ /* === Focus === */
99
97
 
100
- .entropix-radio-item:disabled,
101
- .entropix-radio-item[data-disabled] {
102
- opacity: 0.5;
103
- cursor: not-allowed;
104
- pointer-events: none;
105
- }
98
+ .entropix-radio-item:focus-visible {
99
+ outline: 2px solid var(--entropix-color-border-focus);
100
+ outline-offset: 2px;
101
+ border-radius: var(--entropix-radius-sm);
102
+ }
106
103
 
107
- /* === Responsive — Touch-friendly sizing on mobile === */
104
+ /* === Disabled === */
108
105
 
109
- @media (max-width: 767px) {
110
- .entropix-radio-item {
111
- min-height: 44px;
106
+ .entropix-radio-item:disabled,
107
+ .entropix-radio-item[data-disabled] {
108
+ opacity: 0.5;
109
+ cursor: not-allowed;
110
+ pointer-events: none;
112
111
  }
113
112
 
114
- .entropix-radio-item__indicator {
115
- width: 22px;
116
- height: 22px;
117
- }
113
+ /* === Responsive — Touch-friendly sizing on mobile === */
118
114
 
119
- .entropix-radio-item__indicator[data-state="checked"]::after {
120
- width: 10px;
121
- height: 10px;
115
+ @media (max-width: 767px) {
116
+ .entropix-radio-item {
117
+ min-height: 44px;
118
+ }
119
+
120
+ .entropix-radio-item__indicator {
121
+ width: 22px;
122
+ height: 22px;
123
+ }
124
+
125
+ .entropix-radio-item__indicator[data-state="checked"]::after {
126
+ width: 10px;
127
+ height: 10px;
128
+ }
122
129
  }
123
130
  }
@@ -1,145 +1,150 @@
1
1
  /* Select — @entropix/react */
2
2
 
3
- .entropix-select {
4
- display: flex;
5
- flex-direction: column;
6
- gap: var(--entropix-spacing-1);
7
- position: relative;
8
- width: 100%;
9
- }
3
+ @layer entropix {
4
+ .entropix-select {
5
+ --select-border-color: var(--entropix-color-border-default);
6
+ --select-border-radius: var(--entropix-radius-md);
7
+ --select-bg: var(--entropix-color-bg-primary);
8
+ --select-dropdown-shadow: var(--entropix-shadow-lg);
9
+
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: var(--entropix-spacing-1);
13
+ position: relative;
14
+ width: 100%;
15
+ }
10
16
 
11
- /* === Label === */
17
+ /* === Label === */
12
18
 
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
- }
19
+ .entropix-select-label {
20
+ display: block;
21
+ font-family: var(--entropix-font-family-sans);
22
+ font-size: var(--entropix-font-size-sm);
23
+ font-weight: var(--entropix-font-weight-medium);
24
+ color: var(--entropix-color-text-primary);
25
+ line-height: var(--entropix-line-height-normal);
26
+ }
21
27
 
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
- }
28
+ /* === Trigger === */
45
29
 
46
- .entropix-select-trigger__value {
47
- flex: 1;
48
- overflow: hidden;
49
- text-overflow: ellipsis;
50
- white-space: nowrap;
51
- }
30
+ .entropix-select-trigger {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ justify-content: space-between;
34
+ gap: var(--entropix-spacing-2);
35
+ width: 100%;
36
+ border: 1px solid var(--select-border-color);
37
+ border-radius: var(--select-border-radius);
38
+ background: var(--select-bg);
39
+ color: var(--entropix-color-text-primary);
40
+ font-family: var(--entropix-font-family-sans);
41
+ font-size: var(--entropix-font-size-sm);
42
+ line-height: var(--entropix-line-height-normal);
43
+ padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
44
+ cursor: pointer;
45
+ user-select: none;
46
+ text-align: left;
47
+ transition:
48
+ border-color var(--entropix-duration-fast) var(--entropix-easing-default),
49
+ box-shadow var(--entropix-duration-fast) var(--entropix-easing-default);
50
+ }
52
51
 
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
- }
52
+ .entropix-select-trigger__value {
53
+ flex: 1;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ }
59
58
 
60
- /* === Trigger Hover === */
59
+ .entropix-select-trigger__chevron {
60
+ flex-shrink: 0;
61
+ font-size: var(--entropix-font-size-xs);
62
+ color: var(--entropix-color-text-secondary);
63
+ line-height: 1;
64
+ }
61
65
 
62
- .entropix-select-trigger:hover:not(:disabled) {
63
- border-color: var(--entropix-color-border-hover);
64
- }
66
+ /* === Trigger Hover === */
65
67
 
66
- /* === Trigger Focus === */
68
+ .entropix-select-trigger:hover:not(:disabled) {
69
+ border-color: var(--entropix-color-border-hover);
70
+ }
67
71
 
68
- .entropix-select-trigger:focus-visible {
69
- outline: 2px solid var(--entropix-color-border-focus);
70
- outline-offset: 2px;
71
- }
72
+ /* === Trigger Focus === */
72
73
 
73
- /* === Trigger Disabled === */
74
+ .entropix-select-trigger:focus-visible {
75
+ outline: 2px solid var(--entropix-color-border-focus);
76
+ outline-offset: 2px;
77
+ }
74
78
 
75
- .entropix-select-trigger:disabled {
76
- opacity: 0.5;
77
- cursor: not-allowed;
78
- pointer-events: none;
79
- }
79
+ /* === Trigger Disabled === */
80
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
- }
81
+ .entropix-select-trigger:disabled {
82
+ opacity: 0.5;
83
+ cursor: not-allowed;
84
+ pointer-events: none;
85
+ }
100
86
 
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
- }
87
+ /* === Content (Dropdown) === */
88
+
89
+ .entropix-select-content {
90
+ position: absolute;
91
+ top: 100%;
92
+ left: 0;
93
+ right: 0;
94
+ z-index: 50;
95
+ margin-top: var(--entropix-spacing-1);
96
+ border: 1px solid var(--select-border-color);
97
+ border-radius: var(--select-border-radius);
98
+ background: var(--select-bg);
99
+ box-shadow: var(--select-dropdown-shadow);
100
+ padding: var(--entropix-spacing-1) 0;
101
+ max-height: 240px;
102
+ overflow-y: auto;
103
+ }
115
104
 
116
- .entropix-select-option:hover:not([data-disabled]) {
117
- background: var(--entropix-color-action-secondary-hover);
118
- }
105
+ /* === Option === */
119
106
 
120
- .entropix-select-option[data-state="selected"] {
121
- background: var(--entropix-color-action-secondary-default);
122
- font-weight: var(--entropix-font-weight-medium);
123
- }
107
+ .entropix-select-option {
108
+ display: flex;
109
+ align-items: center;
110
+ padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
111
+ font-family: var(--entropix-font-family-sans);
112
+ font-size: var(--entropix-font-size-sm);
113
+ color: var(--entropix-color-text-primary);
114
+ line-height: var(--entropix-line-height-normal);
115
+ cursor: pointer;
116
+ user-select: none;
117
+ transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
118
+ }
124
119
 
125
- .entropix-select-option[data-state="selected"]:hover {
126
- background: var(--entropix-color-action-secondary-hover);
127
- }
120
+ .entropix-select-option:hover:not([data-disabled]) {
121
+ background: var(--entropix-color-action-secondary-hover);
122
+ }
128
123
 
129
- .entropix-select-option[data-disabled] {
130
- opacity: 0.5;
131
- cursor: not-allowed;
132
- pointer-events: none;
133
- }
124
+ .entropix-select-option[data-state="selected"] {
125
+ background: var(--entropix-color-action-secondary-default);
126
+ font-weight: var(--entropix-font-weight-medium);
127
+ }
134
128
 
135
- /* === Responsive — Touch-friendly sizing on mobile === */
129
+ .entropix-select-option[data-state="selected"]:hover {
130
+ background: var(--entropix-color-action-secondary-hover);
131
+ }
136
132
 
137
- @media (max-width: 767px) {
138
- .entropix-select-trigger {
139
- min-height: 44px;
133
+ .entropix-select-option[data-disabled] {
134
+ opacity: 0.5;
135
+ cursor: not-allowed;
136
+ pointer-events: none;
140
137
  }
141
138
 
142
- .entropix-select-option {
143
- min-height: 44px;
139
+ /* === Responsive — Touch-friendly sizing on mobile === */
140
+
141
+ @media (max-width: 767px) {
142
+ .entropix-select-trigger {
143
+ min-height: 44px;
144
+ }
145
+
146
+ .entropix-select-option {
147
+ min-height: 44px;
148
+ }
144
149
  }
145
150
  }
@@ -1,50 +1,52 @@
1
1
  /* Switch — @entropix/react */
2
2
 
3
- .entropix-switch {
4
- position: relative;
5
- display: inline-flex;
6
- align-items: center;
7
- width: 44px;
8
- height: 24px;
9
- padding: 2px;
10
- border: none;
11
- border-radius: var(--entropix-radius-full);
12
- background: var(--entropix-color-gray-300);
13
- cursor: pointer;
14
- transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
15
- }
3
+ @layer entropix {
4
+ .entropix-switch {
5
+ position: relative;
6
+ display: inline-flex;
7
+ align-items: center;
8
+ width: 44px;
9
+ height: 24px;
10
+ padding: 2px;
11
+ border: none;
12
+ border-radius: var(--entropix-radius-full);
13
+ background: var(--entropix-color-gray-300);
14
+ cursor: pointer;
15
+ transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
16
+ }
16
17
 
17
- .entropix-switch::after {
18
- content: "";
19
- display: block;
20
- width: 20px;
21
- height: 20px;
22
- border-radius: var(--entropix-radius-full);
23
- background: var(--entropix-color-white);
24
- box-shadow: var(--entropix-shadow-sm);
25
- transition: transform var(--entropix-duration-fast) var(--entropix-easing-default);
26
- }
18
+ .entropix-switch::after {
19
+ content: "";
20
+ display: block;
21
+ width: 20px;
22
+ height: 20px;
23
+ border-radius: var(--entropix-radius-full);
24
+ background: var(--entropix-color-white);
25
+ box-shadow: var(--entropix-shadow-sm);
26
+ transition: transform var(--entropix-duration-fast) var(--entropix-easing-default);
27
+ }
27
28
 
28
- .entropix-switch[data-state="checked"] {
29
- background: var(--entropix-color-action-primary-default);
30
- }
31
- .entropix-switch[data-state="checked"]::after {
32
- transform: translateX(20px);
33
- }
29
+ .entropix-switch[data-state="checked"] {
30
+ background: var(--entropix-color-action-primary-default);
31
+ }
32
+ .entropix-switch[data-state="checked"]::after {
33
+ transform: translateX(20px);
34
+ }
34
35
 
35
- .entropix-switch:hover:not(:disabled) {
36
- background: var(--entropix-color-gray-400);
37
- }
38
- .entropix-switch[data-state="checked"]:hover:not(:disabled) {
39
- background: var(--entropix-color-action-primary-hover);
40
- }
36
+ .entropix-switch:hover:not(:disabled) {
37
+ background: var(--entropix-color-gray-400);
38
+ }
39
+ .entropix-switch[data-state="checked"]:hover:not(:disabled) {
40
+ background: var(--entropix-color-action-primary-hover);
41
+ }
41
42
 
42
- .entropix-switch:disabled {
43
- opacity: 0.5;
44
- cursor: not-allowed;
45
- }
43
+ .entropix-switch:disabled {
44
+ opacity: 0.5;
45
+ cursor: not-allowed;
46
+ }
46
47
 
47
- .entropix-switch:focus-visible {
48
- outline: 2px solid var(--entropix-color-border-focus);
49
- outline-offset: 2px;
48
+ .entropix-switch:focus-visible {
49
+ outline: 2px solid var(--entropix-color-border-focus);
50
+ outline-offset: 2px;
51
+ }
50
52
  }