@leavepulse/ui 0.78.1 → 0.78.3

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 (147) hide show
  1. package/dist/chunks/{DropzoneLinkField-CLLhd3WB.js → DropzoneLinkField-CyE7TJ5f.js} +1 -1
  2. package/dist/chunks/LpAddressInput-ft8fQOGx.js +401 -0
  3. package/dist/chunks/{LpAppShell-BKbYCHkx.js → LpAppShell-DRHoQtr-.js} +34 -17
  4. package/dist/chunks/LpAutocomplete-CrZbd0uv.js +310 -0
  5. package/dist/chunks/LpCheckbox-CCWCwD0y.js +129 -0
  6. package/dist/chunks/{LpCodeDisplay-D3BUAhV1.js → LpCodeDisplay-D59uPwRb.js} +1 -1
  7. package/dist/chunks/LpColorPicker-BONURBFN.js +574 -0
  8. package/dist/chunks/LpDatePicker-C2AOtxgF.js +171 -0
  9. package/dist/chunks/{LpDateRangePicker-CNQXdTVv.js → LpDateRangePicker-CiXdIAyh.js} +43 -35
  10. package/dist/chunks/{LpFileTree-C-rJKzEQ.js → LpFileTree-CpNurwZp.js} +2 -2
  11. package/dist/chunks/{LpFileTreeNode-BgYn4U1J.js → LpFileTreeNode-DdF8Cq-s.js} +1 -1
  12. package/dist/chunks/{LpInput-D0O6dpuA.js → LpInput-CbI7z5fQ.js} +3 -4
  13. package/dist/chunks/{LpLogInspector-BdQlX6S-.js → LpLogInspector-CcSJSGan.js} +1 -1
  14. package/dist/chunks/{LpLogViewer-umCZBapN.js → LpLogViewer-CWu49Dko.js} +2 -2
  15. package/dist/chunks/{LpModalNav-gOi1Giz1.js → LpModalNav-DI3BW5ff.js} +1 -1
  16. package/dist/chunks/LpNumberField-C8LfUz_R.js +154 -0
  17. package/dist/chunks/LpOtpInput-B1X9l9no.js +140 -0
  18. package/dist/chunks/{LpPaletteTheme-BIXpZLGe.js → LpPaletteTheme-B-xuZiKK.js} +2 -2
  19. package/dist/chunks/{LpPasswordInput-D4HPhqfV.js → LpPasswordInput-Duc_3wPv.js} +1 -1
  20. package/dist/chunks/{LpPhoneInput-BSL7NX4z.js → LpPhoneInput-CctcRK9K.js} +124 -118
  21. package/dist/chunks/LpRadioGroup-DTM0nd9G.js +103 -0
  22. package/dist/chunks/LpRangeSlider-DJsEZXad.js +97 -0
  23. package/dist/chunks/LpRepeater-Czib3rmv.js +193 -0
  24. package/dist/chunks/{LpSecretField-B2roc4Iz.js → LpSecretField-BtlCk3IH.js} +1 -1
  25. package/dist/chunks/LpSegmented-sskrJKJJ.js +128 -0
  26. package/dist/chunks/LpSelect-JFZehOkd.js +515 -0
  27. package/dist/chunks/{LpSidebar-DDNJzb69.js → LpSidebar-CvRvVBTt.js} +1 -1
  28. package/dist/chunks/LpSlider-C4ilCtZX.js +76 -0
  29. package/dist/chunks/LpSwitch-DyAYTchz.js +122 -0
  30. package/dist/chunks/{LpTableFilter-B_XMOeAh.js → LpTableFilter-CJg5eIcV.js} +2 -2
  31. package/dist/chunks/{LpTagsInput-Dt0mteSj.js → LpTagsInput-CkNxpNYa.js} +4 -3
  32. package/dist/chunks/{LpTextarea-Co0b9PVx.js → LpTextarea-CFK_5QB8.js} +3 -2
  33. package/dist/chunks/{LpThemeStudio-ChU0_Ga8.js → LpThemeStudio-R-wohbCY.js} +2 -2
  34. package/dist/chunks/{LpThemeSwitcher-DmCZ21P_.js → LpThemeSwitcher-Bzy15MCP.js} +1 -1
  35. package/dist/chunks/LpTimeField-B5n0m8m0.js +115 -0
  36. package/dist/chunks/{LpTopologyCanvas-jqz1KCq2.js → LpTopologyCanvas-BNgw9RyZ.js} +2 -2
  37. package/dist/chunks/{LpWorkspaceSwitcher-BeNHCLd5.js → LpWorkspaceSwitcher-ugv-fyig.js} +1 -1
  38. package/dist/components/DropzoneLinkField.vue.js +1 -1
  39. package/dist/components/LpAddressInput.vue.d.ts +4 -0
  40. package/dist/components/LpAddressInput.vue.js +1 -1
  41. package/dist/components/LpAlert.vue.d.ts +3 -3
  42. package/dist/components/LpAppShell.vue.d.ts +19 -1
  43. package/dist/components/LpAppShell.vue.js +1 -1
  44. package/dist/components/LpAutocomplete.vue.d.ts +4 -0
  45. package/dist/components/LpAutocomplete.vue.js +1 -1
  46. package/dist/components/LpBadge.vue.d.ts +2 -2
  47. package/dist/components/LpChart.vue.d.ts +1 -1
  48. package/dist/components/LpCheckbox.vue.d.ts +4 -0
  49. package/dist/components/LpCheckbox.vue.js +1 -1
  50. package/dist/components/LpCodeDisplay.vue.js +1 -1
  51. package/dist/components/LpCollapse.vue.d.ts +1 -1
  52. package/dist/components/LpColorPicker.vue.d.ts +5 -3
  53. package/dist/components/LpColorPicker.vue.js +1 -1
  54. package/dist/components/LpDatePicker.vue.js +1 -1
  55. package/dist/components/LpDateRangePicker.vue.js +1 -1
  56. package/dist/components/LpDropzone.vue.js +1 -1
  57. package/dist/components/LpFileTree.vue.js +1 -1
  58. package/dist/components/LpFileTreeNode.vue.js +1 -1
  59. package/dist/components/LpImageEditor.vue.d.ts +1 -1
  60. package/dist/components/LpInput.vue.js +1 -1
  61. package/dist/components/LpLogInspector.vue.js +1 -1
  62. package/dist/components/LpLogViewer.vue.js +1 -1
  63. package/dist/components/LpModalNav.vue.js +1 -1
  64. package/dist/components/LpNumberField.vue.d.ts +4 -0
  65. package/dist/components/LpNumberField.vue.js +1 -1
  66. package/dist/components/LpOtpInput.vue.d.ts +4 -0
  67. package/dist/components/LpOtpInput.vue.js +1 -1
  68. package/dist/components/LpPaletteTheme.vue.js +1 -1
  69. package/dist/components/LpPasswordInput.vue.js +1 -1
  70. package/dist/components/LpPhoneInput.vue.d.ts +4 -0
  71. package/dist/components/LpPhoneInput.vue.js +1 -1
  72. package/dist/components/LpRadioGroup.vue.d.ts +4 -0
  73. package/dist/components/LpRadioGroup.vue.js +1 -1
  74. package/dist/components/LpRangeSlider.vue.d.ts +4 -0
  75. package/dist/components/LpRangeSlider.vue.js +1 -1
  76. package/dist/components/LpRepeater.vue.d.ts +2 -0
  77. package/dist/components/LpRepeater.vue.js +1 -1
  78. package/dist/components/LpScrollArea.vue.d.ts +1 -1
  79. package/dist/components/LpSecretField.vue.js +1 -1
  80. package/dist/components/LpSegmented.vue.d.ts +4 -0
  81. package/dist/components/LpSegmented.vue.js +1 -1
  82. package/dist/components/LpSelect.vue.d.ts +2 -0
  83. package/dist/components/LpSelect.vue.js +1 -1
  84. package/dist/components/LpShinyText.vue.d.ts +1 -1
  85. package/dist/components/LpSidebar.vue.d.ts +1 -1
  86. package/dist/components/LpSidebar.vue.js +1 -1
  87. package/dist/components/LpSlider.vue.d.ts +4 -0
  88. package/dist/components/LpSlider.vue.js +1 -1
  89. package/dist/components/LpSwitch.vue.d.ts +4 -0
  90. package/dist/components/LpSwitch.vue.js +1 -1
  91. package/dist/components/LpTable.vue.js +2 -2
  92. package/dist/components/LpTableFilter.vue.js +1 -1
  93. package/dist/components/LpTabs.vue.d.ts +1 -1
  94. package/dist/components/LpTagsInput.vue.js +1 -1
  95. package/dist/components/LpTextarea.vue.js +1 -1
  96. package/dist/components/LpThemeStudio.vue.js +1 -1
  97. package/dist/components/LpThemeSwitcher.vue.js +1 -1
  98. package/dist/components/LpTimeField.vue.d.ts +4 -0
  99. package/dist/components/LpTimeField.vue.js +1 -1
  100. package/dist/components/LpTopologyCanvas.vue.js +1 -1
  101. package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
  102. package/dist/components/calendar.d.ts +2 -0
  103. package/dist/composables/useField.d.ts +50 -0
  104. package/dist/composables/useField.js +31 -2
  105. package/dist/composables/useMergedClass.d.ts +6 -2
  106. package/dist/composables/useMergedClass.js +6 -6
  107. package/dist/index.js +34 -34
  108. package/package.json +1 -1
  109. package/src/components/LpAddressInput.vue +8 -4
  110. package/src/components/LpAppShell.vue +56 -18
  111. package/src/components/LpAutocomplete.vue +11 -5
  112. package/src/components/LpCheckbox.vue +8 -6
  113. package/src/components/LpColorPicker.vue +7 -4
  114. package/src/components/LpDatePicker.vue +8 -4
  115. package/src/components/LpDateRangePicker.vue +8 -4
  116. package/src/components/LpInput.vue +3 -4
  117. package/src/components/LpNumberField.vue +11 -6
  118. package/src/components/LpOtpInput.vue +8 -6
  119. package/src/components/LpPhoneInput.vue +11 -6
  120. package/src/components/LpRadioGroup.vue +9 -5
  121. package/src/components/LpRangeSlider.vue +8 -4
  122. package/src/components/LpRepeater.vue +16 -4
  123. package/src/components/LpSegmented.vue +8 -4
  124. package/src/components/LpSelect.vue +8 -7
  125. package/src/components/LpSlider.vue +8 -4
  126. package/src/components/LpSwitch.vue +8 -5
  127. package/src/components/LpTagsInput.vue +4 -3
  128. package/src/components/LpTextarea.vue +3 -2
  129. package/src/components/LpTimeField.vue +8 -6
  130. package/src/components/calendar.ts +2 -0
  131. package/src/composables/useField.ts +52 -0
  132. package/src/composables/useMergedClass.ts +11 -5
  133. package/dist/chunks/LpAddressInput-BSS49jpm.js +0 -393
  134. package/dist/chunks/LpAutocomplete-DkY6CSyD.js +0 -302
  135. package/dist/chunks/LpCheckbox-D6RuDW4X.js +0 -124
  136. package/dist/chunks/LpColorPicker-COHzV68R.js +0 -567
  137. package/dist/chunks/LpDatePicker-DwSDY0mt.js +0 -163
  138. package/dist/chunks/LpNumberField-Csg-1Zh_.js +0 -148
  139. package/dist/chunks/LpOtpInput-BRpLBbOD.js +0 -132
  140. package/dist/chunks/LpRadioGroup-BrazjLY_.js +0 -95
  141. package/dist/chunks/LpRangeSlider-fz61tzc-.js +0 -89
  142. package/dist/chunks/LpRepeater-BkJHSPI1.js +0 -180
  143. package/dist/chunks/LpSegmented-DbEJhbv-.js +0 -123
  144. package/dist/chunks/LpSelect-Y-iuSymW.js +0 -512
  145. package/dist/chunks/LpSlider-A4ixovgS.js +0 -68
  146. package/dist/chunks/LpSwitch-DnC2-0aV.js +0 -115
  147. package/dist/chunks/LpTimeField-DeOcKWJq.js +0 -110
@@ -1,10 +1,10 @@
1
1
  import { defineComponent, ref, computed, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, createTextVNode, toDisplayString, unref } from "vue";
2
2
  import { useLabels } from "../composables/useLpConfig.js";
3
3
  import { suppressPaletteDiscovery } from "../composables/usePaletteCommands.js";
4
- import { _ as _sfc_main$4 } from "./LpThemeStudio-ChU0_Ga8.js";
4
+ import { _ as _sfc_main$4 } from "./LpThemeStudio-R-wohbCY.js";
5
5
  import { _ as _sfc_main$2 } from "./LpThemeProvider-XK6ZeWAE.js";
6
6
  import { _ as _sfc_main$1 } from "./LpButton-DSHioIfD.js";
7
- import { _ as _sfc_main$3 } from "./LpInput-D0O6dpuA.js";
7
+ import { _ as _sfc_main$3 } from "./LpInput-CbI7z5fQ.js";
8
8
  const _hoisted_1 = { class: "flex min-w-0 flex-col gap-4" };
9
9
  const _hoisted_2 = { class: "sticky top-0 z-10 flex gap-2 border-b border-line bg-surface-overlay pb-3" };
10
10
  const _hoisted_3 = { class: "text-sm font-semibold" };
@@ -2,7 +2,7 @@ import { defineComponent, useModel, ref, openBlock, createBlock, mergeProps, unr
2
2
  import { suppressPaletteDiscovery } from "../composables/usePaletteCommands.js";
3
3
  import { useFieldControl } from "../composables/useField.js";
4
4
  import { useLabels } from "../composables/useLpConfig.js";
5
- import { _ as _sfc_main$1 } from "./LpInput-D0O6dpuA.js";
5
+ import { _ as _sfc_main$1 } from "./LpInput-CbI7z5fQ.js";
6
6
  import { _ as _sfc_main$2 } from "./RevealToggle-D_iyrB8d.js";
7
7
  const __default__ = { inheritAttrs: false };
8
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,14 +1,15 @@
1
- import { defineComponent, ref, computed, shallowRef, onMounted, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, createElementVNode, toDisplayString, mergeProps, createTextVNode, Fragment, renderList, createBlock, withModifiers, createCommentVNode } from "vue";
1
+ import { defineComponent, ref, computed, shallowRef, onMounted, useAttrs, openBlock, createBlock, normalizeProps, guardReactiveProps, unref, withCtx, createElementVNode, normalizeStyle, normalizeClass, createVNode, toDisplayString, mergeProps, createTextVNode, createElementBlock, Fragment, renderList, withModifiers, createCommentVNode } from "vue";
2
+ import { _ as _sfc_main$1 } from "./FieldWrapper-DnuMTrqW.js";
2
3
  import { CONTROL_SIZE } from "../components/controlSize.js";
3
4
  import { ComboboxRoot, ComboboxAnchor, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxInput, ComboboxViewport, ComboboxEmpty, ComboboxItem } from "reka-ui";
4
- import { useField, useAttrsField, mergeDescribedBy } from "../composables/useField.js";
5
+ import { useField, useOwnField, mergeDescribedBy } from "../composables/useField.js";
5
6
  import { useFieldNotice } from "../composables/useFieldNotice.js";
6
7
  import { useInputFilter } from "../composables/useInputFilter.js";
7
8
  import { useLabels } from "../composables/useLpConfig.js";
8
9
  import { matchCountryByValue, filterCountries, loadCountries, flagEmoji } from "../components/countries.js";
9
10
  import { COMBOBOX_PANEL, POPOVER_PANEL, OPTION_ITEM, optionStagger } from "../components/dropdown.js";
10
- import { _ as _sfc_main$2 } from "./LpFieldNotice-DJ10cYIo.js";
11
- import { _ as _sfc_main$1 } from "./LpIcon-C6JpQ5td.js";
11
+ import { _ as _sfc_main$3 } from "./LpFieldNotice-DJ10cYIo.js";
12
+ import { _ as _sfc_main$2 } from "./LpIcon-C6JpQ5td.js";
12
13
  import { loadPhoneLib, formatPhone, loadPhoneExamples, digitsBefore, caretAfterDigits, digitsOf } from "../components/phone.js";
13
14
  import { useMergedAttrs } from "../composables/useMergedClass.js";
14
15
  import { usePortalTarget, useOutsideGuard } from "../composables/useView.js";
@@ -29,6 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
30
  placeholder: { default: void 0 },
30
31
  disabled: { type: Boolean },
31
32
  invalid: { type: Boolean },
33
+ error: {},
32
34
  size: { default: "md" },
33
35
  emptyText: {},
34
36
  searchPlaceholder: {},
@@ -177,7 +179,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
177
179
  say(reason.replace("{country}", name), { tone: "danger", duration: 0 });
178
180
  }
179
181
  const sizeClass = CONTROL_SIZE;
180
- const { attrs, field } = useAttrsField(() => ({ invalid: props.invalid || flagged.value, disabled: props.disabled }));
182
+ const attrs = useAttrs();
183
+ const { field, wrapper, ownAttrs } = useOwnField(() => ({ error: props.error, invalid: props.invalid || flagged.value, disabled: props.disabled }));
181
184
  const text = useLabels("phoneInput", {
182
185
  selectCountry: "Select country",
183
186
  placeholder: "Phone number",
@@ -192,14 +195,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
192
195
  unknownCountry: "Unknown country code"
193
196
  }, () => props.labels);
194
197
  const noticeId = `${field.value.id ?? "lp-phone"}-notice`;
195
- const { class: rootClass, attrs: rest } = useMergedAttrs(
196
- () => [
197
- "relative flex w-full items-stretch rounded-control border bg-surface-soft text-ink transition-colors duration-[var(--duration-fast)] focus-within:ring-2 focus-within:ring-ring",
198
- sizeClass[props.size],
199
- field.value.invalid ? "border-danger focus-within:border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand",
200
- field.value.disabled ? "cursor-not-allowed opacity-55" : ""
201
- ].join(" ")
202
- );
198
+ const { class: rootClass, attrs: rest } = useMergedAttrs(() => [
199
+ "relative flex w-full items-stretch rounded-control border bg-surface-soft text-ink transition-colors duration-[var(--duration-fast)] focus-within:ring-2 focus-within:ring-ring",
200
+ sizeClass[props.size],
201
+ field.value.invalid ? "border-danger focus-within:border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand",
202
+ field.value.disabled ? "cursor-not-allowed opacity-55" : ""
203
+ ].join(" "), () => ownAttrs());
203
204
  const inputAttrs = computed(() => {
204
205
  const { style: _s, ...others } = rest.value;
205
206
  return others;
@@ -207,126 +208,131 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
207
208
  const portalTo = usePortalTarget();
208
209
  const guardOutside = useOutsideGuard();
209
210
  return (_ctx, _cache) => {
210
- return openBlock(), createElementBlock("div", {
211
- "data-lp-ring-owner": "",
212
- class: normalizeClass(unref(rootClass)),
213
- style: normalizeStyle(unref(attrs).style)
214
- }, [
215
- createVNode(unref(ComboboxRoot), {
216
- open: open.value,
217
- "onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event),
218
- "ignore-filter": true,
219
- "reset-search-term-on-select": false,
220
- "reset-search-term-on-blur": false,
221
- disabled: unref(field).disabled,
222
- class: "flex"
223
- }, {
224
- default: withCtx(() => [
225
- createVNode(unref(ComboboxAnchor), { "as-child": "" }, {
211
+ return openBlock(), createBlock(_sfc_main$1, normalizeProps(guardReactiveProps(unref(wrapper))), {
212
+ default: withCtx(() => [
213
+ createElementVNode("div", {
214
+ "data-lp-ring-owner": "",
215
+ class: normalizeClass(unref(rootClass)),
216
+ style: normalizeStyle(unref(ownAttrs)() ? unref(attrs).style : void 0)
217
+ }, [
218
+ createVNode(unref(ComboboxRoot), {
219
+ open: open.value,
220
+ "onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event),
221
+ "ignore-filter": true,
222
+ "reset-search-term-on-select": false,
223
+ "reset-search-term-on-blur": false,
224
+ disabled: unref(field).disabled,
225
+ class: "flex"
226
+ }, {
226
227
  default: withCtx(() => [
227
- createVNode(unref(ComboboxTrigger), {
228
- type: "button",
229
- disabled: unref(field).disabled,
230
- class: "flex shrink-0 items-center gap-1 rounded-l-control border-r border-line px-2.5 outline-none hover:bg-ink/5 data-[state=open]:bg-ink/5",
231
- "aria-label": unref(text).selectCountry
232
- }, {
228
+ createVNode(unref(ComboboxAnchor), { "as-child": "" }, {
233
229
  default: withCtx(() => [
234
- createElementVNode("span", _hoisted_1, toDisplayString(activeCountry.value ? unref(flagEmoji)(activeCountry.value.iso2) : "🌐"), 1),
235
- createVNode(_sfc_main$1, {
236
- name: "lucide:chevron-down",
237
- size: 14,
238
- class: "text-muted transition-transform data-[state=open]:rotate-180"
239
- })
230
+ createVNode(unref(ComboboxTrigger), {
231
+ type: "button",
232
+ disabled: unref(field).disabled,
233
+ class: "flex shrink-0 items-center gap-1 rounded-l-control border-r border-line px-2.5 outline-none hover:bg-ink/5 data-[state=open]:bg-ink/5",
234
+ "aria-label": unref(text).selectCountry
235
+ }, {
236
+ default: withCtx(() => [
237
+ createElementVNode("span", _hoisted_1, toDisplayString(activeCountry.value ? unref(flagEmoji)(activeCountry.value.iso2) : "🌐"), 1),
238
+ createVNode(_sfc_main$2, {
239
+ name: "lucide:chevron-down",
240
+ size: 14,
241
+ class: "text-muted transition-transform data-[state=open]:rotate-180"
242
+ })
243
+ ]),
244
+ _: 1
245
+ }, 8, ["disabled", "aria-label"])
240
246
  ]),
241
247
  _: 1
242
- }, 8, ["disabled", "aria-label"])
243
- ]),
244
- _: 1
245
- }),
246
- createVNode(unref(ComboboxPortal), { to: unref(portalTo) }, {
247
- default: withCtx(() => [
248
- createVNode(unref(ComboboxContent), mergeProps({
249
- onInteractOutside: unref(guardOutside),
250
- onEscapeKeyDown: unref(guardOutside)
251
- }, unref(COMBOBOX_PANEL), {
252
- align: "start",
253
- class: [unref(POPOVER_PANEL), "z-(--z-popover) max-h-72 w-72 overflow-hidden"]
254
- }), {
248
+ }),
249
+ createVNode(unref(ComboboxPortal), { to: unref(portalTo) }, {
255
250
  default: withCtx(() => [
256
- createElementVNode("div", _hoisted_2, [
257
- createVNode(unref(ComboboxInput), {
258
- "model-value": query.value,
259
- placeholder: __props.searchPlaceholder ?? unref(text).search,
260
- "aria-label": unref(text).searchLabel,
261
- "auto-focus": "",
262
- class: "h-(--size-control-sm) w-full rounded-inner border border-line bg-surface-soft px-2.5 text-sm text-ink outline-none placeholder:text-muted focus:border-brand",
263
- onInput: _cache[0] || (_cache[0] = ($event) => query.value = $event.target.value)
264
- }, null, 8, ["model-value", "placeholder", "aria-label"])
265
- ]),
266
- createVNode(unref(ComboboxViewport), { class: "max-h-56 overflow-y-auto p-1" }, {
251
+ createVNode(unref(ComboboxContent), mergeProps({
252
+ onInteractOutside: unref(guardOutside),
253
+ onEscapeKeyDown: unref(guardOutside)
254
+ }, unref(COMBOBOX_PANEL), {
255
+ align: "start",
256
+ class: [unref(POPOVER_PANEL), "z-(--z-popover) max-h-72 w-72 overflow-hidden"]
257
+ }), {
267
258
  default: withCtx(() => [
268
- createVNode(unref(ComboboxEmpty), { class: "px-3 py-4 text-center text-sm italic text-muted" }, {
259
+ createElementVNode("div", _hoisted_2, [
260
+ createVNode(unref(ComboboxInput), {
261
+ "model-value": query.value,
262
+ placeholder: __props.searchPlaceholder ?? unref(text).search,
263
+ "aria-label": unref(text).searchLabel,
264
+ "auto-focus": "",
265
+ class: "h-(--size-control-sm) w-full rounded-inner border border-line bg-surface-soft px-2.5 text-sm text-ink outline-none placeholder:text-muted focus:border-brand",
266
+ onInput: _cache[0] || (_cache[0] = ($event) => query.value = $event.target.value)
267
+ }, null, 8, ["model-value", "placeholder", "aria-label"])
268
+ ]),
269
+ createVNode(unref(ComboboxViewport), { class: "max-h-56 overflow-y-auto p-1" }, {
269
270
  default: withCtx(() => [
270
- createTextVNode(toDisplayString(__props.emptyText ?? unref(text).empty), 1)
271
+ createVNode(unref(ComboboxEmpty), { class: "px-3 py-4 text-center text-sm italic text-muted" }, {
272
+ default: withCtx(() => [
273
+ createTextVNode(toDisplayString(__props.emptyText ?? unref(text).empty), 1)
274
+ ]),
275
+ _: 1
276
+ }),
277
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filtered.value, (c, i) => {
278
+ return openBlock(), createBlock(unref(ComboboxItem), {
279
+ key: c.iso2,
280
+ value: c.iso2,
281
+ style: normalizeStyle(unref(optionStagger)(i)),
282
+ class: normalizeClass([unref(OPTION_ITEM), "gap-2.5"]),
283
+ onSelect: withModifiers(($event) => chooseCountry(c), ["prevent"])
284
+ }, {
285
+ default: withCtx(() => [
286
+ createElementVNode("span", _hoisted_3, toDisplayString(unref(flagEmoji)(c.iso2)), 1),
287
+ createElementVNode("span", _hoisted_4, toDisplayString(c.name), 1),
288
+ createElementVNode("span", _hoisted_5, "+" + toDisplayString(c.dial), 1)
289
+ ]),
290
+ _: 2
291
+ }, 1032, ["value", "style", "class", "onSelect"]);
292
+ }), 128))
271
293
  ]),
272
294
  _: 1
273
- }),
274
- (openBlock(true), createElementBlock(Fragment, null, renderList(filtered.value, (c, i) => {
275
- return openBlock(), createBlock(unref(ComboboxItem), {
276
- key: c.iso2,
277
- value: c.iso2,
278
- style: normalizeStyle(unref(optionStagger)(i)),
279
- class: normalizeClass([unref(OPTION_ITEM), "gap-2.5"]),
280
- onSelect: withModifiers(($event) => chooseCountry(c), ["prevent"])
281
- }, {
282
- default: withCtx(() => [
283
- createElementVNode("span", _hoisted_3, toDisplayString(unref(flagEmoji)(c.iso2)), 1),
284
- createElementVNode("span", _hoisted_4, toDisplayString(c.name), 1),
285
- createElementVNode("span", _hoisted_5, "+" + toDisplayString(c.dial), 1)
286
- ]),
287
- _: 2
288
- }, 1032, ["value", "style", "class", "onSelect"]);
289
- }), 128))
295
+ })
290
296
  ]),
291
297
  _: 1
292
- })
298
+ }, 16, ["onInteractOutside", "onEscapeKeyDown", "class"])
293
299
  ]),
294
300
  _: 1
295
- }, 16, ["onInteractOutside", "onEscapeKeyDown", "class"])
301
+ }, 8, ["to"])
296
302
  ]),
297
303
  _: 1
298
- }, 8, ["to"])
299
- ]),
300
- _: 1
301
- }, 8, ["open", "disabled"]),
302
- createElementVNode("input", mergeProps({
303
- type: "tel",
304
- inputmode: "tel",
305
- autocomplete: "tel"
306
- }, inputAttrs.value, {
307
- id: unref(field).id,
308
- value: __props.modelValue,
309
- placeholder: shownPlaceholder.value,
310
- disabled: unref(field).disabled,
311
- required: unref(field).required || void 0,
312
- "aria-invalid": unref(field).invalid || void 0,
313
- "aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy, unref(notice).message.value ? noticeId : void 0),
314
- class: "lp-autofill min-w-0 flex-1 self-stretch bg-transparent px-3 outline-none placeholder:text-muted",
315
- onBeforeinput: onBeforeEdit,
316
- onPaste: _cache[2] || (_cache[2] = //@ts-ignore
317
- (...args) => unref(onPaste) && unref(onPaste)(...args)),
318
- onCompositionend: _cache[3] || (_cache[3] = //@ts-ignore
319
- (...args) => unref(onCompositionEnd) && unref(onCompositionEnd)(...args)),
320
- onInput,
321
- onFocus,
322
- onBlur
323
- }), null, 16, _hoisted_6),
324
- ownNotice.value ? (openBlock(), createBlock(_sfc_main$2, {
325
- key: 0,
326
- notice: unref(notice),
327
- id: noticeId
328
- }, null, 8, ["notice"])) : createCommentVNode("", true)
329
- ], 6);
304
+ }, 8, ["open", "disabled"]),
305
+ createElementVNode("input", mergeProps({
306
+ type: "tel",
307
+ inputmode: "tel",
308
+ autocomplete: "tel"
309
+ }, inputAttrs.value, {
310
+ id: unref(field).id,
311
+ value: __props.modelValue,
312
+ placeholder: shownPlaceholder.value,
313
+ disabled: unref(field).disabled,
314
+ required: unref(field).required || void 0,
315
+ "aria-invalid": unref(field).invalid || void 0,
316
+ "aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy, unref(notice).message.value ? noticeId : void 0),
317
+ class: "lp-autofill min-w-0 flex-1 self-stretch bg-transparent px-3 outline-none placeholder:text-muted",
318
+ onBeforeinput: onBeforeEdit,
319
+ onPaste: _cache[2] || (_cache[2] = //@ts-ignore
320
+ (...args) => unref(onPaste) && unref(onPaste)(...args)),
321
+ onCompositionend: _cache[3] || (_cache[3] = //@ts-ignore
322
+ (...args) => unref(onCompositionEnd) && unref(onCompositionEnd)(...args)),
323
+ onInput,
324
+ onFocus,
325
+ onBlur
326
+ }), null, 16, _hoisted_6),
327
+ ownNotice.value ? (openBlock(), createBlock(_sfc_main$3, {
328
+ key: 0,
329
+ notice: unref(notice),
330
+ id: noticeId
331
+ }, null, 8, ["notice"])) : createCommentVNode("", true)
332
+ ], 6)
333
+ ]),
334
+ _: 1
335
+ }, 16);
330
336
  };
331
337
  }
332
338
  });
@@ -0,0 +1,103 @@
1
+ import { defineComponent, useId, openBlock, createBlock, normalizeProps, guardReactiveProps, unref, withCtx, createVNode, mergeProps, renderSlot, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, createTextVNode } from "vue";
2
+ import { _ as _sfc_main$1 } from "./FieldWrapper-DnuMTrqW.js";
3
+ import { usePaletteControl } from "../composables/usePaletteCommands.js";
4
+ import { RadioGroupRoot, RadioGroupItem, RadioGroupIndicator } from "reka-ui";
5
+ import { useOwnField, mergeDescribedBy } from "../composables/useField.js";
6
+ import { useMergedAttrs } from "../composables/useMergedClass.js";
7
+ import { _ as _sfc_main$2 } from "./LpIcon-C6JpQ5td.js";
8
+ const _hoisted_1 = {
9
+ key: 1,
10
+ class: "flex min-w-0 flex-col"
11
+ };
12
+ const _hoisted_2 = ["id"];
13
+ const __default__ = { inheritAttrs: false };
14
+ const _sfc_main = /* @__PURE__ */ defineComponent({
15
+ ...__default__,
16
+ __name: "LpRadioGroup",
17
+ props: {
18
+ palette: { type: [Boolean, Object], default: void 0 },
19
+ modelValue: {},
20
+ options: {},
21
+ disabled: { type: Boolean },
22
+ error: {}
23
+ },
24
+ emits: ["update:modelValue"],
25
+ setup(__props) {
26
+ const props = __props;
27
+ const { field, wrapper, ownAttrs } = useOwnField(() => ({ error: props.error, disabled: props.disabled }));
28
+ const uid = useId();
29
+ const { class: rootClass, attrs: rest } = useMergedAttrs(
30
+ "flex flex-col gap-2",
31
+ () => ownAttrs()
32
+ );
33
+ usePaletteControl({ disabled: () => field.value.disabled });
34
+ return (_ctx, _cache) => {
35
+ return openBlock(), createBlock(_sfc_main$1, normalizeProps(guardReactiveProps(unref(wrapper))), {
36
+ default: withCtx(() => [
37
+ createVNode(unref(RadioGroupRoot), mergeProps({
38
+ "model-value": __props.modelValue,
39
+ disabled: unref(field).disabled,
40
+ required: unref(field).required,
41
+ "aria-labelledby": unref(field).labelId,
42
+ "aria-invalid": unref(field).invalid || void 0,
43
+ class: unref(rootClass)
44
+ }, unref(rest), {
45
+ "aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy),
46
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => _ctx.$emit("update:modelValue", v))
47
+ }), {
48
+ default: withCtx(() => [
49
+ renderSlot(_ctx.$slots, "default", {}, () => [
50
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (opt, i) => {
51
+ return openBlock(), createElementBlock("label", {
52
+ key: opt.value,
53
+ class: normalizeClass(["group/radio inline-flex gap-2 text-sm text-ink", [
54
+ opt.description ? "items-start" : "items-center",
55
+ opt.disabled ? "cursor-not-allowed text-muted" : unref(field).disabled ? "cursor-not-allowed" : "cursor-pointer"
56
+ ]])
57
+ }, [
58
+ createVNode(unref(RadioGroupItem), {
59
+ value: opt.value,
60
+ disabled: opt.disabled,
61
+ "aria-describedby": opt.description ? `${unref(uid)}-${i}-desc` : void 0,
62
+ class: normalizeClass([opt.description ? "mt-px" : "", "flex size-[18px] shrink-0 items-center justify-center rounded-full border border-line-strong bg-surface-soft outline-none transition-[color,border-color,box-shadow,scale] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] not-data-[state=checked]:group-hover/radio:border-brand active:scale-90 motion-reduce:active:scale-100 focus-visible:ring-2 focus-visible:ring-ring data-[state=checked]:border-brand disabled:cursor-not-allowed disabled:opacity-55"])
63
+ }, {
64
+ default: withCtx(() => [
65
+ createVNode(unref(RadioGroupIndicator), { class: "flex data-[state=checked]:animate-[indicator-in_140ms_var(--ease-emphasized)]" }, {
66
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
67
+ createElementVNode("span", { class: "size-2 rounded-full bg-brand" }, null, -1)
68
+ ])]),
69
+ _: 1
70
+ })
71
+ ]),
72
+ _: 1
73
+ }, 8, ["value", "disabled", "aria-describedby", "class"]),
74
+ opt.icon ? (openBlock(), createBlock(_sfc_main$2, {
75
+ key: 0,
76
+ name: opt.icon,
77
+ size: 16,
78
+ class: normalizeClass(["shrink-0 text-muted", opt.description ? "mt-0.5" : ""])
79
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true),
80
+ opt.description ? (openBlock(), createElementBlock("span", _hoisted_1, [
81
+ createElementVNode("span", null, toDisplayString(opt.label), 1),
82
+ createElementVNode("span", {
83
+ id: `${unref(uid)}-${i}-desc`,
84
+ class: "text-xs text-muted"
85
+ }, toDisplayString(opt.description), 9, _hoisted_2)
86
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
87
+ createTextVNode(toDisplayString(opt.label), 1)
88
+ ], 64))
89
+ ], 2);
90
+ }), 128))
91
+ ])
92
+ ]),
93
+ _: 3
94
+ }, 16, ["model-value", "disabled", "required", "aria-labelledby", "aria-invalid", "class", "aria-describedby"])
95
+ ]),
96
+ _: 3
97
+ }, 16);
98
+ };
99
+ }
100
+ });
101
+ export {
102
+ _sfc_main as _
103
+ };
@@ -0,0 +1,97 @@
1
+ import { defineComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, unref, withCtx, createVNode, mergeProps, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode } from "vue";
2
+ import { _ as _sfc_main$1 } from "./FieldWrapper-DnuMTrqW.js";
3
+ import { _ as _sfc_main$2 } from "./SliderRail-DhPREa_R.js";
4
+ import { usePaletteControl } from "../composables/usePaletteCommands.js";
5
+ import { SliderRoot, SliderThumb } from "reka-ui";
6
+ import { useOwnField, mergeDescribedBy } from "../composables/useField.js";
7
+ import { useMergedAttrs } from "../composables/useMergedClass.js";
8
+ import { SLIDER_GLIDE, useSliderDrag } from "../components/slider.js";
9
+ const __default__ = { inheritAttrs: false };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ ...__default__,
12
+ __name: "LpRangeSlider",
13
+ props: {
14
+ palette: { type: [Boolean, Object], default: void 0 },
15
+ modelValue: { default: () => [0, 100] },
16
+ min: { default: 0 },
17
+ max: { default: 100 },
18
+ step: { default: 1 },
19
+ minGap: { default: 0 },
20
+ disabled: { type: Boolean },
21
+ error: {},
22
+ ariaLabels: {},
23
+ format: {}
24
+ },
25
+ emits: ["update:modelValue", "change"],
26
+ setup(__props, { emit: __emit }) {
27
+ const props = __props;
28
+ const emit = __emit;
29
+ function pair(v) {
30
+ return v && v.length >= 2 ? [v[0], v[1]] : null;
31
+ }
32
+ function onUpdate(v) {
33
+ const value = pair(v);
34
+ if (value) emit("update:modelValue", value);
35
+ }
36
+ function onCommit(v) {
37
+ const value = pair(v);
38
+ if (value) emit("change", value);
39
+ }
40
+ const { field, wrapper, ownAttrs } = useOwnField(() => ({ error: props.error, disabled: props.disabled }));
41
+ const { class: rootClass, attrs: rest } = useMergedAttrs(
42
+ `relative flex h-5 w-full touch-none select-none items-center data-[disabled]:opacity-55 ${SLIDER_GLIDE}`,
43
+ () => ownAttrs()
44
+ );
45
+ const { dragging, onPointerDown } = useSliderDrag();
46
+ const thumbClass = "group/thumb relative block size-4 rounded-pill border-2 border-brand bg-surface shadow outline-none transition-transform duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] hover:scale-110 active:scale-95 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:hover:scale-100 motion-reduce:active:scale-100";
47
+ const labelClass = "pointer-events-none absolute bottom-full left-1/2 mb-1.5 -translate-x-1/2 translate-y-0.5 rounded-control bg-surface-raised px-1.5 py-0.5 text-[11px] whitespace-nowrap text-ink tabular-nums opacity-0 shadow-sm transition-[opacity,translate] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] group-hover/thumb:translate-y-0 group-hover/thumb:opacity-100 group-focus-visible/thumb:translate-y-0 group-focus-visible/thumb:opacity-100 group-active/thumb:translate-y-0 group-active/thumb:opacity-100 motion-reduce:transition-none";
48
+ usePaletteControl({ disabled: () => field.value.disabled });
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createBlock(_sfc_main$1, normalizeProps(guardReactiveProps(unref(wrapper))), {
51
+ default: withCtx(() => [
52
+ createVNode(unref(SliderRoot), mergeProps({
53
+ "model-value": [props.modelValue[0], props.modelValue[1]],
54
+ min: __props.min,
55
+ max: __props.max,
56
+ step: __props.step,
57
+ "min-steps-between-thumbs": Math.round(__props.minGap / __props.step),
58
+ disabled: unref(field).disabled,
59
+ class: unref(rootClass)
60
+ }, unref(rest), {
61
+ "data-dragging": unref(dragging) || void 0,
62
+ onPointerdown: unref(onPointerDown),
63
+ "onUpdate:modelValue": onUpdate,
64
+ onValueCommit: onCommit
65
+ }), {
66
+ default: withCtx(() => [
67
+ createVNode(_sfc_main$2),
68
+ (openBlock(), createElementBlock(Fragment, null, renderList([0, 1], (index) => {
69
+ return createVNode(unref(SliderThumb), {
70
+ key: index,
71
+ id: index === 0 ? unref(field).id : void 0,
72
+ "aria-label": __props.ariaLabels?.[index],
73
+ "aria-labelledby": __props.ariaLabels ? void 0 : unref(field).labelId,
74
+ "aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy),
75
+ class: normalizeClass(thumbClass)
76
+ }, {
77
+ default: withCtx(() => [
78
+ __props.format ? (openBlock(), createElementBlock("span", {
79
+ key: 0,
80
+ class: normalizeClass(labelClass)
81
+ }, toDisplayString(__props.format(props.modelValue[index])), 1)) : createCommentVNode("", true)
82
+ ]),
83
+ _: 2
84
+ }, 1032, ["id", "aria-label", "aria-labelledby", "aria-describedby"]);
85
+ }), 64))
86
+ ]),
87
+ _: 1
88
+ }, 16, ["model-value", "min", "max", "step", "min-steps-between-thumbs", "disabled", "class", "data-dragging", "onPointerdown"])
89
+ ]),
90
+ _: 1
91
+ }, 16);
92
+ };
93
+ }
94
+ });
95
+ export {
96
+ _sfc_main as _
97
+ };