@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.
- package/CHANGELOG.md +92 -51
- package/LICENSE +674 -674
- package/README.md +73 -76
- package/package.json +78 -77
- package/src/Avatar.vue +83 -83
- package/src/Badge.vue +97 -97
- package/src/Banner.vue +118 -118
- package/src/BookmarkButton.vue +27 -27
- package/src/BundleMeta.vue +51 -51
- package/src/Button.vue +103 -103
- package/src/Card.vue +68 -68
- package/src/Checkbox.vue +109 -107
- package/src/Chip.vue +163 -97
- package/src/ChoiceCards.vue +133 -133
- package/src/CloseButton.vue +69 -69
- package/src/CodeBlock.vue +146 -119
- package/src/ColorField.vue +188 -206
- package/src/ColorPicker.vue +201 -201
- package/src/Combobox.vue +331 -334
- package/src/ConfirmDialog.vue +165 -163
- package/src/ConfirmModal.vue +147 -147
- package/src/ConstraintMatrixPreview.vue +708 -708
- package/src/ContextMenu.vue +386 -379
- package/src/CopyButton.vue +156 -156
- package/src/DataTable.vue +293 -292
- package/src/DatePicker.vue +234 -234
- package/src/DescriptionList.vue +73 -73
- package/src/DiffView.vue +68 -68
- package/src/Disclosure.vue +166 -166
- package/src/DragHandle.vue +49 -49
- package/src/Drawer.vue +131 -131
- package/src/DropZone.vue +196 -196
- package/src/DropdownMenu.vue +72 -72
- package/src/EmptyState.vue +111 -111
- package/src/Field.vue +28 -28
- package/src/HsvPicker.vue +208 -208
- package/src/Icon.vue +39 -39
- package/src/IconPicker.vue +209 -209
- package/src/ImageGrid.vue +127 -125
- package/src/InlineEdit.vue +183 -183
- package/src/Input.vue +99 -99
- package/src/Kbd.vue +56 -56
- package/src/Lightbox.vue +176 -173
- package/src/ListFilter.vue +85 -85
- package/src/ListRow.vue +204 -204
- package/src/LoadingMark.vue +217 -161
- package/src/Logo.vue +60 -60
- package/src/Modal.vue +78 -76
- package/src/ModalShell.vue +109 -107
- package/src/Pagination.vue +106 -106
- package/src/Popover.vue +180 -171
- package/src/PostCard.vue +210 -211
- package/src/ProgressBar.vue +90 -90
- package/src/RadioGroup.vue +177 -177
- package/src/RangeSlider.vue +183 -183
- package/src/RelativeDate.vue +35 -35
- package/src/ResizeHandle.vue +143 -143
- package/src/SearchInput.vue +192 -199
- package/src/Select.vue +644 -641
- package/src/Separator.vue +54 -54
- package/src/Skeleton.vue +98 -82
- package/src/Slider.vue +198 -198
- package/src/SortableList.vue +260 -260
- package/src/SplitPane.vue +68 -68
- package/src/StarButton.vue +40 -40
- package/src/Stepper.vue +141 -141
- package/src/SupportLinks.vue +93 -93
- package/src/TagInput.vue +297 -300
- package/src/Textarea.vue +57 -57
- package/src/Timeline.vue +92 -92
- package/src/ToastCard.vue +119 -119
- package/src/ToastHost.vue +40 -40
- package/src/Toggle.vue +36 -36
- package/src/TokenizedValue.vue +310 -310
- package/src/Toolbar.vue +110 -110
- package/src/VirtualList.vue +87 -87
- package/src/VisuallyHidden.vue +29 -29
- package/src/WpButton.vue +75 -75
- package/src/WpCheck.vue +104 -102
- package/src/WpIconButton.vue +107 -107
- package/src/WpImageZoom.vue +544 -544
- package/src/WpNumber.vue +178 -183
- package/src/WpSegmented.vue +175 -175
- package/src/WpSelect.vue +93 -89
- package/src/WpSwitch.vue +163 -163
- package/src/WpTabs.vue +188 -188
- package/src/_modal-motion.css +33 -33
- package/src/_skeleton.css +50 -50
- package/src/axis-color.ts +42 -42
- package/src/button.css +169 -169
- package/src/calendar.ts +59 -59
- package/src/clipboard.ts +50 -50
- package/src/colour-presets.ts +12 -12
- package/src/diff.ts +51 -51
- package/src/drop-zone.ts +41 -41
- package/src/field.css +50 -0
- package/src/flip.ts +237 -237
- package/src/floating-layer.ts +48 -0
- package/src/floating.ts +99 -99
- package/src/highlight.ts +199 -0
- package/src/hsv.ts +100 -100
- package/src/icon-catalog.ts +52 -52
- package/src/image-zoom.ts +93 -93
- package/src/kind-colour.ts +28 -0
- package/src/loading-mark-motion.ts +249 -0
- package/src/logo-paths.ts +21 -21
- package/src/matrix-axis.ts +91 -91
- package/src/pagination.ts +27 -27
- package/src/platform-keys.ts +29 -29
- package/src/rich-tokenize.ts +357 -357
- package/src/select-types.ts +32 -32
- package/src/slider-math.ts +45 -45
- package/src/sortable.ts +22 -22
- package/src/theme/fonts/OFL-Fraunces.txt +93 -93
- package/src/theme/fonts/OFL-JetBrainsMono.txt +93 -93
- package/src/theme/fonts/OFL-Manrope.txt +93 -93
- package/src/theme/looks.css +428 -428
- package/src/theme/palettes.css +254 -254
- package/src/theme/tokens.css +2896 -2894
- package/src/tokens.ts +56 -56
- package/src/tooltip.css +43 -43
- package/src/tooltip.ts +146 -146
- package/src/useDialogFocus.ts +73 -73
- package/src/useGrowableField.ts +357 -357
- package/src/useModalKeyShield.ts +116 -116
- package/src/useToast.ts +48 -48
- package/src/wp-logo.svg +14 -14
- package/src/ChipToggle.vue +0 -92
- package/src/KindChip.vue +0 -53
- package/src/RatingBadge.vue +0 -42
package/src/ColorPicker.vue
CHANGED
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
-
import Popover from "./Popover.vue";
|
|
4
|
-
import Input from "./Input.vue";
|
|
5
|
-
import HsvPicker from "./HsvPicker.vue";
|
|
6
|
-
import { COLOUR_PRESETS } from "./colour-presets";
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
modelValue: string;
|
|
10
|
-
presets?: string[] | undefined;
|
|
11
|
-
ariaLabel?: string | undefined;
|
|
12
|
-
/** Swatch and chevron only, for a tight spot such as a name row. */
|
|
13
|
-
compact?: boolean | undefined;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
-
presets: () => [...COLOUR_PRESETS],
|
|
18
|
-
ariaLabel: undefined,
|
|
19
|
-
compact: false,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
"update:modelValue": [value: string];
|
|
24
|
-
}>();
|
|
25
|
-
|
|
26
|
-
const HEX_RE = /^#[0-9a-fA-F]{6}$/;
|
|
27
|
-
|
|
28
|
-
const open = ref(false);
|
|
29
|
-
const hexDraft = ref(props.modelValue);
|
|
30
|
-
|
|
31
|
-
watch(() => props.modelValue, (v) => {
|
|
32
|
-
hexDraft.value = v;
|
|
33
|
-
});
|
|
34
|
-
// A fresh draft each time it opens, so a half-typed hex doesn't linger.
|
|
35
|
-
watch(open, (v) => { if (v) hexDraft.value = props.modelValue; });
|
|
36
|
-
|
|
37
|
-
const swatchColor = computed(() => (HEX_RE.test(props.modelValue) ? props.modelValue : "transparent"));
|
|
38
|
-
const shownHex = computed(() => (HEX_RE.test(props.modelValue) ? props.modelValue.toLowerCase() : "No colour"));
|
|
39
|
-
|
|
40
|
-
const swatchAriaLabel = computed(
|
|
41
|
-
() => props.ariaLabel ?? `Pick color, current ${props.modelValue}`,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
function close() {
|
|
45
|
-
open.value = false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function selectPreset(preset: string) {
|
|
49
|
-
emit("update:modelValue", preset);
|
|
50
|
-
close();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function onHexInput(value: string) {
|
|
54
|
-
hexDraft.value = value;
|
|
55
|
-
if (HEX_RE.test(value)) {
|
|
56
|
-
emit("update:modelValue", value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function isActivePreset(preset: string): boolean {
|
|
61
|
-
return preset.toLowerCase() === props.modelValue.toLowerCase();
|
|
62
|
-
}
|
|
63
|
-
</script>
|
|
64
|
-
|
|
65
|
-
<template>
|
|
66
|
-
<!-- A swatch button that says what it holds (colour, hex, chevron), on the
|
|
67
|
-
kit Popover so the panel follows it on scroll and closes on Escape or
|
|
68
|
-
a click outside. -->
|
|
69
|
-
<Popover v-model:open="open" :label="swatchAriaLabel">
|
|
70
|
-
<template #trigger="{ props: triggerProps }">
|
|
71
|
-
<button
|
|
72
|
-
v-bind="triggerProps"
|
|
73
|
-
type="button"
|
|
74
|
-
class="wp-color-picker__trigger"
|
|
75
|
-
:class="{ 'wp-color-picker__trigger--compact': compact }"
|
|
76
|
-
:aria-label="swatchAriaLabel"
|
|
77
|
-
data-test="color-trigger"
|
|
78
|
-
>
|
|
79
|
-
<span
|
|
80
|
-
class="wp-color-picker__swatch"
|
|
81
|
-
:style="{ background: swatchColor }"
|
|
82
|
-
data-test="color-swatch"
|
|
83
|
-
aria-hidden="true"
|
|
84
|
-
/>
|
|
85
|
-
<span v-if="!compact" class="wp-color-picker__value" aria-hidden="true">{{ shownHex }}</span>
|
|
86
|
-
<i class="pi pi-chevron-down wp-color-picker__caret" aria-hidden="true" />
|
|
87
|
-
</button>
|
|
88
|
-
</template>
|
|
89
|
-
<div class="wp-color-picker__popover">
|
|
90
|
-
<div class="wp-color-picker__row">
|
|
91
|
-
<Input
|
|
92
|
-
:model-value="hexDraft"
|
|
93
|
-
aria-label="Hex color value"
|
|
94
|
-
class="wp-color-picker__hex"
|
|
95
|
-
data-test="color-hex-input"
|
|
96
|
-
@update:model-value="(v) => onHexInput(String(v ?? ''))"
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
99
|
-
<HsvPicker
|
|
100
|
-
:model-value="props.modelValue"
|
|
101
|
-
:aria-label="swatchAriaLabel"
|
|
102
|
-
@update:model-value="(v) => emit('update:modelValue', v)"
|
|
103
|
-
/>
|
|
104
|
-
<div class="wp-color-picker__palette" role="listbox" aria-label="Preset colors">
|
|
105
|
-
<button
|
|
106
|
-
v-for="preset in props.presets"
|
|
107
|
-
:key="preset"
|
|
108
|
-
type="button"
|
|
109
|
-
class="wp-color-picker__chip"
|
|
110
|
-
:style="{ background: preset }"
|
|
111
|
-
:title="preset"
|
|
112
|
-
:data-active="isActivePreset(preset)"
|
|
113
|
-
:aria-label="`Use preset ${preset}`"
|
|
114
|
-
data-test="color-preset"
|
|
115
|
-
@click="selectPreset(preset)"
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</Popover>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<style scoped>
|
|
123
|
-
.wp-color-picker__trigger {
|
|
124
|
-
display: inline-flex;
|
|
125
|
-
align-items: center;
|
|
126
|
-
gap: var(--wp-space-3);
|
|
127
|
-
height: var(--wp-control-h-md, 32px);
|
|
128
|
-
min-width: 128px;
|
|
129
|
-
padding: 0 var(--wp-space-4) 0 var(--wp-space-2);
|
|
130
|
-
background: var(--wp-bg-2);
|
|
131
|
-
border: 1px solid var(--wp-border);
|
|
132
|
-
border-radius: var(--wp-radius-sm);
|
|
133
|
-
color: var(--wp-text);
|
|
134
|
-
font: inherit;
|
|
135
|
-
cursor: pointer;
|
|
136
|
-
transition: border-color 0.12s, box-shadow 0.12s;
|
|
137
|
-
}
|
|
138
|
-
.wp-color-picker__trigger--compact { min-width: 0; padding: 0 var(--wp-space-3) 0 var(--wp-space-2); gap: var(--wp-space-2); }
|
|
139
|
-
.wp-color-picker__trigger:hover { border-color: var(--wp-border-strong); }
|
|
140
|
-
.wp-color-picker__trigger:focus-visible { outline: none; border-color: var(--wp-accent-500); box-shadow: var(--wp-focus-ring); }
|
|
141
|
-
.wp-color-picker__swatch {
|
|
142
|
-
width: 20px;
|
|
143
|
-
height: 20px;
|
|
144
|
-
flex-shrink: 0;
|
|
145
|
-
border-radius: min(4px, var(--wp-radius-cap, 999px));
|
|
146
|
-
/* An inner ring keeps a dark swatch visible on a dark field. */
|
|
147
|
-
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--wp-text) 22%, transparent);
|
|
148
|
-
}
|
|
149
|
-
.wp-color-picker__value {
|
|
150
|
-
flex: 1;
|
|
151
|
-
text-align: left;
|
|
152
|
-
font-family: var(--wp-font-mono);
|
|
153
|
-
font-size: 12px;
|
|
154
|
-
color: var(--wp-text-muted);
|
|
155
|
-
}
|
|
156
|
-
.wp-color-picker__caret { font-size: 9px; color: var(--wp-text-dim); }
|
|
157
|
-
|
|
158
|
-
.wp-color-picker__popover {
|
|
159
|
-
width: 220px;
|
|
160
|
-
padding: var(--wp-space-2);
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
gap: var(--wp-space-5);
|
|
164
|
-
}
|
|
165
|
-
.wp-color-picker__row {
|
|
166
|
-
display: flex;
|
|
167
|
-
align-items: center;
|
|
168
|
-
gap: var(--wp-space-4);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.wp-color-picker__hex {
|
|
172
|
-
flex: 1;
|
|
173
|
-
min-width: 0;
|
|
174
|
-
font-family: var(--wp-font-mono);
|
|
175
|
-
font-size: var(--wp-text-sm);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.wp-color-picker__palette {
|
|
179
|
-
display: grid;
|
|
180
|
-
grid-template-columns: repeat(4, 1fr);
|
|
181
|
-
gap: var(--wp-space-3);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.wp-color-picker__chip {
|
|
185
|
-
/* Span the grid cell instead of locking at 32px so the swatches reach
|
|
186
|
-
* both edges of the popover. aspect-ratio keeps them square as the
|
|
187
|
-
* cell width changes with popover size. */
|
|
188
|
-
width: 100%;
|
|
189
|
-
aspect-ratio: 1 / 1;
|
|
190
|
-
min-width: 0;
|
|
191
|
-
border-radius: var(--wp-radius-sm);
|
|
192
|
-
border: 1px solid var(--wp-border);
|
|
193
|
-
cursor: pointer;
|
|
194
|
-
padding: 0;
|
|
195
|
-
transition: transform 0.08s, box-shadow 0.12s;
|
|
196
|
-
}
|
|
197
|
-
.wp-color-picker__chip:hover { transform: scale(1.08); }
|
|
198
|
-
.wp-color-picker__chip[data-active="true"] {
|
|
199
|
-
box-shadow: 0 0 0 2px var(--wp-bg-2), 0 0 0 4px var(--wp-accent-500);
|
|
200
|
-
}
|
|
201
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import Popover from "./Popover.vue";
|
|
4
|
+
import Input from "./Input.vue";
|
|
5
|
+
import HsvPicker from "./HsvPicker.vue";
|
|
6
|
+
import { COLOUR_PRESETS } from "./colour-presets";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
modelValue: string;
|
|
10
|
+
presets?: string[] | undefined;
|
|
11
|
+
ariaLabel?: string | undefined;
|
|
12
|
+
/** Swatch and chevron only, for a tight spot such as a name row. */
|
|
13
|
+
compact?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
+
presets: () => [...COLOUR_PRESETS],
|
|
18
|
+
ariaLabel: undefined,
|
|
19
|
+
compact: false,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const emit = defineEmits<{
|
|
23
|
+
"update:modelValue": [value: string];
|
|
24
|
+
}>();
|
|
25
|
+
|
|
26
|
+
const HEX_RE = /^#[0-9a-fA-F]{6}$/;
|
|
27
|
+
|
|
28
|
+
const open = ref(false);
|
|
29
|
+
const hexDraft = ref(props.modelValue);
|
|
30
|
+
|
|
31
|
+
watch(() => props.modelValue, (v) => {
|
|
32
|
+
hexDraft.value = v;
|
|
33
|
+
});
|
|
34
|
+
// A fresh draft each time it opens, so a half-typed hex doesn't linger.
|
|
35
|
+
watch(open, (v) => { if (v) hexDraft.value = props.modelValue; });
|
|
36
|
+
|
|
37
|
+
const swatchColor = computed(() => (HEX_RE.test(props.modelValue) ? props.modelValue : "transparent"));
|
|
38
|
+
const shownHex = computed(() => (HEX_RE.test(props.modelValue) ? props.modelValue.toLowerCase() : "No colour"));
|
|
39
|
+
|
|
40
|
+
const swatchAriaLabel = computed(
|
|
41
|
+
() => props.ariaLabel ?? `Pick color, current ${props.modelValue}`,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
function close() {
|
|
45
|
+
open.value = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function selectPreset(preset: string) {
|
|
49
|
+
emit("update:modelValue", preset);
|
|
50
|
+
close();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function onHexInput(value: string) {
|
|
54
|
+
hexDraft.value = value;
|
|
55
|
+
if (HEX_RE.test(value)) {
|
|
56
|
+
emit("update:modelValue", value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isActivePreset(preset: string): boolean {
|
|
61
|
+
return preset.toLowerCase() === props.modelValue.toLowerCase();
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<!-- A swatch button that says what it holds (colour, hex, chevron), on the
|
|
67
|
+
kit Popover so the panel follows it on scroll and closes on Escape or
|
|
68
|
+
a click outside. -->
|
|
69
|
+
<Popover v-model:open="open" :label="swatchAriaLabel">
|
|
70
|
+
<template #trigger="{ props: triggerProps }">
|
|
71
|
+
<button
|
|
72
|
+
v-bind="triggerProps"
|
|
73
|
+
type="button"
|
|
74
|
+
class="wp-color-picker__trigger"
|
|
75
|
+
:class="{ 'wp-color-picker__trigger--compact': compact }"
|
|
76
|
+
:aria-label="swatchAriaLabel"
|
|
77
|
+
data-test="color-trigger"
|
|
78
|
+
>
|
|
79
|
+
<span
|
|
80
|
+
class="wp-color-picker__swatch"
|
|
81
|
+
:style="{ background: swatchColor }"
|
|
82
|
+
data-test="color-swatch"
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
/>
|
|
85
|
+
<span v-if="!compact" class="wp-color-picker__value" aria-hidden="true">{{ shownHex }}</span>
|
|
86
|
+
<i class="pi pi-chevron-down wp-color-picker__caret" aria-hidden="true" />
|
|
87
|
+
</button>
|
|
88
|
+
</template>
|
|
89
|
+
<div class="wp-color-picker__popover">
|
|
90
|
+
<div class="wp-color-picker__row">
|
|
91
|
+
<Input
|
|
92
|
+
:model-value="hexDraft"
|
|
93
|
+
aria-label="Hex color value"
|
|
94
|
+
class="wp-color-picker__hex"
|
|
95
|
+
data-test="color-hex-input"
|
|
96
|
+
@update:model-value="(v) => onHexInput(String(v ?? ''))"
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
<HsvPicker
|
|
100
|
+
:model-value="props.modelValue"
|
|
101
|
+
:aria-label="swatchAriaLabel"
|
|
102
|
+
@update:model-value="(v) => emit('update:modelValue', v)"
|
|
103
|
+
/>
|
|
104
|
+
<div class="wp-color-picker__palette" role="listbox" aria-label="Preset colors">
|
|
105
|
+
<button
|
|
106
|
+
v-for="preset in props.presets"
|
|
107
|
+
:key="preset"
|
|
108
|
+
type="button"
|
|
109
|
+
class="wp-color-picker__chip"
|
|
110
|
+
:style="{ background: preset }"
|
|
111
|
+
:title="preset"
|
|
112
|
+
:data-active="isActivePreset(preset)"
|
|
113
|
+
:aria-label="`Use preset ${preset}`"
|
|
114
|
+
data-test="color-preset"
|
|
115
|
+
@click="selectPreset(preset)"
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</Popover>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<style scoped>
|
|
123
|
+
.wp-color-picker__trigger {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--wp-space-3);
|
|
127
|
+
height: var(--wp-control-h-md, 32px);
|
|
128
|
+
min-width: 128px;
|
|
129
|
+
padding: 0 var(--wp-space-4) 0 var(--wp-space-2);
|
|
130
|
+
background: var(--wp-bg-2);
|
|
131
|
+
border: 1px solid var(--wp-border);
|
|
132
|
+
border-radius: var(--wp-radius-sm);
|
|
133
|
+
color: var(--wp-text);
|
|
134
|
+
font: inherit;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
transition: border-color 0.12s, box-shadow 0.12s;
|
|
137
|
+
}
|
|
138
|
+
.wp-color-picker__trigger--compact { min-width: 0; padding: 0 var(--wp-space-3) 0 var(--wp-space-2); gap: var(--wp-space-2); }
|
|
139
|
+
.wp-color-picker__trigger:hover { border-color: var(--wp-border-strong); }
|
|
140
|
+
.wp-color-picker__trigger:focus-visible { outline: none; border-color: var(--wp-accent-500); box-shadow: var(--wp-focus-ring); }
|
|
141
|
+
.wp-color-picker__swatch {
|
|
142
|
+
width: 20px;
|
|
143
|
+
height: 20px;
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
border-radius: min(4px, var(--wp-radius-cap, 999px));
|
|
146
|
+
/* An inner ring keeps a dark swatch visible on a dark field. */
|
|
147
|
+
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--wp-text) 22%, transparent);
|
|
148
|
+
}
|
|
149
|
+
.wp-color-picker__value {
|
|
150
|
+
flex: 1;
|
|
151
|
+
text-align: left;
|
|
152
|
+
font-family: var(--wp-font-mono);
|
|
153
|
+
font-size: 12px;
|
|
154
|
+
color: var(--wp-text-muted);
|
|
155
|
+
}
|
|
156
|
+
.wp-color-picker__caret { font-size: 9px; color: var(--wp-text-dim); }
|
|
157
|
+
|
|
158
|
+
.wp-color-picker__popover {
|
|
159
|
+
width: 220px;
|
|
160
|
+
padding: var(--wp-space-2);
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
gap: var(--wp-space-5);
|
|
164
|
+
}
|
|
165
|
+
.wp-color-picker__row {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
gap: var(--wp-space-4);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.wp-color-picker__hex {
|
|
172
|
+
flex: 1;
|
|
173
|
+
min-width: 0;
|
|
174
|
+
font-family: var(--wp-font-mono);
|
|
175
|
+
font-size: var(--wp-text-sm);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.wp-color-picker__palette {
|
|
179
|
+
display: grid;
|
|
180
|
+
grid-template-columns: repeat(4, 1fr);
|
|
181
|
+
gap: var(--wp-space-3);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.wp-color-picker__chip {
|
|
185
|
+
/* Span the grid cell instead of locking at 32px so the swatches reach
|
|
186
|
+
* both edges of the popover. aspect-ratio keeps them square as the
|
|
187
|
+
* cell width changes with popover size. */
|
|
188
|
+
width: 100%;
|
|
189
|
+
aspect-ratio: 1 / 1;
|
|
190
|
+
min-width: 0;
|
|
191
|
+
border-radius: var(--wp-radius-sm);
|
|
192
|
+
border: 1px solid var(--wp-border);
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
padding: 0;
|
|
195
|
+
transition: transform 0.08s, box-shadow 0.12s;
|
|
196
|
+
}
|
|
197
|
+
.wp-color-picker__chip:hover { transform: scale(1.08); }
|
|
198
|
+
.wp-color-picker__chip[data-active="true"] {
|
|
199
|
+
box-shadow: 0 0 0 2px var(--wp-bg-2), 0 0 0 4px var(--wp-accent-500);
|
|
200
|
+
}
|
|
201
|
+
</style>
|