@bridge-ui/vue 0.13.0 → 0.15.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/ai/AGENTS.md +1 -1
- package/ai/README.md +1 -1
- package/ai/llms.txt +4 -3
- package/ai/skills/bridge-ui-forms/SKILL.md +3 -3
- package/ai/skills/bridge-ui-setup/SKILL.md +9 -8
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/Icon/mockIconAdapter.d.ts +5 -0
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +1 -1
- package/dist/Components/ActionFooter/ActionFooter.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/ActionFooter/actionFooter.types.d.ts +7 -12
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +4 -4
- package/dist/Components/ActionFooter/composables/useActionFooter.js +3 -4
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +2 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -3
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -0
- package/dist/Components/BaseField/composables/useBaseField.d.ts +2 -2
- package/dist/Components/BaseField/composables/useBaseField.js +1 -0
- package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
- package/dist/Components/Calendar/calendar.types.d.ts +12 -7
- package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
- package/dist/Components/Calendar/composables/useCalendar.js +144 -143
- package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
- package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
- package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
- package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
- package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
- package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
- package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
- package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
- package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
- package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
- package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
- package/dist/Components/Carousel/composables/useCarousel.js +117 -117
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -0
- package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/Components/ColorField/composables/useColorField.d.ts +2 -2
- package/dist/Components/ColorField/composables/useColorField.js +2 -0
- package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +9 -2
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +53 -45
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +20 -9
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +4 -4
- package/dist/Components/ColorPicker/composables/useColorPicker.js +151 -150
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateField/composables/useDateField.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.js +2 -0
- package/dist/Components/DatePicker/DatePicker.vue.d.ts +12 -4
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +57 -51
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
- package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
- package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
- package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.js +2 -0
- package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +56 -50
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
- package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.js +2 -0
- package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +9 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +84 -78
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
- package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +2 -0
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +112 -106
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
- package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
- package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +2 -2
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FileUpload/fileUpload.types.d.ts +1 -1
- package/dist/Components/FormControl/composables/useFormControl.js +46 -45
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +144 -143
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +0 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/Components/Modal/Modal.vue.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.js +1 -0
- package/dist/Components/OtpField/composables/useOtpField.js +1 -0
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/PasswordField/composables/usePasswordField.js +1 -0
- package/dist/Components/Radio/composables/useRadio.js +1 -0
- package/dist/Components/Rating/Rating.js +5 -0
- package/dist/Components/Rating/Rating.vue.d.ts +20 -0
- package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/Rating/composables/useRating.d.ts +112 -0
- package/dist/Components/Rating/composables/useRating.js +191 -0
- package/dist/Components/Rating/index.d.ts +4 -0
- package/dist/Components/Rating/index.js +3 -0
- package/dist/Components/Rating/rating.types.d.ts +107 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +36 -32
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +2 -1
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +143 -141
- package/dist/Components/Select/Select.vue.d.ts +2 -2
- package/dist/Components/Select/composables/useSelect.d.ts +3 -3
- package/dist/Components/Select/composables/useSelect.js +2 -0
- package/dist/Components/Sidebar/composables/useSidebar.js +1 -1
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- package/dist/Components/Slider/composables/useSlider.js +1 -0
- package/dist/Components/Switch/composables/useSwitch.js +1 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +0 -156
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.js +1 -0
- package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
- package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimeField/composables/useTimeField.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.js +2 -0
- package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
- package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
- package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
- package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +48 -42
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
- package/dist/Components/TimePicker/composables/useTimePicker.js +37 -36
- package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +2 -0
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +12 -4
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +74 -68
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +88 -87
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +0 -1
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Utils/index.d.ts +16 -6
- package/dist/Utils/index.js +39 -35
- package/dist/augments.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +69 -67
- package/dist/theme.css +10 -1
- package/docs/README.md +28 -13
- package/docs/components/ActionFooter.md +16 -14
- package/docs/components/BaseField.md +3 -3
- package/docs/components/BridgeUIProvider.md +108 -16
- package/docs/components/Calendar.md +0 -1
- package/docs/components/CalendarDate.md +0 -1
- package/docs/components/CalendarMonth.md +0 -1
- package/docs/components/CalendarRange.md +0 -1
- package/docs/components/CalendarYear.md +0 -1
- package/docs/components/ColorPicker.md +27 -27
- package/docs/components/DatePicker.md +0 -1
- package/docs/components/DateRangePicker.md +0 -1
- package/docs/components/DateTimePicker.md +0 -1
- package/docs/components/DateTimeRangePicker.md +0 -1
- package/docs/components/I18n.md +6 -6
- package/docs/components/Icon.md +10 -10
- package/docs/components/Rating.md +86 -0
- package/docs/components/RichTextEditor.md +4 -4
- package/docs/components/TimePanel.md +0 -1
- package/docs/components/TimePicker.md +0 -1
- package/docs/components/TimeRangePicker.md +0 -1
- package/package.json +3 -102
- package/dist/Adapters/Examples/date-date-fns.d.ts +0 -9
- package/dist/Adapters/Examples/date-date-fns.js +0 -151
- package/dist/Adapters/Examples/date-dayjs.d.ts +0 -19
- package/dist/Adapters/Examples/date-dayjs.js +0 -174
- package/dist/Adapters/Examples/date-luxon.d.ts +0 -7
- package/dist/Adapters/Examples/date-luxon.js +0 -164
- package/dist/Adapters/Examples/date-moment.d.ts +0 -19
- package/dist/Adapters/Examples/date-moment.js +0 -172
- package/dist/Adapters/Examples/i18n-dictionary.d.ts +0 -15
- package/dist/Adapters/Examples/i18n-dictionary.js +0 -97
- package/dist/Adapters/Examples/i18n-vue-i18n.d.ts +0 -7
- package/dist/Adapters/Examples/i18n-vue-i18n.js +0 -14
- package/dist/Adapters/Examples/icon-fontawesome.d.ts +0 -19
- package/dist/Adapters/Examples/icon-fontawesome.js +0 -81
- package/dist/Adapters/Examples/icon-heroicons.d.ts +0 -5
- package/dist/Adapters/Examples/icon-heroicons.js +0 -55
- package/dist/Adapters/Examples/icon-lucide.d.ts +0 -5
- package/dist/Adapters/Examples/icon-lucide.js +0 -55
- package/dist/Adapters/Examples/icon-phosphor.d.ts +0 -5
- package/dist/Adapters/Examples/icon-phosphor.js +0 -55
- package/dist/Adapters/Examples/icon-tabler.d.ts +0 -5
- package/dist/Adapters/Examples/icon-tabler.js +0 -55
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +0 -5
- package/dist/Adapters/Examples/rich-text-tiptap.js +0 -138
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useOptionalModel as e } from "../../Utils/useOptionalModel.js";
|
|
2
|
+
import t from "../ActionFooter/ActionFooter.js";
|
|
3
|
+
import { useColorPicker as n } from "./composables/useColorPicker.js";
|
|
4
|
+
import { Fragment as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, useModel as x } from "vue";
|
|
5
|
+
import { cn as S } from "@bridge-ui/core/Utils";
|
|
5
6
|
//#region src/Components/ColorPicker/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var C = { class: "min-w-0 truncate text-sm text-dark-700 dark:text-dark-100" }, w = [
|
|
7
8
|
"aria-label",
|
|
8
9
|
"onClick",
|
|
9
10
|
"aria-pressed",
|
|
10
11
|
"disabled"
|
|
11
|
-
],
|
|
12
|
+
], T = /*@__PURE__*/ c({
|
|
12
13
|
inheritAttrs: !1,
|
|
13
14
|
__name: "ColorPicker",
|
|
14
|
-
props: {
|
|
15
|
+
props: /*@__PURE__*/ u({
|
|
15
16
|
alpha: { type: Boolean },
|
|
16
17
|
classes: {},
|
|
18
|
+
color: {},
|
|
17
19
|
customProps: {},
|
|
18
20
|
defaultValue: {},
|
|
19
21
|
disabled: { type: Boolean },
|
|
@@ -25,68 +27,74 @@ var y = { class: "min-w-0 truncate text-sm text-dark-700 dark:text-dark-100" },
|
|
|
25
27
|
type: Boolean,
|
|
26
28
|
default: void 0
|
|
27
29
|
},
|
|
28
|
-
swatches: {}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
swatches: {}
|
|
31
|
+
}, {
|
|
32
|
+
modelValue: {},
|
|
33
|
+
modelModifiers: {}
|
|
34
|
+
}),
|
|
35
|
+
emits: /*@__PURE__*/ u([
|
|
32
36
|
"apply",
|
|
33
37
|
"cancel",
|
|
34
|
-
"change"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
"change",
|
|
39
|
+
"update:modelValue"
|
|
40
|
+
], ["update:modelValue"]),
|
|
41
|
+
setup(c, { emit: u }) {
|
|
42
|
+
let T = x(c, "modelValue"), E = u, D = c, O = g(D.defaultValue ?? null), k = e(T, O), { merged: A, hueBind: j, rootBind: M, areaBind: N, alphaBind: P, showAlpha: F, swatchCss: I, footerBind: ee, showFooter: L, previewBind: R, contentBind: z, handleApply: B, swatchesBind: V, handleCancel: H, hueThumbBind: U, areaThumbBind: W, alphaFillBind: G, formattedValue: K, alphaThumbBind: q, presetSwatches: J, applyButtonProps: Y, isSwatchSelected: X, previewSwatchBind: Z, handleSwatchClick: Q, swatchButtonClass: $, cancelButtonProps: te, swatchSelectedClass: ne, previewSwatchFillBind: re } = n(D, {
|
|
38
43
|
rounded: "md",
|
|
39
|
-
format: "hex"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
format: "hex",
|
|
45
|
+
color: "primary"
|
|
46
|
+
}, k, E);
|
|
47
|
+
return (e, n) => (h(), a("div", p(l(b(M))), [o("div", { class: f(b(z)) }, [
|
|
48
|
+
o("div", p(l(b(N))), [
|
|
49
|
+
n[0] ||= o("span", {
|
|
44
50
|
"aria-hidden": "",
|
|
45
51
|
class: "pointer-events-none absolute inset-0",
|
|
46
52
|
style: { backgroundImage: "linear-gradient(to right, #fff, transparent)" }
|
|
47
53
|
}, null, -1),
|
|
48
|
-
|
|
54
|
+
n[1] ||= o("span", {
|
|
49
55
|
"aria-hidden": "",
|
|
50
56
|
class: "pointer-events-none absolute inset-0",
|
|
51
57
|
style: { backgroundImage: "linear-gradient(to top, #000, transparent)" }
|
|
52
58
|
}, null, -1),
|
|
53
|
-
|
|
59
|
+
o("span", p(l(b(W))), null, 16)
|
|
54
60
|
], 16),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
o("div", p(l(b(j))), [o("span", p(l(b(U))), null, 16)], 16),
|
|
62
|
+
b(F) ? (h(), a("div", p(d({ key: 0 }, b(P))), [o("span", p(l(b(G))), null, 16), o("span", p(l(b(q))), null, 16)], 16)) : i("", !0),
|
|
63
|
+
o("div", p(l(b(R))), [o("span", p(l(b(Z))), [o("span", p(l(b(re))), null, 16)], 16), o("span", C, y(b(K)), 1)], 16),
|
|
64
|
+
b(J).length > 0 ? (h(), a("div", p(d({ key: 1 }, b(V))), [(h(!0), a(r, null, _(b(J), (e) => (h(), a("button", {
|
|
59
65
|
type: "button",
|
|
60
66
|
key: e,
|
|
61
67
|
"aria-label": e,
|
|
62
|
-
onClick: (t) =>
|
|
63
|
-
"aria-pressed":
|
|
64
|
-
disabled:
|
|
65
|
-
class:
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
+
onClick: (t) => b(Q)(e),
|
|
69
|
+
"aria-pressed": b(X)(e),
|
|
70
|
+
disabled: b(A).disabled || b(A).readOnly,
|
|
71
|
+
class: f(b(S)({
|
|
72
|
+
[b($)]: !0,
|
|
73
|
+
[b(ne)]: b(X)(e)
|
|
68
74
|
}))
|
|
69
|
-
}, [
|
|
75
|
+
}, [o("span", {
|
|
70
76
|
"aria-hidden": "",
|
|
71
77
|
class: "absolute inset-0",
|
|
72
|
-
style:
|
|
73
|
-
}, null, 4)], 10,
|
|
74
|
-
], 2),
|
|
75
|
-
apply:
|
|
76
|
-
cancel:
|
|
77
|
-
}, () => [
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
style: m({ backgroundColor: b(I)(e) })
|
|
79
|
+
}, null, 4)], 10, w))), 128))], 16)) : i("", !0)
|
|
80
|
+
], 2), b(L) ? (h(), a("div", p(d({ key: 0 }, b(ee))), [v(e.$slots, "footer", {
|
|
81
|
+
apply: b(B),
|
|
82
|
+
cancel: b(H)
|
|
83
|
+
}, () => [s(b(t), {
|
|
84
|
+
color: b(A).color,
|
|
85
|
+
onApply: b(B),
|
|
86
|
+
onCancel: b(H),
|
|
80
87
|
"custom-props": {
|
|
81
|
-
applyButton:
|
|
82
|
-
cancelButton:
|
|
88
|
+
applyButton: b(Y),
|
|
89
|
+
cancelButton: b(te)
|
|
83
90
|
}
|
|
84
91
|
}, null, 8, [
|
|
92
|
+
"color",
|
|
85
93
|
"onApply",
|
|
86
94
|
"onCancel",
|
|
87
95
|
"custom-props"
|
|
88
|
-
])])], 16)) :
|
|
96
|
+
])])], 16)) : i("", !0)], 16));
|
|
89
97
|
}
|
|
90
98
|
});
|
|
91
99
|
//#endregion
|
|
92
|
-
export {
|
|
100
|
+
export { T as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
2
|
import { ColorFormat, FieldOverlayFooterSlotProps } from '@bridge-ui/core/Domain';
|
|
3
|
-
import { ColorPickerRounded } from '@bridge-ui/core/Tokens';
|
|
3
|
+
import { ButtonColor, ColorPickerRounded } from '@bridge-ui/core/Tokens';
|
|
4
4
|
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
5
|
-
import { ButtonProps } from '../Button/button.types';
|
|
5
|
+
import { ButtonColorOverrides, ButtonProps } from '../Button/button.types';
|
|
6
6
|
export interface ColorPickerRoundedOverrides {}
|
|
7
7
|
export interface ColorPickerClasses {
|
|
8
8
|
/**
|
|
@@ -103,6 +103,10 @@ export interface ColorPickerEmits {
|
|
|
103
103
|
* Emitted when Apply is pressed (`showFooter`) or when the value commits.
|
|
104
104
|
*/
|
|
105
105
|
change: [value: null | string];
|
|
106
|
+
/**
|
|
107
|
+
* Emitted when `v-model` should update.
|
|
108
|
+
*/
|
|
109
|
+
"update:modelValue": [value: null | string];
|
|
106
110
|
}
|
|
107
111
|
export interface ColorPickerOwnProps {
|
|
108
112
|
/**
|
|
@@ -118,6 +122,12 @@ export interface ColorPickerOwnProps {
|
|
|
118
122
|
* @default undefined
|
|
119
123
|
*/
|
|
120
124
|
classes?: ColorPickerClasses;
|
|
125
|
+
/**
|
|
126
|
+
* Color of the Cancel / Apply footer actions.
|
|
127
|
+
*
|
|
128
|
+
* @default "primary"
|
|
129
|
+
*/
|
|
130
|
+
color?: MergeProps<ButtonColor, ButtonColorOverrides>;
|
|
121
131
|
/**
|
|
122
132
|
* Extra props for internal parts.
|
|
123
133
|
*
|
|
@@ -181,12 +191,6 @@ export interface ColorPickerOwnProps {
|
|
|
181
191
|
* @default undefined
|
|
182
192
|
*/
|
|
183
193
|
swatches?: string[];
|
|
184
|
-
/**
|
|
185
|
-
* Controlled value.
|
|
186
|
-
*
|
|
187
|
-
* @default undefined
|
|
188
|
-
*/
|
|
189
|
-
value?: null | string;
|
|
190
194
|
}
|
|
191
195
|
export interface ColorPickerSlots {
|
|
192
196
|
/**
|
|
@@ -197,4 +201,11 @@ export interface ColorPickerSlots {
|
|
|
197
201
|
*/
|
|
198
202
|
footer?: Slot<FieldOverlayFooterSlotProps>;
|
|
199
203
|
}
|
|
200
|
-
export type ColorPickerProps = MergeHtmlProps<ColorPickerOwnProps, HTMLAttributes
|
|
204
|
+
export type ColorPickerProps = MergeHtmlProps<ColorPickerOwnProps, HTMLAttributes> & {
|
|
205
|
+
/**
|
|
206
|
+
* Bound with `v-model` on the component (`defineModel` internally).
|
|
207
|
+
*
|
|
208
|
+
* @default undefined
|
|
209
|
+
*/
|
|
210
|
+
modelValue?: null | string;
|
|
211
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, SetupContext } from 'vue';
|
|
1
|
+
import { MaybeRefOrGetter, Ref, SetupContext } from 'vue';
|
|
2
2
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
3
3
|
import { ColorPickerEmits, ColorPickerOwnProps } from '../colorPicker.types';
|
|
4
|
-
type ColorPickerLibDefaults = LibDefaultsShape<ColorPickerOwnProps, "format" | "rounded">;
|
|
4
|
+
type ColorPickerLibDefaults = LibDefaultsShape<ColorPickerOwnProps, "color" | "format" | "rounded">;
|
|
5
5
|
type ColorPickerMerged = MergeLibDefaults<ColorPickerOwnProps, ColorPickerLibDefaults>;
|
|
6
6
|
/**
|
|
7
7
|
* Owns controlled/uncontrolled value, optional footer draft, and panel binds.
|
|
8
8
|
*/
|
|
9
|
-
export declare function useColorPicker(props: MaybeRefOrGetter<ColorPickerOwnProps>, libDefaults: ColorPickerLibDefaults, emit: SetupContext<ColorPickerEmits>["emit"]): {
|
|
9
|
+
export declare function useColorPicker(props: MaybeRefOrGetter<ColorPickerOwnProps>, libDefaults: ColorPickerLibDefaults, model: Ref<null | string>, emit: SetupContext<ColorPickerEmits>["emit"]): {
|
|
10
10
|
merged: import('vue').ComputedRef<ColorPickerMerged>;
|
|
11
11
|
hueBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
12
12
|
role: string;
|
|
@@ -22,7 +22,7 @@ export declare function useColorPicker(props: MaybeRefOrGetter<ColorPickerOwnPro
|
|
|
22
22
|
onPointerdown: (event: PointerEvent) => void;
|
|
23
23
|
onPointermove: (event: PointerEvent) => void;
|
|
24
24
|
}>>;
|
|
25
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<ColorPickerOwnProps, "
|
|
25
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<ColorPickerOwnProps, "color" | "fill" | "format" | "classes" | "showFooter" | "customProps" | "disabled" | "rounded" | "alpha" | "defaultValue" | "readOnly" | "swatches">>>>;
|
|
26
26
|
areaBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
27
27
|
role: string;
|
|
28
28
|
onKeydown: (event: KeyboardEvent) => void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
3
|
import { FIELD_OVERLAY_INJECTION_KEY as i } from "../../FieldOverlay/fieldOverlayInjectionKey.js";
|
|
4
|
-
import { computed as a, inject as
|
|
4
|
+
import { computed as a, inject as ee, ref as te, toValue as o, useAttrs as s, watch as c } from "vue";
|
|
5
5
|
import { get as l, omit as u } from "es-toolkit/compat";
|
|
6
|
-
import { DEFAULT_COLOR_FORMAT as d, DEFAULT_HSVA as f, colorStringsEqual as p, formatColor as m, hueToCssRgb as ne, parseColor as h, resolveColorAlpha as
|
|
7
|
-
import { colorPickerRoundedProps as
|
|
8
|
-
import { cn as x, mergeBridgeUILayeredClasses as S, splitComponentProps as
|
|
6
|
+
import { DEFAULT_COLOR_FORMAT as d, DEFAULT_HSVA as f, colorStringsEqual as p, formatColor as m, hueToCssRgb as ne, parseColor as h, resolveColorAlpha as re, saturationValueFromPointer as g, toCssRgba as _, unitFromPointer as v } from "@bridge-ui/core/Domain";
|
|
7
|
+
import { colorPickerRoundedProps as y, colorPickerSizeProps as b } from "@bridge-ui/core/Tokens";
|
|
8
|
+
import { cn as x, mergeBridgeUILayeredClasses as S, splitComponentProps as C } from "@bridge-ui/core/Utils";
|
|
9
9
|
//#region src/Components/ColorPicker/composables/useColorPicker.ts
|
|
10
|
-
var
|
|
10
|
+
var w = [
|
|
11
11
|
"fill",
|
|
12
12
|
"alpha",
|
|
13
|
-
"
|
|
13
|
+
"color",
|
|
14
14
|
"format",
|
|
15
15
|
"classes",
|
|
16
16
|
"rounded",
|
|
@@ -21,231 +21,232 @@ var ae = [
|
|
|
21
21
|
"customProps",
|
|
22
22
|
"defaultValue"
|
|
23
23
|
];
|
|
24
|
-
function
|
|
24
|
+
function T(e) {
|
|
25
25
|
return h(e) ?? f;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
27
|
+
function E(f, E, D, O) {
|
|
28
|
+
let ie = s(), k = ee(i, {
|
|
29
29
|
apply: () => void 0,
|
|
30
30
|
cancel: () => void 0
|
|
31
|
-
}),
|
|
32
|
-
bridgeKeys:
|
|
31
|
+
}), A = e(), j = a(() => C({
|
|
32
|
+
bridgeKeys: w,
|
|
33
33
|
props: {
|
|
34
|
-
...
|
|
35
|
-
...
|
|
34
|
+
...ie,
|
|
35
|
+
...o(f)
|
|
36
36
|
}
|
|
37
|
-
})), { merged:
|
|
38
|
-
libDefaults:
|
|
37
|
+
})), { merged: M, entry: N } = n({
|
|
38
|
+
libDefaults: E,
|
|
39
39
|
componentName: "ColorPicker",
|
|
40
|
-
props: () =>
|
|
41
|
-
}),
|
|
40
|
+
props: () => j.value.componentProps
|
|
41
|
+
}), P = a(() => M.value.customProps), F = a(() => u(j.value.inheritedAttrs, [
|
|
42
42
|
"onApply",
|
|
43
43
|
"onCancel",
|
|
44
|
-
"onChange"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
"onChange",
|
|
45
|
+
"onUpdate:modelValue"
|
|
46
|
+
])), I = r({
|
|
47
|
+
entry: N,
|
|
48
|
+
props: () => j.value.componentProps
|
|
49
|
+
}), L = a(() => M.value.format ?? d), R = te(T(D.value));
|
|
50
|
+
c(() => [D.value, M.value.showFooter], ([e, t]) => {
|
|
51
|
+
t && (R.value = T(e));
|
|
51
52
|
});
|
|
52
|
-
let
|
|
53
|
-
...
|
|
53
|
+
let z = a(() => M.value.showFooter ? R.value : T(D.value)), B = a(() => re(M.value.alpha, L.value)), V = a(() => m(z.value, L.value)), H = a(() => _(z.value)), U = a(() => ne(z.value.h)), W = a(() => _({
|
|
54
|
+
...z.value,
|
|
54
55
|
a: 1
|
|
55
|
-
})),
|
|
56
|
-
let e = S(
|
|
56
|
+
})), G = a(() => {
|
|
57
|
+
let e = S(b, N.value?.tokens?.size);
|
|
57
58
|
return l(e, ["md", "swatch"]) ?? "";
|
|
58
|
-
}),
|
|
59
|
-
let e = S(
|
|
60
|
-
return l(e,
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
if (
|
|
65
|
-
|
|
59
|
+
}), K = a(() => {
|
|
60
|
+
let e = S(y, N.value?.tokens?.rounded);
|
|
61
|
+
return l(e, M.value.rounded ?? "md") ?? "";
|
|
62
|
+
}), q = a(() => (M.value.swatches ?? []).filter((e) => h(e))), J = a(() => !M.value.disabled && !M.value.readOnly), Y = (e) => {
|
|
63
|
+
D.value = e, O("change", e);
|
|
64
|
+
}, X = (e) => {
|
|
65
|
+
if (M.value.showFooter) {
|
|
66
|
+
R.value = e;
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
...
|
|
69
|
+
Y(m(e, L.value));
|
|
70
|
+
}, Z = (e) => {
|
|
71
|
+
X({
|
|
72
|
+
...z.value,
|
|
72
73
|
...e
|
|
73
74
|
});
|
|
74
|
-
},
|
|
75
|
+
}, ae = (e) => {
|
|
75
76
|
let t = h(e);
|
|
76
|
-
t &&
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
77
|
+
t && J.value && X(t);
|
|
78
|
+
}, oe = () => {
|
|
79
|
+
Y(m(R.value, L.value)), O("apply"), k.apply();
|
|
80
|
+
}, se = () => {
|
|
81
|
+
R.value = T(D.value), O("cancel"), k.cancel();
|
|
82
|
+
}, ce = (e) => {
|
|
83
|
+
if (!J.value) return;
|
|
84
|
+
let t = e.currentTarget.getBoundingClientRect(), n = g(e.clientX, e.clientY, t);
|
|
85
|
+
Z(n);
|
|
86
|
+
}, le = (e) => {
|
|
87
|
+
if (!J.value) return;
|
|
88
|
+
let t = e.currentTarget.getBoundingClientRect(), n = v(e.clientX, t.left, t.width);
|
|
89
|
+
Z({ h: n * 360 });
|
|
81
90
|
}, ue = (e) => {
|
|
82
|
-
if (!
|
|
83
|
-
let t = e.currentTarget.getBoundingClientRect(), n =
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
if (!Y.value) return;
|
|
87
|
-
let t = e.currentTarget.getBoundingClientRect(), n = y(e.clientX, t.left, t.width);
|
|
88
|
-
Q({ h: n * 360 });
|
|
89
|
-
}, fe = (e) => {
|
|
90
|
-
if (!Y.value) return;
|
|
91
|
-
let t = e.currentTarget.getBoundingClientRect(), n = y(e.clientX, t.left, t.width);
|
|
92
|
-
Q({ a: n });
|
|
93
|
-
}, $ = (e) => ({
|
|
91
|
+
if (!J.value) return;
|
|
92
|
+
let t = e.currentTarget.getBoundingClientRect(), n = v(e.clientX, t.left, t.width);
|
|
93
|
+
Z({ a: n });
|
|
94
|
+
}, Q = (e) => ({
|
|
94
95
|
onPointerdown: (t) => {
|
|
95
96
|
t.preventDefault(), t.currentTarget.setPointerCapture(t.pointerId), e(t);
|
|
96
97
|
},
|
|
97
98
|
onPointermove: (t) => {
|
|
98
99
|
t.currentTarget.hasPointerCapture(t.pointerId) && e(t);
|
|
99
100
|
}
|
|
100
|
-
}),
|
|
101
|
-
if (!
|
|
101
|
+
}), de = (e) => {
|
|
102
|
+
if (!J.value) return;
|
|
102
103
|
let t = e.shiftKey ? 10 : 1;
|
|
103
|
-
e.key === "ArrowLeft" ? (e.preventDefault(),
|
|
104
|
-
},
|
|
105
|
-
if (!
|
|
104
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), Z({ s: z.value.s - t })) : e.key === "ArrowRight" ? (e.preventDefault(), Z({ s: z.value.s + t })) : e.key === "ArrowDown" ? (e.preventDefault(), Z({ v: z.value.v - t })) : e.key === "ArrowUp" && (e.preventDefault(), Z({ v: z.value.v + t }));
|
|
105
|
+
}, fe = (e) => {
|
|
106
|
+
if (!J.value) return;
|
|
106
107
|
let t = e.shiftKey ? 10 : 1;
|
|
107
|
-
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(),
|
|
108
|
-
},
|
|
109
|
-
if (!
|
|
108
|
+
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), Z({ h: z.value.h - t })) : (e.key === "ArrowRight" || e.key === "ArrowUp") && (e.preventDefault(), Z({ h: z.value.h + t }));
|
|
109
|
+
}, pe = (e) => {
|
|
110
|
+
if (!J.value) return;
|
|
110
111
|
let t = e.shiftKey ? .1 : .01;
|
|
111
|
-
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(),
|
|
112
|
-
},
|
|
112
|
+
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), Z({ a: z.value.a - t })) : (e.key === "ArrowRight" || e.key === "ArrowUp") && (e.preventDefault(), Z({ a: z.value.a + t }));
|
|
113
|
+
}, me = a(() => t(P.value?.root, F.value, x({
|
|
113
114
|
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-900": !0,
|
|
114
|
-
"w-full":
|
|
115
|
-
"w-72": !
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
}))),
|
|
119
|
-
|
|
115
|
+
"w-full": M.value.fill,
|
|
116
|
+
"w-72": !M.value.fill,
|
|
117
|
+
[K.value]: !0,
|
|
118
|
+
[I.value.root ?? ""]: !0
|
|
119
|
+
}))), he = a(() => x({ "flex flex-col gap-3 p-3": !0 })), ge = a(() => t(P.value?.area, {
|
|
120
|
+
...Q(ce),
|
|
120
121
|
role: "slider",
|
|
121
|
-
onKeydown:
|
|
122
|
-
tabindex:
|
|
123
|
-
style: { backgroundColor:
|
|
124
|
-
"aria-label":
|
|
125
|
-
"aria-valuetext": `Saturation ${Math.round(
|
|
122
|
+
onKeydown: de,
|
|
123
|
+
tabindex: J.value ? 0 : -1,
|
|
124
|
+
style: { backgroundColor: U.value },
|
|
125
|
+
"aria-label": A("Saturation and brightness"),
|
|
126
|
+
"aria-valuetext": `Saturation ${Math.round(z.value.s)}%, Brightness ${Math.round(z.value.v)}%`
|
|
126
127
|
}, x({
|
|
127
128
|
"relative h-40 w-full cursor-crosshair overflow-hidden touch-none": !0,
|
|
128
|
-
[
|
|
129
|
-
"cursor-not-allowed": !
|
|
130
|
-
[
|
|
131
|
-
}))),
|
|
129
|
+
[K.value]: !0,
|
|
130
|
+
"cursor-not-allowed": !J.value,
|
|
131
|
+
[I.value.area ?? ""]: !0
|
|
132
|
+
}))), _e = a(() => ({
|
|
132
133
|
"aria-hidden": !0,
|
|
133
134
|
style: {
|
|
134
|
-
left: `${
|
|
135
|
-
top: `${100 -
|
|
135
|
+
left: `${z.value.s}%`,
|
|
136
|
+
top: `${100 - z.value.v}%`
|
|
136
137
|
},
|
|
137
138
|
class: "pointer-events-none absolute z-10 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow"
|
|
138
|
-
})),
|
|
139
|
-
|
|
139
|
+
})), ve = a(() => t(P.value?.hue, {
|
|
140
|
+
...Q(le),
|
|
140
141
|
role: "slider",
|
|
141
142
|
"aria-valuemin": 0,
|
|
142
143
|
"aria-valuemax": 360,
|
|
143
|
-
onKeydown:
|
|
144
|
-
"aria-label":
|
|
145
|
-
tabindex:
|
|
146
|
-
"aria-valuenow": Math.round(
|
|
144
|
+
onKeydown: fe,
|
|
145
|
+
"aria-label": A("Hue"),
|
|
146
|
+
tabindex: J.value ? 0 : -1,
|
|
147
|
+
"aria-valuenow": Math.round(z.value.h),
|
|
147
148
|
style: { backgroundImage: "linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)" }
|
|
148
149
|
}, x({
|
|
149
150
|
"relative h-3 w-full cursor-pointer touch-none": !0,
|
|
150
151
|
"rounded-full": !0,
|
|
151
|
-
"cursor-not-allowed": !
|
|
152
|
-
[
|
|
153
|
-
}))),
|
|
152
|
+
"cursor-not-allowed": !J.value,
|
|
153
|
+
[I.value.hue ?? ""]: !0
|
|
154
|
+
}))), ye = a(() => ({
|
|
154
155
|
"aria-hidden": !0,
|
|
155
156
|
style: {
|
|
156
|
-
backgroundColor:
|
|
157
|
-
left: `${
|
|
157
|
+
backgroundColor: U.value,
|
|
158
|
+
left: `${z.value.h / 360 * 100}%`
|
|
158
159
|
},
|
|
159
160
|
class: "pointer-events-none absolute top-1/2 z-10 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow"
|
|
160
|
-
})),
|
|
161
|
-
|
|
161
|
+
})), be = a(() => t(P.value?.alpha, {
|
|
162
|
+
...Q(ue),
|
|
162
163
|
role: "slider",
|
|
163
164
|
"aria-valuemin": 0,
|
|
164
165
|
"aria-valuemax": 100,
|
|
165
|
-
onKeydown:
|
|
166
|
-
tabindex:
|
|
167
|
-
"aria-label":
|
|
168
|
-
"aria-valuenow": Math.round(
|
|
166
|
+
onKeydown: pe,
|
|
167
|
+
tabindex: J.value ? 0 : -1,
|
|
168
|
+
"aria-label": A("Alpha"),
|
|
169
|
+
"aria-valuenow": Math.round(z.value.a * 100)
|
|
169
170
|
}, x({
|
|
170
171
|
"relative h-3 w-full cursor-pointer overflow-hidden touch-none": !0,
|
|
171
172
|
"bg-[image:repeating-conic-gradient(#d1d5db_0%_25%,#ffffff_0%_50%)] bg-[size:0.5rem_0.5rem] dark:bg-[image:repeating-conic-gradient(#4b5563_0%_25%,#1f2937_0%_50%)]": !0,
|
|
172
173
|
"rounded-full": !0,
|
|
173
|
-
"cursor-not-allowed": !
|
|
174
|
-
[
|
|
175
|
-
}))),
|
|
174
|
+
"cursor-not-allowed": !J.value,
|
|
175
|
+
[I.value.alpha ?? ""]: !0
|
|
176
|
+
}))), $ = a(() => ({
|
|
176
177
|
"aria-hidden": !0,
|
|
177
178
|
class: "pointer-events-none absolute inset-0",
|
|
178
|
-
style: { backgroundImage: `linear-gradient(to right, transparent, ${
|
|
179
|
-
})),
|
|
179
|
+
style: { backgroundImage: `linear-gradient(to right, transparent, ${W.value})` }
|
|
180
|
+
})), xe = a(() => ({
|
|
180
181
|
"aria-hidden": !0,
|
|
181
182
|
style: {
|
|
182
|
-
backgroundColor:
|
|
183
|
-
left: `${
|
|
183
|
+
backgroundColor: H.value,
|
|
184
|
+
left: `${z.value.a * 100}%`
|
|
184
185
|
},
|
|
185
186
|
class: "pointer-events-none absolute top-1/2 z-10 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow"
|
|
186
|
-
})),
|
|
187
|
+
})), Se = a(() => t(P.value?.preview, {}, x({
|
|
187
188
|
"flex items-center gap-2": !0,
|
|
188
|
-
[
|
|
189
|
-
}))),
|
|
189
|
+
[I.value.preview ?? ""]: !0
|
|
190
|
+
}))), Ce = a(() => ({
|
|
190
191
|
"aria-hidden": !0,
|
|
191
192
|
class: x({
|
|
192
193
|
"relative shrink-0 overflow-hidden": !0,
|
|
193
194
|
"bg-[image:repeating-conic-gradient(#d1d5db_0%_25%,#ffffff_0%_50%)] bg-[size:0.5rem_0.5rem] dark:bg-[image:repeating-conic-gradient(#4b5563_0%_25%,#1f2937_0%_50%)]": !0,
|
|
194
|
-
[
|
|
195
|
-
[
|
|
195
|
+
[G.value]: !0,
|
|
196
|
+
[K.value]: !0
|
|
196
197
|
})
|
|
197
|
-
})),
|
|
198
|
+
})), we = a(() => ({
|
|
198
199
|
class: "absolute inset-0",
|
|
199
|
-
style: { backgroundColor:
|
|
200
|
-
})),
|
|
200
|
+
style: { backgroundColor: H.value }
|
|
201
|
+
})), Te = a(() => t(P.value?.swatches, {}, x({
|
|
201
202
|
"flex flex-wrap gap-2": !0,
|
|
202
|
-
[
|
|
203
|
+
[I.value.swatches ?? ""]: !0
|
|
203
204
|
})));
|
|
204
205
|
return {
|
|
205
|
-
merged:
|
|
206
|
-
hueBind:
|
|
207
|
-
rootBind:
|
|
208
|
-
areaBind:
|
|
209
|
-
cssColor:
|
|
210
|
-
alphaBind:
|
|
211
|
-
showAlpha:
|
|
212
|
-
footerBind: a(() => t(
|
|
206
|
+
merged: M,
|
|
207
|
+
hueBind: ve,
|
|
208
|
+
rootBind: me,
|
|
209
|
+
areaBind: ge,
|
|
210
|
+
cssColor: H,
|
|
211
|
+
alphaBind: be,
|
|
212
|
+
showAlpha: B,
|
|
213
|
+
footerBind: a(() => t(P.value?.footer, {}, x({
|
|
213
214
|
"flex items-center justify-end gap-2 border-t border-dark-100 bg-dark-50 px-3 py-2 dark:border-dark-800 dark:bg-dark-950/40": !0,
|
|
214
|
-
[
|
|
215
|
+
[I.value.footer ?? ""]: !0
|
|
215
216
|
}))),
|
|
216
|
-
showFooter: a(() => !!
|
|
217
|
-
previewBind:
|
|
218
|
-
contentBind:
|
|
219
|
-
handleApply:
|
|
220
|
-
swatchesBind:
|
|
221
|
-
handleCancel:
|
|
222
|
-
hueThumbBind:
|
|
223
|
-
areaThumbBind:
|
|
224
|
-
alphaFillBind:
|
|
225
|
-
formattedValue:
|
|
226
|
-
alphaThumbBind:
|
|
227
|
-
presetSwatches:
|
|
228
|
-
previewSwatchBind:
|
|
229
|
-
handleSwatchClick:
|
|
217
|
+
showFooter: a(() => !!M.value.showFooter),
|
|
218
|
+
previewBind: Se,
|
|
219
|
+
contentBind: he,
|
|
220
|
+
handleApply: oe,
|
|
221
|
+
swatchesBind: Te,
|
|
222
|
+
handleCancel: se,
|
|
223
|
+
hueThumbBind: ye,
|
|
224
|
+
areaThumbBind: _e,
|
|
225
|
+
alphaFillBind: $,
|
|
226
|
+
formattedValue: V,
|
|
227
|
+
alphaThumbBind: xe,
|
|
228
|
+
presetSwatches: q,
|
|
229
|
+
previewSwatchBind: Ce,
|
|
230
|
+
handleSwatchClick: ae,
|
|
230
231
|
swatchButtonClass: a(() => x({
|
|
231
232
|
"relative shrink-0 overflow-hidden": !0,
|
|
232
233
|
"bg-[image:repeating-conic-gradient(#d1d5db_0%_25%,#ffffff_0%_50%)] bg-[size:0.5rem_0.5rem] dark:bg-[image:repeating-conic-gradient(#4b5563_0%_25%,#1f2937_0%_50%)]": !0,
|
|
234
|
+
[G.value]: !0,
|
|
233
235
|
[K.value]: !0,
|
|
234
|
-
[q.value]: !0,
|
|
235
236
|
"border border-black/10 dark:border-white/15": !0,
|
|
236
|
-
"hover:ring-2 hover:ring-dark-300 hover:ring-offset-2 hover:ring-offset-white dark:hover:ring-dark-500 dark:hover:ring-offset-dark-900":
|
|
237
|
-
"cursor-not-allowed opacity-50": !
|
|
237
|
+
"hover:ring-2 hover:ring-dark-300 hover:ring-offset-2 hover:ring-offset-white dark:hover:ring-dark-500 dark:hover:ring-offset-dark-900": J.value,
|
|
238
|
+
"cursor-not-allowed opacity-50": !J.value
|
|
238
239
|
})),
|
|
239
240
|
swatchSelectedClass: a(() => "ring-2 ring-dark-500 ring-offset-2 ring-offset-white dark:ring-dark-400 dark:ring-offset-dark-900"),
|
|
240
|
-
previewSwatchFillBind:
|
|
241
|
-
applyButtonProps: a(() =>
|
|
242
|
-
cancelButtonProps: a(() =>
|
|
243
|
-
isSwatchSelected: (e) => p(e,
|
|
241
|
+
previewSwatchFillBind: we,
|
|
242
|
+
applyButtonProps: a(() => P.value?.applyButton),
|
|
243
|
+
cancelButtonProps: a(() => P.value?.cancelButton),
|
|
244
|
+
isSwatchSelected: (e) => p(e, V.value),
|
|
244
245
|
swatchCss: (e) => {
|
|
245
246
|
let t = h(e);
|
|
246
|
-
return t ?
|
|
247
|
+
return t ? _(t) : void 0;
|
|
247
248
|
}
|
|
248
249
|
};
|
|
249
250
|
}
|
|
250
251
|
//#endregion
|
|
251
|
-
export {
|
|
252
|
+
export { E as useColorPicker };
|