@proteos/ui 0.47.0 → 0.49.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/dist/index.cjs +39 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.js +38 -6
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/channel-icon/channel-icon.tsx +2 -0
- package/src/components/orb/index.ts +2 -0
- package/src/components/orb/orb.stories.tsx +25 -0
- package/src/components/orb/orb.tsx +57 -0
- package/src/components/record-filter/chip-value.tsx +17 -2
- package/src/components/record-filter/field-label.ts +29 -0
- package/src/components/record-filter/index.ts +1 -0
- package/src/components/record-filter/record-filter-chips.tsx +7 -1
- package/src/components/record-filter/record-filter.stories.tsx +3 -3
- package/src/components/record-filter/record-filter.test.tsx +86 -0
- package/src/components/record-filter/types.ts +2 -1
- package/src/index.ts +1 -0
- package/src/styles.css +1 -0
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var reorderWithEdge = require('@atlaskit/pragmatic-drag-and-drop-hitbox/util/reo
|
|
|
13
13
|
var reactTable = require('@tanstack/react-table');
|
|
14
14
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
15
15
|
var combine = require('@atlaskit/pragmatic-drag-and-drop/combine');
|
|
16
|
+
var thinkingOrbs = require('thinking-orbs');
|
|
16
17
|
var date = require('@internationalized/date');
|
|
17
18
|
|
|
18
19
|
function Popover(props) {
|
|
@@ -1250,7 +1251,8 @@ var CHANNEL_ICONS = {
|
|
|
1250
1251
|
"google-meet": lucideReact.Video,
|
|
1251
1252
|
"teams-meeting": lucideReact.Video,
|
|
1252
1253
|
"webex-meeting": lucideReact.Video,
|
|
1253
|
-
adhoc: lucideReact.AudioLines
|
|
1254
|
+
adhoc: lucideReact.AudioLines,
|
|
1255
|
+
phone: lucideReact.Phone
|
|
1254
1256
|
};
|
|
1255
1257
|
function channelIcon(channel) {
|
|
1256
1258
|
return CHANNEL_ICONS[channel] ?? lucideReact.MessagesSquare;
|
|
@@ -5293,6 +5295,24 @@ function NavGroup({ icon, label, children, className, ...props }) {
|
|
|
5293
5295
|
) })
|
|
5294
5296
|
] });
|
|
5295
5297
|
}
|
|
5298
|
+
var SIZE_PX = { xs: 12, sm: 20, md: 40, lg: 64 };
|
|
5299
|
+
var DESIGN = { xs: 20, sm: 20, md: 64, lg: 64 };
|
|
5300
|
+
function Orb({ size = "sm", state = "solving", speed, theme, className, label }) {
|
|
5301
|
+
const px = SIZE_PX[size];
|
|
5302
|
+
const design = DESIGN[size];
|
|
5303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5304
|
+
thinkingOrbs.ThinkingOrb,
|
|
5305
|
+
{
|
|
5306
|
+
state,
|
|
5307
|
+
size: design,
|
|
5308
|
+
...speed !== void 0 ? { speed } : {},
|
|
5309
|
+
...theme !== void 0 ? { theme } : {},
|
|
5310
|
+
className: chunkMWAXK66H_cjs.cn("inline-block shrink-0", className),
|
|
5311
|
+
...px !== design ? { style: { width: px, height: px } } : {},
|
|
5312
|
+
...label ? { "aria-label": label } : { "aria-hidden": true }
|
|
5313
|
+
}
|
|
5314
|
+
);
|
|
5315
|
+
}
|
|
5296
5316
|
var progressBarStyles = tailwindVariants.tv({
|
|
5297
5317
|
slots: {
|
|
5298
5318
|
track: "relative overflow-hidden rounded-pill bg-surface-2 w-full",
|
|
@@ -5427,6 +5447,12 @@ function FieldTypeTag({ children }) {
|
|
|
5427
5447
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4", children });
|
|
5428
5448
|
}
|
|
5429
5449
|
|
|
5450
|
+
// src/components/record-filter/field-label.ts
|
|
5451
|
+
var FIELD_LABEL_SEPARATOR = " \xB7 ";
|
|
5452
|
+
function joinFieldLabel(...parts) {
|
|
5453
|
+
return parts.filter((part) => !!part && part.length > 0).join(FIELD_LABEL_SEPARATOR);
|
|
5454
|
+
}
|
|
5455
|
+
|
|
5430
5456
|
// src/components/record-filter/operators.ts
|
|
5431
5457
|
var OPERATORS = [
|
|
5432
5458
|
{
|
|
@@ -5558,7 +5584,7 @@ function ChipItem({
|
|
|
5558
5584
|
if (custom !== void 0) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: custom });
|
|
5559
5585
|
}
|
|
5560
5586
|
if (field.type === "enum") {
|
|
5561
|
-
const option = field
|
|
5587
|
+
const option = findEnumOption(field, value);
|
|
5562
5588
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5563
5589
|
Badge,
|
|
5564
5590
|
{
|
|
@@ -5574,6 +5600,9 @@ function ChipItem({
|
|
|
5574
5600
|
function Em({ children }) {
|
|
5575
5601
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-[12px] text-ink-4", children });
|
|
5576
5602
|
}
|
|
5603
|
+
function findEnumOption(field, value) {
|
|
5604
|
+
return field.options?.find((option) => option.value === value);
|
|
5605
|
+
}
|
|
5577
5606
|
function formatValue(field, operator, value) {
|
|
5578
5607
|
const arity = arityOf(operator);
|
|
5579
5608
|
if (arity === 0) return "";
|
|
@@ -5581,13 +5610,16 @@ function formatValue(field, operator, value) {
|
|
|
5581
5610
|
const arr = Array.isArray(value) ? value : typeof value === "string" && value.length > 0 ? value.split(",") : [];
|
|
5582
5611
|
if (arr.length === 0) return "\u2014";
|
|
5583
5612
|
if (field.type === "enum") {
|
|
5584
|
-
const labels = arr.map((v) => field
|
|
5613
|
+
const labels = arr.map((v) => findEnumOption(field, v)?.label ?? v);
|
|
5585
5614
|
return labels.length <= 2 ? labels.join(", ") : `${labels[0]}, ${labels[1]} +${labels.length - 2}`;
|
|
5586
5615
|
}
|
|
5587
5616
|
return arr.length <= 2 ? arr.join(", ") : `${arr[0]}, ${arr[1]} +${arr.length - 2}`;
|
|
5588
5617
|
}
|
|
5589
5618
|
if (field.type === "boolean") return value === true || value === "true" ? "true" : "false";
|
|
5590
5619
|
if (value === "" || value == null) return "\u2014";
|
|
5620
|
+
if (field.type === "enum") {
|
|
5621
|
+
return findEnumOption(field, String(value))?.label ?? String(value);
|
|
5622
|
+
}
|
|
5591
5623
|
if (field.type === "number" || field.type === "integer") {
|
|
5592
5624
|
const n = Number(value);
|
|
5593
5625
|
return Number.isFinite(n) ? n.toLocaleString() : String(value);
|
|
@@ -7195,7 +7227,7 @@ function Chip2({
|
|
|
7195
7227
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-sans text-[12.5px] text-ink-2", children: [
|
|
7196
7228
|
field.parentLabel ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-ink-4", children: [
|
|
7197
7229
|
field.parentLabel,
|
|
7198
|
-
|
|
7230
|
+
FIELD_LABEL_SEPARATOR
|
|
7199
7231
|
] }) : null,
|
|
7200
7232
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ink", children: field.shortLabel })
|
|
7201
7233
|
] }),
|
|
@@ -7770,6 +7802,7 @@ exports.DraftMessageComposer = DraftMessageComposer;
|
|
|
7770
7802
|
exports.DraftMessageReview = DraftMessageReview;
|
|
7771
7803
|
exports.EmptyState = EmptyState;
|
|
7772
7804
|
exports.ErrorAnimation = ErrorAnimation;
|
|
7805
|
+
exports.FIELD_LABEL_SEPARATOR = FIELD_LABEL_SEPARATOR;
|
|
7773
7806
|
exports.FieldCaret = FieldCaret;
|
|
7774
7807
|
exports.FileField = FileField;
|
|
7775
7808
|
exports.FileViewer = FileViewer;
|
|
@@ -7801,6 +7834,7 @@ exports.NavItem = NavItem;
|
|
|
7801
7834
|
exports.NavSection = NavSection;
|
|
7802
7835
|
exports.OPERATORS = OPERATORS;
|
|
7803
7836
|
exports.OperatorPicker = OperatorPicker;
|
|
7837
|
+
exports.Orb = Orb;
|
|
7804
7838
|
exports.PROTECTED_COMBOS = PROTECTED_COMBOS;
|
|
7805
7839
|
exports.Popover = Popover;
|
|
7806
7840
|
exports.PopoverContent = PopoverContent;
|
|
@@ -7876,6 +7910,7 @@ exports.isColumnDragData = isColumnDragData;
|
|
|
7876
7910
|
exports.isDraftReviewOutcome = isDraftReviewOutcome;
|
|
7877
7911
|
exports.isEditableTarget = isEditableTarget;
|
|
7878
7912
|
exports.isPreviewableImageName = isPreviewableImageName;
|
|
7913
|
+
exports.joinFieldLabel = joinFieldLabel;
|
|
7879
7914
|
exports.makeActionsColumn = makeActionsColumn;
|
|
7880
7915
|
exports.messageComposerStyles = messageComposerStyles;
|
|
7881
7916
|
exports.navItemStyles = navItemStyles;
|