@bridge-ui/vue 0.1.0 → 0.1.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 (136) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +5 -3
  2. package/ai/skills/bridge-ui-forms/SKILL.md +4 -2
  3. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +0 -1
  4. package/dist/Components/Autocomplete/composables/useAutocomplete.js +0 -1
  5. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +0 -1
  6. package/dist/Components/Calendar/calendar.types.d.ts +1 -21
  7. package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -2
  8. package/dist/Components/Calendar/composables/useCalendar.js +97 -97
  9. package/dist/Components/Calendar/index.d.ts +1 -1
  10. package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +0 -1
  11. package/dist/Components/CalendarDate/calendarDate.types.d.ts +1 -21
  12. package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +1 -1
  13. package/dist/Components/CalendarDate/composables/useCalendarDate.js +73 -73
  14. package/dist/Components/CalendarDate/index.d.ts +1 -1
  15. package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +0 -1
  16. package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +1 -17
  17. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  18. package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +25 -25
  19. package/dist/Components/CalendarMonth/index.d.ts +1 -1
  20. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +0 -1
  21. package/dist/Components/CalendarRange/calendarRange.types.d.ts +1 -21
  22. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -2
  23. package/dist/Components/CalendarRange/composables/useCalendarRange.js +111 -112
  24. package/dist/Components/CalendarRange/index.d.ts +1 -1
  25. package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +0 -1
  26. package/dist/Components/CalendarYear/calendarYear.types.d.ts +1 -17
  27. package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +1 -1
  28. package/dist/Components/CalendarYear/composables/useCalendarYear.js +27 -27
  29. package/dist/Components/CalendarYear/index.d.ts +1 -1
  30. package/dist/Components/ColorField/ColorField.js +5 -0
  31. package/dist/Components/ColorField/ColorField.vue.d.ts +38 -0
  32. package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +149 -0
  33. package/dist/Components/ColorField/colorField.types.d.ts +179 -0
  34. package/dist/Components/ColorField/composables/useColorField.d.ts +748 -0
  35. package/dist/Components/ColorField/composables/useColorField.js +182 -0
  36. package/dist/Components/ColorField/index.d.ts +3 -0
  37. package/dist/Components/ColorField/index.js +3 -0
  38. package/dist/Components/ColorPicker/ColorPicker.js +5 -0
  39. package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +21 -0
  40. package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +91 -0
  41. package/dist/Components/ColorPicker/colorPicker.types.d.ts +200 -0
  42. package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +111 -0
  43. package/dist/Components/ColorPicker/composables/useColorPicker.js +253 -0
  44. package/dist/Components/ColorPicker/index.d.ts +3 -0
  45. package/dist/Components/ColorPicker/index.js +3 -0
  46. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +4 -7
  47. package/dist/Components/DatePicker/composables/useDatePicker.d.ts +1 -6
  48. package/dist/Components/DatePicker/composables/useDatePicker.js +30 -9
  49. package/dist/Components/DatePicker/datePicker.types.d.ts +1 -29
  50. package/dist/Components/DatePicker/index.d.ts +1 -1
  51. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +4 -7
  52. package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +1 -6
  53. package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +3 -9
  54. package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +1 -29
  55. package/dist/Components/DateRangePicker/index.d.ts +1 -1
  56. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +16 -21
  57. package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +1 -10
  58. package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +30 -39
  59. package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +1 -36
  60. package/dist/Components/DateTimePicker/index.d.ts +1 -1
  61. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +20 -27
  62. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +1 -10
  63. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +34 -43
  64. package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +1 -36
  65. package/dist/Components/DateTimeRangePicker/index.d.ts +1 -1
  66. package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +17 -10
  67. package/dist/Components/FieldOverlay/fieldOverlay.types.d.ts +3 -0
  68. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  69. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +1 -2
  70. package/dist/Components/Listbox/composables/useListbox.d.ts +1 -10
  71. package/dist/Components/Listbox/composables/useListbox.js +50 -51
  72. package/dist/Components/Listbox/index.d.ts +0 -1
  73. package/dist/Components/Listbox/listbox.types.d.ts +0 -6
  74. package/dist/Components/Select/composables/useSelect.d.ts +0 -1
  75. package/dist/Components/Select/composables/useSelect.js +0 -1
  76. package/dist/Components/Step/Step.js +5 -0
  77. package/dist/Components/Step/Step.vue.d.ts +11 -0
  78. package/dist/Components/Step/Step.vue_vue_type_script_setup_true_lang.js +32 -0
  79. package/dist/Components/Step/composables/useStep.d.ts +56 -0
  80. package/dist/Components/Step/composables/useStep.js +162 -0
  81. package/dist/Components/Step/index.d.ts +3 -0
  82. package/dist/Components/Step/index.js +3 -0
  83. package/dist/Components/Step/step.types.d.ts +160 -0
  84. package/dist/Components/Stepper/Stepper.js +5 -0
  85. package/dist/Components/Stepper/Stepper.vue.d.ts +24 -0
  86. package/dist/Components/Stepper/Stepper.vue_vue_type_script_setup_true_lang.js +33 -0
  87. package/dist/Components/Stepper/composables/useStepper.d.ts +18 -0
  88. package/dist/Components/Stepper/composables/useStepper.js +91 -0
  89. package/dist/Components/Stepper/index.d.ts +4 -0
  90. package/dist/Components/Stepper/index.js +4 -0
  91. package/dist/Components/Stepper/stepper.types.d.ts +93 -0
  92. package/dist/Components/Stepper/stepperInjectionKey.d.ts +77 -0
  93. package/dist/Components/Stepper/stepperInjectionKey.js +4 -0
  94. package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +0 -1
  95. package/dist/Components/TimePanel/composables/useTimePanel.d.ts +1 -1
  96. package/dist/Components/TimePanel/composables/useTimePanel.js +75 -75
  97. package/dist/Components/TimePanel/index.d.ts +1 -1
  98. package/dist/Components/TimePanel/timePanel.types.d.ts +1 -17
  99. package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +10 -13
  100. package/dist/Components/TimePicker/composables/useTimePicker.d.ts +1 -5
  101. package/dist/Components/TimePicker/composables/useTimePicker.js +12 -17
  102. package/dist/Components/TimePicker/index.d.ts +1 -1
  103. package/dist/Components/TimePicker/timePicker.types.d.ts +1 -24
  104. package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +13 -18
  105. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +1 -5
  106. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +27 -32
  107. package/dist/Components/TimeRangePicker/index.d.ts +1 -1
  108. package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +1 -24
  109. package/dist/index.d.ts +20 -12
  110. package/dist/index.js +88 -80
  111. package/docs/README.md +3 -0
  112. package/docs/components/Autocomplete.md +1 -1
  113. package/docs/components/BridgeUIProvider.md +9 -11
  114. package/docs/components/Calendar.md +2 -1
  115. package/docs/components/CalendarDate.md +2 -1
  116. package/docs/components/CalendarMonth.md +2 -1
  117. package/docs/components/CalendarRange.md +2 -1
  118. package/docs/components/CalendarYear.md +2 -1
  119. package/docs/components/ColorField.md +93 -0
  120. package/docs/components/ColorPicker.md +78 -0
  121. package/docs/components/DatePicker.md +2 -1
  122. package/docs/components/DateRangePicker.md +2 -1
  123. package/docs/components/DateTimePicker.md +2 -1
  124. package/docs/components/DateTimeRangePicker.md +2 -1
  125. package/docs/components/FieldOverlay.md +1 -1
  126. package/docs/components/Select.md +1 -1
  127. package/docs/components/Stepper.md +60 -0
  128. package/docs/components/TimePanel.md +2 -1
  129. package/docs/components/TimePicker.md +2 -1
  130. package/docs/components/TimeRangePicker.md +2 -1
  131. package/docs/examples/icon-fontawesome.ts +2 -0
  132. package/docs/examples/icon-heroicons.ts +2 -0
  133. package/docs/examples/icon-lucide.ts +2 -0
  134. package/docs/examples/icon-phosphor.ts +2 -0
  135. package/docs/examples/icon-tabler.ts +2 -0
  136. package/package.json +2 -2
@@ -0,0 +1,253 @@
1
+ import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
+ import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
3
+ import { FIELD_OVERLAY_INJECTION_KEY as i } from "../../FieldOverlay/fieldOverlayInjectionKey.js";
4
+ import { computed as a, inject as o, ref as s, toValue as c, useAttrs as ee, watch as te } from "vue";
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 g, saturationValueFromPointer as _, toCssRgba as v, unitFromPointer as y } from "@bridge-ui/core/Domain";
7
+ import { colorPickerRoundedProps as b, colorPickerSizeProps as re } from "@bridge-ui/core/Tokens";
8
+ import { cn as x, mergeBridgeUILayeredClasses as S, splitComponentProps as ie } from "@bridge-ui/core/Utils";
9
+ //#region src/Components/ColorPicker/composables/useColorPicker.ts
10
+ var ae = [
11
+ "fill",
12
+ "alpha",
13
+ "value",
14
+ "format",
15
+ "classes",
16
+ "rounded",
17
+ "disabled",
18
+ "readOnly",
19
+ "swatches",
20
+ "showFooter",
21
+ "customProps",
22
+ "defaultValue"
23
+ ];
24
+ function C(e) {
25
+ return h(e) ?? f;
26
+ }
27
+ function w(f, w, T) {
28
+ let oe = ee(), E = o(i, {
29
+ apply: () => void 0,
30
+ cancel: () => void 0
31
+ }), D = e(), O = a(() => ie({
32
+ bridgeKeys: ae,
33
+ props: {
34
+ ...oe,
35
+ ...c(f)
36
+ }
37
+ })), { merged: k, entry: A } = n({
38
+ libDefaults: w,
39
+ componentName: "ColorPicker",
40
+ props: () => O.value.componentProps
41
+ }), j = a(() => k.value.customProps), M = a(() => u(O.value.inheritedAttrs, [
42
+ "onApply",
43
+ "onCancel",
44
+ "onChange"
45
+ ])), N = r({
46
+ entry: A,
47
+ props: () => O.value.componentProps
48
+ }), P = a(() => c(f)), F = a(() => P.value.value !== void 0), I = s(k.value.defaultValue ?? null), L = a(() => F.value ? P.value.value ?? null : I.value), R = a(() => k.value.format ?? d), z = s(C(L.value));
49
+ te(() => [L.value, k.value.showFooter], ([e, t]) => {
50
+ t && (z.value = C(e));
51
+ });
52
+ let B = a(() => k.value.showFooter ? z.value : C(L.value)), V = a(() => g(k.value.alpha, R.value)), H = a(() => m(B.value, R.value)), U = a(() => v(B.value)), W = a(() => ne(B.value.h)), G = a(() => v({
53
+ ...B.value,
54
+ a: 1
55
+ })), K = a(() => {
56
+ let e = S(re, A.value?.tokens?.size);
57
+ return l(e, ["md", "swatch"]) ?? "";
58
+ }), q = a(() => {
59
+ let e = S(b, A.value?.tokens?.rounded);
60
+ return l(e, k.value.rounded ?? "md") ?? "";
61
+ }), J = a(() => (k.value.swatches ?? []).filter((e) => h(e))), Y = a(() => !k.value.disabled && !k.value.readOnly), X = (e) => {
62
+ F.value || (I.value = e), T("change", e);
63
+ }, Z = (e) => {
64
+ if (k.value.showFooter) {
65
+ z.value = e;
66
+ return;
67
+ }
68
+ X(m(e, R.value));
69
+ }, Q = (e) => {
70
+ Z({
71
+ ...B.value,
72
+ ...e
73
+ });
74
+ }, se = (e) => {
75
+ let t = h(e);
76
+ !t || !Y.value || Z(t);
77
+ }, ce = () => {
78
+ X(m(z.value, R.value)), T("apply"), E.apply();
79
+ }, le = () => {
80
+ z.value = C(L.value), T("cancel"), E.cancel();
81
+ }, ue = (e) => {
82
+ if (!Y.value) return;
83
+ let t = e.currentTarget.getBoundingClientRect(), n = _(e.clientX, e.clientY, t);
84
+ Q(n);
85
+ }, de = (e) => {
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) => ({
94
+ onPointerdown: (t) => {
95
+ t.preventDefault(), t.currentTarget.setPointerCapture(t.pointerId), e(t);
96
+ },
97
+ onPointermove: (t) => {
98
+ t.currentTarget.hasPointerCapture(t.pointerId) && e(t);
99
+ }
100
+ }), pe = (e) => {
101
+ if (!Y.value) return;
102
+ let t = e.shiftKey ? 10 : 1;
103
+ e.key === "ArrowLeft" ? (e.preventDefault(), Q({ s: B.value.s - t })) : e.key === "ArrowRight" ? (e.preventDefault(), Q({ s: B.value.s + t })) : e.key === "ArrowDown" ? (e.preventDefault(), Q({ v: B.value.v - t })) : e.key === "ArrowUp" && (e.preventDefault(), Q({ v: B.value.v + t }));
104
+ }, me = (e) => {
105
+ if (!Y.value) return;
106
+ let t = e.shiftKey ? 10 : 1;
107
+ e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), Q({ h: B.value.h - t })) : (e.key === "ArrowRight" || e.key === "ArrowUp") && (e.preventDefault(), Q({ h: B.value.h + t }));
108
+ }, he = (e) => {
109
+ if (!Y.value) return;
110
+ let t = e.shiftKey ? .1 : .01;
111
+ e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), Q({ a: B.value.a - t })) : (e.key === "ArrowRight" || e.key === "ArrowUp") && (e.preventDefault(), Q({ a: B.value.a + t }));
112
+ }, ge = a(() => t(j.value?.root, M.value, x({
113
+ "flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-900": !0,
114
+ "w-full": k.value.fill,
115
+ "w-72": !k.value.fill,
116
+ [q.value]: !0,
117
+ [N.value.root ?? ""]: !0
118
+ }))), _e = a(() => x({ "flex flex-col gap-3 p-3": !0 })), ve = a(() => t(j.value?.area, {
119
+ ...$(ue),
120
+ role: "slider",
121
+ onKeydown: pe,
122
+ tabindex: Y.value ? 0 : -1,
123
+ style: { backgroundColor: W.value },
124
+ "aria-label": D("Saturation and brightness"),
125
+ "aria-valuetext": `Saturation ${Math.round(B.value.s)}%, Brightness ${Math.round(B.value.v)}%`
126
+ }, x({
127
+ "relative h-40 w-full cursor-crosshair overflow-hidden touch-none": !0,
128
+ [q.value]: !0,
129
+ "cursor-not-allowed": !Y.value,
130
+ [N.value.area ?? ""]: !0
131
+ }))), ye = a(() => ({
132
+ "aria-hidden": !0,
133
+ style: {
134
+ left: `${B.value.s}%`,
135
+ top: `${100 - B.value.v}%`
136
+ },
137
+ 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
+ })), be = a(() => t(j.value?.hue, {
139
+ ...$(de),
140
+ role: "slider",
141
+ "aria-valuemin": 0,
142
+ "aria-valuemax": 360,
143
+ onKeydown: me,
144
+ "aria-label": D("Hue"),
145
+ tabindex: Y.value ? 0 : -1,
146
+ "aria-valuenow": Math.round(B.value.h),
147
+ style: { backgroundImage: "linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)" }
148
+ }, x({
149
+ "relative h-3 w-full cursor-pointer touch-none": !0,
150
+ "rounded-full": !0,
151
+ "cursor-not-allowed": !Y.value,
152
+ [N.value.hue ?? ""]: !0
153
+ }))), xe = a(() => ({
154
+ "aria-hidden": !0,
155
+ style: {
156
+ backgroundColor: W.value,
157
+ left: `${B.value.h / 360 * 100}%`
158
+ },
159
+ 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
+ })), Se = a(() => t(j.value?.alpha, {
161
+ ...$(fe),
162
+ role: "slider",
163
+ "aria-valuemin": 0,
164
+ "aria-valuemax": 100,
165
+ onKeydown: he,
166
+ tabindex: Y.value ? 0 : -1,
167
+ "aria-label": D("Alpha"),
168
+ "aria-valuenow": Math.round(B.value.a * 100)
169
+ }, x({
170
+ "relative h-3 w-full cursor-pointer overflow-hidden touch-none": !0,
171
+ "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
+ "rounded-full": !0,
173
+ "cursor-not-allowed": !Y.value,
174
+ [N.value.alpha ?? ""]: !0
175
+ }))), Ce = a(() => ({
176
+ "aria-hidden": !0,
177
+ class: "pointer-events-none absolute inset-0",
178
+ style: { backgroundImage: `linear-gradient(to right, transparent, ${G.value})` }
179
+ })), we = a(() => ({
180
+ "aria-hidden": !0,
181
+ style: {
182
+ backgroundColor: U.value,
183
+ left: `${B.value.a * 100}%`
184
+ },
185
+ 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
+ })), Te = a(() => t(j.value?.preview, {}, x({
187
+ "flex items-center gap-2": !0,
188
+ [N.value.preview ?? ""]: !0
189
+ }))), Ee = a(() => ({
190
+ "aria-hidden": !0,
191
+ class: x({
192
+ "relative shrink-0 overflow-hidden": !0,
193
+ "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
+ [K.value]: !0,
195
+ [q.value]: !0
196
+ })
197
+ })), De = a(() => ({
198
+ class: "absolute inset-0",
199
+ style: { backgroundColor: U.value }
200
+ })), Oe = a(() => t(j.value?.swatches, {}, x({
201
+ "flex flex-wrap gap-2": !0,
202
+ [N.value.swatches ?? ""]: !0
203
+ })));
204
+ return {
205
+ merged: k,
206
+ hueBind: be,
207
+ rootBind: ge,
208
+ areaBind: ve,
209
+ cssColor: U,
210
+ alphaBind: Se,
211
+ showAlpha: V,
212
+ footerBind: a(() => t(j.value?.footer, {}, x({
213
+ "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
+ [N.value.footer ?? ""]: !0
215
+ }))),
216
+ showFooter: a(() => !!k.value.showFooter),
217
+ previewBind: Te,
218
+ contentBind: _e,
219
+ handleApply: ce,
220
+ swatchesBind: Oe,
221
+ handleCancel: le,
222
+ hueThumbBind: xe,
223
+ areaThumbBind: ye,
224
+ alphaFillBind: Ce,
225
+ formattedValue: H,
226
+ alphaThumbBind: we,
227
+ presetSwatches: J,
228
+ previewSwatchBind: Ee,
229
+ handleSwatchClick: se,
230
+ swatchButtonClass: a(() => x({
231
+ "relative shrink-0 overflow-hidden": !0,
232
+ "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,
233
+ [K.value]: !0,
234
+ [q.value]: !0,
235
+ "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": Y.value,
237
+ "cursor-not-allowed opacity-50": !Y.value
238
+ })),
239
+ swatchSelectedClass: a(() => "ring-2 ring-dark-500 ring-offset-2 ring-offset-white dark:ring-dark-400 dark:ring-offset-dark-900"),
240
+ previewSwatchFillBind: De,
241
+ applyLabel: a(() => D("Apply")),
242
+ cancelLabel: a(() => D("Cancel")),
243
+ applyButtonProps: a(() => j.value?.applyButton),
244
+ cancelButtonProps: a(() => j.value?.cancelButton),
245
+ isSwatchSelected: (e) => p(e, H.value),
246
+ swatchCss: (e) => {
247
+ let t = h(e);
248
+ return t ? v(t) : void 0;
249
+ }
250
+ };
251
+ }
252
+ //#endregion
253
+ export { w as useColorPicker };
@@ -0,0 +1,3 @@
1
+ export type { ColorPickerClasses, ColorPickerCustomProps, ColorPickerEmits, ColorPickerOwnProps, ColorPickerProps, ColorPickerRoundedOverrides, ColorPickerSlots, } from './colorPicker.types';
2
+ export { default as ColorPicker } from './ColorPicker.vue';
3
+ export { useColorPicker } from './composables/useColorPicker';
@@ -0,0 +1,3 @@
1
+ import { useColorPicker as e } from "./composables/useColorPicker.js";
2
+ import t from "./ColorPicker.js";
3
+ export { t as ColorPicker, e as useColorPicker };
@@ -34,7 +34,6 @@ var g = /*@__PURE__*/ s({
34
34
  },
35
35
  startOfWeek: {},
36
36
  timeZone: {},
37
- tokens: {},
38
37
  value: {}
39
38
  },
40
39
  emits: [
@@ -43,7 +42,7 @@ var g = /*@__PURE__*/ s({
43
42
  "change"
44
43
  ],
45
44
  setup(s, { emit: g }) {
46
- let { merged: _, rootBind: v, footerBind: y, showFooter: b, applyLabel: x, handleApply: S, cancelLabel: C, displayValue: w, handleCancel: T, calendarTokens: E, applyButtonProps: D, cancelButtonProps: O, handleCalendarChange: k } = n(s, {
45
+ let { merged: _, rootBind: v, footerBind: y, showFooter: b, applyLabel: x, handleApply: S, cancelLabel: C, displayValue: w, handleCancel: T, applyButtonProps: E, cancelButtonProps: D, handleCalendarChange: O } = n(s, {
47
46
  rounded: "md",
48
47
  startOfWeek: 0,
49
48
  color: "primary"
@@ -54,7 +53,6 @@ var g = /*@__PURE__*/ s({
54
53
  error: m(_).error,
55
54
  range: m(_).range,
56
55
  value: m(w),
57
- tokens: m(E),
58
56
  rounded: m(_).rounded,
59
57
  "max-date": m(_).maxDate,
60
58
  "min-date": m(_).minDate,
@@ -64,7 +62,7 @@ var g = /*@__PURE__*/ s({
64
62
  "time-zone": m(_).timeZone,
65
63
  "hide-years": m(_).hideYears,
66
64
  "hide-months": m(_).hideMonths,
67
- onChange: m(k),
65
+ onChange: m(O),
68
66
  "default-view": m(_).defaultView,
69
67
  "start-of-week": m(_).startOfWeek,
70
68
  "disable-dates": m(_).disableDates,
@@ -81,7 +79,6 @@ var g = /*@__PURE__*/ s({
81
79
  "error",
82
80
  "range",
83
81
  "value",
84
- "tokens",
85
82
  "rounded",
86
83
  "max-date",
87
84
  "min-date",
@@ -106,10 +103,10 @@ var g = /*@__PURE__*/ s({
106
103
  variant: "flat",
107
104
  color: "secondary",
108
105
  onClick: m(T)
109
- }, m(O)), {
106
+ }, m(D)), {
110
107
  default: h(() => [a(p(m(C)), 1)]),
111
108
  _: 1
112
- }, 16, ["onClick"]), o(m(e), l({ color: "primary" }, m(D), { onClick: m(S) }), {
109
+ }, 16, ["onClick"]), o(m(e), l({ color: "primary" }, m(E), { onClick: m(S) }), {
113
110
  default: h(() => [a(p(m(x)), 1)]),
114
111
  _: 1
115
112
  }, 16, ["onClick"])])], 16)) : r("", !0)], 16));
@@ -6,17 +6,12 @@ type DatePickerLibDefaults = LibDefaultsShape<DatePickerOwnProps, "color" | "rou
6
6
  type DatePickerMerged = MergeLibDefaults<DatePickerOwnProps, DatePickerLibDefaults>;
7
7
  export declare function useDatePicker(props: MaybeRefOrGetter<DatePickerOwnProps>, libDefaults: DatePickerLibDefaults, emit: SetupContext<DatePickerEmits>["emit"]): {
8
8
  merged: import('vue').ComputedRef<DatePickerMerged>;
9
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DatePickerOwnProps, "error" | "color" | "fill" | "value" | "classes" | "tokens" | "showFooter" | "customProps" | "rounded" | "disabled" | "multiple" | "range" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "hideOutsideDays" | "hideWeekdays" | "maxDate" | "minDate" | "startOfWeek" | "timeZone" | "defaultView" | "hideMonths" | "hideYears">>>>;
9
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DatePickerOwnProps, "error" | "color" | "fill" | "value" | "classes" | "showFooter" | "customProps" | "rounded" | "disabled" | "multiple" | "range" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "hideOutsideDays" | "hideWeekdays" | "maxDate" | "minDate" | "startOfWeek" | "timeZone" | "defaultView" | "hideMonths" | "hideYears">>>>;
10
10
  footerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
11
11
  showFooter: import('vue').ComputedRef<boolean>;
12
12
  handleApply: () => void;
13
13
  displayValue: import('vue').ComputedRef<DatePickerModel>;
14
14
  handleCancel: () => void;
15
- calendarTokens: import('vue').ComputedRef<{
16
- day: Partial<import('@bridge-ui/core/Tokens').CalendarDay> | undefined;
17
- color: Record<string, Partial<import('@bridge-ui/core/Tokens').CalendarColorItem>> | undefined;
18
- rounded: Record<string, string> | undefined;
19
- }>;
20
15
  handleCalendarChange: (next: DatePickerModel) => void;
21
16
  applyLabel: import('vue').ComputedRef<string>;
22
17
  cancelLabel: import('vue').ComputedRef<string>;
@@ -6,7 +6,33 @@ import { get as d, isNil as f, omit as p } from "es-toolkit/compat";
6
6
  import { menuRoundedProps as m } from "@bridge-ui/core/Tokens";
7
7
  import { cn as h, splitComponentProps as g } from "@bridge-ui/core/Utils";
8
8
  //#region src/Components/DatePicker/composables/useDatePicker.ts
9
- var _ = /* @__PURE__ */ "fill.color.error.range.value.tokens.classes.maxDate.minDate.rounded.disabled.multiple.readOnly.timeZone.hideYears.hideMonths.showFooter.customProps.defaultView.startOfWeek.defaultValue.disableDates.disableYears.hideWeekdays.disableMonths.hideOutsideDays".split(".");
9
+ var _ = [
10
+ "fill",
11
+ "color",
12
+ "error",
13
+ "range",
14
+ "value",
15
+ "classes",
16
+ "maxDate",
17
+ "minDate",
18
+ "rounded",
19
+ "disabled",
20
+ "multiple",
21
+ "readOnly",
22
+ "timeZone",
23
+ "hideYears",
24
+ "hideMonths",
25
+ "showFooter",
26
+ "customProps",
27
+ "defaultView",
28
+ "startOfWeek",
29
+ "defaultValue",
30
+ "disableDates",
31
+ "disableYears",
32
+ "hideWeekdays",
33
+ "disableMonths",
34
+ "hideOutsideDays"
35
+ ];
10
36
  function v(v, y, b) {
11
37
  let x = l(), S = o(i, {
12
38
  apply: () => void 0,
@@ -32,11 +58,7 @@ function v(v, y, b) {
32
58
  u(() => [N.value, T.value.showFooter], ([e, t]) => {
33
59
  t && (P.value = e);
34
60
  });
35
- let F = a(() => T.value.showFooter ? P.value : N.value), I = a(() => ({
36
- day: T.value.tokens?.calendar?.day ?? T.value.tokens?.day,
37
- color: T.value.tokens?.calendar?.color ?? T.value.tokens?.color,
38
- rounded: T.value.tokens?.calendar?.rounded ?? T.value.tokens?.rounded
39
- })), L = (e) => {
61
+ let F = a(() => T.value.showFooter ? P.value : N.value), I = (e) => {
40
62
  j.value || (M.value = e), b("change", e);
41
63
  };
42
64
  return {
@@ -57,19 +79,18 @@ function v(v, y, b) {
57
79
  }))),
58
80
  showFooter: a(() => !!T.value.showFooter),
59
81
  handleApply: () => {
60
- L(P.value), b("apply"), S.apply();
82
+ I(P.value), b("apply"), S.apply();
61
83
  },
62
84
  displayValue: F,
63
85
  handleCancel: () => {
64
86
  P.value = N.value, b("cancel"), S.cancel();
65
87
  },
66
- calendarTokens: I,
67
88
  handleCalendarChange: (e) => {
68
89
  if (T.value.showFooter) {
69
90
  P.value = e;
70
91
  return;
71
92
  }
72
- L(e);
93
+ I(e);
73
94
  },
74
95
  applyLabel: a(() => C("Apply")),
75
96
  cancelLabel: a(() => C("Cancel")),
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, Slot } from 'vue';
2
2
  import { DatePickerModel, DisableDatesInput, FieldOverlayFooterSlotProps, StartOfWeek } from '@bridge-ui/core/Domain';
3
- import { CalendarColor, CalendarColorItem, CalendarDay, CalendarRounded } from '@bridge-ui/core/Tokens';
3
+ import { CalendarColor, CalendarRounded } from '@bridge-ui/core/Tokens';
4
4
  import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
5
5
  import { ButtonProps } from '../Button/button.types';
6
6
  import { CalendarView } from '../Calendar/calendar.types';
@@ -210,12 +210,6 @@ export interface DatePickerOwnProps {
210
210
  * @default undefined
211
211
  */
212
212
  timeZone?: string;
213
- /**
214
- * Token overrides.
215
- *
216
- * @default undefined
217
- */
218
- tokens?: DatePickerTokens;
219
213
  /**
220
214
  * Controlled value.
221
215
  *
@@ -238,26 +232,4 @@ export interface DatePickerSlots {
238
232
  */
239
233
  footer?: Slot<FieldOverlayFooterSlotProps>;
240
234
  }
241
- export interface DatePickerTokens {
242
- /**
243
- * Nested calendar token overrides.
244
- */
245
- calendar?: {
246
- color?: Record<string, Partial<CalendarColorItem>>;
247
- day?: Partial<CalendarDay>;
248
- rounded?: Record<string, string>;
249
- };
250
- /**
251
- * Color token map overrides.
252
- */
253
- color?: Record<string, Partial<CalendarColorItem>>;
254
- /**
255
- * Day chrome overrides.
256
- */
257
- day?: Partial<CalendarDay>;
258
- /**
259
- * Border radius token map overrides.
260
- */
261
- rounded?: Record<string, string>;
262
- }
263
235
  export type DatePickerProps = MergeHtmlProps<DatePickerOwnProps, HTMLAttributes>;
@@ -1,3 +1,3 @@
1
1
  export { useDatePicker } from './composables/useDatePicker';
2
- export type { DatePickerClasses, DatePickerColorOverrides, DatePickerCustomProps, DatePickerEmits, DatePickerOwnProps, DatePickerProps, DatePickerRoundedOverrides, DatePickerSlots, DatePickerTokens, } from './datePicker.types';
2
+ export type { DatePickerClasses, DatePickerColorOverrides, DatePickerCustomProps, DatePickerEmits, DatePickerOwnProps, DatePickerProps, DatePickerRoundedOverrides, DatePickerSlots, } from './datePicker.types';
3
3
  export { default as DatePicker } from './DatePicker.vue';
@@ -32,7 +32,6 @@ var g = /*@__PURE__*/ s({
32
32
  },
33
33
  startOfWeek: {},
34
34
  timeZone: {},
35
- tokens: {},
36
35
  value: {}
37
36
  },
38
37
  emits: [
@@ -41,7 +40,7 @@ var g = /*@__PURE__*/ s({
41
40
  "change"
42
41
  ],
43
42
  setup(s, { emit: g }) {
44
- let { merged: _, rootBind: v, footerBind: y, showFooter: b, applyLabel: x, handleApply: S, cancelLabel: C, displayValue: w, handleCancel: T, calendarTokens: E, applyButtonProps: D, cancelButtonProps: O, handleCalendarChange: k } = n(s, {
43
+ let { merged: _, rootBind: v, footerBind: y, showFooter: b, applyLabel: x, handleApply: S, cancelLabel: C, displayValue: w, handleCancel: T, applyButtonProps: E, cancelButtonProps: D, handleCalendarChange: O } = n(s, {
45
44
  rounded: "md",
46
45
  startOfWeek: 0,
47
46
  color: "primary",
@@ -52,7 +51,6 @@ var g = /*@__PURE__*/ s({
52
51
  color: m(_).color,
53
52
  error: m(_).error,
54
53
  value: m(w),
55
- tokens: m(E),
56
54
  rounded: m(_).rounded,
57
55
  "max-date": m(_).maxDate,
58
56
  "min-date": m(_).minDate,
@@ -62,7 +60,7 @@ var g = /*@__PURE__*/ s({
62
60
  "hide-years": m(_).hideYears,
63
61
  "hide-months": m(_).hideMonths,
64
62
  orientation: m(_).orientation,
65
- onChange: m(k),
63
+ onChange: m(O),
66
64
  "start-of-week": m(_).startOfWeek,
67
65
  "disable-dates": m(_).disableDates,
68
66
  "hide-weekdays": m(_).hideWeekdays,
@@ -77,7 +75,6 @@ var g = /*@__PURE__*/ s({
77
75
  "color",
78
76
  "error",
79
77
  "value",
80
- "tokens",
81
78
  "rounded",
82
79
  "max-date",
83
80
  "min-date",
@@ -101,10 +98,10 @@ var g = /*@__PURE__*/ s({
101
98
  variant: "flat",
102
99
  color: "secondary",
103
100
  onClick: m(T)
104
- }, m(O)), {
101
+ }, m(D)), {
105
102
  default: h(() => [a(p(m(C)), 1)]),
106
103
  _: 1
107
- }, 16, ["onClick"]), o(m(e), l({ color: "primary" }, m(D), { onClick: m(S) }), {
104
+ }, 16, ["onClick"]), o(m(e), l({ color: "primary" }, m(E), { onClick: m(S) }), {
108
105
  default: h(() => [a(p(m(x)), 1)]),
109
106
  _: 1
110
107
  }, 16, ["onClick"])])], 16)) : r("", !0)], 16));
@@ -6,17 +6,12 @@ type DateRangePickerLibDefaults = LibDefaultsShape<DateRangePickerOwnProps, "col
6
6
  type DateRangePickerMerged = MergeLibDefaults<DateRangePickerOwnProps, DateRangePickerLibDefaults>;
7
7
  export declare function useDateRangePicker(props: MaybeRefOrGetter<DateRangePickerOwnProps>, libDefaults: DateRangePickerLibDefaults, emit: SetupContext<DateRangePickerEmits>["emit"]): {
8
8
  merged: import('vue').ComputedRef<DateRangePickerMerged>;
9
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DateRangePickerOwnProps, "error" | "color" | "fill" | "orientation" | "value" | "classes" | "tokens" | "showFooter" | "customProps" | "rounded" | "disabled" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "hideOutsideDays" | "hideWeekdays" | "maxDate" | "minDate" | "startOfWeek" | "timeZone" | "hideMonths" | "hideYears">>>>;
9
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Partial<Omit<DateRangePickerOwnProps, "error" | "color" | "fill" | "orientation" | "value" | "classes" | "showFooter" | "customProps" | "rounded" | "disabled" | "defaultValue" | "readOnly" | "disableDates" | "disableMonths" | "disableYears" | "hideOutsideDays" | "hideWeekdays" | "maxDate" | "minDate" | "startOfWeek" | "timeZone" | "hideMonths" | "hideYears">>>>;
10
10
  footerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
11
11
  showFooter: import('vue').ComputedRef<boolean>;
12
12
  handleApply: () => void;
13
13
  displayValue: import('vue').ComputedRef<[Date, Date] | null>;
14
14
  handleCancel: () => void;
15
- calendarTokens: import('vue').ComputedRef<{
16
- day: Partial<import('@bridge-ui/core/Tokens').CalendarDay> | undefined;
17
- color: Record<string, Partial<import('@bridge-ui/core/Tokens').CalendarColorItem>> | undefined;
18
- rounded: Record<string, string> | undefined;
19
- }>;
20
15
  handleCalendarChange: (next: null | DateRangeValue) => void;
21
16
  applyLabel: import('vue').ComputedRef<string>;
22
17
  cancelLabel: import('vue').ComputedRef<string>;
@@ -11,7 +11,6 @@ var _ = [
11
11
  "color",
12
12
  "error",
13
13
  "value",
14
- "tokens",
15
14
  "classes",
16
15
  "maxDate",
17
16
  "minDate",
@@ -57,11 +56,7 @@ function v(v, y, b) {
57
56
  u(() => [N.value, T.value.showFooter], ([e, t]) => {
58
57
  t && (P.value = e);
59
58
  });
60
- let F = a(() => T.value.showFooter ? P.value : N.value), I = a(() => ({
61
- day: T.value.tokens?.calendar?.day ?? T.value.tokens?.day,
62
- color: T.value.tokens?.calendar?.color ?? T.value.tokens?.color,
63
- rounded: T.value.tokens?.calendar?.rounded ?? T.value.tokens?.rounded
64
- })), L = (e) => {
59
+ let F = a(() => T.value.showFooter ? P.value : N.value), I = (e) => {
65
60
  j.value || (M.value = e), b("change", e);
66
61
  };
67
62
  return {
@@ -82,19 +77,18 @@ function v(v, y, b) {
82
77
  }))),
83
78
  showFooter: a(() => !!T.value.showFooter),
84
79
  handleApply: () => {
85
- L(P.value), b("apply"), S.apply();
80
+ I(P.value), b("apply"), S.apply();
86
81
  },
87
82
  displayValue: F,
88
83
  handleCancel: () => {
89
84
  P.value = N.value, b("cancel"), S.cancel();
90
85
  },
91
- calendarTokens: I,
92
86
  handleCalendarChange: (e) => {
93
87
  if (T.value.showFooter) {
94
88
  P.value = e;
95
89
  return;
96
90
  }
97
- L(e);
91
+ I(e);
98
92
  },
99
93
  applyLabel: a(() => C("Apply")),
100
94
  cancelLabel: a(() => C("Cancel")),
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, Slot } from 'vue';
2
2
  import { DateRangeValue, DisableDatesInput, FieldOverlayFooterSlotProps, StartOfWeek } from '@bridge-ui/core/Domain';
3
- import { CalendarColor, CalendarColorItem, CalendarDay, CalendarRounded } from '@bridge-ui/core/Tokens';
3
+ import { CalendarColor, CalendarRounded } from '@bridge-ui/core/Tokens';
4
4
  import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
5
5
  import { ButtonProps } from '../Button/button.types';
6
6
  import { CalendarDateDayCell } from '../CalendarDate/calendarDate.types';
@@ -195,12 +195,6 @@ export interface DateRangePickerOwnProps {
195
195
  * @default undefined
196
196
  */
197
197
  timeZone?: string;
198
- /**
199
- * Token overrides.
200
- *
201
- * @default undefined
202
- */
203
- tokens?: DateRangePickerTokens;
204
198
  /**
205
199
  * Controlled value.
206
200
  *
@@ -223,26 +217,4 @@ export interface DateRangePickerSlots {
223
217
  */
224
218
  footer?: Slot<FieldOverlayFooterSlotProps>;
225
219
  }
226
- export interface DateRangePickerTokens {
227
- /**
228
- * Nested calendar token overrides.
229
- */
230
- calendar?: {
231
- color?: Record<string, Partial<CalendarColorItem>>;
232
- day?: Partial<CalendarDay>;
233
- rounded?: Record<string, string>;
234
- };
235
- /**
236
- * Color token map overrides.
237
- */
238
- color?: Record<string, Partial<CalendarColorItem>>;
239
- /**
240
- * Day chrome overrides.
241
- */
242
- day?: Partial<CalendarDay>;
243
- /**
244
- * Border radius token map overrides.
245
- */
246
- rounded?: Record<string, string>;
247
- }
248
220
  export type DateRangePickerProps = MergeHtmlProps<DateRangePickerOwnProps, HTMLAttributes>;
@@ -1,3 +1,3 @@
1
1
  export { useDateRangePicker } from './composables/useDateRangePicker';
2
- export type { DateRangePickerClasses, DateRangePickerColorOverrides, DateRangePickerCustomProps, DateRangePickerEmits, DateRangePickerOwnProps, DateRangePickerProps, DateRangePickerRoundedOverrides, DateRangePickerSlots, DateRangePickerTokens, } from './dateRangePicker.types';
2
+ export type { DateRangePickerClasses, DateRangePickerColorOverrides, DateRangePickerCustomProps, DateRangePickerEmits, DateRangePickerOwnProps, DateRangePickerProps, DateRangePickerRoundedOverrides, DateRangePickerSlots, } from './dateRangePicker.types';
3
3
  export { default as DateRangePicker } from './DateRangePicker.vue';