@addsign/moje-agenda-shared-lib 2.0.14 → 2.0.16
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/Dialog-BmQoVu5C.js +424 -0
- package/dist/Dialog-BmQoVu5C.js.map +1 -0
- package/dist/assets/style.css +5 -50
- package/dist/components/datatable/DataTable.js +1 -2
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +1 -2
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +1 -2
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +1 -2
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/DateField.js +1 -1
- package/dist/components/form/DateField.js.map +1 -1
- package/dist/components/form/DateRangeField.js +1 -1
- package/dist/components/form/DateRangeField.js.map +1 -1
- package/dist/components/form/FileInput.js +2 -3
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +2 -3
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +1 -2
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/InputField.js +2 -2
- package/dist/components/form/InputField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +1 -2
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/SelectField.js +1 -2
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +1 -2
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.js +1 -1
- package/dist/components/ui/DateTimePicker.js +1 -1
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/ScrollArea.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/datepicker.js +1 -1
- package/dist/components/ui/input.js +12 -8
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/radioGroup.js +1 -1
- package/dist/components/ui/select.js +6 -7
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sonner.js +9 -5
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/timeInput.d.ts +7 -0
- package/dist/components/ui/timeInput.js +42 -0
- package/dist/components/ui/timeInput.js.map +1 -0
- package/dist/components/ui/toast.js +4 -5
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/tooltip.js +4 -4
- package/dist/form-CFof7yon.js +404 -0
- package/dist/form-CFof7yon.js.map +1 -0
- package/dist/index-DDUC0qyC.js +18 -0
- package/dist/index-DDUC0qyC.js.map +1 -0
- package/dist/index-DoIb06Ge.js +1162 -0
- package/dist/index-DoIb06Ge.js.map +1 -0
- package/dist/index-DrJcw1yx.js +2266 -0
- package/dist/index-DrJcw1yx.js.map +1 -0
- package/dist/index-Dz0Z0Mhp.js +234 -0
- package/dist/index-Dz0Z0Mhp.js.map +1 -0
- package/dist/main.d.ts +0 -1
- package/dist/main.js +1 -5
- package/dist/main.js.map +1 -1
- package/dist/popover-DpJhfyvx.js +319 -0
- package/dist/popover-DpJhfyvx.js.map +1 -0
- package/lib/components/form/DateField.tsx +1 -1
- package/lib/components/form/DateRangeField.tsx +1 -1
- package/lib/components/form/InputField.tsx +2 -2
- package/lib/components/ui/input.tsx +15 -9
- package/lib/main.ts +0 -1
- package/package.json +1 -2
- package/lib/components/ui/sonner.tsx +0 -31
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dz0Z0Mhp.js","sources":["../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs","../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n if (event.key === \"Escape\") {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\nexport {\n useEscapeKeydown\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/dismissable-layer/src/DismissableLayer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;AAGA,SAAS,iBAAiB,qBAAqB,gBAAgB,yCAAY,UAAU;AACnF,QAAM,kBAAkB,eAAe,mBAAmB;AAC1D,QAAM,UAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAU;AAC/B,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACtB;AAAA,IACP;AACI,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAI,CAAE;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAI,CAAE;AAAA,EAC9F,GAAK,CAAC,iBAAiB,aAAa,CAAC;AACrC;ACJA,IAAI,yBAAyB;AAC7B,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,gBAAgB;AACpB,IAAI;AACJ,IAAI,0BAA0B,MAAM,cAAc;AAAA,EAChD,QAAwB,oBAAI,IAAK;AAAA,EACjC,wCAAwD,oBAAI,IAAK;AAAA,EACjE,UAA0B,oBAAI,IAAK;AACrC,CAAC;AACE,IAAC,mBAAmB,MAAM;AAAA,EAC3B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,8BAA8B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,UAAU,MAAM,WAAW,uBAAuB;AACxD,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,IAAI;AAC3C,UAAM,iBAAgB,6BAAM,mBAAiB,yCAAY;AACzD,UAAM,CAAG,EAAA,KAAK,IA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,IAAC,SAAS;","x_google_ignoreList":[0,1]}
|
package/dist/main.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ export * from './components/ui/tooltip.tsx';
|
|
|
44
44
|
export * from './components/ui/separator.tsx';
|
|
45
45
|
export * from './components/ui/textarea.tsx';
|
|
46
46
|
export * from './components/ui/checkbox.tsx';
|
|
47
|
-
export * from './components/ui/sonner.tsx';
|
|
48
47
|
export { Button as ButtonCN, buttonVariants } from './components/ui/button.tsx';
|
|
49
48
|
export { Calendar as CalendarCn } from './components/ui/Calendar.tsx';
|
|
50
49
|
export { default as DateTimePicker } from './components/ui/DateTimePicker.tsx';
|
package/dist/main.js
CHANGED
|
@@ -31,7 +31,7 @@ import { handleErrors } from "./utils/handleErrors.js";
|
|
|
31
31
|
import { hasRightInModule } from "./utils/hasRightInModule.js";
|
|
32
32
|
import { hasRole } from "./utils/hasRole.js";
|
|
33
33
|
import { EApproverRoles, EApproverTypes, EDecisionsTranslations, EEntity, Eagendy, Eassignments, Estavy } from "./types.js";
|
|
34
|
-
import { D, c, e, i, g, f, b, a, h, d } from "./Dialog-
|
|
34
|
+
import { D, c, e, i, g, f, b, a, h, d } from "./Dialog-BmQoVu5C.js";
|
|
35
35
|
import { ScrollArea, ScrollBar } from "./components/ui/ScrollArea.js";
|
|
36
36
|
import { Input } from "./components/ui/input.js";
|
|
37
37
|
import { Form, FormControl, FormDescription, FormFieldCN, FormItem, FormLabel, FormMessage, useFormField } from "./components/ui/form.js";
|
|
@@ -43,12 +43,10 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./comp
|
|
|
43
43
|
import { Separator } from "./components/ui/separator.js";
|
|
44
44
|
import { Textarea } from "./components/ui/textarea.js";
|
|
45
45
|
import { Checkbox } from "./components/ui/checkbox.js";
|
|
46
|
-
import { Toaster } from "./components/ui/sonner.js";
|
|
47
46
|
import { Button, buttonVariants } from "./components/ui/button.js";
|
|
48
47
|
import { C } from "./Calendar-DWT4e7Th.js";
|
|
49
48
|
import { default as default23 } from "./components/ui/DateTimePicker.js";
|
|
50
49
|
import { default as default24 } from "./components/ui/DatePicker.js";
|
|
51
|
-
import { t } from "./index-CmEWEow1.js";
|
|
52
50
|
export {
|
|
53
51
|
default3 as AutocompleteSearchBar,
|
|
54
52
|
default4 as AutocompleteSearchBarServer,
|
|
@@ -131,7 +129,6 @@ export {
|
|
|
131
129
|
default13 as Spinner,
|
|
132
130
|
default21 as SpinnerIcon,
|
|
133
131
|
Textarea,
|
|
134
|
-
Toaster,
|
|
135
132
|
Tooltip,
|
|
136
133
|
TooltipContent,
|
|
137
134
|
TooltipProvider,
|
|
@@ -146,7 +143,6 @@ export {
|
|
|
146
143
|
hasRightInModule,
|
|
147
144
|
hasRole,
|
|
148
145
|
resetAllDataTablePaging,
|
|
149
|
-
t as toast,
|
|
150
146
|
useFederationContext,
|
|
151
147
|
useFormField
|
|
152
148
|
};
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { c as createContextScope, b as composeEventHandlers } from "./index-CDCkSjVs.js";
|
|
4
|
+
import { u as useComposedRefs, S as Slot } from "./index-D9mvqz1C.js";
|
|
5
|
+
import { D as DismissableLayer } from "./index-Dz0Z0Mhp.js";
|
|
6
|
+
import { h as hideOthers, R as ReactRemoveScroll, u as useFocusGuards, F as FocusScope } from "./index-DoIb06Ge.js";
|
|
7
|
+
import { u as useId } from "./index-Deoi9R3y.js";
|
|
8
|
+
import { c as createPopperScope, A as Anchor, C as Content, a as Arrow, R as Root2$1 } from "./index-DjvLSytK.js";
|
|
9
|
+
import { P as Portal$1 } from "./index-DDUC0qyC.js";
|
|
10
|
+
import { P as Presence } from "./index-CA2QNu6z.js";
|
|
11
|
+
import { P as Primitive } from "./index-B761_inZ.js";
|
|
12
|
+
import { u as useControllableState } from "./index-DFSwSCB0.js";
|
|
13
|
+
import { cn } from "./utils/utils.js";
|
|
14
|
+
var POPOVER_NAME = "Popover";
|
|
15
|
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
16
|
+
createPopperScope
|
|
17
|
+
]);
|
|
18
|
+
var usePopperScope = createPopperScope();
|
|
19
|
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
20
|
+
var Popover$1 = (props) => {
|
|
21
|
+
const {
|
|
22
|
+
__scopePopover,
|
|
23
|
+
children,
|
|
24
|
+
open: openProp,
|
|
25
|
+
defaultOpen,
|
|
26
|
+
onOpenChange,
|
|
27
|
+
modal = false
|
|
28
|
+
} = props;
|
|
29
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
30
|
+
const triggerRef = React.useRef(null);
|
|
31
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
32
|
+
const [open = false, setOpen] = useControllableState({
|
|
33
|
+
prop: openProp,
|
|
34
|
+
defaultProp: defaultOpen,
|
|
35
|
+
onChange: onOpenChange
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
38
|
+
PopoverProvider,
|
|
39
|
+
{
|
|
40
|
+
scope: __scopePopover,
|
|
41
|
+
contentId: useId(),
|
|
42
|
+
triggerRef,
|
|
43
|
+
open,
|
|
44
|
+
onOpenChange: setOpen,
|
|
45
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
46
|
+
hasCustomAnchor,
|
|
47
|
+
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
48
|
+
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
|
49
|
+
modal,
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
};
|
|
54
|
+
Popover$1.displayName = POPOVER_NAME;
|
|
55
|
+
var ANCHOR_NAME = "PopoverAnchor";
|
|
56
|
+
var PopoverAnchor = React.forwardRef(
|
|
57
|
+
(props, forwardedRef) => {
|
|
58
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
59
|
+
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
60
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
61
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
onCustomAnchorAdd();
|
|
64
|
+
return () => onCustomAnchorRemove();
|
|
65
|
+
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
66
|
+
return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
70
|
+
var TRIGGER_NAME = "PopoverTrigger";
|
|
71
|
+
var PopoverTrigger$1 = React.forwardRef(
|
|
72
|
+
(props, forwardedRef) => {
|
|
73
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
74
|
+
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
75
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
76
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
77
|
+
const trigger = /* @__PURE__ */ jsx(
|
|
78
|
+
Primitive.button,
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
"aria-haspopup": "dialog",
|
|
82
|
+
"aria-expanded": context.open,
|
|
83
|
+
"aria-controls": context.contentId,
|
|
84
|
+
"data-state": getState(context.open),
|
|
85
|
+
...triggerProps,
|
|
86
|
+
ref: composedTriggerRef,
|
|
87
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
PopoverTrigger$1.displayName = TRIGGER_NAME;
|
|
94
|
+
var PORTAL_NAME = "PopoverPortal";
|
|
95
|
+
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
|
96
|
+
forceMount: void 0
|
|
97
|
+
});
|
|
98
|
+
var PopoverPortal = (props) => {
|
|
99
|
+
const { __scopePopover, forceMount, children, container } = props;
|
|
100
|
+
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
|
101
|
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children }) }) });
|
|
102
|
+
};
|
|
103
|
+
PopoverPortal.displayName = PORTAL_NAME;
|
|
104
|
+
var CONTENT_NAME = "PopoverContent";
|
|
105
|
+
var PopoverContent$1 = React.forwardRef(
|
|
106
|
+
(props, forwardedRef) => {
|
|
107
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
|
108
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
109
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
110
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
PopoverContent$1.displayName = CONTENT_NAME;
|
|
114
|
+
var PopoverContentModal = React.forwardRef(
|
|
115
|
+
(props, forwardedRef) => {
|
|
116
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
117
|
+
const contentRef = React.useRef(null);
|
|
118
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
119
|
+
const isRightClickOutsideRef = React.useRef(false);
|
|
120
|
+
React.useEffect(() => {
|
|
121
|
+
const content = contentRef.current;
|
|
122
|
+
if (content)
|
|
123
|
+
return hideOthers(content);
|
|
124
|
+
}, []);
|
|
125
|
+
return /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
126
|
+
PopoverContentImpl,
|
|
127
|
+
{
|
|
128
|
+
...props,
|
|
129
|
+
ref: composedRefs,
|
|
130
|
+
trapFocus: context.open,
|
|
131
|
+
disableOutsidePointerEvents: true,
|
|
132
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
133
|
+
var _a;
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
if (!isRightClickOutsideRef.current)
|
|
136
|
+
(_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
137
|
+
}),
|
|
138
|
+
onPointerDownOutside: composeEventHandlers(
|
|
139
|
+
props.onPointerDownOutside,
|
|
140
|
+
(event) => {
|
|
141
|
+
const originalEvent = event.detail.originalEvent;
|
|
142
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
143
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
144
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
145
|
+
},
|
|
146
|
+
{ checkForDefaultPrevented: false }
|
|
147
|
+
),
|
|
148
|
+
onFocusOutside: composeEventHandlers(
|
|
149
|
+
props.onFocusOutside,
|
|
150
|
+
(event) => event.preventDefault(),
|
|
151
|
+
{ checkForDefaultPrevented: false }
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
) });
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
var PopoverContentNonModal = React.forwardRef(
|
|
158
|
+
(props, forwardedRef) => {
|
|
159
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
160
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
161
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
162
|
+
return /* @__PURE__ */ jsx(
|
|
163
|
+
PopoverContentImpl,
|
|
164
|
+
{
|
|
165
|
+
...props,
|
|
166
|
+
ref: forwardedRef,
|
|
167
|
+
trapFocus: false,
|
|
168
|
+
disableOutsidePointerEvents: false,
|
|
169
|
+
onCloseAutoFocus: (event) => {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
(_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
|
|
172
|
+
if (!event.defaultPrevented) {
|
|
173
|
+
if (!hasInteractedOutsideRef.current)
|
|
174
|
+
(_b = context.triggerRef.current) == null ? void 0 : _b.focus();
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
}
|
|
177
|
+
hasInteractedOutsideRef.current = false;
|
|
178
|
+
hasPointerDownOutsideRef.current = false;
|
|
179
|
+
},
|
|
180
|
+
onInteractOutside: (event) => {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
(_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
|
|
183
|
+
if (!event.defaultPrevented) {
|
|
184
|
+
hasInteractedOutsideRef.current = true;
|
|
185
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
186
|
+
hasPointerDownOutsideRef.current = true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const target = event.target;
|
|
190
|
+
const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
|
|
191
|
+
if (targetIsTrigger)
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
var PopoverContentImpl = React.forwardRef(
|
|
202
|
+
(props, forwardedRef) => {
|
|
203
|
+
const {
|
|
204
|
+
__scopePopover,
|
|
205
|
+
trapFocus,
|
|
206
|
+
onOpenAutoFocus,
|
|
207
|
+
onCloseAutoFocus,
|
|
208
|
+
disableOutsidePointerEvents,
|
|
209
|
+
onEscapeKeyDown,
|
|
210
|
+
onPointerDownOutside,
|
|
211
|
+
onFocusOutside,
|
|
212
|
+
onInteractOutside,
|
|
213
|
+
...contentProps
|
|
214
|
+
} = props;
|
|
215
|
+
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
|
216
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
217
|
+
useFocusGuards();
|
|
218
|
+
return /* @__PURE__ */ jsx(
|
|
219
|
+
FocusScope,
|
|
220
|
+
{
|
|
221
|
+
asChild: true,
|
|
222
|
+
loop: true,
|
|
223
|
+
trapped: trapFocus,
|
|
224
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
225
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
DismissableLayer,
|
|
228
|
+
{
|
|
229
|
+
asChild: true,
|
|
230
|
+
disableOutsidePointerEvents,
|
|
231
|
+
onInteractOutside,
|
|
232
|
+
onEscapeKeyDown,
|
|
233
|
+
onPointerDownOutside,
|
|
234
|
+
onFocusOutside,
|
|
235
|
+
onDismiss: () => context.onOpenChange(false),
|
|
236
|
+
children: /* @__PURE__ */ jsx(
|
|
237
|
+
Content,
|
|
238
|
+
{
|
|
239
|
+
"data-state": getState(context.open),
|
|
240
|
+
role: "dialog",
|
|
241
|
+
id: context.contentId,
|
|
242
|
+
...popperScope,
|
|
243
|
+
...contentProps,
|
|
244
|
+
ref: forwardedRef,
|
|
245
|
+
style: {
|
|
246
|
+
...contentProps.style,
|
|
247
|
+
// re-namespace exposed content custom properties
|
|
248
|
+
...{
|
|
249
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
250
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
251
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
252
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
253
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
var CLOSE_NAME = "PopoverClose";
|
|
265
|
+
var PopoverClose = React.forwardRef(
|
|
266
|
+
(props, forwardedRef) => {
|
|
267
|
+
const { __scopePopover, ...closeProps } = props;
|
|
268
|
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
269
|
+
return /* @__PURE__ */ jsx(
|
|
270
|
+
Primitive.button,
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
...closeProps,
|
|
274
|
+
ref: forwardedRef,
|
|
275
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
PopoverClose.displayName = CLOSE_NAME;
|
|
281
|
+
var ARROW_NAME = "PopoverArrow";
|
|
282
|
+
var PopoverArrow = React.forwardRef(
|
|
283
|
+
(props, forwardedRef) => {
|
|
284
|
+
const { __scopePopover, ...arrowProps } = props;
|
|
285
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
286
|
+
return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
PopoverArrow.displayName = ARROW_NAME;
|
|
290
|
+
function getState(open) {
|
|
291
|
+
return open ? "open" : "closed";
|
|
292
|
+
}
|
|
293
|
+
var Root2 = Popover$1;
|
|
294
|
+
var Trigger = PopoverTrigger$1;
|
|
295
|
+
var Portal = PopoverPortal;
|
|
296
|
+
var Content2 = PopoverContent$1;
|
|
297
|
+
const Popover = Root2;
|
|
298
|
+
const PopoverTrigger = Trigger;
|
|
299
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
300
|
+
Content2,
|
|
301
|
+
{
|
|
302
|
+
ref,
|
|
303
|
+
align,
|
|
304
|
+
sideOffset,
|
|
305
|
+
className: cn(
|
|
306
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
307
|
+
className
|
|
308
|
+
),
|
|
309
|
+
...props
|
|
310
|
+
}
|
|
311
|
+
) }));
|
|
312
|
+
PopoverContent.displayName = Content2.displayName;
|
|
313
|
+
export {
|
|
314
|
+
Popover as P,
|
|
315
|
+
PopoverTrigger as a,
|
|
316
|
+
PopoverContent as b,
|
|
317
|
+
PopoverClose as c
|
|
318
|
+
};
|
|
319
|
+
//# sourceMappingURL=popover-DpJhfyvx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-DpJhfyvx.js","sources":["../node_modules/@radix-ui/react-popover/dist/index.mjs","../lib/components/ui/popover.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/popover/src/Popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\n\r\nimport { cn } from \"../../utils/utils\";\r\n\r\nconst Popover = PopoverPrimitive.Root;\r\n\r\nconst PopoverTrigger = PopoverPrimitive.Trigger;\r\n\r\nconst PopoverContent = React.forwardRef<\r\n React.ElementRef<typeof PopoverPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n ref={ref}\r\n align={align}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n </PopoverPrimitive.Portal>\r\n));\r\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\r\n\r\nexport { Popover, PopoverTrigger, PopoverContent };\r\n"],"names":["Popover","PopperPrimitive.Root","PopperPrimitive.Anchor","PopoverTrigger","PortalPrimitive","PopoverContent","RemoveScroll","PopperPrimitive.Content","PopperPrimitive.Arrow","PopoverPrimitive.Root","PopoverPrimitive.Trigger","PopoverPrimitive.Portal","PopoverPrimitive.Content"],"mappings":";;;;;;;;;;;;;AAqBA,IAAI,eAAe;AACnB,IAAI,CAAC,sBAAsB,kBAAkB,IAAI,mBAAmB,cAAc;AAAA,EAChF;AACF,CAAC;AACD,IAAI,iBAAiB,kBAAiB;AACtC,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,qBAAqB,YAAY;A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AAAA,MACV;AAAA,QACE,MAAM;AAAA,QACN,GAAG;AAAA,QACH,KAAK;AAAA,QACL,SAAS,qBAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA,MAC/E;AAAA,IACP;AAAA,EACG;AACH;AACA,aAAa,cAAc;AAC3B,IAAI,aAAa;AACjB,IAAI,eAAe,MAAM;AAAA,EACvB,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,gBAAgB,GAAG,WAAU,IAAK;AAC1C,UAAM,cAAc,eAAe,cAAc;AACjD,WAAuB,oBAAIC,OAAuB,EAAE,GAAG,aAAa,GAAG,YAAY,KAAK,aAAY,CAAE;AAAA,EACvG;AACH;AACA,aAAa,cAAc;AAC3B,SAAS,SAAS,MAAM;AACtB,SAAO,OAAO,SAAS;AACzB;AACA,IAAI,QAAQR;AAEZ,IAAI,UAAUG;AACd,IAAI,SAAS;AACb,IAAI,WAAWE;AClSf,MAAM,UAAUI;AAEhB,MAAM,iBAAiBC;AAEvB,MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,QAAQ,UAAU,aAAa,GAAG,GAAG,MAAM,GAAG,QAC3D,oBAAAC,QAAA,EACC,UAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,EAAA,CACF,CACD;AACD,eAAe,cAAcA,SAAyB;","x_google_ignoreList":[0]}
|
|
@@ -93,7 +93,7 @@ export default function DateField({
|
|
|
93
93
|
inputClassName={(className) => {
|
|
94
94
|
return (
|
|
95
95
|
className +
|
|
96
|
-
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] font-normal ${rounded ? " rounded-lg " : " !rounded-none "}`
|
|
96
|
+
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] py-2.5 font-normal ${rounded ? " rounded-lg " : " !rounded-none "} outline-none shadow-none`
|
|
97
97
|
);
|
|
98
98
|
}}
|
|
99
99
|
containerClassName={(className) => {
|
|
@@ -83,7 +83,7 @@ export default function DateRangeField({
|
|
|
83
83
|
inputClassName={(className) => {
|
|
84
84
|
return (
|
|
85
85
|
className +
|
|
86
|
-
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] font-normal ${rounded ? " rounded-lg " : " !rounded-none "}`
|
|
86
|
+
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] font-normal ${rounded ? " rounded-lg " : " !rounded-none "} outline-none shadow-none `
|
|
87
87
|
);
|
|
88
88
|
}}
|
|
89
89
|
containerClassName={(className) => {
|
|
@@ -114,7 +114,7 @@ export default function InputField({
|
|
|
114
114
|
<textarea
|
|
115
115
|
id={name}
|
|
116
116
|
name={name}
|
|
117
|
-
className="grow shrink basis-0 text-gray-900 text-sm font-normal leading-tight focus:border-none
|
|
117
|
+
className="grow shrink basis-0 text-gray-900 text-sm font-normal leading-tight focus:border-none outline-none shadow-none
|
|
118
118
|
bg-white "
|
|
119
119
|
disabled={disabled}
|
|
120
120
|
value={inputValue}
|
|
@@ -137,7 +137,7 @@ export default function InputField({
|
|
|
137
137
|
return (
|
|
138
138
|
<>
|
|
139
139
|
<input
|
|
140
|
-
className={`text-gray-900 text-sm font-normal leading-normal
|
|
140
|
+
className={`text-gray-900 text-sm font-normal leading-normal outline-none shadow-none
|
|
141
141
|
text-ellipsis overflow-hidden w-full disabled:cursor-not-allowed bg-white`}
|
|
142
142
|
id={name}
|
|
143
143
|
name={name}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
2
|
import { cn } from "../..//utils/utils";
|
|
4
3
|
import { Button } from "./button";
|
|
5
4
|
import { LoaderCircleIcon, X } from "lucide-react";
|
|
@@ -25,6 +24,7 @@ const Input = React.forwardRef<HTMLInputElement, IInputProps>(
|
|
|
25
24
|
const [internalValue, setInternalValue] = React.useState(propValue || "");
|
|
26
25
|
const debounceTimeoutRef = React.useRef<NodeJS.Timeout | null>(null); // Ref to hold the debounce timeout
|
|
27
26
|
const [inputIsChanging, setInputIsChanging] = React.useState(false);
|
|
27
|
+
|
|
28
28
|
React.useEffect(() => {
|
|
29
29
|
setInternalValue(propValue ?? "");
|
|
30
30
|
}, [propValue]);
|
|
@@ -42,27 +42,33 @@ const Input = React.forwardRef<HTMLInputElement, IInputProps>(
|
|
|
42
42
|
|
|
43
43
|
// Set a new debounce timeout
|
|
44
44
|
debounceTimeoutRef.current = setTimeout(() => {
|
|
45
|
-
const newValue: string =
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const newValue: string | null =
|
|
46
|
+
type === "number" && value === "" ? null : value;
|
|
47
|
+
setInternalValue(newValue || "");
|
|
48
|
+
onChange?.({
|
|
49
|
+
target: { value: newValue },
|
|
50
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
|
48
51
|
setInputIsChanging(false);
|
|
49
52
|
}, debounceTimeout);
|
|
50
53
|
} else {
|
|
51
|
-
const newValue =
|
|
52
|
-
setInternalValue(newValue);
|
|
53
|
-
onChange?.(
|
|
54
|
+
const newValue = type === "number" && value === "" ? null : value;
|
|
55
|
+
setInternalValue(newValue || "");
|
|
56
|
+
onChange?.({
|
|
57
|
+
target: { value: newValue },
|
|
58
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
|
54
59
|
setInputIsChanging(false);
|
|
55
60
|
}
|
|
56
61
|
},
|
|
57
|
-
[debounceTimeout,
|
|
62
|
+
[debounceTimeout, type, onChange]
|
|
58
63
|
);
|
|
59
64
|
|
|
60
65
|
const handleClear = () => {
|
|
61
66
|
setInternalValue("");
|
|
62
67
|
onChange?.({
|
|
63
|
-
target: { value: "" },
|
|
68
|
+
target: { value: type === "number" ? null : "" },
|
|
64
69
|
} as React.ChangeEvent<HTMLInputElement>);
|
|
65
70
|
};
|
|
71
|
+
|
|
66
72
|
return (
|
|
67
73
|
<div className="relative w-full">
|
|
68
74
|
<input
|
package/lib/main.ts
CHANGED
|
@@ -65,7 +65,6 @@ export * from "./components/ui/tooltip.tsx";
|
|
|
65
65
|
export * from "./components/ui/separator.tsx";
|
|
66
66
|
export * from "./components/ui/textarea.tsx";
|
|
67
67
|
export * from "./components/ui/checkbox.tsx";
|
|
68
|
-
export * from "./components/ui/sonner.tsx";
|
|
69
68
|
export { Button as ButtonCN, buttonVariants } from "./components/ui/button.tsx";
|
|
70
69
|
|
|
71
70
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@addsign/moje-agenda-shared-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.16",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"react-icons": "^5.2.1",
|
|
95
95
|
"react-tailwindcss-datepicker": "^1.6.6",
|
|
96
96
|
"react-use": "^17.5.0",
|
|
97
|
-
"sonner": "^1.7.1",
|
|
98
97
|
"tailwind-merge": "^2.5.4",
|
|
99
98
|
"tailwindcss-animate": "^1.0.7",
|
|
100
99
|
"xlsx": "^0.18.5",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useTheme } from "next-themes";
|
|
4
|
-
import { Toaster as Sonner, toast } from "sonner";
|
|
5
|
-
|
|
6
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
7
|
-
|
|
8
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
9
|
-
const { theme = "system" } = useTheme();
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<Sonner
|
|
13
|
-
theme={theme as ToasterProps["theme"]}
|
|
14
|
-
className="toaster group"
|
|
15
|
-
toastOptions={{
|
|
16
|
-
classNames: {
|
|
17
|
-
toast:
|
|
18
|
-
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
19
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
20
|
-
actionButton:
|
|
21
|
-
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
22
|
-
cancelButton:
|
|
23
|
-
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
24
|
-
},
|
|
25
|
-
}}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { Toaster, toast };
|