@fibery/ui-kit 15.0.1 → 15.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.
Files changed (73) hide show
  1. package/lib/abbreviate-name.js +3 -3
  2. package/lib/avatar.d.ts +3 -3
  3. package/lib/avatar.js +6 -6
  4. package/lib/box.d.ts +2 -1
  5. package/lib/box.js +3 -3
  6. package/lib/box.wyw-in-js.css +1 -1
  7. package/lib/chat/bubble.d.ts +13 -0
  8. package/lib/chat/bubble.js +28 -0
  9. package/lib/chat/bubble.wyw-in-js.css +4 -0
  10. package/lib/chat/file-attachment.d.ts +12 -0
  11. package/lib/chat/file-attachment.js +52 -0
  12. package/lib/chat/file-attachment.wyw-in-js.css +12 -0
  13. package/lib/chat/marker.d.ts +16 -0
  14. package/lib/chat/marker.js +31 -0
  15. package/lib/chat/marker.wyw-in-js.css +5 -0
  16. package/lib/chat/message.d.ts +15 -0
  17. package/lib/chat/message.js +28 -0
  18. package/lib/chat/message.wyw-in-js.css +4 -0
  19. package/lib/chat/shimmer-text.d.ts +1 -0
  20. package/lib/chat/shimmer-text.js +5 -0
  21. package/lib/chat/shimmer-text.wyw-in-js.css +10 -0
  22. package/lib/chat/trace.d.ts +15 -0
  23. package/lib/chat/trace.js +91 -0
  24. package/lib/chat/trace.wyw-in-js.css +9 -0
  25. package/lib/checkbox.d.ts +1 -1
  26. package/lib/checkbox.js +20 -13
  27. package/lib/code-syntax-highlight.d.ts +1 -0
  28. package/lib/code-syntax-highlight.js +5 -0
  29. package/lib/code-syntax-highlight.wyw-in-js.css +1 -0
  30. package/lib/deleted-user.d.ts +7 -0
  31. package/lib/deleted-user.js +34 -0
  32. package/lib/design-system/colors.d.ts +9 -0
  33. package/lib/design-system/colors.js +21 -1
  34. package/lib/design-system/token-name.js +2 -2
  35. package/lib/download-file.js +1 -1
  36. package/lib/emoji-picker/primitives/grid.js +2 -2
  37. package/lib/emoji-picker/primitives/skin-tone.js +13 -7
  38. package/lib/emoji-picker/utils/store.js +2 -2
  39. package/lib/file-item/file-icon.js +12 -12
  40. package/lib/images-gallery/get-gallery-src.js +7 -7
  41. package/lib/images-gallery/images-gallery.d.ts +1 -0
  42. package/lib/images-gallery/images-gallery.js +17 -4
  43. package/lib/mobile-drawer.d.ts +3 -1
  44. package/lib/mobile-drawer.js +10 -7
  45. package/lib/mobile-drawer.wyw-in-js.css +6 -5
  46. package/lib/number-input/utils.js +2 -2
  47. package/lib/palettes/common.d.ts +14 -0
  48. package/lib/palettes/common.js +15 -1
  49. package/lib/popover/mobile-popover.js +1 -1
  50. package/lib/select/components/use-flat-menu-items.js +2 -2
  51. package/lib/select/index.js +1 -1
  52. package/lib/select/styles.js +1 -1
  53. package/lib/sidebar/sidebar.js +1 -1
  54. package/lib/styles.generated.d.ts +18 -0
  55. package/lib/styles.generated.js +18 -0
  56. package/lib/styles.neutral-dark.generated.css +13 -0
  57. package/lib/styles.neutral-dark.generated.d.ts +9 -0
  58. package/lib/styles.neutral-dark.generated.js +9 -0
  59. package/lib/styles.neutral-light.generated.css +13 -0
  60. package/lib/styles.neutral-light.generated.d.ts +9 -0
  61. package/lib/styles.neutral-light.generated.js +9 -0
  62. package/lib/styles.warm-dark.generated.css +13 -0
  63. package/lib/styles.warm-dark.generated.d.ts +9 -0
  64. package/lib/styles.warm-dark.generated.js +9 -0
  65. package/lib/styles.warm-light.generated.css +15 -0
  66. package/lib/styles.warm-light.generated.d.ts +9 -0
  67. package/lib/styles.warm-light.generated.js +9 -0
  68. package/lib/tab-nav/tab-nav.js +1 -1
  69. package/lib/thematic-controls.js +2 -2
  70. package/lib/theme-settings-core.js +1 -1
  71. package/lib/theming.generated.d.ts +1 -1
  72. package/lib/theming.generated.js +9 -0
  73. package/package.json +3 -3
@@ -75,6 +75,13 @@ export declare function defsFromPalette({ key, whiteA, white, blackA, blackish,
75
75
  "--fg-link_hover": [string, string];
76
76
  "--stroke-link_hover": ModeDef<string>;
77
77
  "--fg-code": Def;
78
+ "--fg-code-key": ModeDef<string>;
79
+ "--fg-code-string": ModeDef<string>;
80
+ "--fg-code-literal": ModeDef<string>;
81
+ "--fg-code-comment": ModeDef<string>;
82
+ "--fg-diff-key": ModeDef<string>;
83
+ "--fg-diff-string": ModeDef<string>;
84
+ "--fg-diff-literal": ModeDef<string>;
78
85
  "--bg-code": [string, string];
79
86
  "--bg-code-block": [string, string];
80
87
  "--fg-diff-added": [string, string];
@@ -431,6 +438,8 @@ export declare function defsFromPalette({ key, whiteA, white, blackA, blackish,
431
438
  "--bg-entity-avatar_hover": Def;
432
439
  "--fg-entity-avatar": Def;
433
440
  "--fg-entity-avatar_hover": [string, string];
441
+ "--bg-avatar-deleted-user": [string, string];
442
+ "--fg-avatar-deleted-user": [string, string];
434
443
  "--bg-message_highlighted": [string, string];
435
444
  "--bg-comment_hover": [string, string];
436
445
  "--bg-code-editor": [string, string];
@@ -1,7 +1,9 @@
1
+ import { calcLc, colorFromLc, liftLightnessToLc } from "../apca.js";
1
2
  import { cssFromFilter } from "../color-css-filter.js";
2
3
  import { makeColorFilter } from "../color-filter.js";
3
4
  import { mixSrgb } from "../color-utils.js";
4
5
  import { highlightColors } from "../highlight-colors.js";
6
+ import { codeSyntaxBase } from "../palettes/common.js";
5
7
  import { alphaCoefficients, opacityStates } from "./alpha-coefficients.js";
6
8
  import { alpha, transparent } from "./alpha.js";
7
9
  import { getDarkenColor } from "./colors-js.js";
@@ -254,6 +256,15 @@ function defsFromPalette({ key, whiteA, white, blackA, blackish, black, base, ba
254
256
  const bgActionsMenuItemHover = surface.level4_5;
255
257
  const deneutralizeFilterDef = mapDef(deneutralizeFilterSpec, makeColorFilter);
256
258
  const deneutralize = (def) => mapDef(def, deneutralizeFilterDef);
259
+ const highlights = highlightColors(highlight, surface.level0, deneutralizeFilterDef);
260
+ const lowerContrastSurface = (first, second) => mapDef(first, (background, side) => {
261
+ const other = second[side];
262
+ const foreground = side === 0 ? black : white;
263
+ return Math.abs(calcLc(foreground, background)) < Math.abs(calcLc(foreground, other)) ? background : other;
264
+ });
265
+ const codeBackground = lowerContrastSurface(surface.level3_4, raised.level1);
266
+ const diffBackground = lowerContrastSurface(highlights["--bg-highlight-green"], highlights["--bg-highlight-red"]);
267
+ const syntaxColor = ({ c, h }, background) => mapDef(highlight.fg, ({ Lc }, side) => colorFromLc(background[side], Lc, c, h));
257
268
  const iconFromFg = (color) => ({
258
269
  fg: deneutralize(same(color)),
259
270
  bg: deneutralize(alphaDef(same(color), alphaCoefficients.tint.medium))
@@ -272,7 +283,7 @@ function defsFromPalette({ key, whiteA, white, blackA, blackish, black, base, ba
272
283
  key,
273
284
  colors: {
274
285
  ...shadows,
275
- ...highlightColors(highlight, surface.level0, deneutralizeFilterDef),
286
+ ...highlights,
276
287
  "--filter-swatch-picker": mapDef(deneutralizeFilterSpec, same(cssFromFilter)),
277
288
  "--bg-accent-subtle": alphaDef(same(accent[9]), alphaCoefficients.tint.subtle),
278
289
  "--bg-accent-mild": alphaDef(same(accent[9]), alphaCoefficients.tint.soft),
@@ -330,6 +341,13 @@ function defsFromPalette({ key, whiteA, white, blackA, blackish, black, base, ba
330
341
  "--fg-link_hover": fg.link,
331
342
  "--stroke-link_hover": mapDef(fg.link, (color, side) => separator(alpha(color, alphaCoefficients.stroke.solid[side]))),
332
343
  "--fg-code": codeOrErrorMessage,
344
+ "--fg-code-key": syntaxColor(codeSyntaxBase.key, codeBackground),
345
+ "--fg-code-string": syntaxColor(codeSyntaxBase.string, codeBackground),
346
+ "--fg-code-literal": syntaxColor(codeSyntaxBase.literal, codeBackground),
347
+ "--fg-code-comment": mapDef(highlight.fg, ({ Lc }, side) => liftLightnessToLc(fgAccentText[side], codeBackground[side], Lc)),
348
+ "--fg-diff-key": syntaxColor(codeSyntaxBase.key, diffBackground),
349
+ "--fg-diff-string": syntaxColor(codeSyntaxBase.string, diffBackground),
350
+ "--fg-diff-literal": syntaxColor(codeSyntaxBase.literal, diffBackground),
333
351
  "--bg-code": surface.level3_4,
334
352
  "--bg-code-block": surface.level3_4,
335
353
  "--fg-diff-added": fg.addition,
@@ -686,6 +704,8 @@ function defsFromPalette({ key, whiteA, white, blackA, blackish, black, base, ba
686
704
  "--bg-entity-avatar_hover": viewHighlightBg,
687
705
  "--fg-entity-avatar": borderAccentOrMediumAccent,
688
706
  "--fg-entity-avatar_hover": primary.accent,
707
+ "--bg-avatar-deleted-user": bg.neutral3,
708
+ "--fg-avatar-deleted-user": icon.neutral,
689
709
  "--bg-message_highlighted": surface.level0elevated,
690
710
  "--bg-comment_hover": surface.level2,
691
711
  "--bg-code-editor": raised.level1,
@@ -67,7 +67,7 @@ var reserved = /* @__PURE__ */ new Set([
67
67
  "normal",
68
68
  "unselected"
69
69
  ]);
70
- var opacityStateOwners = Object.keys(opacityStates).map((key) => key.replace(/[A-Z]/g, (upper) => `-${upper.toLowerCase()}`));
70
+ var opacityStateOwners = new Set(Object.keys(opacityStates).map((key) => key.replace(/[A-Z]/g, (upper) => `-${upper.toLowerCase()}`)));
71
71
  function validName(name, types, foreground) {
72
72
  const [stem, ...modifiers] = name.split("_");
73
73
  if (!combinations.has(modifiers.join("_")) || modifiers.some((state) => !states.includes(state))) return false;
@@ -75,7 +75,7 @@ function validName(name, types, foreground) {
75
75
  const type = types.find((type) => stem.startsWith(`${type}-`));
76
76
  if (!type) return false;
77
77
  const owner = stem.slice(type.length + 1);
78
- if (foreground && type === "opacity" && opacityStateOwners.includes(owner)) return modifiers.length === 0;
78
+ if (foreground && type === "opacity" && opacityStateOwners.has(owner)) return modifiers.length === 0;
79
79
  return (foreground && type === "shadow" && /^[0-9]+$/.test(owner) || /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(owner)) && !owner.split("-").some((part) => reserved.has(part));
80
80
  }
81
81
  var isThemeTokenName = (name) => validName(name, themeTypes, true);
@@ -20,7 +20,7 @@ var downloadFile = async (url, fileName) => {
20
20
  a.href = url;
21
21
  a.download = fileName ?? "";
22
22
  a.style.display = "none";
23
- document.body.appendChild(a);
23
+ document.body.append(a);
24
24
  a.click();
25
25
  document.body.removeChild(a);
26
26
  };
@@ -39,7 +39,7 @@ var NotFound = () => {
39
39
  });
40
40
  };
41
41
  var makeData = ({ emojiData, foundEmojis, categories, perLine }) => {
42
- let allCategories = [];
42
+ let allCategories;
43
43
  if (foundEmojis) allCategories = [makeSearchCategory({ emojis: foundEmojis.map(({ id }) => id) })];
44
44
  else allCategories = [makeRecentCategory({ emojis: get(perLine).filter((id) => {
45
45
  const emoji = emojiData.get(id);
@@ -114,7 +114,7 @@ var EmojiPickerGrid = forwardRef(({ disableScroll, renderEmoji }, ref) => {
114
114
  const virtuoso = virtuosoRef.current;
115
115
  if (!virtuoso) return false;
116
116
  let colIdx = -1;
117
- let rowIdx = emojiPreview ? dataByRows.findIndex(({ categoryId, emojis }) => categoryId === emojiPreview.categoryId && (colIdx = emojis.findIndex((id) => id === emojiPreview.emoji.id)) > -1) : -1;
117
+ let rowIdx = emojiPreview ? dataByRows.findIndex(({ categoryId, emojis }) => categoryId === emojiPreview.categoryId && (colIdx = emojis.indexOf(emojiPreview.emoji.id)) > -1) : -1;
118
118
  switch (direction) {
119
119
  case "down": {
120
120
  rowIdx++;
@@ -14,6 +14,14 @@ var skinToneWrapperCss = "s1tjd7cx-skinToneWrapper";
14
14
  var skinToneSwatchCss = "szyvdx7-skinToneSwatch";
15
15
  var expandedCss = "e1keowu-expanded";
16
16
  var openedSkinTextCss = "o1czsvpj-openedSkinText";
17
+ var skinTones = [
18
+ 1,
19
+ 2,
20
+ 3,
21
+ 4,
22
+ 5,
23
+ 6
24
+ ];
17
25
  var EmojiPickerSkinTone = ({ className }) => {
18
26
  const isPhone = useIsPhone();
19
27
  const [opened, setOpened] = useState(false);
@@ -21,11 +29,9 @@ var EmojiPickerSkinTone = ({ className }) => {
21
29
  const i18n = useEmojiPickerI18N();
22
30
  const setSkin = useSetEmojiSkin();
23
31
  const skin = useEmojiSkin();
24
- const skinToneNodes = [];
25
- for (let skinTone = 1; skinTone <= 6; skinTone++) {
26
- const selected = skinTone === skin;
27
- skinToneNodes.push(/* @__PURE__ */ jsx("span", {
28
- className: cx(skinToneSwatchCss, (selected || opened) && expandedCss),
32
+ const skinToneNodes = skinTones.map((skinTone) => {
33
+ return /* @__PURE__ */ jsx("span", {
34
+ className: cx(skinToneSwatchCss, (skinTone === skin || opened) && expandedCss),
29
35
  children: jsx(IconButton, {
30
36
  size: isPhone ? "xLarge" : "large",
31
37
  onClick: () => {
@@ -40,8 +46,8 @@ var EmojiPickerSkinTone = ({ className }) => {
40
46
  size: 20
41
47
  })
42
48
  })
43
- }, `skin-tone-${skinTone}`));
44
- }
49
+ }, `skin-tone-${skinTone}`);
50
+ });
45
51
  return /* @__PURE__ */ jsxs("div", {
46
52
  className: cx(skinToneWrapperCss, className),
47
53
  children: [/* @__PURE__ */ jsx("div", {
@@ -13,14 +13,14 @@ function set(key, value) {
13
13
  if (!isLocalStorageSupported) return;
14
14
  try {
15
15
  localStorage.setItem(`${NAMESPACE}.${key}`, JSON.stringify(value));
16
- } catch (e) {}
16
+ } catch {}
17
17
  }
18
18
  function get(key) {
19
19
  if (!isLocalStorageSupported) return;
20
20
  try {
21
21
  const value = localStorage.getItem(`${NAMESPACE}.${key}`);
22
22
  if (value) return JSON.parse(value);
23
- } catch (e) {
23
+ } catch {
24
24
  return;
25
25
  }
26
26
  }
@@ -11,17 +11,17 @@ function getFileIconComponent(contentType) {
11
11
  if (!contentType) return file_other_default;
12
12
  if (contentType.startsWith("image/")) return file_image_default;
13
13
  if (contentType.startsWith("video/")) return file_video_default;
14
- if (SheetsContentTypes.includes(contentType)) return file_table_default;
15
- if (ArchiveContentTypes.includes(contentType)) return file_archive_default;
16
- if (PresentationContentTypes.includes(contentType)) return file_presentation_default;
17
- if (DocumentContentTypes.includes(contentType) || contentType.startsWith("text/")) return file_document_default;
14
+ if (SheetsContentTypes.has(contentType)) return file_table_default;
15
+ if (ArchiveContentTypes.has(contentType)) return file_archive_default;
16
+ if (PresentationContentTypes.has(contentType)) return file_presentation_default;
17
+ if (DocumentContentTypes.has(contentType) || contentType.startsWith("text/")) return file_document_default;
18
18
  return file_other_default;
19
19
  }
20
20
  function FileIcon({ contentType, ...props }) {
21
21
  const Component = getFileIconComponent(contentType);
22
22
  return /* @__PURE__ */ jsx(Component, { ...props });
23
23
  }
24
- var ArchiveContentTypes = [
24
+ var ArchiveContentTypes = /* @__PURE__ */ new Set([
25
25
  "application/zip",
26
26
  "application/zip-compressed",
27
27
  "application/x-zip",
@@ -55,8 +55,8 @@ var ArchiveContentTypes = [
55
55
  "application/x-compress",
56
56
  "application/x-archive",
57
57
  "application/vnd.android.package-archive"
58
- ];
59
- var PresentationContentTypes = [
58
+ ]);
59
+ var PresentationContentTypes = /* @__PURE__ */ new Set([
60
60
  "application/x-iwork-keynote-sffkey",
61
61
  "application/vnd.ms-powerpoint",
62
62
  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
@@ -72,8 +72,8 @@ var PresentationContentTypes = [
72
72
  "application/pdf",
73
73
  "application/vnd.sun.xml.impress",
74
74
  "application/vnd.stardivision.impress"
75
- ];
76
- var SheetsContentTypes = [
75
+ ]);
76
+ var SheetsContentTypes = /* @__PURE__ */ new Set([
77
77
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
78
78
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
79
79
  "application/vnd.ms-excel",
@@ -95,8 +95,8 @@ var SheetsContentTypes = [
95
95
  "application/vnd.sun.xml.calc",
96
96
  "application/x-dbase",
97
97
  "application/x-iwork-numbers-sffnumbers"
98
- ];
99
- var DocumentContentTypes = [
98
+ ]);
99
+ var DocumentContentTypes = /* @__PURE__ */ new Set([
100
100
  "application/msword",
101
101
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
102
102
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
@@ -122,5 +122,5 @@ var DocumentContentTypes = [
122
122
  "application/x-mswrite",
123
123
  "application/x-abiword",
124
124
  "application/pdf"
125
- ];
125
+ ]);
126
126
  export { FileIcon, getFileIconComponent };
@@ -11,21 +11,21 @@ function getGallerySrc({ src, contentType, contentLength, isPhone }) {
11
11
  };
12
12
  }
13
13
  if (!contentType || !thumbnailsMimeTypesWhiteList.has(contentType)) return null;
14
- if (ImageContentTypes.includes(contentType)) return {
14
+ if (ImageContentTypes.has(contentType)) return {
15
15
  type: "image",
16
16
  src
17
17
  };
18
- if (VideoContentTypes.includes(contentType)) return {
18
+ if (VideoContentTypes.has(contentType)) return {
19
19
  type: "video",
20
20
  src
21
21
  };
22
- if (!isPhone && IframeContentTypes.includes(contentType)) return {
22
+ if (!isPhone && IframeContentTypes.has(contentType)) return {
23
23
  type: "iframe",
24
24
  src: new URL(src, `${window.location}`).href
25
25
  };
26
26
  return null;
27
27
  }
28
- var ImageContentTypes = [
28
+ var ImageContentTypes = /* @__PURE__ */ new Set([
29
29
  "image/apng",
30
30
  "image/png",
31
31
  "image/jpeg",
@@ -36,7 +36,7 @@ var ImageContentTypes = [
36
36
  "image/bmp",
37
37
  "image/tiff",
38
38
  "image/svg+xml"
39
- ];
40
- var VideoContentTypes = ["video/mp4", "video/quicktime"];
41
- var IframeContentTypes = ["application/pdf"];
39
+ ]);
40
+ var VideoContentTypes = /* @__PURE__ */ new Set(["video/mp4", "video/quicktime"]);
41
+ var IframeContentTypes = /* @__PURE__ */ new Set(["application/pdf"]);
42
42
  export { getGallerySrc };
@@ -30,6 +30,7 @@ type Registry = Map<string, {
30
30
  actions?: React.ReactNode;
31
31
  zoomed: boolean;
32
32
  setZoomed: (zoomed: boolean) => void;
33
+ positionElement?: Element;
33
34
  }>;
34
35
  export declare const galleryMainClass: import("@linaria/core").LinariaClassName;
35
36
  export declare function ImagesGalleryProvider({ children }: PropsWithChildren): import("react").JSX.Element;
@@ -248,13 +248,26 @@ function createPhotoSwipeLightbox({ dataSource, ...rest }, { themeMode, toastQue
248
248
  }), toastQueue, themeMode);
249
249
  return photoSwipeLightbox;
250
250
  }
251
+ function inDocumentOrder(items) {
252
+ const sorted = items.flatMap((item) => item.positionElement?.isConnected ? [{
253
+ item,
254
+ element: item.positionElement
255
+ }] : []).sort((a, b) => compareDocumentOrder(a.element, b.element)).map(({ item }) => item);
256
+ const placedItems = new Set(sorted);
257
+ let next = 0;
258
+ return items.map((item) => placedItems.has(item) ? sorted[next++] : item);
259
+ }
260
+ function compareDocumentOrder(a, b) {
261
+ if (a === b) return 0;
262
+ return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
263
+ }
251
264
  function initGallery(imagesRegistry, { toastQueue, themeMode, isPhone }) {
252
- const dataSource = [...imagesRegistry.entries()].map(([key, value]) => {
265
+ const dataSource = inDocumentOrder([...imagesRegistry.entries()].map(([key, value]) => {
253
266
  return {
254
267
  ...value,
255
268
  key
256
269
  };
257
- }).map((item) => ({
270
+ })).map((item) => ({
258
271
  ...item,
259
272
  state: "none",
260
273
  contentType: item.contentType ?? null
@@ -407,7 +420,7 @@ function onVideoContentLoad({ e, item, refreshSlide, getPswp, isPhone }) {
407
420
  if (video.paused) video.play().catch();
408
421
  else video.pause();
409
422
  };
410
- e.content.element.appendChild(video);
423
+ e.content.element.append(video);
411
424
  }
412
425
  function onIframeContentLoad({ e, item, getPswp }) {
413
426
  item.state = "loaded";
@@ -419,6 +432,6 @@ function onIframeContentLoad({ e, item, getPswp }) {
419
432
  const iframe = document.createElement("iframe");
420
433
  iframe.src = item.src;
421
434
  iframe.setAttribute("allowfullscreen", "");
422
- e.content.element.appendChild(iframe);
435
+ e.content.element.append(iframe);
423
436
  }
424
437
  export { ImagesGalleryMethodsProvider, ImagesGalleryProvider, ImagesGalleryRegistryProvider, ImagesGalleryStateContext, ImagesGalleryStateProvider, createPhotoSwipeLightbox, galleryMainClass, initGallery, useImagesGalleryMethods, useImagesGalleryRegistry, useImagesGalleryState, useOnImageGalleryClose };
@@ -1,10 +1,12 @@
1
1
  import { ReactElement, ReactNode, Ref } from "react";
2
- export declare function MobileDrawer({ open, onOpenChange, title, trigger, triggerRef, onNavigateBack, children }: {
2
+ export declare function MobileDrawer({ open, onOpenChange, title, trigger, triggerRef, onNavigateBack, fitContent, dismissible, children }: {
3
3
  open: boolean;
4
4
  onOpenChange: (open: boolean) => void;
5
5
  title: string;
6
6
  trigger?: ReactElement;
7
7
  triggerRef?: Ref<HTMLDivElement>;
8
8
  onNavigateBack?: () => void;
9
+ fitContent?: boolean;
10
+ dismissible?: boolean;
9
11
  children: ReactNode;
10
12
  }): import("react").JSX.Element;
@@ -12,22 +12,24 @@ import { Drawer } from "vaul";
12
12
  // src/mobile-drawer.tsx
13
13
  var overlayClassName = "ojyfzum-overlay";
14
14
  var contentClassName = "c1vy11tb-content";
15
- var handleClassName = "h18829ip-handle";
16
- var headerClassName = "hosmc1y-header";
17
- var headerWithBackClassName = "huxrkcm-headerWithBack";
18
- var titleClassName = "t1hd7yu8-title";
19
- var bodyClassName = "b1j7dhvd-body";
20
- function MobileDrawer({ open, onOpenChange, title, trigger, triggerRef, onNavigateBack, children }) {
15
+ var fitContentClassName = "f18829ip-fitContent";
16
+ var handleClassName = "hosmc1y-handle";
17
+ var headerClassName = "huxrkcm-header";
18
+ var headerWithBackClassName = "h1hd7yu8-headerWithBack";
19
+ var titleClassName = "t1j7dhvd-title";
20
+ var bodyClassName = "b1c7tnde-body";
21
+ function MobileDrawer({ open, onOpenChange, title, trigger, triggerRef, onNavigateBack, fitContent, dismissible = true, children }) {
21
22
  return /* @__PURE__ */ jsxs(Drawer.Root, {
22
23
  open,
23
24
  onOpenChange,
25
+ dismissible,
24
26
  noBodyStyles: true,
25
27
  children: [trigger ? /* @__PURE__ */ jsx(Drawer.Trigger, {
26
28
  asChild: true,
27
29
  ref: triggerRef,
28
30
  children: trigger
29
31
  }) : null, /* @__PURE__ */ jsx(Drawer.Portal, { children: /* @__PURE__ */ jsxs(RadixPortalThemeProvider, { children: [/* @__PURE__ */ jsx(Drawer.Overlay, { className: overlayClassName }), /* @__PURE__ */ jsxs(Drawer.Content, {
30
- className: contentClassName,
32
+ className: cx(contentClassName, fitContent && fitContentClassName),
31
33
  onClick: stopPropagation,
32
34
  children: [
33
35
  /* @__PURE__ */ jsx(Drawer.Handle, { className: handleClassName }),
@@ -46,6 +48,7 @@ function MobileDrawer({ open, onOpenChange, title, trigger, triggerRef, onNaviga
46
48
  }),
47
49
  /* @__PURE__ */ jsx(IconButton, {
48
50
  onClick: () => onOpenChange(false),
51
+ disabled: !dismissible,
49
52
  size: "xLarge",
50
53
  "aria-label": "Close",
51
54
  children: /* @__PURE__ */ jsx(close_default, {})
@@ -1,7 +1,8 @@
1
1
  .ojyfzum-overlay{position:fixed;inset:0;z-index:1050;background:var(--bg-modal);}
2
2
  .c1vy11tb-content{position:fixed;left:0;right:0;bottom:0;z-index:1050;display:grid;grid-template-rows:auto 60px 1fr;height:calc(100% - var(--dynamic-space-safe-area-inset-top) - 24px);background:var(--bg-action-menu);border-top-left-radius:16px;border-top-right-radius:16px;}
3
- .h18829ip-handle{margin:8px auto 0;width:36px;height:4px;border-radius:2px;background:var(--stroke-separator);}
4
- .hosmc1y-header{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 20px;min-width:0;}
5
- .huxrkcm-headerWithBack{padding-left:4px;}
6
- .t1hd7yu8-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;}
7
- .b1j7dhvd-body{border-top:var(--stroke-separator-dimmed);min-width:0;min-height:0;overflow-y:auto;padding-bottom:var(--dynamic-space-safe-area-inset-bottom);display:flex;flex-direction:column;}
3
+ .f18829ip-fitContent{height:auto;max-height:calc(100% - var(--dynamic-space-safe-area-inset-top) - 24px);grid-template-rows:auto 60px minmax(0, 1fr);}
4
+ .hosmc1y-handle{margin:8px auto 0;width:36px;height:4px;border-radius:2px;background:var(--stroke-separator);}
5
+ .huxrkcm-header{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 20px;min-width:0;}
6
+ .h1hd7yu8-headerWithBack{padding-left:4px;}
7
+ .t1j7dhvd-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;}
8
+ .b1c7tnde-body{border-top:var(--stroke-separator-dimmed);min-width:0;min-height:0;overflow-y:auto;padding-bottom:var(--dynamic-space-safe-area-inset-bottom);display:flex;flex-direction:column;}
@@ -21,8 +21,8 @@ var formatValue = (value, isEditing, numberFormat, format) => {
21
21
  var parseValue = (value, numberFormat, numberPrecision) => {
22
22
  if (isEmpty(value)) return null;
23
23
  const parse = (value) => {
24
- const parsed = numberPrecision === 0 ? parseInt(value) : parseFloat(value);
25
- return isNaN(parsed) ? null : parsed;
24
+ const parsed = numberPrecision === 0 ? Number.parseInt(value) : Number.parseFloat(value);
25
+ return Number.isNaN(parsed) ? null : parsed;
26
26
  };
27
27
  const internalizeNumber = (value) => {
28
28
  if (value === null) return value;
@@ -1,2 +1,16 @@
1
1
  import { ThemePaletteBase } from "../design-system/types.js";
2
+ export declare const codeSyntaxBase: {
3
+ key: {
4
+ h: number;
5
+ c: number;
6
+ };
7
+ string: {
8
+ h: number;
9
+ c: number;
10
+ };
11
+ literal: {
12
+ h: number;
13
+ c: number;
14
+ };
15
+ };
2
16
  export declare const common: ThemePaletteBase;
@@ -1,5 +1,19 @@
1
1
  import { enumSettings } from "./enum-settings.js";
2
2
  // src/palettes/common.ts
3
+ var codeSyntaxBase = {
4
+ key: {
5
+ h: 26.752664,
6
+ c: .173577107
7
+ },
8
+ string: {
9
+ h: 172.718497,
10
+ c: .082712071
11
+ },
12
+ literal: {
13
+ h: 194.425984,
14
+ c: .094648565
15
+ }
16
+ };
3
17
  var common = {
4
18
  enum: enumSettings,
5
19
  highlight: {
@@ -34,4 +48,4 @@ var common = {
34
48
  } }
35
49
  }
36
50
  };
37
- export { common };
51
+ export { codeSyntaxBase, common };
@@ -42,7 +42,7 @@ function MobilePopover({ content, mobilePopupStyle, mobilePopupContentClassName,
42
42
  className: cx("cs2dkzn", !height && mobileAnimationClassName, !height && popupContentClassName, height && "c1rcf8rf"),
43
43
  style: {
44
44
  ...mobilePopupStyle,
45
- ...height ? { gridTemplateRows: `1fr ${height}` } : {}
45
+ ...height && { gridTemplateRows: `1fr ${height}` }
46
46
  },
47
47
  onClick: stopPropagation,
48
48
  children: height ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
@@ -4,7 +4,7 @@ import { Children, useMemo } from "react";
4
4
  import { truthy } from "@fibery/helpers/src/_";
5
5
  // src/select/components/use-flat-menu-items.tsx
6
6
  function flattenGroupChildren(children, renderGroup) {
7
- return Children.toArray(children).map((child) => {
7
+ return Children.toArray(children).flatMap((child) => {
8
8
  if (isReactElementWithProps(child) && isGroupChild(child)) {
9
9
  const { props } = child;
10
10
  const groupChildren = Children.toArray(props.children).filter(truthy);
@@ -12,7 +12,7 @@ function flattenGroupChildren(children, renderGroup) {
12
12
  return [renderGroup(props.Heading, props.headingProps), ...groupChildren];
13
13
  }
14
14
  return child;
15
- }).flat().filter(truthy);
15
+ }).filter(truthy);
16
16
  }
17
17
  function useFlatMenuItems({ children, cx, getStyles, getClassNames, selectProps, theme }) {
18
18
  const renderGroup = useMemo(() => (Component, headingProps) => {
@@ -18,7 +18,7 @@ var Select = forwardRef(function SelectInner({ maxMenuHeight, options = [], form
18
18
  options,
19
19
  isSearchable,
20
20
  title: title || typeof placeholder === "string" ? placeholder : "",
21
- isClearable: typeof isClearable === "undefined" ? false : isClearable,
21
+ isClearable: isClearable === void 0 ? false : isClearable,
22
22
  formatOptionLabel,
23
23
  isOptionDisabled,
24
24
  trigger: jsxs("div", {
@@ -189,7 +189,7 @@ var makeSelectInPopoverStyles = (isPhone) => ({
189
189
  paddingBlock: 0,
190
190
  boxShadow: "none !important",
191
191
  borderRadius: border.radius4,
192
- ...isPhone ? {} : {
192
+ ...!isPhone && {
193
193
  display: "flex",
194
194
  flexDirection: "column",
195
195
  minHeight: 0
@@ -43,7 +43,7 @@ var Sidebar = forwardRef(function Sidebar({ side, width, collapsed = false, minW
43
43
  "data-min-content": minContentWidth === void 0 ? void 0 : "",
44
44
  className: cx(rootCss, className),
45
45
  style: {
46
- ...minContentWidth === void 0 ? {} : { maxWidth: `calc(100% - ${minContentWidth}px)` },
46
+ ...!(minContentWidth === void 0) && { maxWidth: `calc(100% - ${minContentWidth}px)` },
47
47
  ...style,
48
48
  [sidebarWidthVar]: isNumericWidth ? `${width}px` : width
49
49
  },
@@ -13,6 +13,8 @@ export declare const wideGamutStyles: {
13
13
  readonly "--bg-highlight-purple": "oklch(0.9497 0.0356 310)";
14
14
  readonly "--bg-highlight-red": "oklch(0.9507 0.0319 25)";
15
15
  readonly "--bg-highlight-yellow": "oklch(0.9478 0.065 85)";
16
+ readonly "--fg-diff-literal": "oklch(0.5194 0.0946 194.43)";
17
+ readonly "--fg-diff-string": "#2C7A65";
16
18
  readonly "--fg-highlight-aqua": "oklch(0.5884 0.1401 185)";
17
19
  readonly "--fg-highlight-aqua-on-bg": "oklch(0.5112 0.1217 185)";
18
20
  readonly "--fg-highlight-aquamarine": "oklch(0.5845 0.1734 163)";
@@ -30,6 +32,8 @@ export declare const wideGamutStyles: {
30
32
  };
31
33
  readonly neutralUserDark: {
32
34
  readonly "--bg-highlight-aqua": "oklch(0.3642 0.065 185)";
35
+ readonly "--fg-code-key": "oklch(0.8206 0.1296 26.75)";
36
+ readonly "--fg-diff-key": "oklch(0.8535 0.1028 26.75)";
33
37
  readonly "--fg-highlight-aqua-on-bg": "#57E0D0";
34
38
  readonly "--fg-highlight-blue": "oklch(0.7922 0.1167 254)";
35
39
  readonly "--fg-highlight-blue-on-bg": "oklch(0.8421 0.0872 254)";
@@ -44,6 +48,9 @@ export declare const wideGamutStyles: {
44
48
  readonly "--bg-highlight-purple": "oklch(0.9459 0.0383 310.08)";
45
49
  readonly "--bg-highlight-red": "oklch(0.9458 0.0332 24.93)";
46
50
  readonly "--bg-highlight-yellow": "oklch(0.9489 0.0639 85.4)";
51
+ readonly "--fg-diff-key": "#BF3732";
52
+ readonly "--fg-diff-literal": "oklch(0.5112 0.0946 194.43)";
53
+ readonly "--fg-diff-string": "#297763";
47
54
  readonly "--fg-highlight-aqua": "oklch(0.5835 0.1236 177.19)";
48
55
  readonly "--fg-highlight-aqua-on-bg": "oklch(0.509 0.1081 177.94)";
49
56
  readonly "--fg-highlight-aquamarine": "oklch(0.5823 0.1478 157.41)";
@@ -59,6 +66,8 @@ export declare const wideGamutStyles: {
59
66
  readonly "--fg-highlight-yellow-on-bg": "oklch(0.5377 0.1113 88.85)";
60
67
  };
61
68
  readonly warmUserDark: {
69
+ readonly "--fg-code-key": "oklch(0.8207 0.1295 26.75)";
70
+ readonly "--fg-diff-key": "oklch(0.854 0.1023 26.75)";
62
71
  readonly "--fg-highlight-blue": "#96BDF6";
63
72
  readonly "--fg-highlight-blue-on-bg": "#ADCEFB";
64
73
  readonly "--fg-highlight-pink-on-bg": "oklch(0.8564 0.1008 343.95)";
@@ -77,6 +86,8 @@ export declare const wideGamutStyles: {
77
86
  readonly "--bg-highlight-pink": "oklch(0.9546 0.0562 345)";
78
87
  readonly "--bg-highlight-purple": "oklch(0.9497 0.0364 310)";
79
88
  readonly "--bg-highlight-red": "oklch(0.9517 0.0473 25)";
89
+ readonly "--fg-diff-literal": "oklch(0.5181 0.0946 194.43)";
90
+ readonly "--fg-diff-string": "#2B7965";
80
91
  readonly "--fg-highlight-aqua": "oklch(0.5767 0.22 185)";
81
92
  readonly "--fg-highlight-aqua-on-bg": "oklch(0.5012 0.1912 185)";
82
93
  readonly "--fg-highlight-aquamarine": "oklch(0.5737 0.25 163)";
@@ -92,6 +103,8 @@ export declare const wideGamutStyles: {
92
103
  readonly "--fg-highlight-yellow-on-bg": "oklch(0.5373 0.1296 85)";
93
104
  };
94
105
  readonly neutralUserDark: {
106
+ readonly "--fg-code-key": "oklch(0.8248 0.1736 26.75)";
107
+ readonly "--fg-diff-key": "oklch(0.8577 0.148 26.75)";
95
108
  readonly "--fg-highlight-blue": "oklch(0.7922 0.1182 254)";
96
109
  readonly "--fg-highlight-blue-on-bg": "oklch(0.8421 0.0884 254)";
97
110
  readonly "--fg-highlight-purple-on-bg": "oklch(0.854 0.1092 310)";
@@ -102,6 +115,9 @@ export declare const wideGamutStyles: {
102
115
  readonly "--bg-highlight-pink": "oklch(0.9493 0.0623 344.86)";
103
116
  readonly "--bg-highlight-purple": "oklch(0.9449 0.0398 310.08)";
104
117
  readonly "--bg-highlight-red": "oklch(0.9465 0.0493 24.92)";
118
+ readonly "--fg-diff-key": "#BE3631";
119
+ readonly "--fg-diff-literal": "oklch(0.5098 0.0946 194.43)";
120
+ readonly "--fg-diff-string": "#287762";
105
121
  readonly "--fg-highlight-aqua": "oklch(0.5726 0.1951 174.53)";
106
122
  readonly "--fg-highlight-aqua-on-bg": "oklch(0.4996 0.1687 175)";
107
123
  readonly "--fg-highlight-aquamarine": "oklch(0.5721 0.2122 156.59)";
@@ -116,6 +132,8 @@ export declare const wideGamutStyles: {
116
132
  readonly "--fg-highlight-yellow-on-bg": "oklch(0.5376 0.1136 88.91)";
117
133
  };
118
134
  readonly warmUserDark: {
135
+ readonly "--fg-code-key": "oklch(0.825 0.1736 26.75)";
136
+ readonly "--fg-diff-key": "oklch(0.8583 0.1473 26.75)";
119
137
  readonly "--fg-highlight-blue-on-bg": "#ACCDFC";
120
138
  readonly "--fg-highlight-purple-on-bg": "oklch(0.8526 0.1007 310.69)";
121
139
  readonly "--fg-highlight-red-on-bg": "oklch(0.8539 0.1034 24.37)";