@trops/dash-core 0.1.683 → 0.1.684
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/index.esm.js +33 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
2
2
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import * as DashReact from '@trops/dash-react';
|
|
5
|
-
import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio,
|
|
5
|
+
import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, useStatusTokens, Caption2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, hexToRgb as hexToRgb$1, themeVariants, SubHeading, Heading2, Paragraph2, Paragraph3, ButtonIcon3, Tag2, Alert, Alert2, Alert3, Toast, Toast2, Toast3, ProgressBar, ProgressBar2, ProgressBar3, MenuItem, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Caption3, Code, Code2, Code3, Divider, Divider2, Divider3, DashPanel2, DashPanel3, Tabs, Tabs2, Tabs3, Accordion, Accordion2, Accordion3, Toggle2, Toggle3, TextArea, Checkbox, Slider, RadioGroup, AlertBanner, StatusBadge as StatusBadge$1, Skeleton, StatCard, DataList, EmptyState, Card, Panel2, ThemeFromUrlPane, AlgoliaSearchBox, CommandPalette, useSidebar, SectionLabel, SegmentedControl, FilterMenu, CodeEditorInline, Icon2, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
6
6
|
export * from '@trops/dash-react';
|
|
7
7
|
export { FontAwesomeIcon, ThemeContext } from '@trops/dash-react';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -19753,6 +19753,18 @@ var WidgetCardStatusBar = function WidgetCardStatusBar(_ref) {
|
|
|
19753
19753
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
19754
19754
|
now = _useState4[0],
|
|
19755
19755
|
setNow = _useState4[1];
|
|
19756
|
+
// Theme tokens + light/dark status colors so the strip follows the
|
|
19757
|
+
// active theme (hardcoded grays rendered dark-only).
|
|
19758
|
+
var _useContext = useContext(ThemeContext),
|
|
19759
|
+
currentTheme = _useContext.currentTheme;
|
|
19760
|
+
var statusTokens = useStatusTokens();
|
|
19761
|
+
var t = function t(key) {
|
|
19762
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
19763
|
+
};
|
|
19764
|
+
// The strip renders as a sibling below the widget's Panel, so it takes
|
|
19765
|
+
// the Panel's corner radius and sits slightly apart from it rather
|
|
19766
|
+
// than butting a square edge against the rounded card.
|
|
19767
|
+
var panelRadius = getStylesForItem(themeObjects.PANEL, currentTheme, {}).borderRadius || "rounded-lg";
|
|
19756
19768
|
|
|
19757
19769
|
// Check if widget declares scheduledTasks in its config
|
|
19758
19770
|
var widgetConfig = item !== null && item !== void 0 && item.component ? ComponentManager.config(item.component, item) : null;
|
|
@@ -19819,27 +19831,28 @@ var WidgetCardStatusBar = function WidgetCardStatusBar(_ref) {
|
|
|
19819
19831
|
summaryText = "".concat(tasks.length, " timers \xB7 next in ").concat(formatCountdown(soonestMs));
|
|
19820
19832
|
}
|
|
19821
19833
|
return /*#__PURE__*/jsxs("div", {
|
|
19822
|
-
className: "border-t
|
|
19834
|
+
className: "mt-1 border ".concat(panelRadius, " overflow-hidden ").concat(t("border-primary-dark"), " ").concat(t("bg-primary-dark"), " select-none ").concat(className),
|
|
19823
19835
|
children: [/*#__PURE__*/jsxs("button", {
|
|
19824
19836
|
type: "button",
|
|
19825
19837
|
onClick: function onClick() {
|
|
19826
19838
|
return setExpanded(!expanded);
|
|
19827
19839
|
},
|
|
19828
|
-
className: "flex items-center w-full px-3 py-1 text-xs gap-2 cursor-pointer transition-colors hover
|
|
19840
|
+
className: "flex items-center w-full px-3 py-1 text-xs gap-2 cursor-pointer transition-colors ".concat(t("hover-bg-primary-dark"), " ").concat(allPaused ? "".concat(t("text-primary-medium"), " opacity-60") : t("text-secondary-medium")),
|
|
19829
19841
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
19830
19842
|
icon: "clock",
|
|
19831
|
-
className: "text-
|
|
19843
|
+
className: "text-xs shrink-0"
|
|
19832
19844
|
}), /*#__PURE__*/jsx("span", {
|
|
19833
19845
|
className: "truncate flex-1 text-left",
|
|
19834
19846
|
children: summaryText
|
|
19835
19847
|
}), /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
19836
19848
|
icon: expanded ? "chevron-up" : "chevron-down",
|
|
19837
|
-
className: "text-
|
|
19849
|
+
className: "text-xs opacity-60 shrink-0"
|
|
19838
19850
|
})]
|
|
19839
19851
|
}), expanded && /*#__PURE__*/jsxs("div", {
|
|
19840
19852
|
className: "px-3 pb-2 pt-1 space-y-2",
|
|
19841
|
-
children: [/*#__PURE__*/jsx(
|
|
19842
|
-
|
|
19853
|
+
children: [/*#__PURE__*/jsx(Caption2, {
|
|
19854
|
+
block: true,
|
|
19855
|
+
className: "font-semibold uppercase tracking-wider",
|
|
19843
19856
|
children: "Scheduled Tasks"
|
|
19844
19857
|
}), tasks.map(function (task) {
|
|
19845
19858
|
var remaining = task.enabled && task.nextFireAt ? task.nextFireAt - now : null;
|
|
@@ -19851,39 +19864,40 @@ var WidgetCardStatusBar = function WidgetCardStatusBar(_ref) {
|
|
|
19851
19864
|
children: [/*#__PURE__*/jsxs("div", {
|
|
19852
19865
|
className: "flex items-center gap-1.5",
|
|
19853
19866
|
children: [/*#__PURE__*/jsx("span", {
|
|
19854
|
-
className: "inline-block w-1.5 h-1.5 rounded-full ".concat(task.enabled ?
|
|
19867
|
+
className: "inline-block w-1.5 h-1.5 rounded-full ".concat(task.enabled ? statusTokens.success.solidBg : t("bg-primary-medium"))
|
|
19855
19868
|
}), /*#__PURE__*/jsx("span", {
|
|
19856
|
-
className: task.enabled ? "
|
|
19869
|
+
className: "".concat(t("text-primary-medium"), " ").concat(task.enabled ? "" : "opacity-60"),
|
|
19857
19870
|
children: task.displayName || task.taskKey
|
|
19858
|
-
}), !task.enabled && /*#__PURE__*/jsx(
|
|
19859
|
-
className: "
|
|
19871
|
+
}), !task.enabled && /*#__PURE__*/jsx(Caption2, {
|
|
19872
|
+
className: "opacity-70",
|
|
19860
19873
|
children: "(paused)"
|
|
19861
19874
|
})]
|
|
19862
|
-
}), /*#__PURE__*/jsx(
|
|
19863
|
-
className: "text-gray-500 text-[10px]",
|
|
19875
|
+
}), /*#__PURE__*/jsx(Caption2, {
|
|
19864
19876
|
children: formatScheduleDescription(task)
|
|
19865
19877
|
})]
|
|
19866
|
-
}), task.enabled && /*#__PURE__*/jsxs(
|
|
19867
|
-
|
|
19878
|
+
}), task.enabled && /*#__PURE__*/jsxs(Caption2, {
|
|
19879
|
+
block: true,
|
|
19880
|
+
className: "pl-4 flex items-center gap-1.5",
|
|
19868
19881
|
children: [/*#__PURE__*/jsxs("span", {
|
|
19869
19882
|
children: ["Next in ", formatCountdown(remaining)]
|
|
19870
19883
|
}), lastFiredText && /*#__PURE__*/jsxs(Fragment, {
|
|
19871
19884
|
children: [/*#__PURE__*/jsx("span", {
|
|
19872
|
-
className: "
|
|
19885
|
+
className: "opacity-50",
|
|
19873
19886
|
children: "\xB7"
|
|
19874
19887
|
}), /*#__PURE__*/jsxs("span", {
|
|
19875
19888
|
children: ["Last: ", lastFiredText]
|
|
19876
19889
|
})]
|
|
19877
19890
|
}), task.fireCount > 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
19878
19891
|
children: [/*#__PURE__*/jsx("span", {
|
|
19879
|
-
className: "
|
|
19892
|
+
className: "opacity-50",
|
|
19880
19893
|
children: "\xB7"
|
|
19881
19894
|
}), /*#__PURE__*/jsxs("span", {
|
|
19882
19895
|
children: ["#", task.fireCount]
|
|
19883
19896
|
})]
|
|
19884
19897
|
})]
|
|
19885
|
-
}), !task.enabled && /*#__PURE__*/jsx(
|
|
19886
|
-
|
|
19898
|
+
}), !task.enabled && /*#__PURE__*/jsx(Caption2, {
|
|
19899
|
+
block: true,
|
|
19900
|
+
className: "pl-4 opacity-70",
|
|
19887
19901
|
children: formatScheduleDescription(task)
|
|
19888
19902
|
})]
|
|
19889
19903
|
}, task.taskId);
|