@dgshahr/ui-kit 0.0.88 → 0.0.89

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.
@@ -1,128 +0,0 @@
1
- "use client";
2
- import { jsxs as T, jsx as t, Fragment as y } from "react/jsx-runtime";
3
- import { c as i } from "./clsx-OuTLNxxd.js";
4
- import { createContext as W, useContext as E, useRef as P, useEffect as S, useState as f } from "react";
5
- import D from "./Drawer/index.mjs";
6
- import { I as O } from "./IconArrowDown2-7ddwV5IE.js";
7
- import R from "./Form/Input/index.mjs";
8
- import './assets/styles.css';/* empty css */
9
- const v = W({
10
- toggleWrapperVisibility: () => {
11
- }
12
- }), F = () => E(v), A = (n) => {
13
- const e = P(null);
14
- return S(() => {
15
- const s = (r) => {
16
- e.current && !e.current.contains(r.target) && n();
17
- };
18
- return document.addEventListener("click", s, !0), () => {
19
- document.removeEventListener("click", s, !0);
20
- };
21
- }, [e, n]), e;
22
- }, w = "dgs-ui-kit-duration-300", h = 400, q = (n) => {
23
- const {
24
- dropdownType: e = "popover",
25
- disabled: s,
26
- isLoading: r,
27
- wrapperClassName: C,
28
- customInput: c,
29
- children: p,
30
- drawerProps: g,
31
- inputProps: x,
32
- popoverClassName: N
33
- } = n, [a, u] = f(!1), [m, d] = f(!1);
34
- let o;
35
- const b = A(() => {
36
- e === "popover" && a && (u(!1), o && clearTimeout(o), o = setTimeout(() => {
37
- d(!1);
38
- }, h));
39
- });
40
- function k() {
41
- if (s || r) return;
42
- const I = !m;
43
- o && clearTimeout(o), I ? (d(!0), o = setTimeout(() => {
44
- u(!0);
45
- }, 0)) : (u(!1), o = setTimeout(() => {
46
- d(!1);
47
- }, h));
48
- }
49
- const l = i({
50
- "!dgs-ui-kit-cursor-not-allowed": s,
51
- "!dgs-ui-kit-cursor-wait": r,
52
- "!dgs-ui-kit-cursor-pointer": !r && !s
53
- });
54
- return /* @__PURE__ */ T(
55
- "div",
56
- {
57
- ref: b,
58
- className: i("dgs-ui-kit-relative", C),
59
- children: [
60
- /* @__PURE__ */ t(
61
- "button",
62
- {
63
- type: "button",
64
- className: i("dgs-ui-kit-w-full", l),
65
- onClick: k,
66
- children: c ? c(a) : /* @__PURE__ */ t(
67
- R,
68
- {
69
- leftIcon: r ? /* @__PURE__ */ t("div", { className: "dot-flashing dgs-ui-kit-mr-2" }) : /* @__PURE__ */ t(
70
- O,
71
- {
72
- width: 20,
73
- height: 20,
74
- className: i("dgs-ui-kit-transition", w, {
75
- "dgs-ui-kit-rotate-180": a
76
- })
77
- }
78
- ),
79
- containerClassName: i(l, {
80
- "dgs-ui-kit-items-baseline": r
81
- }),
82
- className: i("dgs-ui-kit-caret-transparent", l),
83
- disabled: s,
84
- ...x
85
- }
86
- )
87
- }
88
- ),
89
- /* @__PURE__ */ t(
90
- v.Provider,
91
- {
92
- value: {
93
- toggleWrapperVisibility: k
94
- },
95
- children: m && /* @__PURE__ */ t(y, { children: e === "popover" ? /* @__PURE__ */ t(
96
- "div",
97
- {
98
- className: i(
99
- "dgs-ui-kit-absolute dgs-ui-kit-min-w-[300px] dgs-ui-kit-bottom-0 dgs-ui-kit-right-0 dgs-ui-kit-translate-y-[calc(100%+8px)] dgs-ui-kit-overflow-y-auto dgs-ui-kit-overflow-x-hidden dgs-ui-kit-shadow-lg dgs-ui-kit-w-full dgs-ui-kit-max-h-[360px] dgs-ui-kit-transition-all dgs-ui-kit-bg-white dgs-ui-kit-z-50 dgs-ui-kit-rounded-lg dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200 dgs-ui-kit-pb-3",
100
- w,
101
- a ? "dgs-ui-kit-opacity-100" : "dgs-ui-kit-opacity-0 dgs-ui-kit-max-h-0 dgs-ui-kit-overflow-y-hidden",
102
- N
103
- ),
104
- children: p
105
- }
106
- ) : /* @__PURE__ */ t(
107
- D,
108
- {
109
- ...g,
110
- open: a,
111
- onClose: () => u(!1),
112
- containerClassName: i(
113
- "!dgs-ui-kit-pb-3 !dgs-ui-kit-px-0",
114
- g?.containerClassName
115
- ),
116
- children: p
117
- }
118
- ) })
119
- }
120
- )
121
- ]
122
- }
123
- );
124
- };
125
- export {
126
- q as P,
127
- F as u
128
- };