@jsenv/navi 0.2.0 → 0.2.1
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/jsenv_navi.js +634 -684
- package/package.json +3 -4
- package/src/components/field/button.jsx +134 -128
- package/src/components/field/checkbox_list.jsx +5 -3
- package/src/components/field/input_checkbox.jsx +117 -107
- package/src/components/field/input_radio.jsx +147 -137
- package/src/components/field/input_textual.jsx +76 -75
- package/src/components/field/label.jsx +9 -7
- package/src/components/field/navi_css_vars.js +7 -5
- package/src/components/field/radio_list.jsx +5 -3
- package/src/validation/validation_message.js +122 -118
- package/src/components/field/field_css.js +0 -87
|
@@ -33,137 +33,141 @@ const ARROW_HEIGHT = 8;
|
|
|
33
33
|
const ARROW_SPACING = 8;
|
|
34
34
|
|
|
35
35
|
import.meta.css = /* css */ `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
@layer navi {
|
|
37
|
+
:root {
|
|
38
|
+
--navi-info-color: #2196f3;
|
|
39
|
+
--navi-warning-color: #ff9800;
|
|
40
|
+
--navi-error-color: #f44336;
|
|
41
|
+
--navi-validation-message-background-color: white;
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
/* Ensure the validation message CANNOT cause overflow */
|
|
45
|
+
/* might be important to ensure it cannot create scrollbars in the document */
|
|
46
|
+
/* When measuring the size it should take */
|
|
47
|
+
.jsenv_validation_message_container {
|
|
48
|
+
position: fixed;
|
|
49
|
+
inset: 0;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
.jsenv_validation_message {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 0;
|
|
56
|
+
left: 0;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
display: block;
|
|
59
|
+
height: auto;
|
|
60
|
+
opacity: 0;
|
|
61
|
+
/* will be positioned with transform: translate */
|
|
62
|
+
transition: opacity 0.2s ease-in-out;
|
|
63
|
+
overflow: visible;
|
|
64
|
+
}
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
.jsenv_validation_message_border {
|
|
67
|
+
position: absolute;
|
|
68
|
+
filter: drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.2));
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
.jsenv_validation_message_body_wrapper {
|
|
73
|
+
position: relative;
|
|
74
|
+
border-style: solid;
|
|
75
|
+
border-color: transparent;
|
|
76
|
+
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
.jsenv_validation_message_body {
|
|
79
|
+
position: relative;
|
|
80
|
+
display: flex;
|
|
81
|
+
max-width: 47vw;
|
|
82
|
+
padding: 8px;
|
|
83
|
+
flex-direction: row;
|
|
84
|
+
gap: 10px;
|
|
85
|
+
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
.jsenv_validation_message_icon {
|
|
88
|
+
display: flex;
|
|
89
|
+
width: 22px;
|
|
90
|
+
height: 22px;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
align-items: center;
|
|
93
|
+
align-self: flex-start;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
border-radius: 2px;
|
|
96
|
+
}
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
.jsenv_validation_message_exclamation_svg {
|
|
99
|
+
width: 16px;
|
|
100
|
+
height: 12px;
|
|
101
|
+
color: white;
|
|
102
|
+
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
.jsenv_validation_message[data-level="info"] .border_path {
|
|
105
|
+
fill: var(--navi-info-color);
|
|
106
|
+
}
|
|
107
|
+
.jsenv_validation_message[data-level="info"]
|
|
108
|
+
.jsenv_validation_message_icon {
|
|
109
|
+
background-color: var(--navi-info-color);
|
|
110
|
+
}
|
|
111
|
+
.jsenv_validation_message[data-level="warning"] .border_path {
|
|
112
|
+
fill: var(--navi-warning-color);
|
|
113
|
+
}
|
|
114
|
+
.jsenv_validation_message[data-level="warning"]
|
|
115
|
+
.jsenv_validation_message_icon {
|
|
116
|
+
background-color: var(--navi-warning-color);
|
|
117
|
+
}
|
|
118
|
+
.jsenv_validation_message[data-level="error"] .border_path {
|
|
119
|
+
fill: var(--navi-error-color);
|
|
120
|
+
}
|
|
121
|
+
.jsenv_validation_message[data-level="error"]
|
|
122
|
+
.jsenv_validation_message_icon {
|
|
123
|
+
background-color: var(--navi-error-color);
|
|
124
|
+
}
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
.jsenv_validation_message_content {
|
|
127
|
+
min-width: 0;
|
|
128
|
+
align-self: center;
|
|
129
|
+
word-break: break-word;
|
|
130
|
+
overflow-wrap: anywhere;
|
|
131
|
+
}
|
|
129
132
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
.jsenv_validation_message_border svg {
|
|
134
|
+
position: absolute;
|
|
135
|
+
inset: 0;
|
|
136
|
+
overflow: visible;
|
|
137
|
+
}
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
.background_path {
|
|
140
|
+
fill: var(--navi-validation-message-background-color);
|
|
141
|
+
}
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
143
|
+
.jsenv_validation_message_close_button_column {
|
|
144
|
+
display: flex;
|
|
145
|
+
height: 22px;
|
|
146
|
+
}
|
|
147
|
+
.jsenv_validation_message_close_button {
|
|
148
|
+
width: 1em;
|
|
149
|
+
height: 1em;
|
|
150
|
+
padding: 0;
|
|
151
|
+
align-self: center;
|
|
152
|
+
color: currentColor;
|
|
153
|
+
font-size: inherit;
|
|
154
|
+
background: none;
|
|
155
|
+
border: none;
|
|
156
|
+
border-radius: 0.2em;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
}
|
|
159
|
+
.jsenv_validation_message_close_button:hover {
|
|
160
|
+
background: rgba(0, 0, 0, 0.1);
|
|
161
|
+
}
|
|
162
|
+
.close_svg {
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 100%;
|
|
165
|
+
}
|
|
163
166
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
.error_stack {
|
|
168
|
+
max-height: 200px;
|
|
169
|
+
overflow: auto;
|
|
170
|
+
}
|
|
167
171
|
}
|
|
168
172
|
`;
|
|
169
173
|
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import.meta.css = /* css */ `
|
|
2
|
-
:root {
|
|
3
|
-
--navi-field-border-width: 1px;
|
|
4
|
-
--navi-field-outline-width: 1px;
|
|
5
|
-
|
|
6
|
-
--navi-field-border-color: light-dark(#767676, #8e8e93);
|
|
7
|
-
--navi-field-outline-color: light-dark(#355fcc, #3b82f6);
|
|
8
|
-
--navi-field-background-color: light-dark(#f3f4f6, #2d3748);
|
|
9
|
-
--navi-field-accent-color: light-dark(#355fcc, #3b82f6);
|
|
10
|
-
|
|
11
|
-
--navi-field-disabled-border-color: color-mix(
|
|
12
|
-
in srgb,
|
|
13
|
-
var(--navi-field-border-color) 30%,
|
|
14
|
-
white
|
|
15
|
-
);
|
|
16
|
-
--navi-field-readonly-border-color: var(--navi-field-disabled-border-color);
|
|
17
|
-
--navi-field-active-border-color: color-mix(
|
|
18
|
-
in srgb,
|
|
19
|
-
var(--navi-field-border-color) 90%,
|
|
20
|
-
black
|
|
21
|
-
);
|
|
22
|
-
--navi-field-hover-border-color: color-mix(
|
|
23
|
-
in srgb,
|
|
24
|
-
var(--navi-field-border-color) 70%,
|
|
25
|
-
black
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
--navi-field-disabled-background-color: var(--navi-field-background-color);
|
|
29
|
-
--navi-field-readonly-background-color: var(
|
|
30
|
-
--navi-field-disabled-background-color
|
|
31
|
-
);
|
|
32
|
-
--navi-field-hover-background-color: color-mix(
|
|
33
|
-
in srgb,
|
|
34
|
-
var(--navi-field-background-color) 95%,
|
|
35
|
-
black
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
--navi-field-readonly-color: color-mix(
|
|
39
|
-
in srgb,
|
|
40
|
-
currentColor 30%,
|
|
41
|
-
transparent
|
|
42
|
-
);
|
|
43
|
-
--navi-field-disabled-color: var(--navi-field-readonly-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
[data-field-border-and-outline] {
|
|
47
|
-
border-width: calc(
|
|
48
|
-
var(--navi-field-border-width) + var(--navi-field-outline-width)
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
border-style: solid;
|
|
52
|
-
|
|
53
|
-
border-color: transparent;
|
|
54
|
-
outline-width: var(--navi-field-border-width);
|
|
55
|
-
outline-style: none;
|
|
56
|
-
outline-color: var(--navi-field-border-color);
|
|
57
|
-
outline-offset: calc(-1 * (var(--navi-field-border-width)));
|
|
58
|
-
}
|
|
59
|
-
[data-field-wrapper][data-focus-visible] [data-field-border-and-outline] {
|
|
60
|
-
outline-width: calc(
|
|
61
|
-
var(--navi-field-border-width) + var(--navi-field-outline-width)
|
|
62
|
-
);
|
|
63
|
-
outline-style: solid;
|
|
64
|
-
outline-offset: calc(
|
|
65
|
-
-1 * (var(--navi-field-border-width) + var(--navi-field-outline-width))
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
[data-field-wrapper][data-readonly] [data-field-border-and-outline] {
|
|
69
|
-
--navi-field-outline-color: var(--navi-field-readonly-border-color);
|
|
70
|
-
--navi-field-background-color: none;
|
|
71
|
-
}
|
|
72
|
-
[data-field-wrapper][data-active] [data-field-border-and-outline] {
|
|
73
|
-
--navi-field-outline-color: var(--navi-field-active-border-color);
|
|
74
|
-
--navi-field-background-color: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
[data-field-border-hover-only] {
|
|
78
|
-
border: 0;
|
|
79
|
-
}
|
|
80
|
-
[data-field-wrapper][data-hover] [data-field-with-hover-effect-on-border] {
|
|
81
|
-
outline-color: var(--navi-field-hover-border-color);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
[data-field-wrapper][data-readonly] [data-field] {
|
|
85
|
-
--navi-field-color: var(--navi-field-readonly-color);
|
|
86
|
-
}
|
|
87
|
-
`;
|