@10x-media/fields 0.1.0-beta.9 → 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.
Files changed (74) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +8 -3
  3. package/dist/fields/color/client/ColorInput.js +17 -6
  4. package/dist/fields/color/client/ColorInput.js.map +1 -1
  5. package/dist/fields/color/client/ColorPickerPanel.js +18 -12
  6. package/dist/fields/color/client/ColorPickerPanel.js.map +1 -1
  7. package/dist/fields/color/client/colorField.css +131 -178
  8. package/dist/fields/color/client/icons.js +17 -24
  9. package/dist/fields/color/client/icons.js.map +1 -1
  10. package/dist/fields/color/colorField.js +5 -3
  11. package/dist/fields/color/colorField.js.map +1 -1
  12. package/dist/fields/color/server/colorCell.css +8 -9
  13. package/dist/fields/encrypted/components/EncryptedInput.js +44 -26
  14. package/dist/fields/encrypted/components/EncryptedInput.js.map +1 -1
  15. package/dist/fields/encrypted/components/EncryptedTextarea.js +29 -29
  16. package/dist/fields/encrypted/components/EncryptedTextarea.js.map +1 -1
  17. package/dist/fields/encrypted/components/EyeToggle.js +14 -35
  18. package/dist/fields/encrypted/components/EyeToggle.js.map +1 -1
  19. package/dist/fields/encrypted/components/ProtectedField.css +107 -159
  20. package/dist/fields/encrypted/components/ProtectedField.js +6 -2
  21. package/dist/fields/encrypted/components/ProtectedField.js.map +1 -1
  22. package/dist/fields/encrypted/components/RichTextRevealGate.js +3 -3
  23. package/dist/fields/encrypted/components/RichTextRevealGate.js.map +1 -1
  24. package/dist/fields/encrypted/components/WriteOnlyActions.js +58 -53
  25. package/dist/fields/encrypted/components/WriteOnlyActions.js.map +1 -1
  26. package/dist/fields/encrypted/components/WriteOnlyField.js +39 -21
  27. package/dist/fields/encrypted/components/WriteOnlyField.js.map +1 -1
  28. package/dist/fields/encrypted/components/facsimiles.js +70 -79
  29. package/dist/fields/encrypted/components/facsimiles.js.map +1 -1
  30. package/dist/fields/encrypted/components/placement.js.map +1 -1
  31. package/dist/fields/encrypted/encryptedField.js +25 -12
  32. package/dist/fields/encrypted/encryptedField.js.map +1 -1
  33. package/dist/fields/encrypted/{typescriptSchema.js → jsonSchema.js} +4 -4
  34. package/dist/fields/encrypted/jsonSchema.js.map +1 -0
  35. package/dist/fields/encrypted/queryRewrite.js +20 -0
  36. package/dist/fields/encrypted/queryRewrite.js.map +1 -1
  37. package/dist/fields/encrypted/validators.js +1 -1
  38. package/dist/fields/encrypted/validators.js.map +1 -1
  39. package/dist/fields/icon/adapters/tabler/generated/nodes.js +1 -1
  40. package/dist/fields/icon/adapters/tabler/generated/nodes.js.map +1 -1
  41. package/dist/fields/icon/client/IconDrawerContent.js +8 -6
  42. package/dist/fields/icon/client/IconDrawerContent.js.map +1 -1
  43. package/dist/fields/icon/client/IconFieldClient.js +15 -37
  44. package/dist/fields/icon/client/IconFieldClient.js.map +1 -1
  45. package/dist/fields/icon/client/icon-field.css +137 -233
  46. package/dist/fields/icon/codegen/sources/tabler.js +25 -6
  47. package/dist/fields/icon/codegen/sources/tabler.js.map +1 -1
  48. package/dist/fields/icon/layers/upload.js +3 -0
  49. package/dist/fields/icon/layers/upload.js.map +1 -1
  50. package/dist/fields/icon/react/createIcon.js +4 -4
  51. package/dist/fields/icon/react/createIcon.js.map +1 -1
  52. package/dist/fields/measurement/client/MeasurementInput.js +18 -32
  53. package/dist/fields/measurement/client/MeasurementInput.js.map +1 -1
  54. package/dist/fields/measurement/client/measurementField.css +58 -105
  55. package/dist/fields/measurement/server/getUserUnits.js +2 -1
  56. package/dist/fields/measurement/server/getUserUnits.js.map +1 -1
  57. package/dist/fields/phoneNumber/client/CountryPicker.js +14 -9
  58. package/dist/fields/phoneNumber/client/CountryPicker.js.map +1 -1
  59. package/dist/fields/phoneNumber/client/PhoneNumberField.d.ts +1 -1
  60. package/dist/fields/phoneNumber/client/PhoneNumberField.js +22 -4
  61. package/dist/fields/phoneNumber/client/PhoneNumberField.js.map +1 -1
  62. package/dist/fields/phoneNumber/client/phoneNumberField.css +109 -142
  63. package/dist/fields/phoneNumber/phoneNumberField.js +1 -1
  64. package/dist/fields/phoneNumber/phoneNumberField.js.map +1 -1
  65. package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js +2 -1
  66. package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js.map +1 -1
  67. package/dist/index.d.ts +3 -2
  68. package/dist/index.js +5 -4
  69. package/dist/index.js.map +1 -1
  70. package/dist/plugin/companionSelect.d.ts +12 -0
  71. package/dist/plugin/companionSelect.js +107 -0
  72. package/dist/plugin/companionSelect.js.map +1 -0
  73. package/package.json +15 -15
  74. package/dist/fields/encrypted/typescriptSchema.js.map +0 -1
@@ -1,92 +1,62 @@
1
- /* Composite input mirrors Payload's formInput mixin (packages/ui/src/scss/vars.scss) so the
2
- trigger reads as one native text input: glyph, label, marker and clear all live inside one
3
- container and focus rides :focus-within. Sizes are literal px because Payload compiles scss
4
- base() to px (native inputs stay 40px at every breakpoint) while the runtime --base var is
5
- rem-based and shrinks below 1024px, which would leave this shorter than the inputs beside it. */
6
- .tenx-icon-field__control {
7
- display: flex;
8
- align-items: center;
9
- width: 100%;
10
- height: 40px;
11
- padding: 0;
12
- overflow: hidden;
13
- border: 1px solid var(--theme-elevation-150);
14
- border-radius: var(--style-radius-s);
15
- background: var(--theme-input-bg);
16
- color: var(--theme-elevation-800);
17
- font-family: var(--font-body);
18
- font-size: 1rem;
19
- box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
20
- transition-property: border, box-shadow, background-color;
21
- transition-duration: 100ms, 100ms, 500ms;
22
- transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
23
- }
24
-
25
- .tenx-icon-field__control:hover {
26
- border-color: var(--theme-elevation-250);
27
- box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.2);
28
- }
29
-
30
- .tenx-icon-field__control:focus-within {
31
- border-color: var(--theme-elevation-400);
32
- outline: 0;
1
+ /* The control carries Payload's own .form-input-group (forms.css), which owns the border,
2
+ background, radius, height and the hover, focus-within and error borders. This sheet is
3
+ unlayered, so it beats every layered Payload rule: it only adds layout, and states that
4
+ must override the group (warning, read-only) say so explicitly. */
5
+ .tenx-icon-field {
6
+ --tenx-icon-glyph-size: 16px;
33
7
  }
34
8
 
35
- html[data-theme="light"] .tenx-icon-field.error .tenx-icon-field__control {
36
- background-color: var(--theme-error-50);
37
- border-color: var(--theme-error-500);
38
- }
39
-
40
- html[data-theme="dark"] .tenx-icon-field.error .tenx-icon-field__control {
41
- background-color: var(--theme-error-100);
42
- border-color: var(--theme-error-400);
43
- }
44
-
45
- html[data-theme="dark"] .tenx-icon-field.error .tenx-icon-field__control:hover {
46
- border-color: var(--theme-error-500);
9
+ /* Payload lays out each field type's wrap itself (Text, Password, Select); a custom field
10
+ has to opt in to the same column so error, input and description get the native gap. */
11
+ .tenx-icon-field .field-type__wrap {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--spacer-2);
47
15
  }
48
16
 
49
- /* Degradation: the stored value's library is gone. A subtle warning tint plus a compact
50
- marker; the full explanation shows in the drawer banner, not in the trigger. */
51
- .tenx-icon-field__control--warning,
52
- .tenx-icon-field__control--warning:hover {
53
- border-color: var(--theme-warning-250);
17
+ .tenx-icon-field__control {
18
+ color: var(--field-color-text);
19
+ font-size: var(--text-body-medium-font-size);
20
+ font-weight: var(--text-body-medium-font-weight);
21
+ line-height: var(--text-body-medium-line-height);
54
22
  }
55
23
 
56
- html[data-theme="light"] .tenx-icon-field__control--warning {
57
- background-color: var(--theme-warning-50);
24
+ /* Degradation: the stored value's library is gone. A warning border plus a compact marker;
25
+ the full explanation shows in the drawer banner, not in the trigger. Focus and error keep
26
+ their native borders. */
27
+ .tenx-icon-field__control--warning:not(.form-input-group-error):not(:focus-within) {
28
+ border-color: var(--color-border-warning-strong);
58
29
  }
59
30
 
60
- html[data-theme="dark"] .tenx-icon-field__control--warning {
61
- background-color: var(--theme-warning-100);
31
+ /* Payload renders a read-only text field as a disabled input; this is that look. Like the
32
+ native one, an errored read-only field keeps its error border. */
33
+ .tenx-icon-field.read-only .tenx-icon-field__control {
34
+ background: var(--field-color-bg-disabled);
35
+ color: var(--field-color-text-disabled);
62
36
  }
63
37
 
64
- .tenx-icon-field.read-only .tenx-icon-field__control,
65
- .tenx-icon-field.read-only .tenx-icon-field__control:hover {
66
- border-color: var(--theme-elevation-150);
67
- background: var(--theme-elevation-100);
68
- color: var(--theme-elevation-400);
69
- box-shadow: none;
38
+ .tenx-icon-field.read-only .tenx-icon-field__control:not(.form-input-group-error) {
39
+ border-color: var(--field-color-border-disabled);
70
40
  }
71
41
 
72
- /* Square region at the input's start: the 20px glyph is centered in a 1:1 box the height of
73
- the input, giving equal padding on every side, and doubles as the drawer-open affordance. */
42
+ /* Leading region: the glyph sits where a native input's text starts (the field's inline
43
+ padding) with the same gap after it, and doubles as the drawer-open affordance. */
74
44
  .tenx-icon-field__glyph {
75
45
  display: flex;
76
46
  flex: 0 0 auto;
77
47
  align-items: center;
78
48
  justify-content: center;
79
- height: 100%;
80
- aspect-ratio: 1;
49
+ width: calc(var(--tenx-icon-glyph-size) + 2 * var(--field-padding-inline));
81
50
  padding: 0;
82
51
  border: 0;
52
+ border-radius: var(--field-border-radius);
83
53
  background: transparent;
84
54
  color: inherit;
85
55
  cursor: pointer;
86
56
  }
87
57
 
88
58
  .tenx-icon-field__glyph--empty {
89
- color: var(--theme-elevation-300);
59
+ color: var(--field-color-placeholder);
90
60
  }
91
61
 
92
62
  .tenx-icon-field__glyph:disabled {
@@ -95,23 +65,22 @@ html[data-theme="dark"] .tenx-icon-field__control--warning {
95
65
 
96
66
  .tenx-icon-field__glyph:focus-visible {
97
67
  outline: var(--accessibility-outline);
98
- outline-offset: -2px;
68
+ outline-offset: calc(-1 * var(--stroke-width-medium));
99
69
  }
100
70
 
101
- /* Non-text mode: the whole area except the clear button opens the drawer. */
71
+ /* Non-text mode: the whole area except the clear button opens the drawer. Its focus shows
72
+ as the group's focus border, exactly like a native select. */
102
73
  .tenx-icon-field__open {
103
74
  display: flex;
104
75
  flex: 1 1 auto;
105
76
  align-items: center;
106
77
  min-width: 0;
107
- height: 100%;
108
78
  padding: 0;
109
79
  border: 0;
110
80
  background: transparent;
111
81
  color: inherit;
112
- font-family: inherit;
113
- font-size: inherit;
114
- text-align: left;
82
+ font: inherit;
83
+ text-align: start;
115
84
  cursor: pointer;
116
85
  }
117
86
 
@@ -120,66 +89,57 @@ html[data-theme="dark"] .tenx-icon-field__control--warning {
120
89
  }
121
90
 
122
91
  .tenx-icon-field__open:focus-visible {
123
- outline: var(--accessibility-outline);
124
- outline-offset: -2px;
92
+ outline: none;
125
93
  }
126
94
 
127
95
  .tenx-icon-field__value {
128
96
  flex: 1 1 auto;
129
97
  min-width: 0;
130
98
  overflow: hidden;
131
- padding-right: 8px;
99
+ padding-inline-end: var(--field-padding-inline);
132
100
  white-space: nowrap;
133
101
  text-overflow: ellipsis;
134
102
  }
135
103
 
136
- /* Text mode: the label area is a borderless input flexing inside the container. */
104
+ /* Text mode: a .form-input the group strips of chrome; the glyph region already supplies
105
+ the leading space. */
137
106
  .tenx-icon-field__value--input {
138
- height: 100%;
139
- border: 0;
140
- background: transparent;
107
+ padding-inline-start: 0;
141
108
  color: inherit;
142
- font-family: inherit;
143
- font-size: inherit;
144
- appearance: none;
145
- -webkit-appearance: none;
146
- }
147
-
148
- .tenx-icon-field__value--input:focus {
149
- outline: 0;
150
- }
151
-
152
- .tenx-icon-field__value--input::placeholder {
153
- color: var(--theme-elevation-400);
154
109
  }
155
110
 
156
111
  .tenx-icon-field__placeholder {
157
- color: var(--theme-elevation-400);
112
+ color: var(--field-color-placeholder);
158
113
  }
159
114
 
160
- /* Compact degradation marker, right-aligned inside the input. */
161
115
  .tenx-icon-field__marker {
162
116
  display: flex;
163
117
  flex-shrink: 0;
164
118
  align-items: center;
165
- padding: 0 6px;
166
- color: var(--theme-warning-600);
119
+ padding-inline: var(--spacer-1);
120
+ color: var(--color-icon-warning);
167
121
  }
168
122
 
169
- /* Matches the native select's clear indicator: bare icon, no button chrome. */
123
+ /* Payload's select clear indicator: a bare 24px icon button at the inline end. */
170
124
  .tenx-icon-field__clear {
171
125
  display: flex;
172
126
  flex-shrink: 0;
173
127
  align-items: center;
174
- padding: 0 8px;
128
+ justify-content: center;
129
+ align-self: center;
130
+ min-width: var(--spacer-4);
131
+ min-height: var(--spacer-4);
132
+ margin-inline-end: var(--spacer-1);
133
+ padding: 0;
175
134
  border: 0;
135
+ border-radius: var(--radius-small);
176
136
  background: transparent;
177
- color: var(--theme-elevation-500);
137
+ color: var(--color-icon-secondary);
178
138
  cursor: pointer;
179
139
  }
180
140
 
181
141
  .tenx-icon-field__clear:hover {
182
- color: var(--theme-elevation-800);
142
+ color: var(--color-icon);
183
143
  }
184
144
 
185
145
  .tenx-icon-field__clear:focus-visible {
@@ -202,20 +162,26 @@ html[data-theme="dark"] .tenx-icon-field__control--warning {
202
162
  display: inline-block;
203
163
  width: 24px;
204
164
  height: 24px;
205
- background: var(--theme-elevation-100);
206
- border-radius: var(--style-radius-s);
165
+ background: var(--color-bg-secondary);
166
+ border-radius: var(--radius-small);
207
167
  }
208
168
 
169
+ /* Top-aligned: an inline-flex box whose first item is an svg takes its baseline from the svg's
170
+ bottom edge, which lifts the label 2px above the plain-text cells beside it. */
209
171
  .tenx-icon-cell {
210
172
  display: inline-flex;
211
173
  align-items: center;
212
- gap: calc(var(--base) * 0.4);
174
+ gap: var(--spacer-2);
175
+ vertical-align: top;
213
176
  }
214
177
 
215
178
  .tenx-icon-drawer {
216
179
  display: flex;
217
180
  flex-direction: column;
218
181
  min-height: 0;
182
+ /* No block padding: the rail's divider runs from the drawer header to the footer, so the
183
+ top inset lives on the rail and the main column instead. */
184
+ padding: 0 var(--spacer-2-5);
219
185
  /* Cell geometry in one place. The cell box is a fixed square that must equal CELL_SIZE in
220
186
  IconDrawerContent (it drives the column count and the virtualizer row height); the outlined
221
187
  button is smaller and centered, so cell-inset is the gap from each cell-box edge to the
@@ -229,15 +195,17 @@ html[data-theme="dark"] .tenx-icon-field__control--warning {
229
195
  );
230
196
  }
231
197
 
232
- /* Payload's Drawer Gutter (.drawer__content-children) is overflow:auto and stacks
233
- its title header above our content, so a full-height body overflows the Gutter
234
- and adds a second scrollbar on top of the grid's own. Convert the Gutter to a
235
- flex column so the native header stays fixed and our body flex-fills, leaving
236
- the listbox grid as the sole scroller. Scoped to our modal class, same technique
237
- as the color Popup :has() override. */
198
+ /* Payload's drawer body (.drawer__content-children) is the scroller and stacks its title
199
+ header above our content, so a full-height body would add a second scrollbar on top of the
200
+ grid's own. Clip it so the native header stays fixed and our body flex-fills, leaving the
201
+ listbox grid as the sole scroller. Scoped to our modal class. The drawer itself is only
202
+ min-height 100% inside Payload's scrolling modal container, so it grows with its content
203
+ and the virtualizer would see an unbounded grid; pin it to the viewport height. */
204
+ .tenx-icon-drawer-modal.drawer {
205
+ height: 100%;
206
+ }
207
+
238
208
  .tenx-icon-drawer-modal .drawer__content-children {
239
- display: flex;
240
- flex-direction: column;
241
209
  overflow: hidden;
242
210
  }
243
211
 
@@ -254,123 +222,74 @@ html[data-theme="dark"] .tenx-icon-field__control--warning {
254
222
  /* Full degradation explanation shown when the stored value's library is unavailable. */
255
223
  .tenx-icon-drawer__banner {
256
224
  flex-shrink: 0;
257
- margin-bottom: calc(var(--base) * 0.5);
258
- padding: calc(var(--base) * 0.4) calc(var(--base) * 0.6);
259
- border: 1px solid var(--theme-warning-250);
260
- border-radius: var(--style-radius-s);
261
- color: var(--theme-warning-800);
262
- font-size: 0.8rem;
263
- }
264
-
265
- html[data-theme="light"] .tenx-icon-drawer__banner {
266
- background: var(--theme-warning-50);
267
- }
268
-
269
- html[data-theme="dark"] .tenx-icon-drawer__banner {
270
- background: var(--theme-warning-100);
225
+ margin-bottom: var(--spacer-2);
226
+ padding: var(--spacer-2) var(--spacer-2-5);
227
+ border: var(--stroke-width-small) solid var(--color-border-warning);
228
+ border-radius: var(--radius-medium);
229
+ background: var(--color-bg-warning-tertiary);
230
+ color: var(--color-text);
231
+ font-size: var(--text-body-medium-font-size);
232
+ line-height: var(--text-body-medium-line-height);
271
233
  }
272
234
 
273
235
  /* Right column beside the rail. --tenx-icon-grid-width (set inline from columns * CELL_SIZE) is
274
236
  the cell-box span of a full row; aligned-width insets that to the button outlines so the
275
- banner, the search + switcher row, and the visible grid share one left and one right edge. */
237
+ banner, the search + switcher row, and the visible grid share one start and one end edge. */
276
238
  .tenx-icon-drawer__main {
277
239
  display: flex;
278
240
  flex-direction: column;
279
241
  flex-grow: 1;
280
242
  min-width: 0;
281
243
  min-height: 0;
244
+ padding-block-start: var(--spacer-2-5);
282
245
  --tenx-icon-aligned-width: calc(var(--tenx-icon-grid-width) - 2 * var(--tenx-icon-cell-inset));
283
246
  }
284
247
 
285
- /* Banner and search row align to the icon button OUTLINES, not the cell boxes: the outer cells
248
+ /* Banner and search row align to the icon button outlines, not the cell boxes: the outer cells
286
249
  leave a cell-inset gap before the first button and after the last, so insetting these by that
287
- gap lands their left and right edges exactly on the first and last button borders. Both are
288
- children of __main, sharing its left origin and inheriting the width from it. */
250
+ gap lands their edges exactly on the first and last button borders. */
289
251
  .tenx-icon-drawer__banner,
290
252
  .tenx-icon-drawer__header {
291
253
  width: var(--tenx-icon-aligned-width);
292
254
  max-width: 100%;
293
- margin-left: var(--tenx-icon-cell-inset);
255
+ margin-inline-start: var(--tenx-icon-cell-inset);
294
256
  }
295
257
 
296
- /* Search grows to fill the row; the switcher sits at the fixed-width right end so its right
297
- edge is the row's right edge. Width and left inset come from the shared rule above. */
258
+ /* Search grows to fill the row and the switcher sits at the end, 220px when there is room.
259
+ In a narrow drawer the switcher gives way first, down to half the row. */
298
260
  .tenx-icon-drawer__header {
299
261
  display: flex;
300
262
  flex-direction: row;
301
263
  flex-shrink: 0;
302
264
  align-items: center;
303
- gap: calc(var(--base) * 0.5);
304
- padding-bottom: calc(var(--base) * 0.5);
305
- background: var(--theme-bg);
265
+ gap: var(--spacer-2);
266
+ padding-bottom: var(--spacer-2-5);
267
+ background: var(--color-bg);
306
268
  }
307
269
 
308
- /* Bordered control mirroring Payload's formInput: SearchIcon inside-left, borderless input
309
- flexing beside it, focus riding :focus-within. Grows to fill the header row left of the
310
- switcher (min-width: 0 lets it shrink below its content). Literal 40px per the field height
311
- rule (Payload compiles base(2) to px; the --base var shrinks below 1024px). */
270
+ /* A .form-input-group like the field itself, so it matches the switcher beside it. */
312
271
  .tenx-icon-drawer__search {
313
- position: relative;
314
- display: flex;
315
- flex: 1 1 auto;
316
- align-items: center;
317
- min-width: 0;
318
- height: 40px;
319
- border: 1px solid var(--theme-elevation-150);
320
- border-radius: var(--style-radius-s);
321
- background: var(--theme-input-bg);
322
- box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
323
- transition-property: border, box-shadow;
324
- transition-duration: 100ms;
325
- transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
326
- }
327
-
328
- .tenx-icon-drawer__search:hover {
329
- border-color: var(--theme-elevation-250);
272
+ flex: 1 1 0;
273
+ min-width: 50%;
330
274
  }
331
275
 
332
- .tenx-icon-drawer__search:focus-within {
333
- border-color: var(--theme-elevation-400);
334
- }
335
-
336
- /* Square affordance at the start, sized to the control height like Payload's search. */
337
276
  .tenx-icon-drawer__search-icon {
338
277
  display: flex;
339
- flex: 0 0 auto;
278
+ flex: 0 0 var(--spacer-4);
340
279
  align-items: center;
341
280
  justify-content: center;
342
- height: 100%;
343
- aspect-ratio: 1;
344
- color: var(--theme-elevation-400);
281
+ margin-inline-start: var(--spacer-1);
282
+ color: var(--color-icon-secondary);
345
283
  pointer-events: none;
346
284
  }
347
285
 
348
286
  .tenx-icon-drawer__search-input {
349
- flex: 1 1 auto;
350
- min-width: 0;
351
- height: 100%;
352
- padding: 0 calc(var(--base) * 0.5) 0 0;
353
- border: 0;
354
- background: transparent;
355
- color: inherit;
356
- font-family: inherit;
357
- font-size: 1rem;
358
- appearance: none;
359
- -webkit-appearance: none;
360
- }
361
-
362
- .tenx-icon-drawer__search-input:focus {
363
- outline: 0;
364
- }
365
-
366
- .tenx-icon-drawer__search-input::placeholder {
367
- color: var(--theme-elevation-400);
287
+ padding-inline-start: 0;
368
288
  }
369
289
 
370
290
  .tenx-icon-drawer__switcher {
371
- flex: 0 0 auto;
372
- width: 220px;
373
- max-width: 100%;
291
+ flex: 0 1 220px;
292
+ min-width: 0;
374
293
  }
375
294
 
376
295
  .tenx-icon-drawer__sr-only {
@@ -388,42 +307,31 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
388
307
  .tenx-icon-drawer__body {
389
308
  display: flex;
390
309
  flex-grow: 1;
391
- gap: var(--base);
310
+ gap: var(--spacer-3);
392
311
  min-height: 0;
393
312
  }
394
313
 
314
+ /* Category rail: a column of category buttons with a divider down to the footer. */
395
315
  .tenx-icon-drawer__rail {
316
+ padding-block-start: var(--spacer-2-5);
396
317
  display: flex;
397
318
  flex-direction: column;
398
319
  flex-shrink: 0;
399
- gap: 2px;
320
+ gap: calc(var(--spacer-1) / 2);
400
321
  width: 200px;
401
322
  overflow-y: auto;
402
- padding-right: calc(var(--base) * 0.25);
403
- border-right: 1px solid var(--theme-elevation-100);
323
+ padding-inline-end: var(--spacer-2);
324
+ border-inline-end: var(--stroke-width-small) solid var(--color-border);
404
325
  }
405
326
 
327
+ /* Payload Buttons: ghost, pill for the active category. Layout only here: full-width rows with
328
+ the label at the start; category keys come lowercase from the libraries, hence capitalize.
329
+ The Button's height is fixed rather than its content's, so a long rail would squeeze the
330
+ rows instead of scrolling without flex-shrink: 0. */
406
331
  .tenx-icon-drawer__rail-item {
407
- padding: calc(var(--base) * 0.25) calc(var(--base) * 0.5);
408
- background: transparent;
409
- border: none;
410
- border-radius: var(--style-radius-s);
411
- /* 700, not 600: the small rail label needs 4.5:1 on the drawer background */
412
- color: var(--theme-elevation-700);
413
- font-family: inherit;
414
- font-size: 0.875rem;
415
- text-align: left;
332
+ flex-shrink: 0;
333
+ justify-content: flex-start;
416
334
  text-transform: capitalize;
417
- cursor: pointer;
418
- }
419
-
420
- .tenx-icon-drawer__rail-item:hover {
421
- background: var(--theme-elevation-50);
422
- }
423
-
424
- .tenx-icon-drawer__rail-item--active {
425
- background: var(--theme-elevation-100);
426
- color: var(--theme-elevation-800);
427
335
  }
428
336
 
429
337
  .tenx-icon-drawer__grid {
@@ -442,10 +350,8 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
442
350
 
443
351
  /* Fixed cell-size square: width and height both the cell size (the column-count divisor and
444
352
  virtualizer row height in IconDrawerContent). Height keeps rows from overlapping or gapping;
445
- fixing the width instead of growing it left-aligns every row, so a partial last row places its
446
- cells under the same columns as the full rows above it. Containment is deliberately kept off
447
- the cell: paint containment (and content-visibility) would clip the hover tooltip, which
448
- overflows the cell upward; the glyph carries content-visibility instead. */
353
+ fixing the width instead of growing it aligns every row to the start, so a partial last row
354
+ places its cells under the same columns as the full rows above it. */
449
355
  .tenx-icon-drawer__cell {
450
356
  display: flex;
451
357
  flex: 0 0 var(--tenx-icon-cell-size);
@@ -458,7 +364,7 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
458
364
  "Hungary" stores as HUN. Muted and secondary, and deliberately absent from the
459
365
  accessible name so a screen reader announces the label alone. */
460
366
  .tenx-icon-drawer__cell-code {
461
- margin-left: 0.5ch;
367
+ margin-inline-start: 0.5ch;
462
368
  opacity: 0.65;
463
369
  }
464
370
 
@@ -471,19 +377,17 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
471
377
  height: var(--tenx-icon-cell-button-size);
472
378
  padding: 0;
473
379
  background: transparent;
474
- border: 1px solid var(--theme-elevation-150);
475
- border-radius: var(--style-radius-s);
476
- color: var(--theme-elevation-800);
380
+ border: var(--stroke-width-small) solid var(--color-border);
381
+ border-radius: var(--radius-medium);
382
+ color: var(--color-icon);
477
383
  cursor: pointer;
478
384
  transition:
479
385
  border-color 100ms,
480
386
  background-color 100ms;
481
387
  }
482
388
 
483
- /* Hover fades the outline (per the reference) and lifts the glyph with a faint fill. */
484
389
  .tenx-icon-drawer__cell-button:hover {
485
- border-color: var(--theme-elevation-100);
486
- background: var(--theme-elevation-50);
390
+ background: var(--color-bg-hover);
487
391
  }
488
392
 
489
393
  .tenx-icon-drawer__cell-button:focus-visible {
@@ -491,11 +395,11 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
491
395
  outline-offset: var(--accessibility-outline-offset);
492
396
  }
493
397
 
494
- /* Selected uses Payload's success accent (the colour of its focus ring) for a clear active cell. */
495
398
  .tenx-icon-drawer__cell-button--selected,
496
399
  .tenx-icon-drawer__cell-button--selected:hover {
497
- border-color: var(--theme-success-500);
498
- box-shadow: 0 0 0 1px var(--theme-success-500);
400
+ border-color: var(--color-border-selected);
401
+ background: var(--color-bg-selected);
402
+ box-shadow: 0 0 0 var(--stroke-width-small) var(--color-border-selected);
499
403
  }
500
404
 
501
405
  .tenx-icon-drawer__glyph {
@@ -505,30 +409,30 @@ html[data-theme="dark"] .tenx-icon-drawer__banner {
505
409
  width: 24px;
506
410
  height: 24px;
507
411
  /* Skip painting glyphs scrolled just out of view (overscan rows); the fixed size
508
- keeps layout stable while the SVG paint is deferred. Safe here because the glyph
509
- never overflows, unlike the cell which hosts the tooltip. */
412
+ keeps layout stable while the SVG paint is deferred. */
510
413
  content-visibility: auto;
511
414
  }
512
415
 
513
416
  .tenx-icon-drawer__empty {
514
- padding: var(--base);
515
- color: var(--theme-elevation-500);
417
+ padding: var(--spacer-3);
418
+ color: var(--color-text);
516
419
  }
517
420
 
518
421
  .tenx-icon-drawer__loading {
519
422
  display: flex;
520
423
  flex-wrap: wrap;
521
- gap: calc(var(--base) * 0.5);
522
- padding: var(--base) 0;
424
+ gap: var(--spacer-2);
425
+ padding: var(--spacer-3) 0;
523
426
  }
524
427
 
525
428
  .tenx-icon-drawer__footer {
526
429
  position: sticky;
527
430
  bottom: 0;
528
- padding-top: calc(var(--base) * 0.5);
529
- background: var(--theme-bg);
530
- border-top: 1px solid var(--theme-elevation-100);
531
- /* 700, not 600: the small counter needs 4.5:1 on the drawer background */
532
- color: var(--theme-elevation-700);
533
- font-size: 0.75rem;
431
+ padding-block: var(--spacer-2);
432
+ background: var(--color-bg);
433
+ border-top: var(--stroke-width-small) solid var(--color-border);
434
+ /* Primary text, not secondary: the counter needs 4.5:1 on the drawer background */
435
+ color: var(--color-text);
436
+ font-size: var(--text-body-medium-font-size);
437
+ line-height: var(--text-body-medium-line-height);
534
438
  }
@@ -12,17 +12,36 @@ const rootJsonPath = (file) => {
12
12
  const anchor = require.resolve("@tabler/icons/outline/heart.svg");
13
13
  return path.join(path.dirname(anchor), "..", "..", file);
14
14
  };
15
+ /**
16
+ * Tabler's node-data is mostly React-ready, but a few glyphs carry raw SVG attribute names
17
+ * (`stroke-width` on a `<g>`), which React rejects as DOM properties. Camel-case them, leaving
18
+ * `data-` and `aria-` as written.
19
+ */
20
+ const reactAttributeName = (name) => name.startsWith("data-") || name.startsWith("aria-") ? name : name.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
21
+ const reactNode = ([tag, attrs, children]) => {
22
+ const renamed = {};
23
+ for (const [key, value] of Object.entries(attrs)) renamed[reactAttributeName(key)] = value;
24
+ return children ? [
25
+ tag,
26
+ renamed,
27
+ children.map(reactNode)
28
+ ] : [tag, renamed];
29
+ };
15
30
  /** Outline set only in v1; filled variants would double the manifest for little picker value. */
16
31
  const loadTablerSource = () => {
17
32
  const json = require(rootJsonPath("icons.json"));
33
+ const icons = Object.values(json).filter((entry) => "outline" in entry.styles).map((entry) => ({
34
+ name: entry.name,
35
+ tags: entry.tags.filter((tag) => typeof tag === "string"),
36
+ categories: entry.category ? [entry.category.toLowerCase()] : []
37
+ }));
38
+ const raw = require(rootJsonPath("tabler-nodes-outline.json"));
39
+ const nodes = {};
40
+ for (const [name, iconNodes] of Object.entries(raw)) nodes[name] = iconNodes.map(reactNode);
18
41
  return {
19
- icons: Object.values(json).filter((entry) => "outline" in entry.styles).map((entry) => ({
20
- name: entry.name,
21
- tags: entry.tags.filter((tag) => typeof tag === "string"),
22
- categories: entry.category ? [entry.category.toLowerCase()] : []
23
- })),
42
+ icons,
24
43
  importFor: (icon) => ({ module: `@tabler/icons-react/dist/esm/icons/Icon${pascal(icon.name)}.mjs` }),
25
- nodes: require(rootJsonPath("tabler-nodes-outline.json"))
44
+ nodes
26
45
  };
27
46
  };
28
47
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"tabler.js","names":[],"sources":["../../../../../src/fields/icon/codegen/sources/tabler.ts"],"sourcesContent":["import { createRequire } from 'node:module'\nimport path from 'node:path'\nimport type { IconMeta, IconNodeMap } from '../../../../types'\nimport type { LoadedIconSource } from '../types'\n\nconst require = createRequire(import.meta.url)\n\ntype TablerIconEntry = {\n\tname: string\n\tcategory: string\n\ttags: unknown[]\n\tstyles: Record<string, unknown>\n}\n\nconst pascal = (name: string): string =>\n\tname\n\t\t.split('-')\n\t\t.map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join('')\n\n/**\n * `@tabler/icons` maps every subpath to `./icons/*`, so root JSON files are not\n * reachable by bare specifier. Anchor on a file the map does expose and walk\n * back to the package root for `file`.\n */\nconst rootJsonPath = (file: string): string => {\n\tconst anchor = require.resolve('@tabler/icons/outline/heart.svg')\n\treturn path.join(path.dirname(anchor), '..', '..', file)\n}\n\n/** Outline set only in v1; filled variants would double the manifest for little picker value. */\nexport const loadTablerSource = (): LoadedIconSource => {\n\tconst json = require(rootJsonPath('icons.json')) as Record<string, TablerIconEntry>\n\tconst entries = Object.values(json).filter((entry) => 'outline' in entry.styles)\n\tconst icons: IconMeta[] = entries.map((entry) => ({\n\t\tname: entry.name,\n\t\ttags: entry.tags.filter((tag): tag is string => typeof tag === 'string'),\n\t\tcategories: entry.category ? [entry.category.toLowerCase()] : [],\n\t}))\n\t// The outline node-data is keyed by the same bare kebab names as icons.json,\n\t// so no prefix normalization is needed for this package version.\n\tconst nodes = require(rootJsonPath('tabler-nodes-outline.json')) as IconNodeMap\n\treturn {\n\t\ticons,\n\t\timportFor: (icon) => ({\n\t\t\tmodule: `@tabler/icons-react/dist/esm/icons/Icon${pascal(icon.name)}.mjs`,\n\t\t}),\n\t\tnodes,\n\t}\n}\n"],"mappings":";;;AAKA,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAS7C,MAAM,UAAU,SACf,KACE,MAAM,GAAG,EACT,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EAC1D,KAAK,EAAE;;;;;;AAOV,MAAM,gBAAgB,SAAyB;CAC9C,MAAM,SAAS,QAAQ,QAAQ,iCAAiC;CAChE,OAAO,KAAK,KAAK,KAAK,QAAQ,MAAM,GAAG,MAAM,MAAM,IAAI;AACxD;;AAGA,MAAa,yBAA2C;CACvD,MAAM,OAAO,QAAQ,aAAa,YAAY,CAAC;CAU/C,OAAO;EACN,OAVe,OAAO,OAAO,IAAI,EAAE,QAAQ,UAAU,aAAa,MAAM,MACzC,EAAE,KAAK,WAAW;GACjD,MAAM,MAAM;GACZ,MAAM,MAAM,KAAK,QAAQ,QAAuB,OAAO,QAAQ,QAAQ;GACvE,YAAY,MAAM,WAAW,CAAC,MAAM,SAAS,YAAY,CAAC,IAAI,CAAC;EAChE,EAKK;EACJ,YAAY,UAAU,EACrB,QAAQ,0CAA0C,OAAO,KAAK,IAAI,EAAE,MACrE;EACA,OANa,QAAQ,aAAa,2BAA2B,CAMzD;CACL;AACD"}
1
+ {"version":3,"file":"tabler.js","names":[],"sources":["../../../../../src/fields/icon/codegen/sources/tabler.ts"],"sourcesContent":["import { createRequire } from 'node:module'\nimport path from 'node:path'\nimport type { IconMeta, IconNode, IconNodeMap } from '../../../../types'\nimport type { LoadedIconSource } from '../types'\n\nconst require = createRequire(import.meta.url)\n\ntype TablerIconEntry = {\n\tname: string\n\tcategory: string\n\ttags: unknown[]\n\tstyles: Record<string, unknown>\n}\n\nconst pascal = (name: string): string =>\n\tname\n\t\t.split('-')\n\t\t.map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join('')\n\n/**\n * `@tabler/icons` maps every subpath to `./icons/*`, so root JSON files are not\n * reachable by bare specifier. Anchor on a file the map does expose and walk\n * back to the package root for `file`.\n */\nconst rootJsonPath = (file: string): string => {\n\tconst anchor = require.resolve('@tabler/icons/outline/heart.svg')\n\treturn path.join(path.dirname(anchor), '..', '..', file)\n}\n\n/**\n * Tabler's node-data is mostly React-ready, but a few glyphs carry raw SVG attribute names\n * (`stroke-width` on a `<g>`), which React rejects as DOM properties. Camel-case them, leaving\n * `data-` and `aria-` as written.\n */\nconst reactAttributeName = (name: string): string =>\n\tname.startsWith('data-') || name.startsWith('aria-')\n\t\t? name\n\t\t: name.replace(/-([a-z])/g, (_match, letter: string) => letter.toUpperCase())\n\nconst reactNode = ([tag, attrs, children]: IconNode): IconNode => {\n\tconst renamed: Record<string, string> = {}\n\tfor (const [key, value] of Object.entries(attrs)) renamed[reactAttributeName(key)] = value\n\treturn children ? [tag, renamed, children.map(reactNode)] : [tag, renamed]\n}\n\n/** Outline set only in v1; filled variants would double the manifest for little picker value. */\nexport const loadTablerSource = (): LoadedIconSource => {\n\tconst json = require(rootJsonPath('icons.json')) as Record<string, TablerIconEntry>\n\tconst entries = Object.values(json).filter((entry) => 'outline' in entry.styles)\n\tconst icons: IconMeta[] = entries.map((entry) => ({\n\t\tname: entry.name,\n\t\ttags: entry.tags.filter((tag): tag is string => typeof tag === 'string'),\n\t\tcategories: entry.category ? [entry.category.toLowerCase()] : [],\n\t}))\n\t// The outline node-data is keyed by the same bare kebab names as icons.json,\n\t// so no prefix normalization is needed for this package version.\n\tconst raw = require(rootJsonPath('tabler-nodes-outline.json')) as IconNodeMap\n\tconst nodes: IconNodeMap = {}\n\tfor (const [name, iconNodes] of Object.entries(raw)) nodes[name] = iconNodes.map(reactNode)\n\treturn {\n\t\ticons,\n\t\timportFor: (icon) => ({\n\t\t\tmodule: `@tabler/icons-react/dist/esm/icons/Icon${pascal(icon.name)}.mjs`,\n\t\t}),\n\t\tnodes,\n\t}\n}\n"],"mappings":";;;AAKA,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAS7C,MAAM,UAAU,SACf,KACE,MAAM,GAAG,EACT,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EAC1D,KAAK,EAAE;;;;;;AAOV,MAAM,gBAAgB,SAAyB;CAC9C,MAAM,SAAS,QAAQ,QAAQ,iCAAiC;CAChE,OAAO,KAAK,KAAK,KAAK,QAAQ,MAAM,GAAG,MAAM,MAAM,IAAI;AACxD;;;;;;AAOA,MAAM,sBAAsB,SAC3B,KAAK,WAAW,OAAO,KAAK,KAAK,WAAW,OAAO,IAChD,OACA,KAAK,QAAQ,cAAc,QAAQ,WAAmB,OAAO,YAAY,CAAC;AAE9E,MAAM,aAAa,CAAC,KAAK,OAAO,cAAkC;CACjE,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG,QAAQ,mBAAmB,GAAG,KAAK;CACrF,OAAO,WAAW;EAAC;EAAK;EAAS,SAAS,IAAI,SAAS;CAAC,IAAI,CAAC,KAAK,OAAO;AAC1E;;AAGA,MAAa,yBAA2C;CACvD,MAAM,OAAO,QAAQ,aAAa,YAAY,CAAC;CAE/C,MAAM,QADU,OAAO,OAAO,IAAI,EAAE,QAAQ,UAAU,aAAa,MAAM,MACzC,EAAE,KAAK,WAAW;EACjD,MAAM,MAAM;EACZ,MAAM,MAAM,KAAK,QAAQ,QAAuB,OAAO,QAAQ,QAAQ;EACvE,YAAY,MAAM,WAAW,CAAC,MAAM,SAAS,YAAY,CAAC,IAAI,CAAC;CAChE,EAAE;CAGF,MAAM,MAAM,QAAQ,aAAa,2BAA2B,CAAC;CAC7D,MAAM,QAAqB,CAAC;CAC5B,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,GAAG,GAAG,MAAM,QAAQ,UAAU,IAAI,SAAS;CAC1F,OAAO;EACN;EACA,YAAY,UAAU,EACrB,QAAQ,0CAA0C,OAAO,KAAK,IAAI,EAAE,MACrE;EACA;CACD;AACD"}