@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,115 +0,0 @@
1
- import { defineComponent, useSlots, computed, useId, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, withCtx, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, mergeProps } from "vue";
2
- import { usePaletteControl } from "../composables/usePaletteCommands.js";
3
- import { SwitchRoot, SwitchThumb } from "reka-ui";
4
- import { useFieldControl, mergeDescribedBy } from "../composables/useField.js";
5
- import { useOptimisticToggle } from "../composables/useOptimisticToggle.js";
6
- import { _ as _sfc_main$1 } from "./LpLoader-Bf1yZwaU.js";
7
- import { useMergedAttrs } from "../composables/useMergedClass.js";
8
- const _hoisted_1 = {
9
- key: 0,
10
- class: "flex min-w-0 flex-col"
11
- };
12
- const _hoisted_2 = {
13
- key: 1,
14
- class: "flex min-w-0 flex-col"
15
- };
16
- const __default__ = { inheritAttrs: false };
17
- const _sfc_main = /* @__PURE__ */ defineComponent({
18
- ...__default__,
19
- __name: "LpSwitch",
20
- props: {
21
- palette: { type: [Boolean, Object], default: void 0 },
22
- modelValue: { type: Boolean },
23
- disabled: { type: Boolean },
24
- label: {},
25
- description: {},
26
- labelPosition: { default: "end" },
27
- action: {}
28
- },
29
- emits: ["update:modelValue", "done", "error"],
30
- setup(__props, { emit: __emit }) {
31
- const props = __props;
32
- const emit = __emit;
33
- const { pending, set } = useOptimisticToggle(() => props.action, emit);
34
- const slots = useSlots();
35
- const labelled = computed(() => Boolean(props.label || props.description || slots.default));
36
- const TRACK = "group/switch inline-flex h-5 w-9 shrink-0 items-center rounded-pill border border-line bg-surface-soft px-0.5 outline-none transition-colors duration-[var(--duration-fast)] focus-visible:ring-2 focus-visible:ring-ring data-[state=checked]:border-transparent data-[state=checked]:bg-brand disabled:cursor-not-allowed disabled:opacity-55";
37
- const THUMB = "h-3.5 w-3.5 rounded-full bg-ink shadow transition-[translate,width,background-color] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] group-active/switch:w-5 group-data-[state=checked]/switch:translate-x-4 group-data-[state=checked]/switch:bg-ink-inverse group-data-[state=checked]/switch:group-active/switch:translate-x-2.5 motion-reduce:group-active/switch:w-3.5";
38
- const { class: rootClass, attrs: rest } = useMergedAttrs(() => {
39
- if (!labelled.value) return TRACK;
40
- return props.labelPosition === "start" ? "flex w-full cursor-pointer items-center justify-between gap-3 text-sm text-ink" : "inline-flex cursor-pointer items-center gap-2 text-sm text-ink";
41
- });
42
- const field = useFieldControl(() => ({
43
- wrapped: false,
44
- id: typeof rest.value.id === "string" ? rest.value.id : void 0,
45
- disabled: props.disabled
46
- }));
47
- const descriptionId = `${useId()}-description`;
48
- const describedBy = computed(
49
- () => mergeDescribedBy(rest.value["aria-describedby"], props.description && labelled.value ? descriptionId : void 0, field.value.describedBy)
50
- );
51
- function onUpdate(value) {
52
- void set(value);
53
- }
54
- usePaletteControl({ label: () => props.label, disabled: () => field.value.disabled || pending.value, editorProps: () => ({ action: void 0, "onUpdate:modelValue": onUpdate }) });
55
- return (_ctx, _cache) => {
56
- return openBlock(), createBlock(resolveDynamicComponent(labelled.value ? "label" : "span"), {
57
- class: normalizeClass(labelled.value ? [unref(rootClass), unref(field).disabled && "cursor-not-allowed"] : "contents")
58
- }, {
59
- default: withCtx(() => [
60
- labelled.value && __props.labelPosition === "start" ? (openBlock(), createElementBlock("span", _hoisted_1, [
61
- renderSlot(_ctx.$slots, "default", {}, () => [
62
- createTextVNode(toDisplayString(__props.label), 1)
63
- ]),
64
- __props.description ? (openBlock(), createElementBlock("span", {
65
- key: 0,
66
- id: descriptionId,
67
- class: "text-xs text-muted"
68
- }, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
69
- ])) : createCommentVNode("", true),
70
- createVNode(unref(SwitchRoot), mergeProps(unref(rest), {
71
- id: unref(field).id,
72
- "model-value": __props.modelValue,
73
- disabled: unref(field).disabled,
74
- required: unref(field).required,
75
- "aria-describedby": describedBy.value,
76
- "aria-busy": unref(pending) || void 0,
77
- class: labelled.value ? TRACK : unref(rootClass),
78
- "onUpdate:modelValue": onUpdate
79
- }), {
80
- default: withCtx(() => [
81
- createVNode(unref(SwitchThumb), {
82
- class: normalizeClass([THUMB, "grid place-items-center"])
83
- }, {
84
- default: withCtx(() => [
85
- createVNode(_sfc_main$1, {
86
- active: unref(pending),
87
- size: "inline",
88
- "aria-hidden": "true",
89
- class: "text-[10px] text-ink-inverse group-data-[state=checked]/switch:text-ink"
90
- }, null, 8, ["active"])
91
- ]),
92
- _: 1
93
- }, 8, ["class"])
94
- ]),
95
- _: 1
96
- }, 16, ["id", "model-value", "disabled", "required", "aria-describedby", "aria-busy", "class"]),
97
- labelled.value && __props.labelPosition === "end" ? (openBlock(), createElementBlock("span", _hoisted_2, [
98
- renderSlot(_ctx.$slots, "default", {}, () => [
99
- createTextVNode(toDisplayString(__props.label), 1)
100
- ]),
101
- __props.description ? (openBlock(), createElementBlock("span", {
102
- key: 0,
103
- id: descriptionId,
104
- class: "text-xs text-muted"
105
- }, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
106
- ])) : createCommentVNode("", true)
107
- ]),
108
- _: 3
109
- }, 8, ["class"]);
110
- };
111
- }
112
- });
113
- export {
114
- _sfc_main as _
115
- };
@@ -1,110 +0,0 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createCommentVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
2
- import { CONTROL_SIZE } from "../components/controlSize.js";
3
- import { usePaletteControl } from "../composables/usePaletteCommands.js";
4
- import { Time } from "@internationalized/date";
5
- import { TimeFieldRoot, TimeFieldInput } from "reka-ui";
6
- import { useFieldControl, mergeDescribedBy, focusLeft } from "../composables/useField.js";
7
- import { useMergedAttrs } from "../composables/useMergedClass.js";
8
- import { _ as _sfc_main$1 } from "./LpIcon-C6JpQ5td.js";
9
- const __default__ = { inheritAttrs: false };
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- ...__default__,
12
- __name: "LpTimeField",
13
- props: {
14
- palette: { type: [Boolean, Object], default: void 0 },
15
- modelValue: {},
16
- disabled: { type: Boolean },
17
- invalid: { type: Boolean },
18
- size: { default: "md" },
19
- hourCycle: { default: 24 },
20
- locale: {},
21
- icon: { type: Boolean, default: true }
22
- },
23
- emits: ["update:modelValue", "blur"],
24
- setup(__props, { emit: __emit }) {
25
- const props = __props;
26
- const emit = __emit;
27
- function onFocusOut(event) {
28
- if (focusLeft(event)) emit("blur", event);
29
- }
30
- const value = computed(() => {
31
- const match = /^(\d{2}):(\d{2})/.exec(props.modelValue || "");
32
- return match ? new Time(Number(match[1]), Number(match[2])) : void 0;
33
- });
34
- function onUpdate(next) {
35
- if (!next || typeof next !== "object" || !("hour" in next) || !("minute" in next)) {
36
- emit("update:modelValue", void 0);
37
- return;
38
- }
39
- const pad = (n) => String(n).padStart(2, "0");
40
- emit("update:modelValue", `${pad(next.hour)}:${pad(next.minute)}`);
41
- }
42
- const field = useFieldControl(() => ({
43
- wrapped: false,
44
- invalid: props.invalid,
45
- disabled: props.disabled
46
- }));
47
- const shellSize = CONTROL_SIZE;
48
- const { class: rootClass, attrs: rest } = useMergedAttrs(
49
- () => [
50
- "flex w-full items-center gap-0.5 rounded-control border bg-surface-soft px-3 text-ink transition-colors duration-[var(--duration-fast)] focus-within:ring-2 focus-within:ring-ring data-[disabled]:cursor-not-allowed data-[disabled]:opacity-55",
51
- shellSize[props.size],
52
- field.value.invalid ? "border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand"
53
- ].join(" ")
54
- );
55
- usePaletteControl({ disabled: () => field.value.disabled, invalid: () => field.value.invalid });
56
- return (_ctx, _cache) => {
57
- return openBlock(), createBlock(unref(TimeFieldRoot), mergeProps({
58
- "model-value": value.value,
59
- "hour-cycle": __props.hourCycle,
60
- locale: __props.locale,
61
- granularity: "minute",
62
- disabled: unref(field).disabled,
63
- required: unref(field).required,
64
- "aria-invalid": unref(field).invalid || void 0,
65
- "aria-labelledby": unref(field).labelId,
66
- class: unref(rootClass)
67
- }, unref(rest), {
68
- "aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy),
69
- "onUpdate:modelValue": onUpdate,
70
- onFocusout: onFocusOut
71
- }), {
72
- default: withCtx(({ segments }) => [
73
- __props.icon ? (openBlock(), createBlock(_sfc_main$1, {
74
- key: 0,
75
- name: "lucide:clock",
76
- size: 15,
77
- class: "mr-1.5 shrink-0 text-muted"
78
- })) : createCommentVNode("", true),
79
- (openBlock(true), createElementBlock(Fragment, null, renderList(segments, (item, i) => {
80
- return openBlock(), createElementBlock(Fragment, { key: i }, [
81
- item.part === "literal" ? (openBlock(), createBlock(unref(TimeFieldInput), {
82
- key: 0,
83
- part: item.part,
84
- class: "text-muted"
85
- }, {
86
- default: withCtx(() => [
87
- createTextVNode(toDisplayString(item.value), 1)
88
- ]),
89
- _: 2
90
- }, 1032, ["part"])) : (openBlock(), createBlock(unref(TimeFieldInput), {
91
- key: 1,
92
- part: item.part,
93
- class: "rounded-sm px-0.5 tabular-nums outline-none focus:bg-brand-soft focus:text-brand data-[placeholder]:text-muted"
94
- }, {
95
- default: withCtx(() => [
96
- createTextVNode(toDisplayString(item.value), 1)
97
- ]),
98
- _: 2
99
- }, 1032, ["part"]))
100
- ], 64);
101
- }), 128))
102
- ]),
103
- _: 1
104
- }, 16, ["model-value", "hour-cycle", "locale", "disabled", "required", "aria-invalid", "aria-labelledby", "class", "aria-describedby"]);
105
- };
106
- }
107
- });
108
- export {
109
- _sfc_main as _
110
- };