@leavepulse/ui 0.78.0 → 0.78.2
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/dist/chunks/{DropzoneLinkField-DXIr0eFz.js → DropzoneLinkField-CyE7TJ5f.js} +1 -1
- package/dist/chunks/FieldLeading-mr81aEAP.js +27 -0
- package/dist/chunks/LpAddressInput-ft8fQOGx.js +401 -0
- package/dist/chunks/{LpAppShell-BNAVTQsY.js → LpAppShell-DkvU6IBB.js} +23 -4
- package/dist/chunks/LpAutocomplete-CrZbd0uv.js +310 -0
- package/dist/chunks/LpCheckbox-CCWCwD0y.js +129 -0
- package/dist/chunks/{LpCodeBlock-DuzmnIHl.js → LpCodeBlock-DBqy4RLd.js} +1 -1
- package/dist/chunks/{LpCodeDisplay-CO8fngxa.js → LpCodeDisplay-D59uPwRb.js} +3 -3
- package/dist/chunks/LpColorPicker-BONURBFN.js +574 -0
- package/dist/chunks/{LpConfirmDialog-6oCIJTDa.js → LpConfirmDialog-CnrmzkuN.js} +1 -1
- package/dist/chunks/{LpConfirmHost-DgHvfT6s.js → LpConfirmHost-CwbObVGH.js} +1 -1
- package/dist/chunks/{LpContextMenu--eMGIql6.js → LpContextMenu-Bx_IhQDS.js} +5 -5
- package/dist/chunks/{LpCopyButton-7EOSIuwa.js → LpCopyButton-sAMvWeLP.js} +1 -1
- package/dist/chunks/{LpDataList-DgBeM01y.js → LpDataList-CaVfsozH.js} +2 -2
- package/dist/chunks/LpDatePicker-C2AOtxgF.js +171 -0
- package/dist/chunks/{LpDateRangePicker-CNQXdTVv.js → LpDateRangePicker-CiXdIAyh.js} +43 -35
- package/dist/chunks/{LpDrawer-Bt9UUqt_.js → LpDrawer-DXNQFpAA.js} +1 -1
- package/dist/chunks/{LpFileTree-BSx1kBoV.js → LpFileTree-CpNurwZp.js} +3 -3
- package/dist/chunks/{LpFileTreeNode-4dVmFHb3.js → LpFileTreeNode-DdF8Cq-s.js} +2 -2
- package/dist/chunks/{LpHoverCard-DanH3Nz1.js → LpHoverCard-CHE9jAJG.js} +6 -6
- package/dist/chunks/{LpInfraNode-BAU40Km2.js → LpInfraNode-Bb5nbuFY.js} +17 -0
- package/dist/chunks/{LpInput-DL6HEJdi.js → LpInput-CbI7z5fQ.js} +21 -25
- package/dist/chunks/{LpInspector-CuoMAhiw.js → LpInspector-DO3fTCQ1.js} +2 -2
- package/dist/chunks/{LpLaneNode-HtnQf2FF.js → LpLaneNode-Bqcdm8Rf.js} +19 -1
- package/dist/chunks/{LpLightbox-xvpQ64MM.js → LpLightbox-CtDTQV01.js} +1 -1
- package/dist/chunks/{LpLogInspector-6cNnXqp4.js → LpLogInspector-CcSJSGan.js} +1 -1
- package/dist/chunks/{LpLogViewer-Dvb1E9_G.js → LpLogViewer-CWu49Dko.js} +4 -4
- package/dist/chunks/{LpMediaGallery-Df-tiWeq.js → LpMediaGallery-BYEwySoF.js} +2 -2
- package/dist/chunks/{LpModal-DrtQ_1A2.js → LpModal-DDvrSAnf.js} +1 -1
- package/dist/chunks/{LpModalNav-DkmGCnZE.js → LpModalNav-DI3BW5ff.js} +2 -2
- package/dist/chunks/{LpNotificationBell-D_wklO1m.js → LpNotificationBell-DUbVyK6R.js} +3 -3
- package/dist/chunks/LpNumberField-C8LfUz_R.js +154 -0
- package/dist/chunks/LpOtpInput-B1X9l9no.js +140 -0
- package/dist/chunks/LpPageScrollbar-D2O0xhJw.js +164 -0
- package/dist/chunks/{LpPaletteTheme-dVtxHx-F.js → LpPaletteTheme-B-xuZiKK.js} +2 -2
- package/dist/chunks/{LpPasswordInput-B-zD6tUS.js → LpPasswordInput-Duc_3wPv.js} +2 -2
- package/dist/chunks/{LpPhoneInput-BSL7NX4z.js → LpPhoneInput-CctcRK9K.js} +124 -118
- package/dist/chunks/{LpPie-9t_guO49.js → LpPie-oVNHjsKD.js} +2 -2
- package/dist/chunks/{LpPipeline-rjXvEDRJ.js → LpPipeline-BSXT6oUJ.js} +1 -1
- package/dist/chunks/LpRadioGroup-DTM0nd9G.js +103 -0
- package/dist/chunks/LpRangeSlider-DJsEZXad.js +97 -0
- package/dist/chunks/{LpRelativeTime-BovUk8MP.js → LpRelativeTime-0zI-44ve.js} +1 -1
- package/dist/chunks/LpRepeater-Czib3rmv.js +193 -0
- package/dist/chunks/{LpScrollArea-ay4Xo_hg.js → LpScrollArea-CqvwfZs2.js} +9 -12
- package/dist/chunks/{LpSecretField-DBvU6iAw.js → LpSecretField-BtlCk3IH.js} +4 -4
- package/dist/chunks/LpSegmented-sskrJKJJ.js +128 -0
- package/dist/chunks/LpSelect-JFZehOkd.js +515 -0
- package/dist/chunks/{LpServiceNode-D8uJ8sGk.js → LpServiceNode-Cln2ntdw.js} +17 -0
- package/dist/chunks/{LpSidebar-kSkpPh3-.js → LpSidebar-CvRvVBTt.js} +4 -4
- package/dist/chunks/{LpSidebarNav-C2mvqrY2.js → LpSidebarNav-CE0jQS8i.js} +2 -2
- package/dist/chunks/{LpSidebarRow-eRP4Q31q.js → LpSidebarRow-DOTg1txp.js} +2 -2
- package/dist/chunks/LpSlider-C4ilCtZX.js +76 -0
- package/dist/chunks/{LpStat-pMNZgFcq.js → LpStat-DPjc6_fX.js} +17 -4
- package/dist/chunks/LpSwitch-DyAYTchz.js +122 -0
- package/dist/chunks/{LpTableFilter-DgARTsA1.js → LpTableFilter-CJg5eIcV.js} +2 -2
- package/dist/chunks/{LpTagsInput-Dt0mteSj.js → LpTagsInput-CkNxpNYa.js} +4 -3
- package/dist/chunks/{LpTextarea-Co0b9PVx.js → LpTextarea-CFK_5QB8.js} +3 -2
- package/dist/chunks/{LpThemeStudio-DzYfE-5k.js → LpThemeStudio-R-wohbCY.js} +3 -3
- package/dist/chunks/{LpThemeSwitcher-CFLkdbBL.js → LpThemeSwitcher-Bzy15MCP.js} +2 -2
- package/dist/chunks/LpTimeField-B5n0m8m0.js +115 -0
- package/dist/chunks/{LpToaster-QFj0P-5m.js → LpToaster-Ct_ZOhCh.js} +1 -1
- package/dist/chunks/{LpTooltip-BJf3lZMq.js → LpTooltip-Bz_rrq5S.js} +5 -5
- package/dist/chunks/{LpTopologyCanvas-BOHHHZ_6.js → LpTopologyCanvas-BNgw9RyZ.js} +14 -9
- package/dist/chunks/{LpTruncate-C6u3gjc6.js → LpTruncate-ellq9RYM.js} +2 -2
- package/dist/chunks/{LpUptimeBar-BnYmR2rj.js → LpUptimeBar-BoxcCDVY.js} +1 -1
- package/dist/chunks/{LpWorkspaceSwitcher-D0e9upAy.js → LpWorkspaceSwitcher-ugv-fyig.js} +2 -2
- package/dist/chunks/{RevealToggle-CCPDE8Mv.js → RevealToggle-D_iyrB8d.js} +1 -1
- package/dist/component-names.d.ts +1 -1
- package/dist/components/DropzoneLinkField.vue.js +1 -1
- package/dist/components/FieldLeading.vue.d.ts +16 -0
- package/dist/components/FieldLeading.vue.js +4 -0
- package/dist/components/LpAddressInput.vue.d.ts +4 -0
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.d.ts +3 -3
- package/dist/components/LpAppShell.vue.d.ts +16 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.d.ts +4 -0
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpChart.vue.d.ts +1 -1
- package/dist/components/LpChart.vue.js +1 -1
- package/dist/components/LpCheckbox.vue.d.ts +4 -0
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpCollapse.vue.d.ts +1 -1
- package/dist/components/LpColorPicker.vue.d.ts +5 -3
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.js +1 -1
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.js +1 -1
- package/dist/components/LpContextMenu.vue.js +1 -1
- package/dist/components/LpCopyButton.vue.js +1 -1
- package/dist/components/LpDataList.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDateRangePicker.vue.js +1 -1
- package/dist/components/LpDock.vue.js +1 -1
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpHoverCard.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.d.ts +1 -1
- package/dist/components/LpInfraNode.vue.d.ts +11 -2
- package/dist/components/LpInfraNode.vue.js +1 -1
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpInspector.vue.js +1 -1
- package/dist/components/LpLaneNode.vue.d.ts +2 -3
- package/dist/components/LpLaneNode.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLogInspector.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +17 -2
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.d.ts +4 -0
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPageScrollbar.vue.d.ts +10 -0
- package/dist/components/LpPageScrollbar.vue.js +4 -0
- package/dist/components/LpPaletteTheme.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.d.ts +4 -0
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPipeline.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.d.ts +4 -0
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpRangeSlider.vue.d.ts +4 -0
- package/dist/components/LpRangeSlider.vue.js +1 -1
- package/dist/components/LpRelativeTime.vue.js +1 -1
- package/dist/components/LpRepeater.vue.d.ts +2 -0
- package/dist/components/LpRepeater.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.d.ts +1 -1
- package/dist/components/LpScrollArea.vue.js +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpSegmented.vue.d.ts +4 -0
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.d.ts +2 -0
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpServiceNode.vue.d.ts +8 -2
- package/dist/components/LpServiceNode.vue.js +1 -1
- package/dist/components/LpShinyText.vue.d.ts +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +1 -1
- package/dist/components/LpSidebar.vue.d.ts +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpSidebarRow.vue.js +1 -1
- package/dist/components/LpSlider.vue.d.ts +4 -0
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpStat.vue.d.ts +16 -0
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpSwitch.vue.d.ts +4 -0
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.js +5 -5
- package/dist/components/LpTableFilter.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +1 -1
- package/dist/components/LpTabs.vue.js +1 -1
- package/dist/components/LpTagsInput.vue.js +1 -1
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTimeField.vue.d.ts +4 -0
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.d.ts +2 -2
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpTruncate.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/RevealToggle.vue.js +1 -1
- package/dist/components/calendar.d.ts +2 -0
- package/dist/components/menuWhen.js +1 -1
- package/dist/components/scrollbar.d.ts +34 -0
- package/dist/components/scrollbar.js +47 -0
- package/dist/composables/propCheck.d.ts +1 -1
- package/dist/composables/propCheck.js +15 -4
- package/dist/composables/useField.d.ts +50 -0
- package/dist/composables/useField.js +31 -2
- package/dist/composables/useMergedClass.d.ts +6 -2
- package/dist/composables/useMergedClass.js +6 -6
- package/dist/composables/usePaletteCommands.js +4 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +170 -168
- package/package.json +1 -1
- package/src/component-names.ts +1 -0
- package/src/components/FieldLeading.vue +17 -0
- package/src/components/LpAddressInput.vue +8 -4
- package/src/components/LpAppShell.vue +23 -0
- package/src/components/LpAutocomplete.vue +11 -5
- package/src/components/LpCheckbox.vue +8 -6
- package/src/components/LpColorPicker.vue +7 -4
- package/src/components/LpContextMenu.vue +7 -0
- package/src/components/LpDatePicker.vue +8 -4
- package/src/components/LpDateRangePicker.vue +8 -4
- package/src/components/LpHoverCard.vue +7 -0
- package/src/components/LpInfraNode.vue +4 -3
- package/src/components/LpInput.vue +7 -7
- package/src/components/LpLaneNode.vue +5 -1
- package/src/components/LpNumberField.vue +18 -7
- package/src/components/LpOtpInput.vue +8 -6
- package/src/components/LpPageScrollbar.vue +195 -0
- package/src/components/LpPhoneInput.vue +11 -6
- package/src/components/LpRadioGroup.vue +9 -5
- package/src/components/LpRangeSlider.vue +8 -4
- package/src/components/LpRepeater.vue +16 -4
- package/src/components/LpScrollArea.vue +27 -23
- package/src/components/LpSegmented.vue +8 -4
- package/src/components/LpSelect.vue +8 -7
- package/src/components/LpServiceNode.vue +4 -2
- package/src/components/LpSlider.vue +8 -4
- package/src/components/LpStat.vue +25 -5
- package/src/components/LpSwitch.vue +8 -5
- package/src/components/LpTagsInput.vue +4 -3
- package/src/components/LpTextarea.vue +3 -2
- package/src/components/LpTimeField.vue +8 -6
- package/src/components/LpTooltip.vue +7 -0
- package/src/components/LpTopologyCanvas.vue +3 -1
- package/src/components/calendar.ts +2 -0
- package/src/components/scrollbar.ts +71 -0
- package/src/composables/propCheck.ts +20 -5
- package/src/composables/useField.ts +52 -0
- package/src/composables/useMergedClass.ts +11 -5
- package/src/composables/usePaletteCommands.ts +5 -2
- package/src/index.ts +1 -0
- package/dist/chunks/LpAddressInput-ZqoZ-N2Y.js +0 -393
- package/dist/chunks/LpAutocomplete-DkY6CSyD.js +0 -302
- package/dist/chunks/LpCheckbox-D6RuDW4X.js +0 -124
- package/dist/chunks/LpColorPicker-BxAHEnR5.js +0 -567
- package/dist/chunks/LpDatePicker-DwSDY0mt.js +0 -163
- package/dist/chunks/LpNumberField-CNHsmSDZ.js +0 -134
- package/dist/chunks/LpOtpInput-BRpLBbOD.js +0 -132
- package/dist/chunks/LpRadioGroup-BrazjLY_.js +0 -95
- package/dist/chunks/LpRangeSlider-fz61tzc-.js +0 -89
- package/dist/chunks/LpRepeater-BkJHSPI1.js +0 -180
- package/dist/chunks/LpSegmented-DbEJhbv-.js +0 -123
- package/dist/chunks/LpSelect-Y-iuSymW.js +0 -512
- package/dist/chunks/LpSlider-A4ixovgS.js +0 -68
- package/dist/chunks/LpSwitch-DnC2-0aV.js +0 -115
- package/dist/chunks/LpTimeField-DeOcKWJq.js +0 -110
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, shallowRef, onMounted,
|
|
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,
|
|
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$
|
|
11
|
-
import { _ as _sfc_main$
|
|
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
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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(),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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(
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
301
|
+
}, 8, ["to"])
|
|
296
302
|
]),
|
|
297
303
|
_: 1
|
|
298
|
-
}, 8, ["
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
});
|
|
@@ -7,14 +7,14 @@ import { useReveal } from "../composables/useReveal.js";
|
|
|
7
7
|
import { useTween, lerp, mixColor } from "../composables/useTween.js";
|
|
8
8
|
import { resolveSlices, arcPath, calloutLabels, formatTick } from "../components/chart.js";
|
|
9
9
|
import { _ as _sfc_main$9 } from "./LegendSwatch-BhRjrtzv.js";
|
|
10
|
-
import { _ as _sfc_main$4 } from "./LpContextMenu
|
|
10
|
+
import { _ as _sfc_main$4 } from "./LpContextMenu-Bx_IhQDS.js";
|
|
11
11
|
import { _ as _sfc_main$3 } from "./LpEmptyState-DurPF001.js";
|
|
12
12
|
import { _ as _sfc_main$6 } from "./LpNumberFlow-Vqj0tP7B.js";
|
|
13
13
|
import { _ as _sfc_main$7 } from "./LpRollingText-B54Pje7P.js";
|
|
14
14
|
import { _ as _sfc_main$8 } from "./LpShift-DAgS_d2x.js";
|
|
15
15
|
import { _ as _sfc_main$2 } from "./LpSkeleton-BB6XIV-w.js";
|
|
16
16
|
import { _ as _sfc_main$1 } from "./LpSwap-M7nFeW3C.js";
|
|
17
|
-
import { _ as _sfc_main$5 } from "./LpTooltip-
|
|
17
|
+
import { _ as _sfc_main$5 } from "./LpTooltip-Bz_rrq5S.js";
|
|
18
18
|
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
19
19
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
20
20
|
import { isElement } from "../composables/realm.js";
|
|
@@ -10,7 +10,7 @@ import { _ as _sfc_main$5 } from "./LpIcon-C6JpQ5td.js";
|
|
|
10
10
|
import { _ as _sfc_main$4 } from "./LpRollingText-B54Pje7P.js";
|
|
11
11
|
import { _ as _sfc_main$3 } from "./LpShift-DAgS_d2x.js";
|
|
12
12
|
import { _ as _sfc_main$1 } from "./LpStepMark-Dw2MRTrt.js";
|
|
13
|
-
import { _ as _sfc_main$7 } from "./LpTooltip-
|
|
13
|
+
import { _ as _sfc_main$7 } from "./LpTooltip-Bz_rrq5S.js";
|
|
14
14
|
import { _ as _sfc_main$2 } from "./StepConnector-37OgEOXA.js";
|
|
15
15
|
import { stepKey, duplicateStepKeys, connectorFilled, currentStepIndex, stepElapsed, childProgress } from "../components/pipeline.js";
|
|
16
16
|
import { DEFAULT_UNIT_LABELS, toEpoch, formatElapsed } from "../components/timeSpan.js";
|
|
@@ -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
|
+
};
|
|
@@ -3,7 +3,7 @@ import { useLocale } from "../composables/useLocale.js";
|
|
|
3
3
|
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
4
|
import { useNow } from "../composables/useNow.js";
|
|
5
5
|
import { _ as _sfc_main$2 } from "./LpRollingText-B54Pje7P.js";
|
|
6
|
-
import { _ as _sfc_main$1 } from "./LpTooltip-
|
|
6
|
+
import { _ as _sfc_main$1 } from "./LpTooltip-Bz_rrq5S.js";
|
|
7
7
|
import { formatRelativeTime } from "../components/relativeTime.js";
|
|
8
8
|
import { toEpoch } from "../components/timeSpan.js";
|
|
9
9
|
const _hoisted_1 = ["datetime"];
|