@dumiflex/wp-kit 0.3.0 → 0.5.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +92 -51
  2. package/LICENSE +674 -674
  3. package/README.md +73 -76
  4. package/package.json +78 -77
  5. package/src/Avatar.vue +83 -83
  6. package/src/Badge.vue +97 -97
  7. package/src/Banner.vue +118 -118
  8. package/src/BookmarkButton.vue +27 -27
  9. package/src/BundleMeta.vue +51 -51
  10. package/src/Button.vue +103 -103
  11. package/src/Card.vue +68 -68
  12. package/src/Checkbox.vue +109 -107
  13. package/src/Chip.vue +163 -97
  14. package/src/ChoiceCards.vue +133 -133
  15. package/src/CloseButton.vue +69 -69
  16. package/src/CodeBlock.vue +146 -119
  17. package/src/ColorField.vue +188 -206
  18. package/src/ColorPicker.vue +201 -201
  19. package/src/Combobox.vue +331 -334
  20. package/src/ConfirmDialog.vue +165 -163
  21. package/src/ConfirmModal.vue +147 -147
  22. package/src/ConstraintMatrixPreview.vue +708 -708
  23. package/src/ContextMenu.vue +386 -379
  24. package/src/CopyButton.vue +156 -156
  25. package/src/DataTable.vue +293 -292
  26. package/src/DatePicker.vue +234 -234
  27. package/src/DescriptionList.vue +73 -73
  28. package/src/DiffView.vue +68 -68
  29. package/src/Disclosure.vue +166 -166
  30. package/src/DragHandle.vue +49 -49
  31. package/src/Drawer.vue +131 -131
  32. package/src/DropZone.vue +196 -196
  33. package/src/DropdownMenu.vue +72 -72
  34. package/src/EmptyState.vue +111 -111
  35. package/src/Field.vue +28 -28
  36. package/src/HsvPicker.vue +208 -208
  37. package/src/Icon.vue +39 -39
  38. package/src/IconPicker.vue +209 -209
  39. package/src/ImageGrid.vue +127 -125
  40. package/src/InlineEdit.vue +183 -183
  41. package/src/Input.vue +99 -99
  42. package/src/Kbd.vue +56 -56
  43. package/src/Lightbox.vue +176 -173
  44. package/src/ListFilter.vue +85 -85
  45. package/src/ListRow.vue +204 -204
  46. package/src/LoadingMark.vue +217 -161
  47. package/src/Logo.vue +60 -60
  48. package/src/Modal.vue +78 -76
  49. package/src/ModalShell.vue +109 -107
  50. package/src/Pagination.vue +106 -106
  51. package/src/Popover.vue +180 -171
  52. package/src/PostCard.vue +210 -211
  53. package/src/ProgressBar.vue +90 -90
  54. package/src/RadioGroup.vue +177 -177
  55. package/src/RangeSlider.vue +183 -183
  56. package/src/RelativeDate.vue +35 -35
  57. package/src/ResizeHandle.vue +143 -143
  58. package/src/SearchInput.vue +192 -199
  59. package/src/Select.vue +644 -641
  60. package/src/Separator.vue +54 -54
  61. package/src/Skeleton.vue +98 -82
  62. package/src/Slider.vue +198 -198
  63. package/src/SortableList.vue +260 -260
  64. package/src/SplitPane.vue +68 -68
  65. package/src/StarButton.vue +40 -40
  66. package/src/Stepper.vue +141 -141
  67. package/src/SupportLinks.vue +93 -93
  68. package/src/TagInput.vue +297 -300
  69. package/src/Textarea.vue +57 -57
  70. package/src/Timeline.vue +92 -92
  71. package/src/ToastCard.vue +119 -119
  72. package/src/ToastHost.vue +40 -40
  73. package/src/Toggle.vue +36 -36
  74. package/src/TokenizedValue.vue +310 -310
  75. package/src/Toolbar.vue +110 -110
  76. package/src/VirtualList.vue +87 -87
  77. package/src/VisuallyHidden.vue +29 -29
  78. package/src/WpButton.vue +75 -75
  79. package/src/WpCheck.vue +104 -102
  80. package/src/WpIconButton.vue +107 -107
  81. package/src/WpImageZoom.vue +544 -544
  82. package/src/WpNumber.vue +178 -183
  83. package/src/WpSegmented.vue +175 -175
  84. package/src/WpSelect.vue +93 -89
  85. package/src/WpSwitch.vue +163 -163
  86. package/src/WpTabs.vue +188 -188
  87. package/src/_modal-motion.css +33 -33
  88. package/src/_skeleton.css +50 -50
  89. package/src/axis-color.ts +42 -42
  90. package/src/button.css +169 -169
  91. package/src/calendar.ts +59 -59
  92. package/src/clipboard.ts +50 -50
  93. package/src/colour-presets.ts +12 -12
  94. package/src/diff.ts +51 -51
  95. package/src/drop-zone.ts +41 -41
  96. package/src/field.css +50 -0
  97. package/src/flip.ts +237 -237
  98. package/src/floating-layer.ts +48 -0
  99. package/src/floating.ts +99 -99
  100. package/src/highlight.ts +199 -0
  101. package/src/hsv.ts +100 -100
  102. package/src/icon-catalog.ts +52 -52
  103. package/src/image-zoom.ts +93 -93
  104. package/src/kind-colour.ts +28 -0
  105. package/src/loading-mark-motion.ts +249 -0
  106. package/src/logo-paths.ts +21 -21
  107. package/src/matrix-axis.ts +91 -91
  108. package/src/pagination.ts +27 -27
  109. package/src/platform-keys.ts +29 -29
  110. package/src/rich-tokenize.ts +357 -357
  111. package/src/select-types.ts +32 -32
  112. package/src/slider-math.ts +45 -45
  113. package/src/sortable.ts +22 -22
  114. package/src/theme/fonts/OFL-Fraunces.txt +93 -93
  115. package/src/theme/fonts/OFL-JetBrainsMono.txt +93 -93
  116. package/src/theme/fonts/OFL-Manrope.txt +93 -93
  117. package/src/theme/looks.css +428 -428
  118. package/src/theme/palettes.css +254 -254
  119. package/src/theme/tokens.css +2896 -2894
  120. package/src/tokens.ts +56 -56
  121. package/src/tooltip.css +43 -43
  122. package/src/tooltip.ts +146 -146
  123. package/src/useDialogFocus.ts +73 -73
  124. package/src/useGrowableField.ts +357 -357
  125. package/src/useModalKeyShield.ts +116 -116
  126. package/src/useToast.ts +48 -48
  127. package/src/wp-logo.svg +14 -14
  128. package/src/ChipToggle.vue +0 -92
  129. package/src/KindChip.vue +0 -53
  130. package/src/RatingBadge.vue +0 -42
@@ -1,206 +1,188 @@
1
- <script setup lang="ts">
2
- /**
3
- * A colour swatch that opens a picker: the colour square, a hex box, and
4
- * (with `alpha`) an opacity number, or (with `allowNone`) a "None" choice.
5
- * The value is a hex string, `#rrggbb` or `#rrggbbaa` once it is
6
- * see-through, or `none`. Other text (a colour name typed in a workflow) is
7
- * kept and shown as it is until a pick replaces it. Sits on the kit Popover,
8
- * so it follows the swatch on scroll and closes on Escape or a click
9
- * outside. Works on the canvas (`size="sm"`) and in the manager.
10
- *
11
- * <ColorField v-model="labelColor" alpha allow-none size="sm" aria-label="Label band" />
12
- */
13
- import { computed, ref, watch } from "vue";
14
- import HsvPicker from "./HsvPicker.vue";
15
- import Popover from "./Popover.vue";
16
- import WpNumber from "./WpNumber.vue";
17
- import WpButton from "./WpButton.vue";
18
- import { rgbToHex } from "./hsv";
19
-
20
- const props = withDefaults(defineProps<{
21
- modelValue: string;
22
- /** Offer an opacity number (writes `#rrggbbaa`). */
23
- alpha?: boolean | undefined;
24
- /** Offer "None" (writes `none`). */
25
- allowNone?: boolean | undefined;
26
- size?: "sm" | "md" | undefined;
27
- ariaLabel?: string | undefined;
28
- disabled?: boolean | undefined;
29
- dataTest?: string | undefined;
30
- }>(), { alpha: false, allowNone: false, size: "sm", ariaLabel: "Colour", disabled: false, dataTest: undefined });
31
-
32
- const emit = defineEmits<{ "update:modelValue": [value: string] }>();
33
-
34
- const HEX = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
35
-
36
- /** `#rgb` / `#rgba` / `#rrggbb` / `#rrggbbaa` → `{ rgb: "#rrggbb", alpha: 0-255 }`. */
37
- function parse(value: string): { rgb: string; alpha: number } | null {
38
- const v = value.trim();
39
- if (!HEX.test(v)) return null;
40
- let h = v.slice(1).toLowerCase();
41
- if (h.length <= 4) h = h.split("").map((c) => c + c).join("");
42
- return { rgb: `#${h.slice(0, 6)}`, alpha: h.length === 8 ? parseInt(h.slice(6), 16) : 255 };
43
- }
44
- function compose(rgb: string, alpha: number): string {
45
- const a = Math.max(0, Math.min(255, Math.round(alpha)));
46
- return a >= 255 ? rgb : `${rgb}${a.toString(16).padStart(2, "0")}`;
47
- }
48
-
49
- const open = ref(false);
50
- const isNone = computed(() => props.modelValue.trim().toLowerCase() === "none");
51
- const parsed = computed(() => parse(props.modelValue));
52
- const BLACK = rgbToHex({ r: 0, g: 0, b: 0 });
53
- const rgb = computed(() => parsed.value?.rgb ?? BLACK);
54
- const alphaValue = computed(() => (parsed.value ? parsed.value.alpha : 255));
55
- const opacity = computed(() => Math.round((alphaValue.value / 255) * 100));
56
-
57
- const shown = computed(() => (isNone.value ? "none" : props.modelValue.trim() || "none"));
58
- const swatch = computed(() => {
59
- if (isNone.value) return "transparent";
60
- const p = parsed.value;
61
- if (!p) return props.modelValue;
62
- return `rgba(${parseInt(p.rgb.slice(1, 3), 16)}, ${parseInt(p.rgb.slice(3, 5), 16)}, ${parseInt(p.rgb.slice(5, 7), 16)}, ${p.alpha / 255})`;
63
- });
64
-
65
- const draft = ref(props.modelValue);
66
- watch(() => props.modelValue, (v) => { draft.value = v; });
67
- watch(open, (v) => { if (v) draft.value = props.modelValue; });
68
-
69
- function onHsv(hex: string): void {
70
- emit("update:modelValue", compose(hex, props.alpha ? alphaValue.value : 255));
71
- }
72
- function onOpacity(pct: number | null): void {
73
- if (pct === null) return;
74
- emit("update:modelValue", compose(rgb.value, (pct / 100) * 255));
75
- }
76
- function onDraft(ev: Event): void {
77
- const v = (ev.target as HTMLInputElement).value.trim();
78
- draft.value = v;
79
- const p = parse(v);
80
- if (p) emit("update:modelValue", compose(p.rgb, props.alpha ? p.alpha : 255));
81
- }
82
- function pickNone(): void {
83
- emit("update:modelValue", "none");
84
- open.value = false;
85
- }
86
- </script>
87
-
88
- <template>
89
- <Popover v-model:open="open" :label="ariaLabel">
90
- <template #trigger="{ props: triggerProps }">
91
- <button
92
- v-bind="triggerProps"
93
- type="button"
94
- class="wp-color-field"
95
- :class="[`wp-color-field--${size}`, { 'is-none': isNone }]"
96
- :disabled="disabled"
97
- :aria-label="`${ariaLabel}: ${shown}`"
98
- :data-test="dataTest"
99
- >
100
- <span class="wp-color-field__chip" aria-hidden="true">
101
- <span class="wp-color-field__fill" :style="{ background: swatch }" />
102
- </span>
103
- <span class="wp-color-field__value" aria-hidden="true">{{ shown }}</span>
104
- </button>
105
- </template>
106
- <div class="wp-color-field__panel" @keydown.stop>
107
- <HsvPicker :model-value="rgb" :aria-label="ariaLabel" @update:model-value="onHsv" />
108
- <div class="wp-color-field__row">
109
- <input
110
- class="wp-color-field__hex"
111
- :value="draft"
112
- :aria-label="`${ariaLabel} hex`"
113
- spellcheck="false"
114
- :data-test="dataTest ? `${dataTest}-hex` : undefined"
115
- @change="onDraft"
116
- @keydown.enter="onDraft"
117
- >
118
- <WpNumber
119
- v-if="alpha"
120
- class="wp-color-field__alpha"
121
- :model-value="isNone ? 0 : opacity"
122
- :min="0"
123
- :max="100"
124
- suffix="%"
125
- size="sm"
126
- :aria-label="`${ariaLabel} opacity`"
127
- :data-test="dataTest ? `${dataTest}-alpha` : undefined"
128
- @update:model-value="onOpacity"
129
- />
130
- </div>
131
- <WpButton
132
- v-if="allowNone"
133
- size="sm"
134
- variant="ghost"
135
- icon="pi-ban"
136
- :pressed="isNone"
137
- :data-test="dataTest ? `${dataTest}-none` : undefined"
138
- @click="pickNone"
139
- >None</WpButton>
140
- </div>
141
- </Popover>
142
- </template>
143
-
144
- <style scoped>
145
- .wp-color-field {
146
- display: inline-flex;
147
- align-items: center;
148
- gap: 6px;
149
- min-width: 0;
150
- height: var(--wp-control-h-sm, 24px);
151
- padding: 0 8px 0 3px;
152
- background: var(--wp-bg-2);
153
- border: 1px solid var(--wp-border);
154
- border-radius: min(4px, var(--wp-radius-cap, 999px));
155
- color: var(--wp-text);
156
- font: 11px var(--wp-font-mono, monospace);
157
- cursor: pointer;
158
- }
159
- .wp-color-field--md { height: var(--wp-control-h-md, 32px); font-size: 12px; }
160
- .wp-color-field:hover:not(:disabled) { border-color: var(--wp-border-strong); }
161
- .wp-color-field:focus-visible { outline: 2px solid var(--wp-focus-ring); outline-offset: 1px; }
162
- .wp-color-field:disabled { opacity: 0.5; cursor: default; }
163
- .wp-color-field__chip {
164
- position: relative;
165
- flex: none;
166
- width: 16px;
167
- height: 16px;
168
- overflow: hidden;
169
- border: 1px solid var(--wp-border-strong);
170
- border-radius: min(3px, var(--wp-radius-cap, 999px));
171
- /* Checks show through a see-through colour. */
172
- background: repeating-conic-gradient(var(--wp-bg-4) 0 25%, var(--wp-bg-1) 0 50%) 0 0 / 8px 8px;
173
- }
174
- .wp-color-field__fill { position: absolute; inset: 0; }
175
- .wp-color-field.is-none .wp-color-field__chip::after {
176
- content: "";
177
- position: absolute;
178
- inset: 0;
179
- background: linear-gradient(to top right, transparent calc(50% - 1px), var(--wp-danger) 50%, transparent calc(50% + 1px));
180
- }
181
- .wp-color-field__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
182
- .wp-color-field.is-none .wp-color-field__value { color: var(--wp-text-dim); font-family: var(--wp-font-sans, sans-serif); }
183
-
184
- .wp-color-field__panel {
185
- display: flex;
186
- flex-direction: column;
187
- gap: 8px;
188
- width: 200px;
189
- padding: 0;
190
- }
191
- .wp-color-field__row { display: flex; gap: 6px; align-items: center; }
192
- .wp-color-field__hex {
193
- flex: 1;
194
- min-width: 0;
195
- height: var(--wp-control-h-sm, 24px);
196
- padding: 0 6px;
197
- background: var(--wp-bg-1);
198
- color: var(--wp-text);
199
- border: 1px solid var(--wp-border);
200
- border-radius: min(4px, var(--wp-radius-cap, 999px));
201
- font: 11px var(--wp-font-mono, monospace);
202
- outline: none;
203
- }
204
- .wp-color-field__hex:focus { border-color: var(--wp-border-focus); }
205
- .wp-color-field__alpha { width: 72px; flex: none; }
206
- </style>
1
+ <script setup lang="ts">
2
+ /**
3
+ * A colour swatch that opens a picker: the colour square, a hex box, and
4
+ * (with `alpha`) an opacity number, or (with `allowNone`) a "None" choice.
5
+ * The value is a hex string, `#rrggbb` or `#rrggbbaa` once it is
6
+ * see-through, or `none`. Other text (a colour name typed in a workflow) is
7
+ * kept and shown as it is until a pick replaces it. Sits on the kit Popover,
8
+ * so it follows the swatch on scroll and closes on Escape or a click
9
+ * outside. Works on the canvas (`size="sm"`) and in the manager.
10
+ *
11
+ * <ColorField v-model="labelColor" alpha allow-none size="sm" aria-label="Label band" />
12
+ */
13
+ import { computed, ref, watch } from "vue";
14
+ import HsvPicker from "./HsvPicker.vue";
15
+ import Popover from "./Popover.vue";
16
+ import WpNumber from "./WpNumber.vue";
17
+ import WpButton from "./WpButton.vue";
18
+ import { rgbToHex } from "./hsv";
19
+
20
+ const props = withDefaults(defineProps<{
21
+ modelValue: string;
22
+ /** Offer an opacity number (writes `#rrggbbaa`). */
23
+ alpha?: boolean | undefined;
24
+ /** Offer "None" (writes `none`). */
25
+ allowNone?: boolean | undefined;
26
+ size?: "sm" | "md" | undefined;
27
+ ariaLabel?: string | undefined;
28
+ disabled?: boolean | undefined;
29
+ dataTest?: string | undefined;
30
+ }>(), { alpha: false, allowNone: false, size: "sm", ariaLabel: "Colour", disabled: false, dataTest: undefined });
31
+
32
+ const emit = defineEmits<{ "update:modelValue": [value: string] }>();
33
+
34
+ const HEX = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
35
+
36
+ /** `#rgb` / `#rgba` / `#rrggbb` / `#rrggbbaa` → `{ rgb: "#rrggbb", alpha: 0-255 }`. */
37
+ function parse(value: string): { rgb: string; alpha: number } | null {
38
+ const v = value.trim();
39
+ if (!HEX.test(v)) return null;
40
+ let h = v.slice(1).toLowerCase();
41
+ if (h.length <= 4) h = h.split("").map((c) => c + c).join("");
42
+ return { rgb: `#${h.slice(0, 6)}`, alpha: h.length === 8 ? parseInt(h.slice(6), 16) : 255 };
43
+ }
44
+ function compose(rgb: string, alpha: number): string {
45
+ const a = Math.max(0, Math.min(255, Math.round(alpha)));
46
+ return a >= 255 ? rgb : `${rgb}${a.toString(16).padStart(2, "0")}`;
47
+ }
48
+
49
+ const open = ref(false);
50
+ const isNone = computed(() => props.modelValue.trim().toLowerCase() === "none");
51
+ const parsed = computed(() => parse(props.modelValue));
52
+ const BLACK = rgbToHex({ r: 0, g: 0, b: 0 });
53
+ const rgb = computed(() => parsed.value?.rgb ?? BLACK);
54
+ const alphaValue = computed(() => (parsed.value ? parsed.value.alpha : 255));
55
+ const opacity = computed(() => Math.round((alphaValue.value / 255) * 100));
56
+
57
+ const shown = computed(() => (isNone.value ? "none" : props.modelValue.trim() || "none"));
58
+ const swatch = computed(() => {
59
+ if (isNone.value) return "transparent";
60
+ const p = parsed.value;
61
+ if (!p) return props.modelValue;
62
+ return `rgba(${parseInt(p.rgb.slice(1, 3), 16)}, ${parseInt(p.rgb.slice(3, 5), 16)}, ${parseInt(p.rgb.slice(5, 7), 16)}, ${p.alpha / 255})`;
63
+ });
64
+
65
+ const draft = ref(props.modelValue);
66
+ watch(() => props.modelValue, (v) => { draft.value = v; });
67
+ watch(open, (v) => { if (v) draft.value = props.modelValue; });
68
+
69
+ function onHsv(hex: string): void {
70
+ emit("update:modelValue", compose(hex, props.alpha ? alphaValue.value : 255));
71
+ }
72
+ function onOpacity(pct: number | null): void {
73
+ if (pct === null) return;
74
+ emit("update:modelValue", compose(rgb.value, (pct / 100) * 255));
75
+ }
76
+ function onDraft(ev: Event): void {
77
+ const v = (ev.target as HTMLInputElement).value.trim();
78
+ draft.value = v;
79
+ const p = parse(v);
80
+ if (p) emit("update:modelValue", compose(p.rgb, props.alpha ? p.alpha : 255));
81
+ }
82
+ function pickNone(): void {
83
+ emit("update:modelValue", "none");
84
+ open.value = false;
85
+ }
86
+ </script>
87
+
88
+ <template>
89
+ <Popover v-model:open="open" :label="ariaLabel">
90
+ <template #trigger="{ props: triggerProps }">
91
+ <button
92
+ v-bind="triggerProps"
93
+ type="button"
94
+ class="wp-color-field wp-field-box"
95
+ :class="[`wp-color-field--${size}`, `wp-field-box--${size}`, { 'is-none': isNone }]"
96
+ :disabled="disabled"
97
+ :aria-label="`${ariaLabel}: ${shown}`"
98
+ :data-test="dataTest"
99
+ >
100
+ <span class="wp-color-field__chip" aria-hidden="true">
101
+ <span class="wp-color-field__fill" :style="{ background: swatch }" />
102
+ </span>
103
+ <span class="wp-color-field__value" aria-hidden="true">{{ shown }}</span>
104
+ </button>
105
+ </template>
106
+ <div class="wp-color-field__panel" @keydown.stop>
107
+ <HsvPicker :model-value="rgb" :aria-label="ariaLabel" @update:model-value="onHsv" />
108
+ <div class="wp-color-field__row">
109
+ <input
110
+ class="wp-color-field__hex wp-field-box wp-field-box--sm"
111
+ :value="draft"
112
+ :aria-label="`${ariaLabel} hex`"
113
+ spellcheck="false"
114
+ :data-test="dataTest ? `${dataTest}-hex` : undefined"
115
+ @change="onDraft"
116
+ @keydown.enter="onDraft"
117
+ >
118
+ <WpNumber
119
+ v-if="alpha"
120
+ class="wp-color-field__alpha"
121
+ :model-value="isNone ? 0 : opacity"
122
+ :min="0"
123
+ :max="100"
124
+ suffix="%"
125
+ size="sm"
126
+ :aria-label="`${ariaLabel} opacity`"
127
+ :data-test="dataTest ? `${dataTest}-alpha` : undefined"
128
+ @update:model-value="onOpacity"
129
+ />
130
+ </div>
131
+ <WpButton
132
+ v-if="allowNone"
133
+ size="sm"
134
+ variant="ghost"
135
+ icon="pi-ban"
136
+ :pressed="isNone"
137
+ :data-test="dataTest ? `${dataTest}-none` : undefined"
138
+ @click="pickNone"
139
+ >None</WpButton>
140
+ </div>
141
+ </Popover>
142
+ </template>
143
+
144
+ <style scoped src="./field.css"></style>
145
+
146
+ <style scoped>
147
+ .wp-color-field {
148
+ display: inline-flex;
149
+ align-items: center;
150
+ gap: 6px;
151
+ min-width: 0;
152
+ height: var(--wp-field-h);
153
+ padding: 0 8px 0 3px;
154
+ font-family: var(--wp-font-mono, monospace);
155
+ cursor: pointer;
156
+ }
157
+ .wp-color-field__chip {
158
+ position: relative;
159
+ flex: none;
160
+ width: 16px;
161
+ height: 16px;
162
+ overflow: hidden;
163
+ border: 1px solid var(--wp-border-strong);
164
+ border-radius: min(3px, var(--wp-radius-cap, 999px));
165
+ /* Checks show through a see-through colour. */
166
+ background: repeating-conic-gradient(var(--wp-bg-4) 0 25%, var(--wp-bg-1) 0 50%) 0 0 / 8px 8px;
167
+ }
168
+ .wp-color-field__fill { position: absolute; inset: 0; }
169
+ .wp-color-field.is-none .wp-color-field__chip::after {
170
+ content: "";
171
+ position: absolute;
172
+ inset: 0;
173
+ background: linear-gradient(to top right, transparent calc(50% - 1px), var(--wp-danger) 50%, transparent calc(50% + 1px));
174
+ }
175
+ .wp-color-field__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
176
+ .wp-color-field.is-none .wp-color-field__value { color: var(--wp-text-dim); font-family: var(--wp-font-sans, sans-serif); }
177
+
178
+ .wp-color-field__panel {
179
+ display: flex;
180
+ flex-direction: column;
181
+ gap: 8px;
182
+ width: 200px;
183
+ padding: 0;
184
+ }
185
+ .wp-color-field__row { display: flex; gap: 6px; align-items: center; }
186
+ .wp-color-field__hex { flex: 1; min-width: 0; height: var(--wp-field-h); padding: 0 6px; font-family: var(--wp-font-mono, monospace); }
187
+ .wp-color-field__alpha { width: 72px; flex: none; }
188
+ </style>