@dreamtree-org/twreact-ui 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +2 -2
- package/README.md +258 -10
- package/ai-skills/dreamtree-ui.md +111 -15
- package/charts/package.json +5 -0
- package/dist/_shared/cn-DPPQUJu1.js +138 -0
- package/dist/ai-schema.json +1252 -179
- package/dist/charts/index.d.ts +9 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +769 -0
- package/dist/components/charts/AreaChart.d.ts +4 -0
- package/dist/components/charts/AreaChart.d.ts.map +1 -0
- package/dist/components/charts/BarChart.d.ts +4 -0
- package/dist/components/charts/BarChart.d.ts.map +1 -0
- package/dist/components/charts/CartesianChart.d.ts +5 -0
- package/dist/components/charts/CartesianChart.d.ts.map +1 -0
- package/dist/components/charts/ChartFrame.d.ts +18 -0
- package/dist/components/charts/ChartFrame.d.ts.map +1 -0
- package/dist/components/charts/DonutChart.d.ts +4 -0
- package/dist/components/charts/DonutChart.d.ts.map +1 -0
- package/dist/components/charts/LineChart.d.ts +4 -0
- package/dist/components/charts/LineChart.d.ts.map +1 -0
- package/dist/components/charts/Sparkline.d.ts +5 -0
- package/dist/components/charts/Sparkline.d.ts.map +1 -0
- package/dist/components/charts/chartTheme.d.ts +26 -0
- package/dist/components/charts/chartTheme.d.ts.map +1 -0
- package/dist/components/core/Accordion.d.ts.map +1 -1
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Checkbox.d.ts.map +1 -1
- package/dist/components/core/ColorPicker.d.ts.map +1 -1
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Form.d.ts.map +1 -1
- package/dist/components/core/Input.d.ts.map +1 -1
- package/dist/components/core/LocationPicker.d.ts.map +1 -1
- package/dist/components/core/Popover.d.ts +4 -0
- package/dist/components/core/Popover.d.ts.map +1 -0
- package/dist/components/core/PriceRangePicker.d.ts.map +1 -1
- package/dist/components/core/ProgressBar.d.ts.map +1 -1
- package/dist/components/core/Radio.d.ts.map +1 -1
- package/dist/components/core/Rate.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/core/Skeleton.d.ts.map +1 -1
- package/dist/components/core/Slider.d.ts +4 -0
- package/dist/components/core/Slider.d.ts.map +1 -0
- package/dist/components/core/SpeechToText.d.ts.map +1 -1
- package/dist/components/core/Switch.d.ts.map +1 -1
- package/dist/components/core/Table/ActionMenu.d.ts.map +1 -1
- package/dist/components/core/Table/ColumnMenu.d.ts +2 -1
- package/dist/components/core/Table/ColumnMenu.d.ts.map +1 -1
- package/dist/components/core/Table/MobileCard.d.ts +2 -2
- package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
- package/dist/components/core/Table/Table.d.ts.map +1 -1
- package/dist/components/core/Table/TableRow.d.ts +4 -2
- package/dist/components/core/Table/TableRow.d.ts.map +1 -1
- package/dist/components/core/Tabs.d.ts.map +1 -1
- package/dist/components/core/Textarea.d.ts +4 -0
- package/dist/components/core/Textarea.d.ts.map +1 -0
- package/dist/components/core/ThreeDotPopover.d.ts.map +1 -1
- package/dist/components/core/Tooltip.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/Drawer.d.ts +4 -0
- package/dist/components/feedback/Drawer.d.ts.map +1 -0
- package/dist/components/feedback/Toast.d.ts +14 -5
- package/dist/components/feedback/Toast.d.ts.map +1 -1
- package/dist/components/feedback/Tour.d.ts +4 -0
- package/dist/components/feedback/Tour.d.ts.map +1 -0
- package/dist/components/feedback/TourSpotlight.d.ts +9 -0
- package/dist/components/feedback/TourSpotlight.d.ts.map +1 -0
- package/dist/components/navigation/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/FootNav.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +8 -2
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/rich-text/RichTextEditor.d.ts +4 -0
- package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -0
- package/dist/components/rich-text/RichTextToolbar.d.ts +219 -0
- package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -0
- package/dist/components/utility/Badge.d.ts.map +1 -1
- package/dist/components/utility/FileUpload.d.ts.map +1 -1
- package/dist/components/utility/Sortable.d.ts +4 -0
- package/dist/components/utility/Sortable.d.ts.map +1 -0
- package/dist/esm/_vendor/object-assign/index.js +99 -0
- package/dist/esm/_vendor/prop-types/_vendor/react-is/cjs/react-is.development.js +190 -0
- package/dist/esm/_vendor/prop-types/_vendor/react-is/cjs/react-is.production.min.js +26 -0
- package/dist/esm/_vendor/prop-types/_vendor/react-is/index.js +19 -0
- package/dist/esm/_vendor/prop-types/checkPropTypes.js +115 -0
- package/dist/esm/_vendor/prop-types/factoryWithThrowingShims.js +74 -0
- package/dist/esm/_vendor/prop-types/factoryWithTypeCheckers.js +625 -0
- package/dist/esm/_vendor/prop-types/index.js +30 -0
- package/dist/esm/_vendor/prop-types/lib/ReactPropTypesSecret.js +21 -0
- package/dist/esm/_vendor/prop-types/lib/has.js +11 -0
- package/dist/esm/_virtual/_commonjsHelpers.js +5 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +329 -0
- package/dist/esm/_virtual/index.js +3 -0
- package/dist/esm/_virtual/index2.js +3 -0
- package/dist/esm/_virtual/react-is.development.js +3 -0
- package/dist/esm/_virtual/react-is.production.min.js +3 -0
- package/dist/esm/charts/index.js +5 -0
- package/dist/esm/components/blocks/AppShell.js +205 -0
- package/dist/esm/components/blocks/ConfirmDialog.js +57 -0
- package/dist/esm/components/blocks/EmptyState.js +44 -0
- package/dist/esm/components/blocks/ErrorState.js +53 -0
- package/dist/esm/components/blocks/LoadingState.js +134 -0
- package/dist/esm/components/blocks/PageHeader.js +51 -0
- package/dist/esm/components/blocks/StatCard.js +79 -0
- package/dist/esm/components/blocks/StatusPill.js +55 -0
- package/dist/esm/components/charts/AreaChart.js +16 -0
- package/dist/esm/components/charts/BarChart.js +16 -0
- package/dist/esm/components/charts/CartesianChart.js +250 -0
- package/dist/esm/components/charts/ChartFrame.js +170 -0
- package/dist/esm/components/charts/DonutChart.js +119 -0
- package/dist/esm/components/charts/LineChart.js +16 -0
- package/dist/esm/components/charts/Sparkline.js +110 -0
- package/dist/esm/components/charts/chartTheme.js +109 -0
- package/dist/esm/components/core/Accordion.js +260 -0
- package/dist/esm/components/core/Button.js +59 -0
- package/dist/esm/components/core/Checkbox.js +188 -0
- package/dist/esm/components/core/ColorPicker.js +348 -0
- package/dist/esm/components/core/DatePicker.js +436 -0
- package/dist/esm/components/core/DateRangePicker.js +494 -0
- package/dist/esm/components/core/Form.js +522 -0
- package/dist/esm/components/core/Input.js +179 -0
- package/dist/esm/components/core/Loader.js +141 -0
- package/dist/esm/components/core/LocationPicker.js +161 -0
- package/dist/esm/components/core/Popover.js +171 -0
- package/dist/esm/components/core/PriceRangePicker.js +376 -0
- package/dist/esm/components/core/ProgressBar.js +152 -0
- package/dist/esm/components/core/Radio.js +156 -0
- package/dist/esm/components/core/Rate.js +197 -0
- package/dist/esm/components/core/RoundedTag.js +118 -0
- package/dist/esm/components/core/Select.js +857 -0
- package/dist/esm/components/core/Skeleton.js +100 -0
- package/dist/esm/components/core/Slider.js +134 -0
- package/dist/esm/components/core/SpeechToText.js +226 -0
- package/dist/esm/components/core/Switch.js +207 -0
- package/dist/esm/components/core/Table/ActionMenu.js +251 -0
- package/dist/esm/components/core/Table/ColumnMenu.js +55 -0
- package/dist/esm/components/core/Table/FieldInput.js +157 -0
- package/dist/esm/components/core/Table/MobileCard.js +187 -0
- package/dist/esm/components/core/Table/MobileFilters.js +72 -0
- package/dist/esm/components/core/Table/Pagination.js +157 -0
- package/dist/esm/components/core/Table/Table.js +1533 -0
- package/dist/esm/components/core/Table/TableRow.js +254 -0
- package/dist/esm/components/core/Table/constants.js +35 -0
- package/dist/esm/components/core/Table/helpers.js +124 -0
- package/dist/esm/components/core/Table/useClickOutside.js +26 -0
- package/dist/esm/components/core/Tabs.js +289 -0
- package/dist/esm/components/core/TextToSpeech.js +52 -0
- package/dist/esm/components/core/Textarea.js +125 -0
- package/dist/esm/components/core/ThreeDotPopover.js +160 -0
- package/dist/esm/components/core/Tooltip.js +372 -0
- package/dist/esm/components/feedback/Alert.js +96 -0
- package/dist/esm/components/feedback/Dialog.js +200 -0
- package/dist/esm/components/feedback/Drawer.js +171 -0
- package/dist/esm/components/feedback/Toast.js +362 -0
- package/dist/esm/components/feedback/Tour.js +214 -0
- package/dist/esm/components/feedback/TourSpotlight.js +71 -0
- package/dist/esm/components/navigation/Breadcrumbs.js +75 -0
- package/dist/esm/components/navigation/Dropdown.js +53 -0
- package/dist/esm/components/navigation/FootNav.js +51 -0
- package/dist/esm/components/navigation/Navbar.js +437 -0
- package/dist/esm/components/navigation/Sidebar.js +567 -0
- package/dist/esm/components/rich-text/RichTextEditor.js +244 -0
- package/dist/esm/components/rich-text/RichTextToolbar.js +397 -0
- package/dist/esm/components/utility/Avatar.js +89 -0
- package/dist/esm/components/utility/Badge.js +47 -0
- package/dist/esm/components/utility/Card.js +85 -0
- package/dist/esm/components/utility/Carousel.js +97 -0
- package/dist/esm/components/utility/Condition.js +9 -0
- package/dist/esm/components/utility/FileUpload.js +177 -0
- package/dist/esm/components/utility/Pagination.js +111 -0
- package/dist/esm/components/utility/Sortable.js +190 -0
- package/dist/esm/components/utility/Stepper.js +101 -0
- package/dist/esm/hooks/useApi.js +169 -0
- package/dist/esm/hooks/useControllableState.js +32 -0
- package/dist/esm/hooks/useFocusTrap.js +85 -0
- package/dist/esm/hooks/useLatestRef.js +20 -0
- package/dist/esm/hooks/useMixins.js +100 -0
- package/dist/esm/hooks/useScrollLock.js +26 -0
- package/dist/esm/hooks/useSliderValues.js +135 -0
- package/dist/esm/hooks/useSortable.js +188 -0
- package/dist/esm/hooks/useTheme.js +53 -0
- package/dist/esm/hooks/useTourTarget.js +92 -0
- package/dist/esm/index.js +65 -0
- package/dist/esm/rich-text/index.js +1 -0
- package/dist/esm/store/index.js +26 -0
- package/dist/esm/store/store.js +107 -0
- package/dist/esm/store/storeSlice.js +45 -0
- package/dist/esm/utils/cn.js +11 -0
- package/dist/esm/utils/emitter.js +169 -0
- package/dist/esm/utils/helpers.js +161 -0
- package/dist/esm/utils/position.js +134 -0
- package/dist/hooks/useApi.d.ts +2 -1
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useControllableState.d.ts +11 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.d.ts +15 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useLatestRef.d.ts +8 -0
- package/dist/hooks/useLatestRef.d.ts.map +1 -0
- package/dist/hooks/useMixins.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.d.ts +2 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/hooks/useSliderValues.d.ts +43 -0
- package/dist/hooks/useSliderValues.d.ts.map +1 -0
- package/dist/hooks/useSortable.d.ts +32 -0
- package/dist/hooks/useSortable.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTourTarget.d.ts +15 -0
- package/dist/hooks/useTourTarget.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +4817 -2216
- package/dist/index.js +4822 -2214
- package/dist/rich-text/index.d.ts +5 -0
- package/dist/rich-text/index.d.ts.map +1 -0
- package/dist/rich-text/index.js +654 -0
- package/dist/tokens/brands/studio.css +14 -0
- package/dist/tokens/brands/studio.json +20 -0
- package/dist/types/charts.d.ts +97 -0
- package/dist/types/charts.d.ts.map +1 -0
- package/dist/types/index.d.ts +193 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rich-text.d.ts +50 -0
- package/dist/types/rich-text.d.ts.map +1 -0
- package/dist/utils/position.d.ts +30 -0
- package/dist/utils/position.d.ts.map +1 -0
- package/doc/README.md +20 -1
- package/mcp/catalog.snapshot.json +2505 -800
- package/mcp/server-core.mjs +30 -1
- package/package.json +51 -3
- package/rich-text/package.json +5 -0
- package/tokens/brands/studio.json +20 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
function _arrayLikeToArray(r, a) {
|
|
2
|
+
(null == a || a > r.length) && (a = r.length);
|
|
3
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(r) {
|
|
7
|
+
if (Array.isArray(r)) return r;
|
|
8
|
+
}
|
|
9
|
+
function _arrayWithoutHoles(r) {
|
|
10
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
11
|
+
}
|
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
13
|
+
try {
|
|
14
|
+
var i = n[a](c),
|
|
15
|
+
u = i.value;
|
|
16
|
+
} catch (n) {
|
|
17
|
+
return void e(n);
|
|
18
|
+
}
|
|
19
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
20
|
+
}
|
|
21
|
+
function _asyncToGenerator(n) {
|
|
22
|
+
return function () {
|
|
23
|
+
var t = this,
|
|
24
|
+
e = arguments;
|
|
25
|
+
return new Promise(function (r, o) {
|
|
26
|
+
var a = n.apply(t, e);
|
|
27
|
+
function _next(n) {
|
|
28
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
29
|
+
}
|
|
30
|
+
function _throw(n) {
|
|
31
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
32
|
+
}
|
|
33
|
+
_next(void 0);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function _classCallCheck(a, n) {
|
|
38
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
39
|
+
}
|
|
40
|
+
function _defineProperties(e, r) {
|
|
41
|
+
for (var t = 0; t < r.length; t++) {
|
|
42
|
+
var o = r[t];
|
|
43
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function _createClass(e, r, t) {
|
|
47
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
48
|
+
writable: false
|
|
49
|
+
}), e;
|
|
50
|
+
}
|
|
51
|
+
function _createForOfIteratorHelper(r, e) {
|
|
52
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
53
|
+
if (!t) {
|
|
54
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
55
|
+
t && (r = t);
|
|
56
|
+
var n = 0,
|
|
57
|
+
F = function () {};
|
|
58
|
+
return {
|
|
59
|
+
s: F,
|
|
60
|
+
n: function () {
|
|
61
|
+
return n >= r.length ? {
|
|
62
|
+
done: true
|
|
63
|
+
} : {
|
|
64
|
+
done: false,
|
|
65
|
+
value: r[n++]
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
e: function (r) {
|
|
69
|
+
throw r;
|
|
70
|
+
},
|
|
71
|
+
f: F
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
75
|
+
}
|
|
76
|
+
var o,
|
|
77
|
+
a = true,
|
|
78
|
+
u = false;
|
|
79
|
+
return {
|
|
80
|
+
s: function () {
|
|
81
|
+
t = t.call(r);
|
|
82
|
+
},
|
|
83
|
+
n: function () {
|
|
84
|
+
var r = t.next();
|
|
85
|
+
return a = r.done, r;
|
|
86
|
+
},
|
|
87
|
+
e: function (r) {
|
|
88
|
+
u = true, o = r;
|
|
89
|
+
},
|
|
90
|
+
f: function () {
|
|
91
|
+
try {
|
|
92
|
+
a || null == t.return || t.return();
|
|
93
|
+
} finally {
|
|
94
|
+
if (u) throw o;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function _defineProperty(e, r, t) {
|
|
100
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
101
|
+
value: t,
|
|
102
|
+
enumerable: true,
|
|
103
|
+
configurable: true,
|
|
104
|
+
writable: true
|
|
105
|
+
}) : e[r] = t, e;
|
|
106
|
+
}
|
|
107
|
+
function _iterableToArray(r) {
|
|
108
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
109
|
+
}
|
|
110
|
+
function _iterableToArrayLimit(r, l) {
|
|
111
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
112
|
+
if (null != t) {
|
|
113
|
+
var e,
|
|
114
|
+
n,
|
|
115
|
+
i,
|
|
116
|
+
u,
|
|
117
|
+
a = [],
|
|
118
|
+
f = true,
|
|
119
|
+
o = false;
|
|
120
|
+
try {
|
|
121
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
122
|
+
if (Object(t) !== t) return;
|
|
123
|
+
f = !1;
|
|
124
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
125
|
+
} catch (r) {
|
|
126
|
+
o = true, n = r;
|
|
127
|
+
} finally {
|
|
128
|
+
try {
|
|
129
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
130
|
+
} finally {
|
|
131
|
+
if (o) throw n;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return a;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function _nonIterableRest() {
|
|
138
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
+
}
|
|
140
|
+
function _nonIterableSpread() {
|
|
141
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
142
|
+
}
|
|
143
|
+
function ownKeys(e, r) {
|
|
144
|
+
var t = Object.keys(e);
|
|
145
|
+
if (Object.getOwnPropertySymbols) {
|
|
146
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
147
|
+
r && (o = o.filter(function (r) {
|
|
148
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
149
|
+
})), t.push.apply(t, o);
|
|
150
|
+
}
|
|
151
|
+
return t;
|
|
152
|
+
}
|
|
153
|
+
function _objectSpread2(e) {
|
|
154
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
155
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
156
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
157
|
+
_defineProperty(e, r, t[r]);
|
|
158
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
159
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return e;
|
|
163
|
+
}
|
|
164
|
+
function _objectWithoutProperties(e, t) {
|
|
165
|
+
if (null == e) return {};
|
|
166
|
+
var o,
|
|
167
|
+
r,
|
|
168
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
169
|
+
if (Object.getOwnPropertySymbols) {
|
|
170
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
171
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
172
|
+
}
|
|
173
|
+
return i;
|
|
174
|
+
}
|
|
175
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
176
|
+
if (null == r) return {};
|
|
177
|
+
var t = {};
|
|
178
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
179
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
180
|
+
t[n] = r[n];
|
|
181
|
+
}
|
|
182
|
+
return t;
|
|
183
|
+
}
|
|
184
|
+
function _regenerator() {
|
|
185
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
186
|
+
var e,
|
|
187
|
+
t,
|
|
188
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
189
|
+
n = r.iterator || "@@iterator",
|
|
190
|
+
o = r.toStringTag || "@@toStringTag";
|
|
191
|
+
function i(r, n, o, i) {
|
|
192
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
193
|
+
u = Object.create(c.prototype);
|
|
194
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
195
|
+
var i,
|
|
196
|
+
c,
|
|
197
|
+
u,
|
|
198
|
+
f = 0,
|
|
199
|
+
p = o || [],
|
|
200
|
+
y = false,
|
|
201
|
+
G = {
|
|
202
|
+
p: 0,
|
|
203
|
+
n: 0,
|
|
204
|
+
v: e,
|
|
205
|
+
a: d,
|
|
206
|
+
f: d.bind(e, 4),
|
|
207
|
+
d: function (t, r) {
|
|
208
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
function d(r, n) {
|
|
212
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
213
|
+
var o,
|
|
214
|
+
i = p[t],
|
|
215
|
+
d = G.p,
|
|
216
|
+
l = i[2];
|
|
217
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
218
|
+
}
|
|
219
|
+
if (o || r > 1) return a;
|
|
220
|
+
throw y = true, n;
|
|
221
|
+
}
|
|
222
|
+
return function (o, p, l) {
|
|
223
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
224
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
225
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
226
|
+
try {
|
|
227
|
+
if (f = 2, i) {
|
|
228
|
+
if (c || (o = "next"), t = i[o]) {
|
|
229
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
230
|
+
if (!t.done) return t;
|
|
231
|
+
u = t.value, c < 2 && (c = 0);
|
|
232
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
233
|
+
i = e;
|
|
234
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
235
|
+
} catch (t) {
|
|
236
|
+
i = e, c = 1, u = t;
|
|
237
|
+
} finally {
|
|
238
|
+
f = 1;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
value: t,
|
|
243
|
+
done: y
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
}(r, o, i), true), u;
|
|
247
|
+
}
|
|
248
|
+
var a = {};
|
|
249
|
+
function Generator() {}
|
|
250
|
+
function GeneratorFunction() {}
|
|
251
|
+
function GeneratorFunctionPrototype() {}
|
|
252
|
+
t = Object.getPrototypeOf;
|
|
253
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
254
|
+
return this;
|
|
255
|
+
}), t),
|
|
256
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
257
|
+
function f(e) {
|
|
258
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
259
|
+
}
|
|
260
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
261
|
+
return this;
|
|
262
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
263
|
+
return "[object Generator]";
|
|
264
|
+
}), (_regenerator = function () {
|
|
265
|
+
return {
|
|
266
|
+
w: i,
|
|
267
|
+
m: f
|
|
268
|
+
};
|
|
269
|
+
})();
|
|
270
|
+
}
|
|
271
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
272
|
+
var i = Object.defineProperty;
|
|
273
|
+
try {
|
|
274
|
+
i({}, "", {});
|
|
275
|
+
} catch (e) {
|
|
276
|
+
i = 0;
|
|
277
|
+
}
|
|
278
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
279
|
+
function o(r, n) {
|
|
280
|
+
_regeneratorDefine(e, r, function (e) {
|
|
281
|
+
return this._invoke(r, n, e);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
r ? i ? i(e, r, {
|
|
285
|
+
value: n,
|
|
286
|
+
enumerable: !t,
|
|
287
|
+
configurable: !t,
|
|
288
|
+
writable: !t
|
|
289
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
290
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
291
|
+
}
|
|
292
|
+
function _slicedToArray(r, e) {
|
|
293
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
294
|
+
}
|
|
295
|
+
function _toConsumableArray(r) {
|
|
296
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
297
|
+
}
|
|
298
|
+
function _toPrimitive(t, r) {
|
|
299
|
+
if ("object" != typeof t || !t) return t;
|
|
300
|
+
var e = t[Symbol.toPrimitive];
|
|
301
|
+
if (void 0 !== e) {
|
|
302
|
+
var i = e.call(t, r);
|
|
303
|
+
if ("object" != typeof i) return i;
|
|
304
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
305
|
+
}
|
|
306
|
+
return ("string" === r ? String : Number)(t);
|
|
307
|
+
}
|
|
308
|
+
function _toPropertyKey(t) {
|
|
309
|
+
var i = _toPrimitive(t, "string");
|
|
310
|
+
return "symbol" == typeof i ? i : i + "";
|
|
311
|
+
}
|
|
312
|
+
function _typeof(o) {
|
|
313
|
+
"@babel/helpers - typeof";
|
|
314
|
+
|
|
315
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
316
|
+
return typeof o;
|
|
317
|
+
} : function (o) {
|
|
318
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
319
|
+
}, _typeof(o);
|
|
320
|
+
}
|
|
321
|
+
function _unsupportedIterableToArray(r, a) {
|
|
322
|
+
if (r) {
|
|
323
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
324
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
325
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _classCallCheck as classCallCheck, _createClass as createClass, _createForOfIteratorHelper as createForOfIteratorHelper, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _regenerator as regenerator, _regeneratorDefine as regeneratorDefine, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as LineChart } from '../components/charts/LineChart.js';
|
|
2
|
+
export { default as BarChart } from '../components/charts/BarChart.js';
|
|
3
|
+
export { default as AreaChart } from '../components/charts/AreaChart.js';
|
|
4
|
+
export { default as DonutChart } from '../components/charts/DonutChart.js';
|
|
5
|
+
export { default as Sparkline } from '../components/charts/Sparkline.js';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, createForOfIteratorHelper as _createForOfIteratorHelper } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
|
5
|
+
import { X, Menu } from 'lucide-react';
|
|
6
|
+
import { cn } from '../../utils/cn.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["brand", "nav", "sidebarFooter", "topbar", "pageTitle", "linkAs", "children", "className"];
|
|
9
|
+
// Extracted from procurementpro/components/app-shell.tsx (12 of 13 products hand-roll a shell).
|
|
10
|
+
// Sidebar on lg+, top bar + drawer below. Colours come from the shell role tokens, so a brand file
|
|
11
|
+
// restyles it. Nav items render with `linkAs` (pass Next.js Link) so links prefetch and open in new tabs.
|
|
12
|
+
var NavList = function NavList(_ref) {
|
|
13
|
+
var nav = _ref.nav,
|
|
14
|
+
Link = _ref.Link,
|
|
15
|
+
onNavigate = _ref.onNavigate;
|
|
16
|
+
var groups = [];
|
|
17
|
+
var _iterator = _createForOfIteratorHelper(nav),
|
|
18
|
+
_step;
|
|
19
|
+
try {
|
|
20
|
+
var _loop = function _loop() {
|
|
21
|
+
var item = _step.value;
|
|
22
|
+
var key = item.group || '';
|
|
23
|
+
var g = groups.find(function (x) {
|
|
24
|
+
return x.key === key;
|
|
25
|
+
});
|
|
26
|
+
if (!g) groups.push(g = {
|
|
27
|
+
key: key,
|
|
28
|
+
items: []
|
|
29
|
+
});
|
|
30
|
+
g.items.push(item);
|
|
31
|
+
};
|
|
32
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
33
|
+
_loop();
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
_iterator.e(err);
|
|
37
|
+
} finally {
|
|
38
|
+
_iterator.f();
|
|
39
|
+
}
|
|
40
|
+
return jsx("nav", {
|
|
41
|
+
"aria-label": "Main navigation",
|
|
42
|
+
className: "flex-1 overflow-y-auto px-3 pb-4",
|
|
43
|
+
children: groups.map(function (g) {
|
|
44
|
+
return jsxs("div", {
|
|
45
|
+
className: "mb-3",
|
|
46
|
+
children: [g.key && jsx("p", {
|
|
47
|
+
className: "px-3 pb-1 pt-2 text-micro font-medium uppercase tracking-wide text-shell-foreground/70",
|
|
48
|
+
children: g.key
|
|
49
|
+
}), jsx("ul", {
|
|
50
|
+
className: "space-y-0.5",
|
|
51
|
+
children: g.items.map(function (item) {
|
|
52
|
+
var content = jsxs(Fragment, {
|
|
53
|
+
children: [item.icon && jsx("span", {
|
|
54
|
+
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center",
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: item.icon
|
|
57
|
+
}), jsx("span", {
|
|
58
|
+
className: "flex-1 truncate",
|
|
59
|
+
children: item.label
|
|
60
|
+
}), item.count > 0 && jsx("span", {
|
|
61
|
+
className: "rounded-full bg-white/15 px-2 py-0.5 text-xs font-semibold text-white",
|
|
62
|
+
children: item.count
|
|
63
|
+
})]
|
|
64
|
+
});
|
|
65
|
+
var cls = cn('flex h-10 w-full items-center gap-3 rounded-control px-3 text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary-400', item.active ? 'bg-shell-active font-semibold text-white' : 'text-shell-foreground hover:bg-white/5 hover:text-white');
|
|
66
|
+
var handle = function handle() {
|
|
67
|
+
var _item$onClick;
|
|
68
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item);
|
|
69
|
+
onNavigate();
|
|
70
|
+
};
|
|
71
|
+
return jsx("li", {
|
|
72
|
+
children: item.href ? jsx(Link, {
|
|
73
|
+
href: item.href,
|
|
74
|
+
className: cls,
|
|
75
|
+
"aria-current": item.active ? 'page' : undefined,
|
|
76
|
+
onClick: handle,
|
|
77
|
+
children: content
|
|
78
|
+
}) : jsx("button", {
|
|
79
|
+
type: "button",
|
|
80
|
+
className: cls,
|
|
81
|
+
"aria-current": item.active ? 'page' : undefined,
|
|
82
|
+
onClick: handle,
|
|
83
|
+
children: content
|
|
84
|
+
})
|
|
85
|
+
}, item.id);
|
|
86
|
+
})
|
|
87
|
+
})]
|
|
88
|
+
}, g.key || 'main');
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var AppShell = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
93
|
+
var brand = _ref2.brand,
|
|
94
|
+
nav = _ref2.nav,
|
|
95
|
+
sidebarFooter = _ref2.sidebarFooter,
|
|
96
|
+
topbar = _ref2.topbar,
|
|
97
|
+
pageTitle = _ref2.pageTitle,
|
|
98
|
+
_ref2$linkAs = _ref2.linkAs,
|
|
99
|
+
Link = _ref2$linkAs === void 0 ? 'a' : _ref2$linkAs,
|
|
100
|
+
children = _ref2.children,
|
|
101
|
+
className = _ref2.className,
|
|
102
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
103
|
+
var _useState = useState(false),
|
|
104
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
105
|
+
open = _useState2[0],
|
|
106
|
+
setOpen = _useState2[1];
|
|
107
|
+
var menuButton = useRef(null);
|
|
108
|
+
var close = useCallback(function () {
|
|
109
|
+
return setOpen(false);
|
|
110
|
+
}, []);
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
if (!open) return undefined;
|
|
113
|
+
var onKey = function onKey(e) {
|
|
114
|
+
if (e.key === 'Escape') {
|
|
115
|
+
var _menuButton$current;
|
|
116
|
+
setOpen(false);
|
|
117
|
+
(_menuButton$current = menuButton.current) === null || _menuButton$current === void 0 || _menuButton$current.focus();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
document.addEventListener('keydown', onKey);
|
|
121
|
+
return function () {
|
|
122
|
+
return document.removeEventListener('keydown', onKey);
|
|
123
|
+
};
|
|
124
|
+
}, [open]);
|
|
125
|
+
var sidebar = jsxs(Fragment, {
|
|
126
|
+
children: [jsxs("div", {
|
|
127
|
+
className: "flex items-center justify-between px-5 pb-4 pt-5 text-white",
|
|
128
|
+
children: [jsx("div", {
|
|
129
|
+
className: "min-w-0",
|
|
130
|
+
children: brand
|
|
131
|
+
}), jsx("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
className: "rounded-control p-1.5 text-shell-foreground hover:bg-white/10 lg:hidden",
|
|
134
|
+
onClick: close,
|
|
135
|
+
"aria-label": "Close navigation",
|
|
136
|
+
children: jsx(X, {
|
|
137
|
+
className: "h-5 w-5"
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
}), jsx(NavList, {
|
|
141
|
+
nav: nav,
|
|
142
|
+
Link: Link,
|
|
143
|
+
onNavigate: close
|
|
144
|
+
}), sidebarFooter && jsx("div", {
|
|
145
|
+
className: "border-t border-white/10 p-3",
|
|
146
|
+
children: sidebarFooter
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
return jsxs("div", _objectSpread2(_objectSpread2({
|
|
150
|
+
ref: ref,
|
|
151
|
+
className: cn('min-h-screen bg-background text-foreground lg:grid lg:grid-cols-[16rem_minmax(0,1fr)]', className)
|
|
152
|
+
}, props), {}, {
|
|
153
|
+
children: [jsx("a", {
|
|
154
|
+
href: "#main",
|
|
155
|
+
className: "sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-50 focus:rounded-control focus:bg-surface focus:px-3 focus:py-2",
|
|
156
|
+
children: "Skip to content"
|
|
157
|
+
}), jsx("aside", {
|
|
158
|
+
className: "sticky top-0 hidden h-screen flex-col bg-shell lg:flex",
|
|
159
|
+
"aria-label": "Sidebar",
|
|
160
|
+
children: sidebar
|
|
161
|
+
}), open && jsxs("div", {
|
|
162
|
+
className: "fixed inset-0 z-40 lg:hidden",
|
|
163
|
+
children: [jsx("div", {
|
|
164
|
+
className: "absolute inset-0 bg-secondary-900/50",
|
|
165
|
+
onClick: close,
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
}), jsx("aside", {
|
|
168
|
+
className: "absolute inset-y-0 left-0 flex w-72 max-w-[85%] flex-col bg-shell",
|
|
169
|
+
"aria-label": "Sidebar",
|
|
170
|
+
children: sidebar
|
|
171
|
+
})]
|
|
172
|
+
}), jsxs("div", {
|
|
173
|
+
className: "flex min-w-0 flex-col",
|
|
174
|
+
children: [jsxs("header", {
|
|
175
|
+
className: "sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-line bg-surface px-4 lg:px-6",
|
|
176
|
+
children: [jsx("button", {
|
|
177
|
+
ref: menuButton,
|
|
178
|
+
type: "button",
|
|
179
|
+
className: "-ml-1 rounded-control p-2 text-muted hover:bg-secondary-100 lg:hidden",
|
|
180
|
+
onClick: function onClick() {
|
|
181
|
+
return setOpen(true);
|
|
182
|
+
},
|
|
183
|
+
"aria-label": "Open navigation",
|
|
184
|
+
"aria-expanded": open,
|
|
185
|
+
children: jsx(Menu, {
|
|
186
|
+
className: "h-5 w-5"
|
|
187
|
+
})
|
|
188
|
+
}), pageTitle && jsx("span", {
|
|
189
|
+
className: "truncate text-sm font-semibold lg:hidden",
|
|
190
|
+
children: pageTitle
|
|
191
|
+
}), jsx("div", {
|
|
192
|
+
className: "ml-auto flex items-center gap-3",
|
|
193
|
+
children: topbar
|
|
194
|
+
})]
|
|
195
|
+
}), jsx("main", {
|
|
196
|
+
id: "main",
|
|
197
|
+
className: "mx-auto w-full max-w-7xl flex-1 px-4 py-6 md:px-8 md:py-8",
|
|
198
|
+
children: children
|
|
199
|
+
})]
|
|
200
|
+
})]
|
|
201
|
+
}));
|
|
202
|
+
});
|
|
203
|
+
AppShell.displayName = 'AppShell';
|
|
204
|
+
|
|
205
|
+
export { AppShell as default };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Dialog from '../feedback/Dialog.js';
|
|
6
|
+
import Button from '../core/Button.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["isOpen", "title", "description", "confirmLabel", "cancelLabel", "destructive", "loading", "onConfirm", "onCancel", "className"];
|
|
9
|
+
// Extracted from firepro/components/ui/confirm-dialog.tsx. Replaces native confirm():
|
|
10
|
+
// the title asks the question, one line says what happens, the button is named with the verb.
|
|
11
|
+
var ConfirmDialog = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var isOpen = _ref.isOpen,
|
|
13
|
+
title = _ref.title,
|
|
14
|
+
description = _ref.description,
|
|
15
|
+
confirmLabel = _ref.confirmLabel,
|
|
16
|
+
_ref$cancelLabel = _ref.cancelLabel,
|
|
17
|
+
cancelLabel = _ref$cancelLabel === void 0 ? 'Cancel' : _ref$cancelLabel,
|
|
18
|
+
_ref$destructive = _ref.destructive,
|
|
19
|
+
destructive = _ref$destructive === void 0 ? false : _ref$destructive,
|
|
20
|
+
_ref$loading = _ref.loading,
|
|
21
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
22
|
+
onConfirm = _ref.onConfirm,
|
|
23
|
+
onCancel = _ref.onCancel,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
return jsx(Dialog, _objectSpread2(_objectSpread2({
|
|
27
|
+
ref: ref,
|
|
28
|
+
isOpen: isOpen,
|
|
29
|
+
onClose: onCancel,
|
|
30
|
+
title: title,
|
|
31
|
+
size: "sm",
|
|
32
|
+
dismissible: !loading,
|
|
33
|
+
className: className,
|
|
34
|
+
footer: jsxs("div", {
|
|
35
|
+
className: "flex flex-col-reverse gap-3 sm:flex-row sm:justify-end",
|
|
36
|
+
children: [jsx(Button, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
onClick: onCancel,
|
|
39
|
+
disabled: loading,
|
|
40
|
+
children: cancelLabel
|
|
41
|
+
}), jsx(Button, {
|
|
42
|
+
variant: destructive ? 'destructive' : 'primary',
|
|
43
|
+
onClick: onConfirm,
|
|
44
|
+
loading: loading,
|
|
45
|
+
children: confirmLabel
|
|
46
|
+
})]
|
|
47
|
+
})
|
|
48
|
+
}, props), {}, {
|
|
49
|
+
children: description && jsx("p", {
|
|
50
|
+
className: "text-sm text-muted",
|
|
51
|
+
children: description
|
|
52
|
+
})
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
ConfirmDialog.displayName = 'ConfirmDialog';
|
|
56
|
+
|
|
57
|
+
export { ConfirmDialog as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Inbox } from 'lucide-react';
|
|
6
|
+
import { cn } from '../../utils/cn.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["title", "description", "icon", "action", "compact", "className"];
|
|
9
|
+
// Extracted from procurementpro/components/common/empty-state.tsx (7 products hand-roll one).
|
|
10
|
+
// Sits inside the card it replaces: icon, title, one line of guidance, optional action.
|
|
11
|
+
var EmptyState = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var title = _ref.title,
|
|
13
|
+
description = _ref.description,
|
|
14
|
+
icon = _ref.icon,
|
|
15
|
+
action = _ref.action,
|
|
16
|
+
_ref$compact = _ref.compact,
|
|
17
|
+
compact = _ref$compact === void 0 ? false : _ref$compact,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return jsxs("div", _objectSpread2(_objectSpread2({
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: cn('flex flex-col items-center justify-center gap-2 text-center', compact ? 'px-4 py-8' : 'px-6 py-12', className)
|
|
23
|
+
}, props), {}, {
|
|
24
|
+
children: [jsx("span", {
|
|
25
|
+
className: "mb-1 grid h-12 w-12 place-items-center rounded-full bg-secondary-100 text-muted",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: icon || jsx(Inbox, {
|
|
28
|
+
className: "h-6 w-6"
|
|
29
|
+
})
|
|
30
|
+
}), jsx("h3", {
|
|
31
|
+
className: "text-base font-semibold text-foreground",
|
|
32
|
+
children: title
|
|
33
|
+
}), description && jsx("p", {
|
|
34
|
+
className: "max-w-sm text-sm text-muted",
|
|
35
|
+
children: description
|
|
36
|
+
}), action && jsx("div", {
|
|
37
|
+
className: "mt-3",
|
|
38
|
+
children: action
|
|
39
|
+
})]
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
EmptyState.displayName = 'EmptyState';
|
|
43
|
+
|
|
44
|
+
export { EmptyState as default };
|