@10x-media/fields 0.1.0-beta.8 → 4.0.0-alpha.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/CHANGELOG.md +12 -0
- package/README.md +8 -3
- package/dist/exports/client.d.ts +4 -1
- package/dist/exports/client.js +3 -1
- package/dist/fields/color/client/ColorField.d.ts +2 -0
- package/dist/fields/color/client/ColorField.js +34 -337
- package/dist/fields/color/client/ColorField.js.map +1 -1
- package/dist/fields/color/client/ColorInput.d.ts +44 -0
- package/dist/fields/color/client/ColorInput.js +385 -0
- package/dist/fields/color/client/ColorInput.js.map +1 -0
- package/dist/fields/color/client/ColorPickerPanel.js +18 -12
- package/dist/fields/color/client/ColorPickerPanel.js.map +1 -1
- package/dist/fields/color/client/colorField.css +131 -178
- package/dist/fields/color/client/icons.js +17 -24
- package/dist/fields/color/client/icons.js.map +1 -1
- package/dist/fields/color/colorField.js +5 -3
- package/dist/fields/color/colorField.js.map +1 -1
- package/dist/fields/color/server/colorCell.css +8 -9
- package/dist/fields/color/valueIssue.js +23 -0
- package/dist/fields/color/valueIssue.js.map +1 -0
- package/dist/fields/encrypted/components/EncryptedInput.js +44 -26
- package/dist/fields/encrypted/components/EncryptedInput.js.map +1 -1
- package/dist/fields/encrypted/components/EncryptedTextarea.js +29 -29
- package/dist/fields/encrypted/components/EncryptedTextarea.js.map +1 -1
- package/dist/fields/encrypted/components/EyeToggle.js +14 -35
- package/dist/fields/encrypted/components/EyeToggle.js.map +1 -1
- package/dist/fields/encrypted/components/ProtectedField.css +107 -159
- package/dist/fields/encrypted/components/ProtectedField.js +6 -2
- package/dist/fields/encrypted/components/ProtectedField.js.map +1 -1
- package/dist/fields/encrypted/components/RichTextRevealGate.js +3 -3
- package/dist/fields/encrypted/components/RichTextRevealGate.js.map +1 -1
- package/dist/fields/encrypted/components/WriteOnlyActions.js +58 -53
- package/dist/fields/encrypted/components/WriteOnlyActions.js.map +1 -1
- package/dist/fields/encrypted/components/WriteOnlyField.js +39 -21
- package/dist/fields/encrypted/components/WriteOnlyField.js.map +1 -1
- package/dist/fields/encrypted/components/facsimiles.js +70 -79
- package/dist/fields/encrypted/components/facsimiles.js.map +1 -1
- package/dist/fields/encrypted/components/placement.js.map +1 -1
- package/dist/fields/encrypted/encryptedField.js +25 -12
- package/dist/fields/encrypted/encryptedField.js.map +1 -1
- package/dist/fields/encrypted/{typescriptSchema.js → jsonSchema.js} +4 -4
- package/dist/fields/encrypted/jsonSchema.js.map +1 -0
- package/dist/fields/encrypted/queryRewrite.js +20 -0
- package/dist/fields/encrypted/queryRewrite.js.map +1 -1
- package/dist/fields/encrypted/validators.js +1 -1
- package/dist/fields/encrypted/validators.js.map +1 -1
- package/dist/fields/icon/adapters/tabler/generated/nodes.js +1 -1
- package/dist/fields/icon/adapters/tabler/generated/nodes.js.map +1 -1
- package/dist/fields/icon/client/IconDrawerContent.js +8 -6
- package/dist/fields/icon/client/IconDrawerContent.js.map +1 -1
- package/dist/fields/icon/client/IconFieldClient.js +15 -37
- package/dist/fields/icon/client/IconFieldClient.js.map +1 -1
- package/dist/fields/icon/client/icon-field.css +137 -233
- package/dist/fields/icon/codegen/sources/tabler.js +25 -6
- package/dist/fields/icon/codegen/sources/tabler.js.map +1 -1
- package/dist/fields/icon/layers/upload.js +3 -0
- package/dist/fields/icon/layers/upload.js.map +1 -1
- package/dist/fields/icon/react/createIcon.js +4 -4
- package/dist/fields/icon/react/createIcon.js.map +1 -1
- package/dist/fields/measurement/client/MeasurementField.d.ts +2 -0
- package/dist/fields/measurement/client/MeasurementField.js +29 -345
- package/dist/fields/measurement/client/MeasurementField.js.map +1 -1
- package/dist/fields/measurement/client/MeasurementInput.d.ts +42 -0
- package/dist/fields/measurement/client/MeasurementInput.js +313 -0
- package/dist/fields/measurement/client/MeasurementInput.js.map +1 -0
- package/dist/fields/measurement/client/measurementField.css +58 -105
- package/dist/fields/measurement/client/useMeasurementModel.d.ts +19 -0
- package/dist/fields/measurement/client/useMeasurementModel.js +85 -0
- package/dist/fields/measurement/client/useMeasurementModel.js.map +1 -0
- package/dist/fields/measurement/server/getUserUnits.js +2 -1
- package/dist/fields/measurement/server/getUserUnits.js.map +1 -1
- package/dist/fields/phoneNumber/client/CountryPicker.js +14 -9
- package/dist/fields/phoneNumber/client/CountryPicker.js.map +1 -1
- package/dist/fields/phoneNumber/client/PhoneNumberField.d.ts +1 -1
- package/dist/fields/phoneNumber/client/PhoneNumberField.js +22 -4
- package/dist/fields/phoneNumber/client/PhoneNumberField.js.map +1 -1
- package/dist/fields/phoneNumber/client/phoneNumberField.css +109 -142
- package/dist/fields/phoneNumber/phoneNumberField.js +1 -1
- package/dist/fields/phoneNumber/phoneNumberField.js.map +1 -1
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js +2 -1
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/plugin/companionSelect.d.ts +12 -0
- package/dist/plugin/companionSelect.js +107 -0
- package/dist/plugin/companionSelect.js.map +1 -0
- package/package.json +15 -15
- package/dist/fields/encrypted/typescriptSchema.js.map +0 -1
|
@@ -2,71 +2,49 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
/*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(native inputs stay 40px tall at every breakpoint), while the runtime --base var
|
|
9
|
-
is rem-based and shrinks with the responsive html font-size. Deriving from
|
|
10
|
-
var(--base) made this container 3px shorter than native inputs at <=1024px. */
|
|
11
|
-
.fields-color__container {
|
|
5
|
+
/* Payload spaces Error, input, AfterInput and Description per field type
|
|
6
|
+
(.field-type.text .field-type__wrap), so a custom field restates it */
|
|
7
|
+
.fields-color .field-type__wrap {
|
|
12
8
|
display: flex;
|
|
13
|
-
|
|
14
|
-
gap:
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 40px;
|
|
17
|
-
padding: 0 8px 0 6px;
|
|
18
|
-
border: 1px solid var(--theme-elevation-150);
|
|
19
|
-
border-radius: var(--style-radius-s);
|
|
20
|
-
background: var(--theme-input-bg);
|
|
21
|
-
color: var(--theme-elevation-800);
|
|
22
|
-
font-family: var(--font-body);
|
|
23
|
-
font-size: 1rem;
|
|
24
|
-
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
|
|
25
|
-
transition-property: border, box-shadow, background-color;
|
|
26
|
-
transition-duration: 100ms, 100ms, 500ms;
|
|
27
|
-
transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fields-color__container:hover {
|
|
31
|
-
border-color: var(--theme-elevation-250);
|
|
32
|
-
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.2);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.fields-color__container:focus-within {
|
|
36
|
-
border-color: var(--theme-elevation-400);
|
|
37
|
-
outline: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
html[data-theme="light"] .fields-color.error .fields-color__container {
|
|
41
|
-
background-color: var(--theme-error-50);
|
|
42
|
-
border-color: var(--theme-error-500);
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--spacer-2);
|
|
43
11
|
}
|
|
44
12
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
13
|
+
/* Chrome (border, background, radius, height, hover, focus, error) comes from
|
|
14
|
+
Payload's .form-input-group and .form-input-group-error on the same element;
|
|
15
|
+
this rule only lays out the swatch, the text run and the clear control. */
|
|
16
|
+
.fields-color__container {
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--spacer-2);
|
|
19
|
+
padding-inline: var(--spacer-1-5) var(--spacer-2);
|
|
20
|
+
color: var(--field-color-text);
|
|
48
21
|
}
|
|
49
22
|
|
|
50
|
-
|
|
51
|
-
|
|
23
|
+
/* Payload's group hover skips any group holding an input:read-only, and the
|
|
24
|
+
closed Popup keeps the picker's range inputs (which always match
|
|
25
|
+
:read-only) mounted inside this container, so the hover is restated here */
|
|
26
|
+
.fields-color:not(.error, .read-only) .fields-color__container:hover:not(:focus-within) {
|
|
27
|
+
border-color: var(--field-color-border-hover);
|
|
52
28
|
}
|
|
53
29
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
30
|
+
/* Native read-only fields render a disabled input; the color input stays
|
|
31
|
+
readOnly (its value remains selectable), so the disabled look is applied
|
|
32
|
+
here, and wins over :focus-within the way a disabled input never focuses. */
|
|
33
|
+
.fields-color.read-only .fields-color__container {
|
|
34
|
+
background: var(--field-color-bg-disabled);
|
|
35
|
+
border-color: var(--field-color-border-disabled);
|
|
36
|
+
color: var(--field-color-text-disabled);
|
|
60
37
|
}
|
|
61
38
|
|
|
62
39
|
.fields-color__checker {
|
|
63
40
|
background-image: conic-gradient(
|
|
64
|
-
var(--
|
|
41
|
+
var(--color-bg-tertiary) 0 25%,
|
|
65
42
|
transparent 0 50%,
|
|
66
|
-
var(--
|
|
43
|
+
var(--color-bg-tertiary) 0 75%,
|
|
67
44
|
transparent 0
|
|
68
45
|
);
|
|
69
46
|
background-size: 8px 8px;
|
|
47
|
+
background-clip: padding-box;
|
|
70
48
|
}
|
|
71
49
|
|
|
72
50
|
.fields-color__popup,
|
|
@@ -75,8 +53,9 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
75
53
|
flex-shrink: 0;
|
|
76
54
|
}
|
|
77
55
|
|
|
78
|
-
/* Payload caps popup scroll containers at
|
|
79
|
-
so the panel must be targeted via :has, not through
|
|
56
|
+
/* Payload caps popup scroll containers at min(320px, 100vh - 16px) and portals
|
|
57
|
+
popup content to body, so the panel must be targeted via :has, not through
|
|
58
|
+
the .popup root our className lands on */
|
|
80
59
|
.popup__scroll-container:has(> .fields-color__panel) {
|
|
81
60
|
max-height: none;
|
|
82
61
|
}
|
|
@@ -84,9 +63,11 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
84
63
|
.fields-color__swatch-button {
|
|
85
64
|
display: flex;
|
|
86
65
|
flex-shrink: 0;
|
|
66
|
+
height: auto;
|
|
87
67
|
padding: 0;
|
|
88
68
|
cursor: pointer;
|
|
89
69
|
border: 0;
|
|
70
|
+
border-radius: var(--radius-medium);
|
|
90
71
|
background: transparent;
|
|
91
72
|
}
|
|
92
73
|
|
|
@@ -97,21 +78,15 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
97
78
|
.fields-color__swatch {
|
|
98
79
|
position: relative;
|
|
99
80
|
display: block;
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
81
|
+
width: 1.25rem;
|
|
82
|
+
height: 1.25rem;
|
|
102
83
|
overflow: hidden;
|
|
103
|
-
border:
|
|
104
|
-
border-radius: var(--
|
|
84
|
+
border: var(--stroke-width-small) solid var(--field-color-border);
|
|
85
|
+
border-radius: var(--radius-medium);
|
|
105
86
|
}
|
|
106
87
|
|
|
107
88
|
.fields-color__swatch-button:hover .fields-color__swatch {
|
|
108
|
-
border-color: var(--
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.fields-color__swatch-button:focus-visible {
|
|
112
|
-
outline: var(--accessibility-outline);
|
|
113
|
-
outline-offset: 1px;
|
|
114
|
-
border-radius: var(--style-radius-s);
|
|
89
|
+
border-color: var(--field-color-border-hover);
|
|
115
90
|
}
|
|
116
91
|
|
|
117
92
|
.fields-color__swatch-color {
|
|
@@ -121,7 +96,7 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
121
96
|
}
|
|
122
97
|
|
|
123
98
|
.fields-color__swatch-color[data-missing="true"] {
|
|
124
|
-
background: repeating-linear-gradient(45deg, var(--
|
|
99
|
+
background: repeating-linear-gradient(45deg, var(--color-icon-danger) 0 4px, transparent 4px 8px);
|
|
125
100
|
}
|
|
126
101
|
|
|
127
102
|
/* Read-only muting stops at the container chrome: the swatch fill must keep
|
|
@@ -133,19 +108,19 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
133
108
|
|
|
134
109
|
/* Clips the chip/input/badge run so fixed-size flex items can never escape the
|
|
135
110
|
container at narrow widths; the swatch and clear button stay outside it, so
|
|
136
|
-
the clear control keeps its place at the
|
|
111
|
+
the clear control keeps its place at the inline end. The fade is a mask, not
|
|
137
112
|
a background-colored gradient overlay, so it stays correct over every
|
|
138
|
-
container background (
|
|
113
|
+
container background (read-only, both themes).
|
|
139
114
|
The modifier is toggled from a measured scrollWidth overflow, never applied
|
|
140
|
-
statically: the badge always sits at the run's
|
|
141
|
-
|
|
115
|
+
statically: the badge always sits at the run's end, so a static mask would
|
|
116
|
+
fade it even with room to spare. */
|
|
142
117
|
.fields-color__content {
|
|
143
118
|
display: flex;
|
|
144
119
|
flex: 1 1 auto;
|
|
145
120
|
min-width: 0;
|
|
146
121
|
align-items: center;
|
|
147
|
-
gap:
|
|
148
|
-
|
|
122
|
+
gap: var(--spacer-2);
|
|
123
|
+
align-self: stretch;
|
|
149
124
|
overflow: hidden;
|
|
150
125
|
}
|
|
151
126
|
|
|
@@ -154,20 +129,33 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
154
129
|
mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
|
|
155
130
|
}
|
|
156
131
|
|
|
157
|
-
|
|
158
|
-
|
|
132
|
+
[dir="rtl"] .fields-color__content--fade {
|
|
133
|
+
-webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
|
|
134
|
+
mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Mirrors the native multi-value chip. The sibling input's width: 100% basis
|
|
138
|
+
would otherwise squeeze the chip to nothing; the max-width keeps runaway
|
|
139
|
+
labels ellipsizing instead of overflowing */
|
|
159
140
|
.fields-color__chip {
|
|
160
141
|
display: flex;
|
|
161
142
|
flex-shrink: 0;
|
|
162
143
|
max-width: 60%;
|
|
144
|
+
height: 1.25rem;
|
|
163
145
|
align-items: center;
|
|
164
|
-
gap:
|
|
165
|
-
padding:
|
|
166
|
-
border
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
146
|
+
gap: var(--spacer-1);
|
|
147
|
+
padding-inline: var(--spacer-1-5);
|
|
148
|
+
border: var(--stroke-width-small) solid var(--color-border);
|
|
149
|
+
border-radius: var(--radius-chip);
|
|
150
|
+
background: var(--color-bg);
|
|
151
|
+
color: var(--field-color-text);
|
|
152
|
+
font-size: var(--text-body-medium-font-size);
|
|
153
|
+
font-weight: var(--text-body-medium-font-weight);
|
|
154
|
+
line-height: var(--text-body-medium-line-height);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.fields-color.read-only .fields-color__chip {
|
|
158
|
+
color: inherit;
|
|
171
159
|
}
|
|
172
160
|
|
|
173
161
|
.fields-color__chip-swatch {
|
|
@@ -176,8 +164,8 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
176
164
|
width: 12px;
|
|
177
165
|
height: 12px;
|
|
178
166
|
overflow: hidden;
|
|
179
|
-
border:
|
|
180
|
-
border-radius:
|
|
167
|
+
border: var(--stroke-width-small) solid var(--field-color-border);
|
|
168
|
+
border-radius: var(--radius-chip);
|
|
181
169
|
}
|
|
182
170
|
|
|
183
171
|
.fields-color__chip-color {
|
|
@@ -187,7 +175,7 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
187
175
|
}
|
|
188
176
|
|
|
189
177
|
.fields-color__chip-color[data-missing="true"] {
|
|
190
|
-
background: repeating-linear-gradient(45deg, var(--
|
|
178
|
+
background: repeating-linear-gradient(45deg, var(--color-icon-danger) 0 3px, transparent 3px 6px);
|
|
191
179
|
}
|
|
192
180
|
|
|
193
181
|
.fields-color__chip-label {
|
|
@@ -198,79 +186,66 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
198
186
|
|
|
199
187
|
.fields-color__chip-alpha {
|
|
200
188
|
flex-shrink: 0;
|
|
201
|
-
color: var(--
|
|
202
|
-
font-size:
|
|
203
|
-
line-height:
|
|
189
|
+
color: var(--color-text-secondary);
|
|
190
|
+
font-size: var(--text-body-small-font-size);
|
|
191
|
+
line-height: var(--text-body-small-line-height);
|
|
204
192
|
}
|
|
205
193
|
|
|
194
|
+
/* .form-input supplies the typography and placeholder color; the group strips
|
|
195
|
+
its chrome. Padding is dropped because the container's gap spaces the run. */
|
|
206
196
|
.fields-color__input {
|
|
207
|
-
|
|
208
|
-
width: 100%;
|
|
209
|
-
min-width: 0;
|
|
210
|
-
height: 100%;
|
|
197
|
+
align-self: stretch;
|
|
211
198
|
padding: 0;
|
|
212
|
-
border: 0;
|
|
213
|
-
background: transparent;
|
|
214
199
|
color: inherit;
|
|
215
|
-
font-family: inherit;
|
|
216
|
-
font-size: inherit;
|
|
217
|
-
line-height: 20px;
|
|
218
|
-
appearance: none;
|
|
219
|
-
-webkit-appearance: none;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.fields-color__input:focus {
|
|
223
|
-
outline: 0;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.fields-color__input::placeholder {
|
|
227
|
-
color: var(--theme-elevation-400);
|
|
228
200
|
}
|
|
229
201
|
|
|
230
202
|
.fields-color__badge {
|
|
231
203
|
flex-shrink: 0;
|
|
232
|
-
padding:
|
|
233
|
-
border-radius: var(--
|
|
234
|
-
background: var(--
|
|
235
|
-
color: var(--
|
|
236
|
-
font-size:
|
|
237
|
-
|
|
204
|
+
padding-inline: var(--spacer-1);
|
|
205
|
+
border-radius: var(--radius-chip);
|
|
206
|
+
background: var(--color-bg-secondary);
|
|
207
|
+
color: var(--color-text-secondary);
|
|
208
|
+
font-size: var(--text-body-small-font-size);
|
|
209
|
+
font-weight: var(--text-body-small-font-weight);
|
|
210
|
+
line-height: var(--text-body-small-line-height);
|
|
238
211
|
letter-spacing: 0.05em;
|
|
239
212
|
text-transform: uppercase;
|
|
240
213
|
}
|
|
241
214
|
|
|
242
|
-
/* Matches the native select's clear
|
|
215
|
+
/* Matches the native select's clear indicator: bare icon in a 24px box, 4px
|
|
216
|
+
from the inline end like .rs__indicators */
|
|
243
217
|
.fields-color__clear {
|
|
244
218
|
display: flex;
|
|
245
219
|
flex-shrink: 0;
|
|
246
220
|
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
min-width: var(--spacer-4);
|
|
223
|
+
min-height: var(--spacer-4);
|
|
224
|
+
margin-inline-end: calc(var(--spacer-1) - var(--spacer-2));
|
|
247
225
|
padding: 0;
|
|
248
226
|
border: 0;
|
|
249
227
|
background: transparent;
|
|
250
|
-
color: var(--
|
|
228
|
+
color: var(--color-icon-secondary);
|
|
251
229
|
cursor: pointer;
|
|
252
230
|
}
|
|
253
231
|
|
|
254
232
|
.fields-color__clear:hover {
|
|
255
|
-
color: var(--
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.fields-color__clear:focus-visible {
|
|
259
|
-
outline: var(--accessibility-outline);
|
|
233
|
+
color: var(--color-icon);
|
|
260
234
|
}
|
|
261
235
|
|
|
262
236
|
.fields-color__panel {
|
|
263
237
|
display: flex;
|
|
264
238
|
flex-direction: column;
|
|
265
|
-
gap:
|
|
239
|
+
gap: var(--spacer-2);
|
|
266
240
|
width: 260px;
|
|
267
|
-
padding:
|
|
241
|
+
padding-inline: var(--spacer-2);
|
|
242
|
+
color: var(--color-text);
|
|
268
243
|
}
|
|
269
244
|
|
|
270
245
|
.fields-color__sv {
|
|
271
246
|
position: relative;
|
|
272
247
|
height: 160px;
|
|
273
|
-
border-radius: var(--
|
|
248
|
+
border-radius: var(--radius-medium);
|
|
274
249
|
background-image:
|
|
275
250
|
linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
|
|
276
251
|
linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
|
|
@@ -278,11 +253,6 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
278
253
|
touch-action: none;
|
|
279
254
|
}
|
|
280
255
|
|
|
281
|
-
.fields-color__sv:focus-visible {
|
|
282
|
-
outline: 2px solid var(--theme-elevation-400);
|
|
283
|
-
outline-offset: 2px;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
256
|
.fields-color__sv-thumb {
|
|
287
257
|
position: absolute;
|
|
288
258
|
width: 12px;
|
|
@@ -297,10 +267,14 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
297
267
|
.fields-color__slider {
|
|
298
268
|
width: 100%;
|
|
299
269
|
height: 12px;
|
|
300
|
-
|
|
301
|
-
border
|
|
270
|
+
margin: 0;
|
|
271
|
+
border: var(--stroke-width-small) solid var(--field-color-border);
|
|
272
|
+
border-radius: var(--radius-full);
|
|
302
273
|
appearance: none;
|
|
303
274
|
-webkit-appearance: none;
|
|
275
|
+
/* The gradient is sized to the padding box and repeats under the border, which painted
|
|
276
|
+
the alpha track's opaque end as a strip at its transparent start. */
|
|
277
|
+
background-clip: padding-box;
|
|
304
278
|
background-size: 100% 100%;
|
|
305
279
|
}
|
|
306
280
|
|
|
@@ -321,102 +295,81 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
321
295
|
-webkit-appearance: none;
|
|
322
296
|
width: 16px;
|
|
323
297
|
height: 16px;
|
|
324
|
-
border:
|
|
298
|
+
border: var(--stroke-width-small) solid var(--color-border-strong);
|
|
325
299
|
border-radius: 50%;
|
|
326
|
-
background: var(--
|
|
300
|
+
background: var(--color-bg);
|
|
327
301
|
cursor: pointer;
|
|
328
302
|
}
|
|
329
303
|
|
|
330
304
|
.fields-color__slider::-moz-range-thumb {
|
|
331
305
|
width: 16px;
|
|
332
306
|
height: 16px;
|
|
333
|
-
border:
|
|
307
|
+
border: var(--stroke-width-small) solid var(--color-border-strong);
|
|
334
308
|
border-radius: 50%;
|
|
335
|
-
background: var(--
|
|
309
|
+
background: var(--color-bg);
|
|
336
310
|
cursor: pointer;
|
|
337
311
|
}
|
|
338
312
|
|
|
339
|
-
.fields-color__slider:focus-visible {
|
|
340
|
-
outline: 2px solid var(--theme-elevation-400);
|
|
341
|
-
outline-offset: 2px;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
313
|
.fields-color__controls {
|
|
345
314
|
display: flex;
|
|
346
315
|
align-items: center;
|
|
347
|
-
gap:
|
|
316
|
+
gap: var(--spacer-1);
|
|
348
317
|
}
|
|
349
318
|
|
|
350
319
|
.fields-color__formats {
|
|
351
320
|
display: flex;
|
|
352
321
|
flex: 1 1 auto;
|
|
353
|
-
gap:
|
|
322
|
+
gap: var(--spacer-1);
|
|
354
323
|
}
|
|
355
324
|
|
|
325
|
+
/* Payload Buttons: ghost when idle, pill for the active format (the pill's own fill, not its
|
|
326
|
+
selected state, whose text falls short of 4.5:1 at this size). Layout only here: equal
|
|
327
|
+
segments across the row. */
|
|
356
328
|
.fields-color__format {
|
|
357
329
|
flex: 1 1 0;
|
|
358
|
-
height: 28px;
|
|
359
|
-
border: 1px solid var(--theme-elevation-150);
|
|
360
|
-
border-radius: var(--style-radius-s);
|
|
361
|
-
background: transparent;
|
|
362
|
-
color: var(--theme-elevation-600);
|
|
363
|
-
font-size: 0.7rem;
|
|
364
|
-
letter-spacing: 0.05em;
|
|
365
|
-
text-transform: uppercase;
|
|
366
|
-
cursor: pointer;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.fields-color__format[aria-pressed="true"] {
|
|
370
|
-
background: var(--theme-elevation-150);
|
|
371
|
-
color: var(--theme-elevation-800);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.fields-color__eyedropper {
|
|
375
|
-
display: flex;
|
|
376
|
-
align-items: center;
|
|
377
330
|
justify-content: center;
|
|
378
|
-
width: 28px;
|
|
379
|
-
height: 28px;
|
|
380
|
-
border: 1px solid var(--theme-elevation-150);
|
|
381
|
-
border-radius: var(--style-radius-s);
|
|
382
|
-
background: transparent;
|
|
383
|
-
color: var(--theme-elevation-600);
|
|
384
|
-
cursor: pointer;
|
|
385
331
|
}
|
|
386
332
|
|
|
387
|
-
.fields-color__eyedropper
|
|
388
|
-
|
|
389
|
-
border-color: var(--theme-elevation-250);
|
|
333
|
+
.fields-color__eyedropper {
|
|
334
|
+
flex-shrink: 0;
|
|
390
335
|
}
|
|
391
336
|
|
|
392
337
|
.fields-color__presets-label {
|
|
393
|
-
margin-bottom:
|
|
394
|
-
color: var(--
|
|
395
|
-
font-size:
|
|
338
|
+
margin-bottom: var(--spacer-1);
|
|
339
|
+
color: var(--color-text);
|
|
340
|
+
font-size: var(--text-body-medium-font-size);
|
|
341
|
+
line-height: var(--text-body-medium-line-height);
|
|
396
342
|
}
|
|
397
343
|
|
|
398
344
|
.fields-color__missing {
|
|
399
|
-
margin: 0 0
|
|
400
|
-
color: var(--
|
|
401
|
-
font-size:
|
|
345
|
+
margin: 0 0 var(--spacer-1);
|
|
346
|
+
color: var(--color-text-danger);
|
|
347
|
+
font-size: var(--text-body-small-font-size);
|
|
348
|
+
line-height: var(--text-body-small-line-height);
|
|
402
349
|
}
|
|
403
350
|
|
|
404
351
|
.fields-color__presets-grid {
|
|
405
352
|
display: grid;
|
|
406
353
|
grid-template-columns: repeat(8, 1fr);
|
|
407
|
-
gap:
|
|
354
|
+
gap: var(--spacer-1);
|
|
408
355
|
}
|
|
409
356
|
|
|
357
|
+
/* About 27px across, so the field swatch's 5px on 20px scales to 7px here; Payload has no
|
|
358
|
+
token between medium (5px) and large (13px). */
|
|
410
359
|
.fields-color__preset {
|
|
411
360
|
position: relative;
|
|
412
361
|
overflow: hidden;
|
|
413
362
|
aspect-ratio: 1;
|
|
414
363
|
padding: 0;
|
|
415
|
-
border:
|
|
416
|
-
border-radius: var(--
|
|
364
|
+
border: var(--stroke-width-small) solid var(--field-color-border);
|
|
365
|
+
border-radius: calc(var(--radius-medium) + var(--radius-small));
|
|
417
366
|
cursor: pointer;
|
|
418
367
|
}
|
|
419
368
|
|
|
369
|
+
.fields-color__preset:hover {
|
|
370
|
+
border-color: var(--field-color-border-hover);
|
|
371
|
+
}
|
|
372
|
+
|
|
420
373
|
.fields-color__preset > span {
|
|
421
374
|
position: absolute;
|
|
422
375
|
inset: 0;
|
|
@@ -424,8 +377,8 @@ html[data-theme="dark"] .fields-color.error .fields-color__container:hover {
|
|
|
424
377
|
}
|
|
425
378
|
|
|
426
379
|
.fields-color__preset[aria-pressed="true"] {
|
|
427
|
-
outline:
|
|
428
|
-
outline-offset:
|
|
380
|
+
outline: var(--stroke-width-medium) solid var(--color-border-selected);
|
|
381
|
+
outline-offset: var(--accessibility-outline-offset);
|
|
429
382
|
}
|
|
430
383
|
|
|
431
384
|
.fields-color__sr-only {
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/fields/color/client/icons.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Lucide's pipette at the scale of Payload's own icons: drawn in its 24px box and rendered at
|
|
6
|
+
* 16px, so the 1.5 stroke lands as a 1px line, like the native line icons beside it.
|
|
7
|
+
*/
|
|
8
|
+
const ICON_SIZE = 16;
|
|
9
|
+
const ICON_STROKE = 24 / ICON_SIZE * 1;
|
|
4
10
|
const EyedropperIcon = () => /* @__PURE__ */ jsxs("svg", {
|
|
5
11
|
"aria-hidden": "true",
|
|
12
|
+
className: "icon icon--eyedropper",
|
|
6
13
|
fill: "none",
|
|
7
|
-
height:
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
height: ICON_SIZE,
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round",
|
|
18
|
+
strokeWidth: ICON_STROKE,
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
width: ICON_SIZE,
|
|
10
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
22
|
children: [
|
|
12
|
-
/* @__PURE__ */ jsx("path", {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
strokeLinecap: "round",
|
|
16
|
-
strokeLinejoin: "round",
|
|
17
|
-
strokeWidth: "1.5"
|
|
18
|
-
}),
|
|
19
|
-
/* @__PURE__ */ jsx("path", {
|
|
20
|
-
d: "M2.2 13.8v-2l6-6",
|
|
21
|
-
stroke: "currentColor",
|
|
22
|
-
strokeLinecap: "round",
|
|
23
|
-
strokeLinejoin: "round",
|
|
24
|
-
strokeWidth: "1.5"
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ jsx("path", {
|
|
27
|
-
d: "m10 4 2.3-2.3a1.4 1.4 0 0 1 2 2L12 6l.3.3a1.4 1.4 0 0 1-2 2L7.7 5.7a1.4 1.4 0 0 1 2-2l.3.3Z",
|
|
28
|
-
stroke: "currentColor",
|
|
29
|
-
strokeLinecap: "round",
|
|
30
|
-
strokeLinejoin: "round",
|
|
31
|
-
strokeWidth: "1.5"
|
|
32
|
-
})
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: "m2 22 1-1h3l9-9" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M3 21v-3l9-9" }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
|
|
33
26
|
]
|
|
34
27
|
});
|
|
35
28
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","names":[],"sources":["../../../../src/fields/color/client/icons.tsx"],"sourcesContent":["'use client'\nimport type React from 'react'\n\nexport const EyedropperIcon: React.FC = () => (\n\t<svg\n\t\taria-hidden=\"true\"\n\t\
|
|
1
|
+
{"version":3,"file":"icons.js","names":[],"sources":["../../../../src/fields/color/client/icons.tsx"],"sourcesContent":["'use client'\nimport type React from 'react'\n\n/**\n * Lucide's pipette at the scale of Payload's own icons: drawn in its 24px box and rendered at\n * 16px, so the 1.5 stroke lands as a 1px line, like the native line icons beside it.\n */\nconst ICON_SIZE = 16\nconst ICON_STROKE = (24 / ICON_SIZE) * 1\n\nexport const EyedropperIcon: React.FC = () => (\n\t<svg\n\t\taria-hidden=\"true\"\n\t\tclassName=\"icon icon--eyedropper\"\n\t\tfill=\"none\"\n\t\theight={ICON_SIZE}\n\t\tstroke=\"currentColor\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tstrokeWidth={ICON_STROKE}\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth={ICON_SIZE}\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path d=\"m2 22 1-1h3l9-9\" />\n\t\t<path d=\"M3 21v-3l9-9\" />\n\t\t<path d=\"m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z\" />\n\t</svg>\n)\n"],"mappings":";;;;;;;AAOA,MAAM,YAAY;AAClB,MAAM,cAAe,KAAK,YAAa;AAEvC,MAAa,uBACZ,qBAAC,OAAD;CACC,eAAY;CACZ,WAAU;CACV,MAAK;CACL,QAAQ;CACR,QAAO;CACP,eAAc;CACd,gBAAe;CACf,aAAa;CACb,SAAQ;CACR,OAAO;CACP,OAAM;WAXP;EAaC,oBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;EAC3B,oBAAC,QAAD,EAAM,GAAE,eAAgB,CAAA;EACxB,oBAAC,QAAD,EAAM,GAAE,+FAAgG,CAAA;CACpG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCompanions } from "../../plugin/companionSelect.js";
|
|
1
2
|
import { keys } from "../../translations/keys.js";
|
|
2
3
|
import { parseColor } from "./engine/parse.js";
|
|
3
4
|
import { formatColor } from "./engine/format.js";
|
|
@@ -132,10 +133,10 @@ function colorField(options = {}) {
|
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
const resolvedAdmin = {
|
|
135
|
-
|
|
136
|
+
disabled: { column: true },
|
|
136
137
|
hidden: true
|
|
137
138
|
};
|
|
138
|
-
|
|
139
|
+
const resolvedField = resolveMode === "schemes" ? {
|
|
139
140
|
name: `${field.name}Resolved`,
|
|
140
141
|
type: "json",
|
|
141
142
|
admin: resolvedAdmin,
|
|
@@ -147,7 +148,8 @@ function colorField(options = {}) {
|
|
|
147
148
|
admin: resolvedAdmin,
|
|
148
149
|
hooks: { afterRead: [resolveHook] },
|
|
149
150
|
virtual: true
|
|
150
|
-
}
|
|
151
|
+
};
|
|
152
|
+
return [withCompanions(field, [resolvedField.name]), resolvedField];
|
|
151
153
|
}
|
|
152
154
|
//#endregion
|
|
153
155
|
export { colorField };
|