@orion-ds/react 5.0.0 → 5.1.0
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/README.md +48 -4
- package/dist/client.cjs +1 -1
- package/dist/client.mjs +143 -139
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.module.css.cjs +1 -1
- package/dist/components/Button/Button.module.css.mjs +28 -28
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.mjs +105 -86
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.d.ts +2 -3
- package/dist/components/Chart/Chart.d.ts.map +1 -1
- package/dist/components/Chart/Chart.mjs +124 -71
- package/dist/components/Chat/components/ChatMarkdown.cjs +1 -1
- package/dist/components/Chat/components/ChatMarkdown.d.ts.map +1 -1
- package/dist/components/Chat/components/ChatMarkdown.mjs +32 -17
- package/dist/components/CodeEditor/CodeEditor.cjs +6 -6
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.mjs +118 -99
- package/dist/components/CollapsibleFolder/CollapsibleFolder.cjs +1 -1
- package/dist/components/CollapsibleFolder/CollapsibleFolder.d.ts.map +1 -1
- package/dist/components/CollapsibleFolder/CollapsibleFolder.mjs +123 -105
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +70 -52
- package/dist/components/MissingDependencyError.cjs +1 -0
- package/dist/components/MissingDependencyError.d.ts +5 -0
- package/dist/components/MissingDependencyError.d.ts.map +1 -0
- package/dist/components/MissingDependencyError.mjs +140 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +143 -139
- package/dist/styles.css +111 -3
- package/dist/theme.css +110 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/optionalDeps.cjs +1 -0
- package/dist/utils/optionalDeps.d.ts +63 -0
- package/dist/utils/optionalDeps.d.ts.map +1 -0
- package/dist/utils/optionalDeps.mjs +55 -0
- package/package.json +2 -1
|
@@ -1,80 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import oe, { useState as u, useRef as le } from "react";
|
|
3
|
+
import { ChevronDown as R, MoreHorizontal as ie } from "lucide-react";
|
|
4
|
+
import { MissingDependencyError as se } from "../MissingDependencyError.mjs";
|
|
5
|
+
import r from "./CollapsibleFolder.module.css.mjs";
|
|
6
6
|
import { Collapsible as v } from "../Collapsible/Collapsible.mjs";
|
|
7
|
-
import { Badge as
|
|
8
|
-
import { Dropdown as
|
|
9
|
-
import { Button as
|
|
10
|
-
|
|
7
|
+
import { Badge as de } from "../Badge/Badge.mjs";
|
|
8
|
+
import { Dropdown as w } from "../Dropdown/Dropdown.mjs";
|
|
9
|
+
import { Button as z } from "../Button/Button.mjs";
|
|
10
|
+
let A, O = null;
|
|
11
|
+
try {
|
|
12
|
+
A = require("@dnd-kit/core").useDroppable;
|
|
13
|
+
} catch (l) {
|
|
14
|
+
O = l instanceof Error ? l : new Error("@dnd-kit/core not found");
|
|
15
|
+
}
|
|
16
|
+
function ce(l) {
|
|
17
|
+
if (O)
|
|
18
|
+
return /* @__PURE__ */ t(
|
|
19
|
+
se,
|
|
20
|
+
{
|
|
21
|
+
available: !1,
|
|
22
|
+
componentName: "CollapsibleFolder",
|
|
23
|
+
depName: ["@dnd-kit/core", "@dnd-kit/sortable", "@dnd-kit/utilities"],
|
|
24
|
+
installCommand: "npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities",
|
|
25
|
+
pnpmCommand: "pnpm add @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities",
|
|
26
|
+
docsUrl: "https://docs.orion-ds.dev/components/collapsible-folder"
|
|
27
|
+
}
|
|
28
|
+
);
|
|
11
29
|
const {
|
|
12
|
-
id:
|
|
13
|
-
title:
|
|
14
|
-
itemCount:
|
|
15
|
-
items:
|
|
16
|
-
renderItem:
|
|
17
|
-
itemLabel:
|
|
18
|
-
itemLabelPlural:
|
|
19
|
-
emptyText:
|
|
20
|
-
sortLabel:
|
|
21
|
-
defaultExpanded:
|
|
22
|
-
sortOptions:
|
|
23
|
-
selectedSort:
|
|
30
|
+
id: p,
|
|
31
|
+
title: B,
|
|
32
|
+
itemCount: D,
|
|
33
|
+
items: i,
|
|
34
|
+
renderItem: j,
|
|
35
|
+
itemLabel: K = "Item",
|
|
36
|
+
itemLabelPlural: $ = "Items",
|
|
37
|
+
emptyText: q = "No items in this folder",
|
|
38
|
+
sortLabel: b = "Sort",
|
|
39
|
+
defaultExpanded: M = !0,
|
|
40
|
+
sortOptions: d,
|
|
41
|
+
selectedSort: Y,
|
|
24
42
|
onSortChange: H,
|
|
25
|
-
onDrop:
|
|
26
|
-
onFolderEdit:
|
|
27
|
-
onFolderDelete:
|
|
43
|
+
onDrop: N,
|
|
44
|
+
onFolderEdit: C,
|
|
45
|
+
onFolderDelete: k,
|
|
28
46
|
onFolderInvite: T,
|
|
29
|
-
isDropTarget:
|
|
30
|
-
isDropCompleted:
|
|
47
|
+
isDropTarget: P = !1,
|
|
48
|
+
isDropCompleted: U = !1,
|
|
31
49
|
onDragEnter: Z,
|
|
32
50
|
onDragLeaveFolder: x,
|
|
33
51
|
className: G,
|
|
34
52
|
...J
|
|
35
|
-
} =
|
|
36
|
-
if (e.preventDefault(), e.dataTransfer.dropEffect = "move",
|
|
37
|
-
|
|
53
|
+
} = l, [g, Q] = u(M), [f, c] = u(null), [y, h] = u(!1), I = le(null), { setNodeRef: V } = A({ id: p }), W = (e) => {
|
|
54
|
+
if (e.preventDefault(), e.dataTransfer.dropEffect = "move", y || (h(!0), Z?.()), !g || i.length === 0) {
|
|
55
|
+
c(0);
|
|
38
56
|
return;
|
|
39
57
|
}
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
|
|
58
|
+
const n = I.current;
|
|
59
|
+
if (!n) return;
|
|
60
|
+
const o = Array.from(
|
|
61
|
+
n.querySelectorAll("[data-item-id]")
|
|
44
62
|
), ae = e.clientY;
|
|
45
|
-
let
|
|
46
|
-
for (let
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
50
|
-
if (ae <
|
|
51
|
-
|
|
63
|
+
let E = o.length;
|
|
64
|
+
for (let m = 0; m < o.length; m++) {
|
|
65
|
+
const F = o[m];
|
|
66
|
+
if (!F) continue;
|
|
67
|
+
const S = F.getBoundingClientRect();
|
|
68
|
+
if (ae < S.top + S.height / 2) {
|
|
69
|
+
E = m;
|
|
52
70
|
break;
|
|
53
71
|
}
|
|
54
72
|
}
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
e.currentTarget.contains(e.relatedTarget) || (
|
|
58
|
-
},
|
|
73
|
+
c(E);
|
|
74
|
+
}, X = (e) => {
|
|
75
|
+
e.currentTarget.contains(e.relatedTarget) || (h(!1), c(null), x?.());
|
|
76
|
+
}, _ = (e) => {
|
|
59
77
|
e.preventDefault();
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
|
|
78
|
+
const n = e.dataTransfer.getData("text/plain") || e.dataTransfer.getData("itemId");
|
|
79
|
+
if (n && N) {
|
|
80
|
+
const o = f ?? i.length;
|
|
81
|
+
N(n, p, o);
|
|
64
82
|
}
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain",
|
|
68
|
-
},
|
|
83
|
+
h(!1), c(null), x?.();
|
|
84
|
+
}, ee = (e, n) => {
|
|
85
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", n);
|
|
86
|
+
}, te = d?.map((e) => ({
|
|
69
87
|
id: e.value,
|
|
70
88
|
label: e.label,
|
|
71
89
|
onClick: () => H?.(e.value)
|
|
72
|
-
})),
|
|
73
|
-
...
|
|
90
|
+
})), L = [
|
|
91
|
+
...C ? [
|
|
74
92
|
{
|
|
75
93
|
id: "rename",
|
|
76
94
|
label: "Rename",
|
|
77
|
-
onClick:
|
|
95
|
+
onClick: C
|
|
78
96
|
}
|
|
79
97
|
] : [],
|
|
80
98
|
...T ? [
|
|
@@ -84,113 +102,113 @@ function se(w) {
|
|
|
84
102
|
onClick: T
|
|
85
103
|
}
|
|
86
104
|
] : [],
|
|
87
|
-
...
|
|
105
|
+
...k ? [
|
|
88
106
|
{
|
|
89
107
|
id: "delete",
|
|
90
108
|
label: "Delete folder",
|
|
91
109
|
danger: !0,
|
|
92
|
-
onClick:
|
|
110
|
+
onClick: k
|
|
93
111
|
}
|
|
94
112
|
] : []
|
|
95
|
-
],
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
113
|
+
], s = P || y, re = [
|
|
114
|
+
r.folder,
|
|
115
|
+
s && r.dropTarget,
|
|
116
|
+
U && r.dropCompleted,
|
|
99
117
|
G
|
|
100
|
-
].filter(Boolean).join(" "),
|
|
101
|
-
return /* @__PURE__ */
|
|
118
|
+
].filter(Boolean).join(" "), ne = D === 1 ? K : $;
|
|
119
|
+
return /* @__PURE__ */ t(
|
|
102
120
|
"div",
|
|
103
121
|
{
|
|
104
|
-
ref:
|
|
105
|
-
className:
|
|
106
|
-
"data-folder-id":
|
|
107
|
-
"data-drop-active":
|
|
108
|
-
onDragOver:
|
|
109
|
-
onDragLeave:
|
|
110
|
-
onDrop:
|
|
122
|
+
ref: V,
|
|
123
|
+
className: re,
|
|
124
|
+
"data-folder-id": p,
|
|
125
|
+
"data-drop-active": s,
|
|
126
|
+
onDragOver: W,
|
|
127
|
+
onDragLeave: X,
|
|
128
|
+
onDrop: _,
|
|
111
129
|
...J,
|
|
112
|
-
children: /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ a(v, { open: g, onOpenChange: Q, children: [
|
|
131
|
+
/* @__PURE__ */ a("div", { className: r.header, children: [
|
|
132
|
+
/* @__PURE__ */ a(v.Trigger, { className: r.trigger, children: [
|
|
133
|
+
/* @__PURE__ */ t(
|
|
116
134
|
R,
|
|
117
135
|
{
|
|
118
136
|
size: 20,
|
|
119
|
-
className: `${
|
|
137
|
+
className: `${r.chevron} ${g ? r.expanded : ""}`
|
|
120
138
|
}
|
|
121
139
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
125
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ t("h2", { className: r.title, children: B }),
|
|
141
|
+
/* @__PURE__ */ a(de, { variant: "secondary", className: r.badge, children: [
|
|
142
|
+
D,
|
|
143
|
+
/* @__PURE__ */ a("span", { className: r.badgeLabel, children: [
|
|
126
144
|
" ",
|
|
127
|
-
|
|
145
|
+
ne
|
|
128
146
|
] })
|
|
129
147
|
] })
|
|
130
148
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
/* @__PURE__ */ a("div", { className: r.actions, children: [
|
|
150
|
+
d && d.length > 0 && /* @__PURE__ */ t("div", { className: r.sortDropdown, children: /* @__PURE__ */ t(
|
|
151
|
+
w,
|
|
134
152
|
{
|
|
135
|
-
trigger: /* @__PURE__ */
|
|
136
|
-
|
|
153
|
+
trigger: /* @__PURE__ */ t(
|
|
154
|
+
z,
|
|
137
155
|
{
|
|
138
156
|
variant: "ghost",
|
|
139
157
|
size: "sm",
|
|
140
|
-
iconRight: /* @__PURE__ */
|
|
141
|
-
"aria-label": `Sort by ${
|
|
142
|
-
children:
|
|
158
|
+
iconRight: /* @__PURE__ */ t(R, { size: 16 }),
|
|
159
|
+
"aria-label": `Sort by ${b}`,
|
|
160
|
+
children: d.find((e) => e.value === Y)?.label || b
|
|
143
161
|
}
|
|
144
162
|
),
|
|
145
|
-
items:
|
|
163
|
+
items: te,
|
|
146
164
|
placement: "bottom-end"
|
|
147
165
|
}
|
|
148
166
|
) }),
|
|
149
|
-
|
|
150
|
-
|
|
167
|
+
L.length > 0 && /* @__PURE__ */ t(
|
|
168
|
+
w,
|
|
151
169
|
{
|
|
152
|
-
trigger: /* @__PURE__ */
|
|
153
|
-
|
|
170
|
+
trigger: /* @__PURE__ */ t(
|
|
171
|
+
z,
|
|
154
172
|
{
|
|
155
173
|
variant: "ghost",
|
|
156
174
|
size: "sm",
|
|
157
175
|
iconOnly: !0,
|
|
158
|
-
icon: /* @__PURE__ */
|
|
176
|
+
icon: /* @__PURE__ */ t(ie, { size: 20 }),
|
|
159
177
|
"aria-label": "Folder actions"
|
|
160
178
|
}
|
|
161
179
|
),
|
|
162
|
-
items:
|
|
180
|
+
items: L,
|
|
163
181
|
placement: "bottom-end"
|
|
164
182
|
}
|
|
165
183
|
)
|
|
166
184
|
] })
|
|
167
185
|
] }),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
170
|
-
|
|
186
|
+
/* @__PURE__ */ t(v.Content, { children: /* @__PURE__ */ t("div", { className: r.content, children: i.length === 0 ? s ? /* @__PURE__ */ t("div", { className: r.emptyDropZone, children: /* @__PURE__ */ t("div", { className: r.insertionLine, role: "presentation" }) }) : /* @__PURE__ */ t("div", { className: r.emptyState, children: /* @__PURE__ */ t("p", { className: r.emptyText, children: q }) }) : /* @__PURE__ */ a("div", { className: r.grid, ref: I, children: [
|
|
187
|
+
i.map((e, n) => /* @__PURE__ */ a(oe.Fragment, { children: [
|
|
188
|
+
s && f === n && /* @__PURE__ */ t(
|
|
171
189
|
"div",
|
|
172
190
|
{
|
|
173
|
-
className:
|
|
191
|
+
className: r.insertionLine,
|
|
174
192
|
role: "presentation"
|
|
175
193
|
}
|
|
176
194
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ t(
|
|
178
196
|
"div",
|
|
179
197
|
{
|
|
180
198
|
"data-item-id": e.id,
|
|
181
199
|
draggable: e.draggable,
|
|
182
|
-
onDragStart: (
|
|
183
|
-
children:
|
|
200
|
+
onDragStart: (o) => ee(o, e.id),
|
|
201
|
+
children: j(e, n)
|
|
184
202
|
}
|
|
185
203
|
)
|
|
186
204
|
] }, e.id)),
|
|
187
|
-
|
|
205
|
+
s && f === i.length && /* @__PURE__ */ t("div", { className: r.insertionLine, role: "presentation" })
|
|
188
206
|
] }) }) })
|
|
189
207
|
] })
|
|
190
208
|
}
|
|
191
209
|
);
|
|
192
210
|
}
|
|
193
|
-
|
|
211
|
+
ce.displayName = "CollapsibleFolder";
|
|
194
212
|
export {
|
|
195
|
-
|
|
213
|
+
ce as CollapsibleFolder
|
|
196
214
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("react"),F=require("lucide-react"),M=require("../MissingDependencyError.cjs"),l=require("./DatePicker.module.css.cjs"),j=require("../Calendar/Calendar.cjs"),O=require("../Popover/Popover.cjs"),R=require("../Button/Button.cjs");let o,v=null;try{o=require("date-fns").format}catch(e){v=e instanceof Error?e:new Error("date-fns not found")}const x=e=>{if(v)return t.jsx(M.MissingDependencyError,{available:!1,componentName:"DatePicker",depName:"date-fns",installCommand:"npm install date-fns",pnpmCommand:"pnpm add date-fns",docsUrl:"https://docs.orion-ds.dev/components/date-picker"});const{mode:n="single",min:C,max:b,disabledDates:P,placeholder:u="Pick a date",presets:i,format:r="PPP",disabled:S=!1,triggerClassName:N,className:k}=e,[D,c]=d.useState(!1),f=d.useMemo(()=>n==="single"&&e.mode!=="range"?e.selected?o(e.selected,r):null:n==="range"&&e.mode==="range"&&e.selected?.from?e.selected.to?`${o(e.selected.from,r)} - ${o(e.selected.to,r)}`:o(e.selected.from,r):null,[n,e,r]),g=d.useCallback(a=>{if(n==="single"&&e.mode!=="range"){const s=e.onSelect;s?.(a),c(!1)}else if(n==="range"&&e.mode==="range"){const s=e.onSelect,m=a;s?.(m),m?.from&&m?.to&&c(!1)}},[n,e]),q=d.useCallback(a=>{if(n==="single"&&e.mode!=="range"){const s=e.onSelect;s?.(a.value)}else if(n==="range"&&e.mode==="range"){const s=e.onSelect;s?.(a.value)}c(!1)},[n,e]),y=[l.default.trigger,N].filter(Boolean).join(" "),w=[l.default.wrapper,k].filter(Boolean).join(" "),h={min:C,max:b,disabled:P},B=t.jsxs("div",{className:l.default.popoverContent,children:[i&&i.length>0&&t.jsx("div",{className:l.default.presets,children:i.map(a=>t.jsx("button",{type:"button",className:l.default.presetButton,onClick:()=>q(a),children:a.label},a.label))}),n==="single"?t.jsx(j.Calendar,{mode:"single",selected:e.mode!=="range"?e.selected:void 0,onSelect:g,...h}):t.jsx(j.Calendar,{mode:"range",selected:e.mode==="range"?e.selected:void 0,onSelect:g,...h})]}),E=t.jsx(R.Button,{variant:"secondary",className:y,disabled:S,"aria-label":u,icon:t.jsx(F.Calendar,{size:16,className:l.default.triggerIcon}),children:f?t.jsx("span",{children:f}):t.jsx("span",{className:l.default.placeholder,children:u})});return t.jsx("div",{className:w,children:t.jsx(O.Popover,{trigger:E,content:B,placement:"bottom-start",open:D,onOpenChange:c,showArrow:!1,offset:4,className:l.default.popover})})};x.displayName="DatePicker";exports.DatePicker=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAc5E,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsKhD,CAAC"}
|
|
@@ -1,63 +1,81 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { Calendar as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Button as
|
|
9
|
-
|
|
1
|
+
import { jsxs as F, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useMemo as M, useCallback as h } from "react";
|
|
3
|
+
import { Calendar as O } from "lucide-react";
|
|
4
|
+
import { MissingDependencyError as q } from "../MissingDependencyError.mjs";
|
|
5
|
+
import l from "./DatePicker.module.css.mjs";
|
|
6
|
+
import { Calendar as v } from "../Calendar/Calendar.mjs";
|
|
7
|
+
import { Popover as z } from "../Popover/Popover.mjs";
|
|
8
|
+
import { Button as A } from "../Button/Button.mjs";
|
|
9
|
+
let s, C = null;
|
|
10
|
+
try {
|
|
11
|
+
s = require("date-fns").format;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
C = e instanceof Error ? e : new Error("date-fns not found");
|
|
14
|
+
}
|
|
15
|
+
const I = (e) => {
|
|
16
|
+
if (C)
|
|
17
|
+
return /* @__PURE__ */ n(
|
|
18
|
+
q,
|
|
19
|
+
{
|
|
20
|
+
available: !1,
|
|
21
|
+
componentName: "DatePicker",
|
|
22
|
+
depName: "date-fns",
|
|
23
|
+
installCommand: "npm install date-fns",
|
|
24
|
+
pnpmCommand: "pnpm add date-fns",
|
|
25
|
+
docsUrl: "https://docs.orion-ds.dev/components/date-picker"
|
|
26
|
+
}
|
|
27
|
+
);
|
|
10
28
|
const {
|
|
11
29
|
mode: t = "single",
|
|
12
|
-
min:
|
|
13
|
-
max:
|
|
14
|
-
disabledDates:
|
|
30
|
+
min: N,
|
|
31
|
+
max: S,
|
|
32
|
+
disabledDates: b,
|
|
15
33
|
placeholder: m = "Pick a date",
|
|
16
|
-
presets:
|
|
34
|
+
presets: d,
|
|
17
35
|
format: r = "PPP",
|
|
18
|
-
disabled:
|
|
19
|
-
triggerClassName:
|
|
20
|
-
className:
|
|
21
|
-
} = e, [
|
|
22
|
-
(
|
|
36
|
+
disabled: P = !1,
|
|
37
|
+
triggerClassName: k,
|
|
38
|
+
className: y
|
|
39
|
+
} = e, [D, c] = $(!1), f = M(() => t === "single" && e.mode !== "range" ? e.selected ? s(e.selected, r) : null : t === "range" && e.mode === "range" && e.selected?.from ? e.selected.to ? `${s(e.selected.from, r)} - ${s(e.selected.to, r)}` : s(e.selected.from, r) : null, [t, e, r]), g = h(
|
|
40
|
+
(a) => {
|
|
23
41
|
if (t === "single" && e.mode !== "range") {
|
|
24
42
|
const o = e.onSelect;
|
|
25
|
-
o?.(
|
|
43
|
+
o?.(a), c(!1);
|
|
26
44
|
} else if (t === "range" && e.mode === "range") {
|
|
27
|
-
const o = e.onSelect,
|
|
28
|
-
o?.(
|
|
45
|
+
const o = e.onSelect, i = a;
|
|
46
|
+
o?.(i), i?.from && i?.to && c(!1);
|
|
29
47
|
}
|
|
30
48
|
},
|
|
31
49
|
[t, e]
|
|
32
|
-
),
|
|
33
|
-
(
|
|
50
|
+
), w = h(
|
|
51
|
+
(a) => {
|
|
34
52
|
if (t === "single" && e.mode !== "range") {
|
|
35
53
|
const o = e.onSelect;
|
|
36
|
-
o?.(
|
|
54
|
+
o?.(a.value);
|
|
37
55
|
} else if (t === "range" && e.mode === "range") {
|
|
38
56
|
const o = e.onSelect;
|
|
39
|
-
o?.(
|
|
57
|
+
o?.(a.value);
|
|
40
58
|
}
|
|
41
|
-
|
|
59
|
+
c(!1);
|
|
42
60
|
},
|
|
43
61
|
[t, e]
|
|
44
|
-
),
|
|
45
|
-
min:
|
|
46
|
-
max:
|
|
47
|
-
disabled:
|
|
48
|
-
}, B = /* @__PURE__ */
|
|
49
|
-
|
|
62
|
+
), x = [l.trigger, k].filter(Boolean).join(" "), j = [l.wrapper, y].filter(Boolean).join(" "), u = {
|
|
63
|
+
min: N,
|
|
64
|
+
max: S,
|
|
65
|
+
disabled: b
|
|
66
|
+
}, B = /* @__PURE__ */ F("div", { className: l.popoverContent, children: [
|
|
67
|
+
d && d.length > 0 && /* @__PURE__ */ n("div", { className: l.presets, children: d.map((a) => /* @__PURE__ */ n(
|
|
50
68
|
"button",
|
|
51
69
|
{
|
|
52
70
|
type: "button",
|
|
53
|
-
className:
|
|
54
|
-
onClick: () =>
|
|
55
|
-
children:
|
|
71
|
+
className: l.presetButton,
|
|
72
|
+
onClick: () => w(a),
|
|
73
|
+
children: a.label
|
|
56
74
|
},
|
|
57
|
-
|
|
75
|
+
a.label
|
|
58
76
|
)) }),
|
|
59
77
|
t === "single" ? /* @__PURE__ */ n(
|
|
60
|
-
|
|
78
|
+
v,
|
|
61
79
|
{
|
|
62
80
|
mode: "single",
|
|
63
81
|
selected: e.mode !== "range" ? e.selected : void 0,
|
|
@@ -65,7 +83,7 @@ const M = (e) => {
|
|
|
65
83
|
...u
|
|
66
84
|
}
|
|
67
85
|
) : /* @__PURE__ */ n(
|
|
68
|
-
|
|
86
|
+
v,
|
|
69
87
|
{
|
|
70
88
|
mode: "range",
|
|
71
89
|
selected: e.mode === "range" ? e.selected : void 0,
|
|
@@ -73,32 +91,32 @@ const M = (e) => {
|
|
|
73
91
|
...u
|
|
74
92
|
}
|
|
75
93
|
)
|
|
76
|
-
] }),
|
|
77
|
-
|
|
94
|
+
] }), E = /* @__PURE__ */ n(
|
|
95
|
+
A,
|
|
78
96
|
{
|
|
79
97
|
variant: "secondary",
|
|
80
|
-
className:
|
|
81
|
-
disabled:
|
|
98
|
+
className: x,
|
|
99
|
+
disabled: P,
|
|
82
100
|
"aria-label": m,
|
|
83
|
-
icon: /* @__PURE__ */ n(
|
|
84
|
-
children: f ? /* @__PURE__ */ n("span", { children: f }) : /* @__PURE__ */ n("span", { className:
|
|
101
|
+
icon: /* @__PURE__ */ n(O, { size: 16, className: l.triggerIcon }),
|
|
102
|
+
children: f ? /* @__PURE__ */ n("span", { children: f }) : /* @__PURE__ */ n("span", { className: l.placeholder, children: m })
|
|
85
103
|
}
|
|
86
104
|
);
|
|
87
|
-
return /* @__PURE__ */ n("div", { className:
|
|
88
|
-
|
|
105
|
+
return /* @__PURE__ */ n("div", { className: j, children: /* @__PURE__ */ n(
|
|
106
|
+
z,
|
|
89
107
|
{
|
|
90
|
-
trigger:
|
|
108
|
+
trigger: E,
|
|
91
109
|
content: B,
|
|
92
110
|
placement: "bottom-start",
|
|
93
|
-
open:
|
|
94
|
-
onOpenChange:
|
|
111
|
+
open: D,
|
|
112
|
+
onOpenChange: c,
|
|
95
113
|
showArrow: !1,
|
|
96
114
|
offset: 4,
|
|
97
|
-
className:
|
|
115
|
+
className: l.popover
|
|
98
116
|
}
|
|
99
117
|
) });
|
|
100
118
|
};
|
|
101
|
-
|
|
119
|
+
I.displayName = "DatePicker";
|
|
102
120
|
export {
|
|
103
|
-
|
|
121
|
+
I as DatePicker
|
|
104
122
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=({componentName:s,depName:r,installCommand:t,pnpmCommand:a,docsUrl:d})=>{const o=Array.isArray(r)?r:[r];return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"20px",border:"2px solid var(--status-error, #ef4444)",borderRadius:"var(--radius-control, 12px)",backgroundColor:"var(--surface-layer, #f3f4f6)",fontFamily:"var(--font-secondary, sans-serif)",fontSize:"14px",color:"var(--text-primary, #000)"},children:[e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[e.jsx("span",{style:{fontSize:"18px",fontWeight:"bold",color:"var(--status-error, #ef4444)",marginTop:"2px"},children:"🔴"}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:"600",marginBottom:"4px"},children:[s," component requires"," ",o.length===1?"a dependency":"dependencies"]}),e.jsx("div",{style:{color:"var(--text-secondary, #666)"},children:o.map((n,l)=>e.jsxs("div",{children:[o.length>1&&e.jsxs("span",{children:[l+1,". "]}),e.jsx("code",{style:{backgroundColor:"var(--surface-base, #fff)",padding:"2px 6px",borderRadius:"4px",fontFamily:"monospace"},children:n})]},n))})]})]}),e.jsxs("div",{style:{marginTop:"8px"},children:[e.jsx("div",{style:{fontWeight:"500",marginBottom:"8px"},children:"Install with npm:"}),e.jsx("code",{style:{display:"block",backgroundColor:"var(--surface-base, #fff)",padding:"8px 12px",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",overflow:"auto",border:"1px solid var(--border-subtle, #e5e7eb)"},children:t})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:"500",marginBottom:"8px"},children:"Or with pnpm:"}),e.jsx("code",{style:{display:"block",backgroundColor:"var(--surface-base, #fff)",padding:"8px 12px",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",overflow:"auto",border:"1px solid var(--border-subtle, #e5e7eb)"},children:a})]}),e.jsxs("div",{style:{marginTop:"4px",fontSize:"13px",color:"var(--text-secondary, #666)"},children:["Learn more:"," ",e.jsxs("a",{href:d,style:{color:"var(--text-brand, #1b5bff)",textDecoration:"underline"},children:["Orion ",s," Documentation"]})]})]})};i.displayName="MissingDependencyError";exports.MissingDependencyError=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MissingDependencyError.d.ts","sourceRoot":"","sources":["../../src/components/MissingDependencyError.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwH7D,CAAC"}
|