@proteos/ui 0.55.0 → 0.57.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.
Files changed (50) hide show
  1. package/dist/{chunk-IKAX76MB.js → chunk-NSE4VW3Z.js} +45 -21
  2. package/dist/chunk-NSE4VW3Z.js.map +1 -0
  3. package/dist/{chunk-MWAXK66H.cjs → chunk-NWGG5WFL.cjs} +45 -21
  4. package/dist/chunk-NWGG5WFL.cjs.map +1 -0
  5. package/dist/index.cjs +377 -361
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +46 -14
  8. package/dist/index.d.ts +46 -14
  9. package/dist/index.js +124 -108
  10. package/dist/index.js.map +1 -1
  11. package/dist/{pdf-view-MH75RVQP.js → pdf-view-RQ2OZYHJ.js} +3 -3
  12. package/dist/{pdf-view-MH75RVQP.js.map → pdf-view-RQ2OZYHJ.js.map} +1 -1
  13. package/dist/{pdf-view-K4MMVHVY.cjs → pdf-view-RRMAUK3L.cjs} +7 -7
  14. package/dist/{pdf-view-K4MMVHVY.cjs.map → pdf-view-RRMAUK3L.cjs.map} +1 -1
  15. package/package.json +2 -2
  16. package/src/components/avatar/avatar.stories.tsx +13 -0
  17. package/src/components/avatar/avatar.tsx +16 -9
  18. package/src/components/badge-multi-select/badge-multi-select.tsx +2 -2
  19. package/src/components/button/button.stories.tsx +202 -97
  20. package/src/components/button/button.test.tsx +40 -7
  21. package/src/components/button/button.tsx +71 -18
  22. package/src/components/combobox/combobox.tsx +2 -2
  23. package/src/components/currency-input/currency-input.tsx +2 -2
  24. package/src/components/date-picker/calendar-internals.tsx +1 -1
  25. package/src/components/date-picker/date-picker.tsx +3 -3
  26. package/src/components/date-time-picker/date-time-picker.tsx +3 -3
  27. package/src/components/icon-picker/icon-picker.tsx +2 -2
  28. package/src/components/image-lightbox/image-lightbox.tsx +2 -2
  29. package/src/components/menu/menu.tsx +2 -2
  30. package/src/components/modal/modal.tsx +4 -4
  31. package/src/components/multi-select/multi-select.tsx +2 -2
  32. package/src/components/popover/popover.tsx +2 -2
  33. package/src/components/record-filter/chip-value.tsx +6 -5
  34. package/src/components/record-filter/filter-value-input.tsx +11 -9
  35. package/src/components/record-filter/nested-group.tsx +2 -2
  36. package/src/components/record-filter/operators.test.ts +67 -12
  37. package/src/components/record-filter/operators.ts +43 -2
  38. package/src/components/record-filter/record-filter-builder-panel.tsx +11 -23
  39. package/src/components/record-filter/record-filter-chips.tsx +3 -10
  40. package/src/components/record-filter/types.ts +6 -1
  41. package/src/components/segmented-control/segmented-control.stories.tsx +134 -8
  42. package/src/components/segmented-control/segmented-control.test.tsx +81 -8
  43. package/src/components/segmented-control/segmented-control.tsx +38 -19
  44. package/src/components/select/select.tsx +2 -2
  45. package/src/components/time-field/time-field.tsx +1 -1
  46. package/src/components/toast/toast.tsx +2 -2
  47. package/src/components/tooltip/tooltip.tsx +2 -2
  48. package/src/styles.css +58 -0
  49. package/dist/chunk-IKAX76MB.js.map +0 -1
  50. package/dist/chunk-MWAXK66H.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { cn, Button, Skeleton } from './chunk-IKAX76MB.js';
2
- export { Button, Skeleton, buttonStyles, cn, skeletonStyles } from './chunk-IKAX76MB.js';
1
+ import { cn, Button, Skeleton } from './chunk-NSE4VW3Z.js';
2
+ export { Button, Skeleton, buttonStyles, cn, skeletonStyles } from './chunk-NSE4VW3Z.js';
3
3
  import { icons, Contact, Paperclip, BookText, Banknote, UsersRound, User, Link2, Braces, Brackets, ToggleLeft, CircleDot, Calendar, Hash, Type, File, FileImage, FileText, FileSpreadsheet, FileArchive, Loader2, X, Shapes, Search, Phone, AudioLines, Video, Mic, AtSign, MessagesSquare, Camera, Send, Linkedin, MessageCircle, Mail, Pipette, Pencil, ChevronDown, GripVertical, SendHorizontal, CircleX, Download, ChevronRight as ChevronRight$1, CircleCheck, CircleAlert, Info } from 'lucide-react';
4
4
  import { tv } from 'tailwind-variants';
5
5
  import { Tabs as Tabs$1, TabPanel, Tab, TabList, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, DialogTrigger, Popover as Popover$1, Dialog, DropZone, Text, FileTrigger, Heading, Label, Input as Input$1, ListBox, ListBoxItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, Button as Button$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb, Link, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, FieldError, TextField, ComboBox, ComboBoxStateContext, Select as Select$1, SelectValue, ModalOverlay, Modal as Modal$1, DatePicker as DatePicker$1, Group, DateInput, DateSegment, Menu as Menu$1, MenuItem as MenuItem$1, Disclosure, DisclosurePanel, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, Separator as Separator$1, Switch as Switch$1, TextArea, TimeField as TimeField$1, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion, UNSTABLE_Toast, UNSTABLE_ToastContent, Calendar as Calendar$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, DatePickerStateContext } from 'react-aria-components';
@@ -35,8 +35,8 @@ function PopoverContent({
35
35
  className: (renderProps) => cn(
36
36
  "rounded-md border border-rule bg-surface",
37
37
  "shadow-[var(--shadow-float)]",
38
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
39
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1",
38
+ "entering:animate-enter-slide-down",
39
+ "exiting:animate-exit-slide-up",
40
40
  panelClassName,
41
41
  typeof className === "function" ? className(renderProps) : className
42
42
  ),
@@ -403,7 +403,7 @@ function AttributeTypeIcon({
403
403
  var avatarStyles = tv({
404
404
  base: [
405
405
  "inline-grid place-items-center shrink-0 select-none overflow-hidden",
406
- "rounded-full border",
406
+ "border",
407
407
  "font-mono font-medium tracking-[-0.005em]"
408
408
  ],
409
409
  variants: {
@@ -415,17 +415,22 @@ var avatarStyles = tv({
415
415
  },
416
416
  tone: {
417
417
  paper: "bg-surface-3 text-ink border-rule",
418
- indigo: "bg-accent text-[#f0efe8] border-transparent",
419
- moss: "bg-[#5b7052] text-[#f0efe8] border-transparent",
420
- terra: "bg-[#8a5a3f] text-[#f0efe8] border-transparent",
421
- slate: "bg-ink text-surface border-transparent"
418
+ indigo: "bg-tile-indigo text-tile-fg border-transparent",
419
+ moss: "bg-tile-moss text-tile-fg border-transparent",
420
+ terra: "bg-tile-terra text-tile-fg border-transparent",
421
+ slate: "bg-tile-slate text-tile-fg border-transparent"
422
+ },
423
+ shape: {
424
+ circle: "rounded-full",
425
+ square: "rounded-md"
422
426
  }
423
427
  },
424
- defaultVariants: { size: "md", tone: "paper" }
428
+ defaultVariants: { size: "md", tone: "paper", shape: "circle" }
425
429
  });
426
430
  function Avatar({
427
431
  size,
428
432
  tone,
433
+ shape,
429
434
  initials,
430
435
  src,
431
436
  alt = "",
@@ -435,7 +440,7 @@ function Avatar({
435
440
  }) {
436
441
  const [failedSrc, setFailedSrc] = useState(null);
437
442
  const showsImage = Boolean(src) && failedSrc !== src;
438
- return /* @__PURE__ */ jsx("span", { ...props, className: cn(avatarStyles({ size, tone }), className), children: showsImage ? /* @__PURE__ */ jsx(
443
+ return /* @__PURE__ */ jsx("span", { ...props, className: cn(avatarStyles({ size, tone, shape }), className), children: showsImage ? /* @__PURE__ */ jsx(
439
444
  "img",
440
445
  {
441
446
  src: src ?? void 0,
@@ -702,8 +707,8 @@ function IconPicker({
702
707
  className: cn(
703
708
  "w-[316px] rounded-md border border-rule bg-surface p-2",
704
709
  "shadow-[var(--shadow-raised)]",
705
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
706
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
710
+ "entering:animate-enter-slide-down",
711
+ "exiting:animate-exit-slide-up"
707
712
  ),
708
713
  children: [
709
714
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 pb-2", children: [
@@ -953,8 +958,8 @@ function Tooltip({ className, offset = 6, ...props }) {
953
958
  "rounded-md border border-rule bg-surface shadow-[var(--shadow-raised)]",
954
959
  "px-2.5 py-1.5",
955
960
  "font-mono text-[11.5px] text-ink-2",
956
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1 entering:duration-150",
957
- "exiting:animate-out exiting:fade-out-0 exiting:duration-100",
961
+ "entering:animate-enter-slide-down",
962
+ "exiting:animate-exit-fade",
958
963
  typeof className === "function" ? className(renderProps) : className
959
964
  )
960
965
  }
@@ -1310,8 +1315,8 @@ function BadgeMultiSelect({
1310
1315
  // (defaultOpen) — no browser outline around the whole panel.
1311
1316
  "outline-none rounded-md border border-rule bg-surface p-1",
1312
1317
  "shadow-[var(--shadow-raised)]",
1313
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
1314
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
1318
+ "entering:animate-enter-slide-down",
1319
+ "exiting:animate-exit-slide-up"
1315
1320
  ),
1316
1321
  children: /* @__PURE__ */ jsx("div", { ref: popoverRef, children: /* @__PURE__ */ jsx(
1317
1322
  ListBox,
@@ -1857,8 +1862,8 @@ function Combobox({
1857
1862
  "min-w-[var(--trigger-width)]",
1858
1863
  "rounded-md border border-rule bg-surface p-1",
1859
1864
  "shadow-[var(--shadow-raised)]",
1860
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
1861
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
1865
+ "entering:animate-enter-slide-down",
1866
+ "exiting:animate-exit-slide-up"
1862
1867
  ),
1863
1868
  children: /* @__PURE__ */ jsx(
1864
1869
  ListBox,
@@ -2350,8 +2355,8 @@ function Select({
2350
2355
  "z-[1300]",
2351
2356
  "rounded-md border border-rule bg-surface p-1",
2352
2357
  "shadow-[var(--shadow-raised)]",
2353
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
2354
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1",
2358
+ "entering:animate-enter-slide-down",
2359
+ "exiting:animate-exit-slide-up",
2355
2360
  popoverClassName
2356
2361
  ),
2357
2362
  children: [
@@ -2531,8 +2536,8 @@ function ModalContent({
2531
2536
  "fixed inset-0 z-50 flex items-center justify-center p-4",
2532
2537
  // Warm ink scrim — stays in the Proteos palette (no pure black).
2533
2538
  "bg-[color-mix(in_oklab,var(--color-ink)_40%,transparent)]",
2534
- "entering:animate-in entering:fade-in-0 entering:duration-150",
2535
- "exiting:animate-out exiting:fade-out-0 exiting:duration-100",
2539
+ "entering:animate-enter-fade",
2540
+ "exiting:animate-exit-fade",
2536
2541
  typeof className === "function" ? className(renderProps) : className
2537
2542
  ),
2538
2543
  children: /* @__PURE__ */ jsx(
@@ -2546,8 +2551,8 @@ function ModalContent({
2546
2551
  "flex flex-col max-h-[calc(100dvh-2rem)]",
2547
2552
  "bg-surface border border-rule rounded-lg",
2548
2553
  "shadow-[var(--shadow-float)]",
2549
- "entering:animate-in entering:zoom-in-95 entering:slide-in-from-top-2 entering:duration-150",
2550
- "exiting:animate-out exiting:zoom-out-95 exiting:duration-100",
2554
+ "entering:animate-enter-zoom",
2555
+ "exiting:animate-exit-zoom",
2551
2556
  modalClassName
2552
2557
  ),
2553
2558
  children: /* @__PURE__ */ jsx(Dialog, { className: "outline-none flex flex-col min-h-0 overflow-hidden", children })
@@ -2821,8 +2826,8 @@ function CurrencyInput({
2821
2826
  className: cn(
2822
2827
  "min-w-[9rem] rounded-md border border-rule bg-surface p-1",
2823
2828
  "shadow-[var(--shadow-raised)]",
2824
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
2825
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
2829
+ "entering:animate-enter-slide-down",
2830
+ "exiting:animate-exit-slide-up"
2826
2831
  ),
2827
2832
  children: /* @__PURE__ */ jsx(ListBox, { className: "max-h-72 overflow-auto outline-none", children: currencyOptions.map((option) => /* @__PURE__ */ jsxs(
2828
2833
  ListBoxItem,
@@ -4061,7 +4066,7 @@ function CalendarSurface() {
4061
4066
  "data-[outside-month]:text-ink-4",
4062
4067
  "data-[hovered]:bg-surface-2 data-[hovered]:text-ink",
4063
4068
  "data-[focus-visible]:shadow-[var(--shadow-focus)]",
4064
- "data-[selected]:bg-accent data-[selected]:text-[#f0efe8]",
4069
+ "data-[selected]:bg-accent data-[selected]:text-tile-fg",
4065
4070
  "data-[selected]:data-[hovered]:bg-accent-2",
4066
4071
  "data-[disabled]:opacity-30 data-[disabled]:cursor-not-allowed",
4067
4072
  "data-[unavailable]:line-through data-[unavailable]:text-ink-4"
@@ -4122,7 +4127,7 @@ function DatePicker({
4122
4127
  "data-[placeholder]:text-ink-4",
4123
4128
  "data-[type=literal]:text-ink-4",
4124
4129
  // segment focus treatment: indigo fill, paper text
4125
- "data-[focused]:bg-accent data-[focused]:text-[#f0efe8] data-[focused]:rounded-[3px]",
4130
+ "data-[focused]:bg-accent data-[focused]:text-tile-fg data-[focused]:rounded-[3px]",
4126
4131
  "data-[disabled]:cursor-not-allowed"
4127
4132
  )
4128
4133
  }
@@ -4161,8 +4166,8 @@ function DatePicker({
4161
4166
  "w-[var(--trigger-width)] min-w-[18rem] max-w-[500px]",
4162
4167
  "rounded-md border border-rule bg-surface p-4",
4163
4168
  "shadow-[var(--shadow-raised)]",
4164
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
4165
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
4169
+ "entering:animate-enter-slide-down",
4170
+ "exiting:animate-exit-slide-up"
4166
4171
  ),
4167
4172
  children: /* @__PURE__ */ jsx(Dialog, { className: "outline-none", children: /* @__PURE__ */ jsx(CalendarSurface, {}) })
4168
4173
  }
@@ -4176,7 +4181,7 @@ var segmentStyles = cn(
4176
4181
  "data-[placeholder]:text-ink-4",
4177
4182
  "data-[type=literal]:text-ink-4",
4178
4183
  // segment focus treatment: indigo fill, paper text
4179
- "data-[focused]:bg-accent data-[focused]:text-[#f0efe8] data-[focused]:rounded-[3px]",
4184
+ "data-[focused]:bg-accent data-[focused]:text-tile-fg data-[focused]:rounded-[3px]",
4180
4185
  "data-[disabled]:cursor-not-allowed"
4181
4186
  );
4182
4187
  function PopoverTimeField({
@@ -4303,8 +4308,8 @@ function DateTimePicker({
4303
4308
  "w-[var(--trigger-width)] min-w-[18rem] max-w-[500px]",
4304
4309
  "rounded-md border border-rule bg-surface p-4",
4305
4310
  "shadow-[var(--shadow-raised)]",
4306
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
4307
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
4311
+ "entering:animate-enter-slide-down",
4312
+ "exiting:animate-exit-slide-up"
4308
4313
  ),
4309
4314
  children: /* @__PURE__ */ jsxs(Dialog, { className: "outline-none", children: [
4310
4315
  /* @__PURE__ */ jsx(CalendarSurface, {}),
@@ -4538,8 +4543,8 @@ function MultiSelect({
4538
4543
  // (defaultOpen) — no browser outline around the whole panel.
4539
4544
  "outline-none rounded-md border border-rule bg-surface p-1",
4540
4545
  "shadow-[var(--shadow-raised)]",
4541
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-top-1",
4542
- "exiting:animate-out exiting:fade-out-0 exiting:slide-out-to-top-1"
4546
+ "entering:animate-enter-slide-down",
4547
+ "exiting:animate-exit-slide-up"
4543
4548
  ),
4544
4549
  children: [
4545
4550
  isSearchable ? /* @__PURE__ */ jsx("div", { className: "border-b border-rule-2 px-1 pb-1 mb-1", children: /* @__PURE__ */ jsx(
@@ -5576,8 +5581,8 @@ var imageLightboxStyles = tv({
5576
5581
  "fixed inset-0 z-50 flex items-center justify-center p-4",
5577
5582
  // Deeper scrim than Modal's 40% — the image needs the page fully dimmed.
5578
5583
  "bg-[color-mix(in_oklab,var(--color-ink)_72%,transparent)]",
5579
- "entering:animate-in entering:fade-in-0 entering:duration-150",
5580
- "exiting:animate-out exiting:fade-out-0 exiting:duration-100"
5584
+ "entering:animate-enter-fade",
5585
+ "exiting:animate-exit-fade"
5581
5586
  ]
5582
5587
  });
5583
5588
  function ImageLightbox({ isOpen, onOpenChange, src, name, onDownload }) {
@@ -5662,7 +5667,7 @@ function VideoView({ name, src }) {
5662
5667
  /* @__PURE__ */ jsx("video", { controls: true, src, "aria-label": name, className: "h-full w-full object-contain" })
5663
5668
  );
5664
5669
  }
5665
- var PdfView = lazy(() => import('./pdf-view-MH75RVQP.js'));
5670
+ var PdfView = lazy(() => import('./pdf-view-RQ2OZYHJ.js'));
5666
5671
  var fileViewerStyles = tv({
5667
5672
  base: [
5668
5673
  "relative flex w-full flex-col overflow-hidden",
@@ -5809,8 +5814,8 @@ function MenuPopover({ className, offset = 4, placement = "bottom start", ...pro
5809
5814
  className: (renderProps) => cn(
5810
5815
  "min-w-[200px] p-1 bg-surface border border-rule rounded-md",
5811
5816
  "shadow-[var(--shadow-float)] outline-none z-[1200]",
5812
- "entering:animate-in entering:fade-in-0 entering:zoom-in-95",
5813
- "exiting:animate-out exiting:fade-out-0 exiting:zoom-out-95",
5817
+ "entering:animate-enter-zoom",
5818
+ "exiting:animate-exit-zoom",
5814
5819
  typeof className === "function" ? className(renderProps) : className
5815
5820
  )
5816
5821
  }
@@ -6217,7 +6222,8 @@ var OPERATORS = [
6217
6222
  "relation",
6218
6223
  "user",
6219
6224
  "principal",
6220
- "contact-address"
6225
+ "contact-address",
6226
+ "array"
6221
6227
  ]
6222
6228
  },
6223
6229
  {
@@ -6233,10 +6239,19 @@ var OPERATORS = [
6233
6239
  "relation",
6234
6240
  "user",
6235
6241
  "principal",
6236
- "contact-address"
6242
+ "contact-address",
6243
+ "array"
6237
6244
  ]
6238
6245
  },
6239
6246
  { id: "contains", label: "contains", arity: 1, types: ["string", "array", "contact-address"] },
6247
+ {
6248
+ id: "not_contains",
6249
+ label: "does not contain",
6250
+ arity: 1,
6251
+ types: ["string", "array", "contact-address"]
6252
+ },
6253
+ // Array-only: "has every one of these". On a scalar the backend rejects it.
6254
+ { id: "contains_all", label: "has all of", arity: "n", types: ["array"] },
6240
6255
  { id: "starts_with", label: "starts with", arity: 1, types: ["string", "contact-address"] },
6241
6256
  { id: "ends_with", label: "ends with", arity: 1, types: ["string", "contact-address"] },
6242
6257
  {
@@ -6299,14 +6314,33 @@ var OP_LABEL_OVERRIDES = {
6299
6314
  integer: { gt: "is greater than", lt: "is less than", eq: "equals", ne: "does not equal" },
6300
6315
  currency: { gt: "is greater than", lt: "is less than", eq: "equals", ne: "does not equal" },
6301
6316
  datetime: { eq: "is on", ne: "is not on", gt: "is after", lt: "is before" },
6302
- array: { contains: "contains", empty: "is empty", not_empty: "is not empty" },
6317
+ // Arrays filter by set membership, in the words every CRM uses for it.
6318
+ array: {
6319
+ contains: "has",
6320
+ not_contains: "does not have",
6321
+ in: "has any of",
6322
+ not_in: "has none of",
6323
+ contains_all: "has all of",
6324
+ empty: "is empty",
6325
+ not_empty: "is not empty"
6326
+ },
6303
6327
  boolean: { eq: "is", ne: "is not" }
6304
6328
  };
6329
+ var OP_ORDER_OVERRIDES = {
6330
+ array: ["contains", "not_contains", "in", "contains_all", "not_in", "empty", "not_empty"]
6331
+ };
6305
6332
  function operatorsForType(type) {
6306
- return OPERATORS.filter((op) => op.types.includes(type)).map((op) => {
6333
+ const ops = OPERATORS.filter((op) => op.types.includes(type)).map((op) => {
6307
6334
  const override = OP_LABEL_OVERRIDES[type]?.[op.id];
6308
6335
  return override ? { ...op, label: override } : op;
6309
6336
  });
6337
+ const order = OP_ORDER_OVERRIDES[type];
6338
+ if (!order) return ops;
6339
+ return [...ops].sort((a, b) => order.indexOf(a.id) - order.indexOf(b.id));
6340
+ }
6341
+ function isEnumLike(field) {
6342
+ if (field.type === "enum") return true;
6343
+ return field.type === "array" && (field.options?.length ?? 0) > 0;
6310
6344
  }
6311
6345
  function operatorById(id) {
6312
6346
  return OPERATORS.find((o) => o.id === id);
@@ -6378,7 +6412,7 @@ function ChipItem({
6378
6412
  const custom = effectiveRenderer({ field, operator, value });
6379
6413
  if (custom !== void 0) return /* @__PURE__ */ jsx(Fragment, { children: custom });
6380
6414
  }
6381
- if (field.type === "enum") {
6415
+ if (isEnumLike(field)) {
6382
6416
  const option = findEnumOption(field, value);
6383
6417
  return /* @__PURE__ */ jsx(
6384
6418
  Badge,
@@ -6406,7 +6440,7 @@ function formatValue(field, operator, value) {
6406
6440
  if (arity === "n") {
6407
6441
  const arr = Array.isArray(value) ? value : typeof value === "string" && value.length > 0 ? value.split(",") : [];
6408
6442
  if (arr.length === 0) return "\u2014";
6409
- if (field.type === "enum") {
6443
+ if (isEnumLike(field)) {
6410
6444
  const labels = arr.map((v) => findEnumOption(field, v)?.label ?? v);
6411
6445
  return labels.length <= 2 ? labels.join(", ") : `${labels[0]}, ${labels[1]} +${labels.length - 2}`;
6412
6446
  }
@@ -6414,7 +6448,7 @@ function formatValue(field, operator, value) {
6414
6448
  }
6415
6449
  if (field.type === "boolean") return value === true || value === "true" ? "true" : "false";
6416
6450
  if (value === "" || value == null) return "\u2014";
6417
- if (field.type === "enum") {
6451
+ if (isEnumLike(field)) {
6418
6452
  return findEnumOption(field, String(value))?.label ?? String(value);
6419
6453
  }
6420
6454
  if (field.type === "number" || field.type === "integer") {
@@ -6429,46 +6463,54 @@ var segmentedControlStyles = tv({
6429
6463
  // stretching parent (e.g. a `flex flex-col` card body, whose default
6430
6464
  // align-items:stretch would otherwise pull it to full width). Consumers
6431
6465
  // can still opt into full width by passing `w-full` via className.
6432
- group: "inline-flex w-fit rounded-sm border border-rule-strong bg-surface p-0.5 gap-0.5",
6466
+ group: "inline-flex w-fit gap-px p-0.5 rounded-chip bg-surface-2 border border-rule",
6433
6467
  segment: [
6434
- "inline-flex items-center justify-center cursor-pointer",
6435
- "font-mono tracking-[0.04em] rounded-[3px] outline-none select-none",
6436
- "transition-[background-color,color] duration-150",
6437
- "data-[hovered]:text-ink",
6438
- "data-[selected]:bg-ink data-[selected]:text-surface",
6468
+ "inline-flex items-center justify-center gap-1 cursor-pointer select-none",
6469
+ "font-sans font-medium tracking-[-0.005em] rounded-sm outline-none text-ink-3",
6470
+ "transition-[background-color,color,box-shadow] duration-150",
6471
+ // Unselected: hover/press tint into the track colour. `selected` is
6472
+ // declared after `hovered` in styles.css, so the pill wins over these.
6473
+ "hovered:text-ink hovered:bg-[color-mix(in_oklab,var(--color-ink)_6%,var(--color-surface-2))]",
6474
+ "pressed:bg-[color-mix(in_oklab,var(--color-ink)_10%,var(--color-surface-2))]",
6475
+ // Selected: lifted white pill, static.
6476
+ "selected:bg-surface selected:text-ink selected:shadow-[var(--shadow-rest)]",
6439
6477
  "data-[focus-visible]:shadow-[var(--shadow-focus)]",
6478
+ "selected:data-[focus-visible]:shadow-[var(--shadow-focus),var(--shadow-rest)]",
6440
6479
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed"
6441
6480
  ]
6442
6481
  },
6443
6482
  variants: {
6444
6483
  size: {
6445
- sm: { segment: "px-2 py-0.5 text-[10.5px] tracking-[0.08em]" },
6446
- md: { segment: "px-2.5 py-1 text-[12px]" }
6484
+ sm: { segment: "px-2 py-0.5 text-[11.5px] min-h-[22px]" },
6485
+ md: { segment: "px-2.5 py-1 text-[12.5px] min-h-[26px]" }
6447
6486
  },
6448
- tone: {
6449
- // Default: ink fill on selected.
6450
- default: { segment: "text-ink-3" }
6487
+ // Dense flow-wrapping register (designer inspector): the group becomes a
6488
+ // wrapping flex row and every segment grows to share the line.
6489
+ wrap: {
6490
+ true: { group: "flex flex-wrap w-auto", segment: "flex-1 min-w-7 px-1.5" },
6491
+ false: {}
6451
6492
  }
6452
6493
  },
6453
- defaultVariants: { size: "sm", tone: "default" }
6494
+ defaultVariants: { size: "sm", wrap: false }
6454
6495
  });
6455
6496
  function SegmentedControl({
6456
6497
  options,
6457
6498
  value,
6458
6499
  onChange,
6459
6500
  size,
6501
+ wrap = false,
6460
6502
  autoFocus = false,
6461
6503
  className,
6462
6504
  orientation = "horizontal",
6463
6505
  ...props
6464
6506
  }) {
6465
- const styles4 = segmentedControlStyles({ size });
6507
+ const styles4 = segmentedControlStyles({ size, wrap });
6466
6508
  return /* @__PURE__ */ jsx(
6467
6509
  RadioGroup$1,
6468
6510
  {
6469
6511
  ...props,
6470
6512
  orientation,
6471
- value: String(value),
6513
+ value: value === null ? null : String(value),
6472
6514
  onChange: (next) => onChange(next),
6473
6515
  className: cn(styles4.group(), className),
6474
6516
  children: options.map((option) => /* @__PURE__ */ jsx(
@@ -6476,6 +6518,7 @@ function SegmentedControl({
6476
6518
  {
6477
6519
  value: String(option.id),
6478
6520
  ...option.isDisabled ? { isDisabled: true } : {},
6521
+ ...option["aria-label"] !== void 0 ? { "aria-label": option["aria-label"] } : {},
6479
6522
  ...autoFocus && option.id === value ? { autoFocus: true } : {},
6480
6523
  className: styles4.segment(),
6481
6524
  children: option.label
@@ -6662,7 +6705,7 @@ function FilterValueInput({
6662
6705
  }
6663
6706
  const leaf = (() => {
6664
6707
  if (arity === "n") {
6665
- if (field.type === "enum") {
6708
+ if (isEnumLike(field)) {
6666
6709
  return /* @__PURE__ */ jsx(
6667
6710
  EnumMultiValue,
6668
6711
  {
@@ -6689,7 +6732,7 @@ function FilterValueInput({
6689
6732
  }
6690
6733
  );
6691
6734
  }
6692
- if (field.type === "enum") {
6735
+ if (isEnumLike(field)) {
6693
6736
  return /* @__PURE__ */ jsx(
6694
6737
  EnumSingleValue,
6695
6738
  {
@@ -6850,7 +6893,9 @@ function placeholderFor(field, operator) {
6850
6893
  if (field.type === "number" || field.type === "integer" || field.type === "currency") return "0";
6851
6894
  if (operator === "starts_with") return "starts with\u2026";
6852
6895
  if (operator === "ends_with") return "ends with\u2026";
6853
- if (operator === "contains") return "contains\u2026";
6896
+ if (operator === "contains") return field.type === "array" ? "has\u2026" : "contains\u2026";
6897
+ if (operator === "not_contains")
6898
+ return field.type === "array" ? "does not have\u2026" : "does not contain\u2026";
6854
6899
  return "value";
6855
6900
  }
6856
6901
  function OperatorPicker({
@@ -7238,8 +7283,8 @@ function NestedGroup({
7238
7283
  {
7239
7284
  "aria-label": "Group joiner",
7240
7285
  options: [
7241
- { id: "and", label: "AND" },
7242
- { id: "or", label: "OR" }
7286
+ { id: "and", label: "and" },
7287
+ { id: "or", label: "or" }
7243
7288
  ],
7244
7289
  value: group.logicalOperator,
7245
7290
  onChange: (next) => onChange({ ...group, logicalOperator: next })
@@ -7475,8 +7520,8 @@ function RecordFilterBuilderPanel({
7475
7520
  {
7476
7521
  "aria-label": "Joiner",
7477
7522
  options: [
7478
- { id: "and", label: "AND" },
7479
- { id: "or", label: "OR" }
7523
+ { id: "and", label: "and" },
7524
+ { id: "or", label: "or" }
7480
7525
  ],
7481
7526
  value: filter.logicalOperator,
7482
7527
  onChange: setJoiner2
@@ -7581,17 +7626,12 @@ function RecordFilterBuilderPanel({
7581
7626
  ),
7582
7627
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
7583
7628
  onSaveView ? /* @__PURE__ */ jsxs(
7584
- "button",
7629
+ Button,
7585
7630
  {
7586
- type: "button",
7587
- onClick: onSaveView,
7588
- disabled: totalChildren === 0,
7589
- className: cn(
7590
- "inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-sm",
7591
- "font-sans text-[13px] text-ink-2 hover:bg-surface-2 hover:text-ink",
7592
- "disabled:opacity-40 disabled:pointer-events-none",
7593
- "outline-none cursor-pointer"
7594
- ),
7631
+ variant: "ghost",
7632
+ size: "sm",
7633
+ onPress: onSaveView,
7634
+ isDisabled: totalChildren === 0,
7595
7635
  children: [
7596
7636
  /* @__PURE__ */ jsxs(
7597
7637
  "svg",
@@ -7614,19 +7654,7 @@ function RecordFilterBuilderPanel({
7614
7654
  ]
7615
7655
  }
7616
7656
  ) : null,
7617
- /* @__PURE__ */ jsx(
7618
- "button",
7619
- {
7620
- type: "button",
7621
- onClick: onClose,
7622
- className: cn(
7623
- "inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm",
7624
- "bg-ink text-surface font-mono text-[12px]",
7625
- "hover:bg-accent-ink outline-none cursor-pointer"
7626
- ),
7627
- children: "Done"
7628
- }
7629
- )
7657
+ /* @__PURE__ */ jsx(Button, { variant: "cta", size: "sm", onPress: onClose, children: "Done" })
7630
7658
  ] })
7631
7659
  ]
7632
7660
  }
@@ -8133,19 +8161,7 @@ function ChipMiniEditor({
8133
8161
  onChange: onChangeValue
8134
8162
  }
8135
8163
  ) }),
8136
- /* @__PURE__ */ jsx(
8137
- "button",
8138
- {
8139
- type: "submit",
8140
- className: cn(
8141
- "shrink-0 inline-flex items-center px-2.5 py-1.5 rounded-md",
8142
- "bg-ink text-surface font-mono text-[12px]",
8143
- "hover:bg-accent-ink cursor-pointer outline-none",
8144
- "focus-visible:shadow-[var(--shadow-focus)]"
8145
- ),
8146
- children: "Save"
8147
- }
8148
- )
8164
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: "cta", size: "sm", className: "shrink-0", children: "Save" })
8149
8165
  ]
8150
8166
  }
8151
8167
  );
@@ -8436,7 +8452,7 @@ function TimeField({
8436
8452
  "data-[placeholder]:text-ink-4",
8437
8453
  "data-[type=literal]:text-ink-4",
8438
8454
  // segment focus treatment: indigo fill, paper text
8439
- "data-[focused]:bg-accent data-[focused]:text-[#f0efe8] data-[focused]:rounded-[3px]",
8455
+ "data-[focused]:bg-accent data-[focused]:text-tile-fg data-[focused]:rounded-[3px]",
8440
8456
  "data-[disabled]:cursor-not-allowed"
8441
8457
  )
8442
8458
  }
@@ -8459,8 +8475,8 @@ var toastStyles = tv({
8459
8475
  "rounded-lg border border-rule bg-surface shadow-float",
8460
8476
  "px-3.5 py-3 outline-none",
8461
8477
  "focus-visible:shadow-focus",
8462
- "entering:animate-in entering:fade-in-0 entering:slide-in-from-bottom-2 entering:duration-200",
8463
- "exiting:animate-out exiting:fade-out-0 exiting:duration-150"
8478
+ "entering:animate-enter-slide-up",
8479
+ "exiting:animate-exit-fade"
8464
8480
  ],
8465
8481
  icon: "size-4 shrink-0 mt-0.5",
8466
8482
  title: "font-sans text-[13px] font-medium leading-[1.4] text-ink",