@fibery/ui-kit 9.1.2 → 9.1.3

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 (78) hide show
  1. package/lib/actions-menu/actions-menu-sub-command-menu.js +2 -2
  2. package/lib/actions-menu/contexts/actions-menu-context.js +2 -2
  3. package/lib/actions-menu/contexts/actions-menu-dangerous-rows.js +3 -3
  4. package/lib/antd/input.d.ts +1 -1
  5. package/lib/automation-avatar.d.ts +8 -0
  6. package/lib/automation-avatar.js +43 -0
  7. package/lib/board-table-loader.js +6 -6
  8. package/lib/comment.js +3 -3
  9. package/lib/design-system/colors.d.ts +4 -4
  10. package/lib/design-system/colors.js +6 -6
  11. package/lib/emoji-picker/primitives/content.js +2 -2
  12. package/lib/emoji-picker/primitives/preview-provider.js +3 -3
  13. package/lib/emoji-picker/primitives/root.js +3 -3
  14. package/lib/emoji-picker/primitives/search-provider.js +3 -3
  15. package/lib/emoji-picker/primitives/skin-provider.js +3 -3
  16. package/lib/emoji-picker/stores/emoji-data-store.js +2 -2
  17. package/lib/file-item/file-preview-actions.js +1 -1
  18. package/lib/icons/ast/index.d.ts +4 -1
  19. package/lib/icons/ast/index.js +4 -1
  20. package/lib/icons/ast/integration-claude.d.ts +5 -0
  21. package/lib/icons/ast/integration-claude.js +25 -0
  22. package/lib/icons/ast/integration-gemini.d.ts +5 -0
  23. package/lib/icons/ast/integration-gemini.js +25 -0
  24. package/lib/icons/ast/integration-openai.d.ts +5 -0
  25. package/lib/icons/ast/integration-openai.js +25 -0
  26. package/lib/icons/react/index.d.ts +4 -1
  27. package/lib/icons/react/index.js +4 -1
  28. package/lib/icons/react/integration-claude.d.ts +15 -0
  29. package/lib/icons/react/integration-claude.js +21 -0
  30. package/lib/icons/react/integration-gemini.d.ts +15 -0
  31. package/lib/icons/react/integration-gemini.js +21 -0
  32. package/lib/icons/react/integration-openai.d.ts +15 -0
  33. package/lib/icons/react/integration-openai.js +21 -0
  34. package/lib/images-gallery/images-gallery.js +4 -4
  35. package/lib/loaders.js +4 -4
  36. package/lib/open-popover-tracker.js +2 -2
  37. package/lib/popover/index.js +2 -2
  38. package/lib/popover/mobile-popover-context.js +2 -2
  39. package/lib/popover/popup-stack-context.js +2 -2
  40. package/lib/random.d.ts +4 -0
  41. package/lib/random.js +11 -0
  42. package/lib/rich-input-loader.js +3 -3
  43. package/lib/root-theme-provider.wyw-in-js.css +1 -1
  44. package/lib/select/select-loader.js +2 -2
  45. package/lib/skeleton.d.ts +23 -0
  46. package/lib/skeleton.js +47 -0
  47. package/lib/skeleton.wyw-in-js.css +4 -0
  48. package/lib/tab-nav/tab-nav.js +2 -2
  49. package/lib/theming.generated.d.ts +8 -8
  50. package/lib/theming.generated.js +8 -8
  51. package/lib/toast/toast-provider.js +2 -2
  52. package/lib/unit/loading-unit-value.d.ts +2 -2
  53. package/lib/unit/loading-unit-value.js +2 -2
  54. package/lib/use-is-phone.js +2 -2
  55. package/lib/use-on-screen-keyboard-data.js +3 -3
  56. package/package.json +3 -6
  57. package/lib/ai/model.d.ts +0 -8
  58. package/lib/ai/model.js +0 -55
  59. package/lib/ai/model.wyw-in-js.css +0 -1
  60. package/lib/antd/auto-width-transparent-textarea.d.ts +0 -8
  61. package/lib/antd/auto-width-transparent-textarea.js +0 -34
  62. package/lib/antd/auto-width-transparent-textarea.wyw-in-js.css +0 -2
  63. package/lib/get-trigger-node-popup-container.d.ts +0 -4
  64. package/lib/get-trigger-node-popup-container.js +0 -8
  65. package/lib/lists/actions-menu-row-surface.d.ts +0 -12
  66. package/lib/lists/actions-menu-row-surface.js +0 -65
  67. package/lib/lists/actions-menu-row-surface.wyw-in-js.css +0 -4
  68. package/lib/loading-sausage.d.ts +0 -24
  69. package/lib/loading-sausage.js +0 -54
  70. package/lib/loading-sausage.wyw-in-js.css +0 -4
  71. package/lib/nested-menu-item.d.ts +0 -1
  72. package/lib/nested-menu-item.js +0 -0
  73. package/lib/not-empty.d.ts +0 -4
  74. package/lib/not-empty.js +0 -6
  75. package/lib/use-why-did-you-update.d.ts +0 -4
  76. package/lib/use-why-did-you-update.js +0 -25
  77. package/lib/with-data.d.ts +0 -77
  78. package/lib/with-data.js +0 -55
@@ -1399,10 +1399,10 @@ var neutralStyles = {
1399
1399
  "--cardBg": "rgb(51,51,51)",
1400
1400
  "--selectedImageBorder": "rgba(255,255,255,0.59)",
1401
1401
  "--transparent": "rgba(255, 255, 255, 0)",
1402
- "--progressBg": "rgb(237,237,237)",
1403
- "--progressText": "rgb(94,94,94)",
1404
- "--progressFillBg": "rgb(94,94,94)",
1405
- "--progressFillText": "rgb(255,255,255)",
1402
+ "--progressBg": "rgb(41,41,41)",
1403
+ "--progressText": "rgb(161,161,161)",
1404
+ "--progressFillBg": "rgb(161,161,161)",
1405
+ "--progressFillText": "rgb(28,28,28)",
1406
1406
  "--progressBarFillNeutral": "rgba(112, 112, 112, 0.2)",
1407
1407
  "--progressBarFill": "#5f85dd",
1408
1408
  "--progressBarBg": "rgba(95, 133, 221, 0.25)",
@@ -2499,10 +2499,10 @@ var warmStyles = {
2499
2499
  "--cardBg": "rgb(55,50,48)",
2500
2500
  "--selectedImageBorder": "rgba(255,255,254,0.59)",
2501
2501
  "--transparent": "rgba(255, 255, 255, 0)",
2502
- "--progressBg": "rgb(243,236,229)",
2503
- "--progressText": "rgb(99,94,87)",
2504
- "--progressFillBg": "rgb(99,94,87)",
2505
- "--progressFillText": "rgb(255,253,250)",
2502
+ "--progressBg": "rgb(45,40,38)",
2503
+ "--progressText": "rgb(166,159,157)",
2504
+ "--progressFillBg": "rgb(166,159,157)",
2505
+ "--progressFillText": "rgb(32,27,25)",
2506
2506
  "--progressBarFillNeutral": "rgba(117, 111, 109, 0.2)",
2507
2507
  "--progressBarFill": "rgb(22,152,183)",
2508
2508
  "--progressBarBg": "rgba(22, 152, 183, 0.25)",
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { createContext } from "@fibery/react/src/create-context";
2
3
  import "react";
3
- import { createContext as createContext$1 } from "@fibery/react/src/create-context";
4
4
  import { ToastProvider as ToastProvider$1 } from "@radix-ui/react-toast";
5
5
  //#region src/toast/toast-provider.tsx
6
- var [Provider, useCtx] = createContext$1("ToastQueue");
6
+ var [Provider, useCtx] = createContext("ToastQueue");
7
7
  var ToastProvider = ({ toastQueue, children }) => {
8
8
  return /* @__PURE__ */ jsx(Provider, {
9
9
  value: toastQueue,
@@ -1,6 +1,6 @@
1
- import { LoadingSausageProps } from "../loading-sausage.js";
1
+ import { SkeletonProps } from "../skeleton.js";
2
2
  //#region src/unit/loading-unit-value.d.ts
3
3
  declare const unitTextHeight = 8;
4
- declare const LoadingUnitValue: (props: LoadingSausageProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const LoadingUnitValue: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
5
5
  //#endregion
6
6
  export { LoadingUnitValue, unitTextHeight };
@@ -1,12 +1,12 @@
1
1
  import "./loading-unit-value.wyw-in-js.css";
2
- import { LoadingSausage } from "../loading-sausage.js";
2
+ import { Skeleton } from "../skeleton.js";
3
3
  /* empty css */
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/unit/loading-unit-value.tsx
6
6
  var unitTextHeight = 8;
7
7
  var LoadingUnitValue = (props) => /* @__PURE__ */ jsx("div", {
8
8
  className: "cl6zvo6",
9
- children: jsx(LoadingSausage, {
9
+ children: jsx(Skeleton, {
10
10
  ...props,
11
11
  height: 8
12
12
  })
@@ -2,10 +2,10 @@ import { mobileRootClassName } from "./mobile-styles.js";
2
2
  import { isPhoneApp, isPhoneMode, phoneMediaQuery, phoneMediaQueryDynamic } from "./phone.js";
3
3
  import { useIsMediaQueryMatched } from "./use-is-media-query-matched.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
+ import { createContext } from "@fibery/react/src/create-context";
5
6
  import { useLayoutEffect } from "react";
6
- import { createContext as createContext$1 } from "@fibery/react/src/create-context";
7
7
  //#region src/use-is-phone.tsx
8
- var [Provider, useIsPhone] = createContext$1("PhoneContext", false);
8
+ var [Provider, useIsPhone] = createContext("PhoneContext", false);
9
9
  function IsPhoneProvider({ children }) {
10
10
  const isPhone = useIsMediaQueryMatched(phoneMediaQueryDynamic);
11
11
  useLayoutEffect(() => {
@@ -2,12 +2,12 @@ import { keyboardHeightVar, mobileKeyboardOpenClassName } from "./mobile-styles.
2
2
  import { isPhoneApp } from "./phone.js";
3
3
  import { noop } from "@fibery/helpers/src/_";
4
4
  import { jsx } from "react/jsx-runtime";
5
+ import { createContext } from "@fibery/react/src/create-context";
5
6
  import { useEffect, useState } from "react";
6
- import { createContext as createContext$1 } from "@fibery/react/src/create-context";
7
7
  //#region src/use-on-screen-keyboard-data.tsx
8
8
  var defaultKeyboardHeight = 350;
9
- var [OnScreenKeyboardHeightValueProvider, useOnScreenKeyboardHeight] = createContext$1("OnScreenKeyboardHeightProvider", defaultKeyboardHeight);
10
- var [IsOnScreenKeyboardOpenedValueProvider, useIsOnScreenKeyboardOpened] = createContext$1("IsOnScreenKeyboardOpenedValueProvider", false);
9
+ var [OnScreenKeyboardHeightValueProvider, useOnScreenKeyboardHeight] = createContext("OnScreenKeyboardHeightProvider", defaultKeyboardHeight);
10
+ var [IsOnScreenKeyboardOpenedValueProvider, useIsOnScreenKeyboardOpened] = createContext("IsOnScreenKeyboardOpenedValueProvider", false);
11
11
  function OnScreenKeyboardContextProvider({ children }) {
12
12
  const [keyboardHeight, setKeyboardHeight] = useState(defaultKeyboardHeight);
13
13
  const [keyboardVisible, setKeyboardVisible] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "9.1.2",
3
+ "version": "9.1.3",
4
4
  "license": "UNLICENSED",
5
5
  "files": [
6
6
  "lib"
@@ -113,8 +113,6 @@
113
113
  "@types/apca-w3": "0.1.3",
114
114
  "@types/d3-shape": "3.1.7",
115
115
  "@types/history": "4.7.11",
116
- "@types/react-select-country-list": "2.2.3",
117
- "@types/setimmediate": "1.0.4",
118
116
  "apca-w3": "0.1.9",
119
117
  "chrono-node": "2.9.0",
120
118
  "classnames": "2.3.1",
@@ -140,15 +138,14 @@
140
138
  "react-day-picker": "8.10.1",
141
139
  "react-popper": "2.3.0",
142
140
  "react-select": "5.3.2",
143
- "react-select-country-list": "2.2.1",
144
141
  "react-virtuoso": "4.18.1",
145
142
  "screenfull": "6.0.2",
146
143
  "tabbable": "5.2.1",
147
144
  "vaul": "1.1.2",
148
145
  "virtua": "0.50.4",
149
146
  "@fibery/emoji-data": "3.0.0",
150
- "@fibery/react": "2.0.3",
151
- "@fibery/helpers": "3.4.0"
147
+ "@fibery/helpers": "3.4.0",
148
+ "@fibery/react": "2.0.4"
152
149
  },
153
150
  "peerDependencies": {
154
151
  "react": "18.3.1",
package/lib/ai/model.d.ts DELETED
@@ -1,8 +0,0 @@
1
- //#region src/ai/model.d.ts
2
- type Props = {
3
- initialValue: string;
4
- onChange: (s: string) => void;
5
- };
6
- declare const Model: ({ initialValue, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
7
- //#endregion
8
- export { Model };
package/lib/ai/model.js DELETED
@@ -1,55 +0,0 @@
1
- import "./model.wyw-in-js.css";
2
- import { Tooltip } from "../tooltip.js";
3
- import { Emoji } from "../emoji.js";
4
- /* empty css */
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { useCallback, useState } from "react";
7
- //#region src/ai/model.tsx
8
- var exampleItemCodeStyle = "e1jf3cc2-exampleItemCode";
9
- var indicators = [{
10
- name: "gpt-3.5-turbo-16k",
11
- symbol: "🤖",
12
- desc: /* @__PURE__ */ jsxs(Fragment, { children: [
13
- /* @__PURE__ */ jsx("p", { children: "$0.003 / 1K tokens" }),
14
- /* @__PURE__ */ jsx("p", { children: "Most capable GPT-3.5 model optimized for chat at 1/30th the cost of GPT-4 model" }),
15
- /* @__PURE__ */ jsx("p", { children: "Good at: Complex intent, cause and effect, summarization for audience" })
16
- ] })
17
- }, {
18
- name: "gpt-4",
19
- symbol: "🧠",
20
- desc: /* @__PURE__ */ jsxs(Fragment, { children: [
21
- /* @__PURE__ */ jsx("p", { children: "$0.0600 / 1K tokens." }),
22
- /* @__PURE__ */ jsx("p", { children: "With broad general knowledge and domain expertise," }),
23
- /* @__PURE__ */ jsx("p", { children: "GPT-4 can follow complex instructions in natural language and solve difficult problems with accuracy" }),
24
- /* @__PURE__ */ jsx("p", { children: "Excellent at: Complex intent, cause and effect, summarization for audience" })
25
- ] })
26
- }];
27
- var delta = 1;
28
- var rotate = (n, min, max) => n > max ? min : n;
29
- var Model = ({ initialValue, onChange }) => {
30
- const [index, setIndex] = useState(indicators.map(({ name }) => name).indexOf(initialValue));
31
- const onUseButtonClick = useCallback(() => {
32
- const nextIndex = rotate(index + delta, 0, indicators.length - 1);
33
- onChange(indicators[nextIndex].name);
34
- setIndex(nextIndex);
35
- }, [onChange, index]);
36
- const item = indicators[index];
37
- return /* @__PURE__ */ jsx("div", { children: jsx(Tooltip, {
38
- title: `Model: ${item.name}`,
39
- description: item.desc,
40
- instant: true,
41
- children: /* @__PURE__ */ jsx("button", {
42
- type: "button",
43
- onClick: onUseButtonClick,
44
- className: exampleItemCodeStyle,
45
- children: /* @__PURE__ */ jsx(Emoji, {
46
- symbol: item.symbol,
47
- label: item.name,
48
- size: 1.25,
49
- inline: true
50
- })
51
- })
52
- }) });
53
- };
54
- //#endregion
55
- export { Model };
@@ -1 +0,0 @@
1
- .e1jf3cc2-exampleItemCode{font-family:"SFMono-Regular",Menlo,Consolas,"PT Mono","Liberation Mono",Courier,monospace;font-size:12px;line-height:1.5;font-weight:410;color:var(--textColor);white-space:initial;text-align:left;border-radius:4px;border:none;background-color:var(--transparent);cursor:pointer;}.e1jf3cc2-exampleItemCode:hover{background-color:var(--colorAccentBgSubtle);}
@@ -1,8 +0,0 @@
1
- import TextArea from "rc-textarea";
2
- //#region src/antd/auto-width-transparent-textarea.d.ts
3
- declare const AutoWidthTransparentTextArea: import("react").ForwardRefExoticComponent<import("rc-textarea").TextAreaProps & {
4
- wrapperClassName?: string;
5
- bypassedRef?: React.ForwardedRef<React.ElementRef<typeof TextArea>>;
6
- } & import("react").RefAttributes<HTMLDivElement>>;
7
- //#endregion
8
- export { AutoWidthTransparentTextArea };
@@ -1,34 +0,0 @@
1
- import "./auto-width-transparent-textarea.wyw-in-js.css";
2
- import { TransparentInputWrapper } from "./input.js";
3
- /* empty css */
4
- import { jsx } from "react/jsx-runtime";
5
- import { forwardRef, useRef } from "react";
6
- import { cx } from "@linaria/core";
7
- import { useComposedRefs } from "@fibery/react/src/use-composed-refs";
8
- import RcTextArea from "rc-textarea";
9
- //#region src/antd/auto-width-transparent-textarea.tsx
10
- var wrapper = "w1dk3li9-wrapper";
11
- var textArea = "twcv412-textArea";
12
- var AutoWidthTransparentTextArea = forwardRef(function AutoWidthTransparentTextArea({ onChange, style, className, wrapperClassName, ...props }, ref) {
13
- const wrapperRef = useRef(null);
14
- const composedRef = useComposedRefs(ref, wrapperRef);
15
- const handleChange = (e) => {
16
- if (wrapperRef.current) wrapperRef.current.dataset.value = e.target.value;
17
- onChange?.(e);
18
- };
19
- return /* @__PURE__ */ jsx(TransparentInputWrapper, {
20
- className: cx(wrapper, wrapperClassName),
21
- "data-value": props.value || props.placeholder,
22
- ref: composedRef,
23
- children: jsx(RcTextArea, {
24
- prefixCls: "ant-input",
25
- className: cx("ant-input", textArea, className),
26
- style,
27
- onChange: handleChange,
28
- cols: 1,
29
- ...props
30
- })
31
- });
32
- });
33
- //#endregion
34
- export { AutoWidthTransparentTextArea };
@@ -1,2 +0,0 @@
1
- .w1dk3li9-wrapper{display:inline-grid;}.w1dk3li9-wrapper::after{content:attr(data-value);white-space:pre-wrap;word-wrap:break-word;visibility:hidden;display:block;grid-area:1/1;min-width:0;height:1px;}
2
- .twcv412-textArea{grid-area:1/1;}
@@ -1,4 +0,0 @@
1
- //#region src/get-trigger-node-popup-container.d.ts
2
- declare const getTriggerNodePopupContainer: (triggerNode: HTMLElement) => HTMLElement;
3
- //#endregion
4
- export { getTriggerNodePopupContainer };
@@ -1,8 +0,0 @@
1
- import { assert } from "@fibery/helpers/utils/trace";
2
- //#region src/get-trigger-node-popup-container.ts
3
- var getTriggerNodePopupContainer = (triggerNode) => {
4
- assert(triggerNode, "triggerNode");
5
- return triggerNode;
6
- };
7
- //#endregion
8
- export { getTriggerNodePopupContainer };
@@ -1,12 +0,0 @@
1
- import { ActionsMenuItemProps } from "../actions-menu/actions-menu-item.js";
2
- import { ListRowContentProps, ListRowSurfaceProps } from "./list-row-surface.js";
3
- //#region src/lists/actions-menu-row-surface.d.ts
4
- interface ActionMenuItemSurfaceProps extends Omit<ActionsMenuItemProps, "description">, Omit<ListRowSurfaceProps, "children" | "darker" | "onSelect" | "id"> {}
5
- declare const actionMenuItemSurface: import("@linaria/core").LinariaClassName;
6
- declare const ActionMenuItemSurface: import("react").ForwardRefExoticComponent<ActionMenuItemSurfaceProps & import("react").RefAttributes<HTMLDivElement>>;
7
- interface ActionMenuItemContentProps extends ListRowContentProps {
8
- description?: string;
9
- }
10
- declare const ActionMenuItemContent: import("react").ForwardRefExoticComponent<ActionMenuItemContentProps & import("react").RefAttributes<HTMLDivElement>>;
11
- //#endregion
12
- export { ActionMenuItemContent, ActionMenuItemSurface, actionMenuItemSurface };
@@ -1,65 +0,0 @@
1
- import "./actions-menu-row-surface.wyw-in-js.css";
2
- import { textClasses } from "../design-system/typography.js";
3
- import { useIsSupportHover } from "../use-is-support-hover.js";
4
- import { useActionsMenuContext } from "../actions-menu/contexts/actions-menu-context.js";
5
- import { useActiveDangerousRow, useSetActiveDangerousRow } from "../actions-menu/contexts/actions-menu-dangerous-rows.js";
6
- import { ListRowContent, listRowSurfaceStylesBase } from "./list-row-surface.js";
7
- /* empty css */
8
- import { noop } from "@fibery/helpers/src/_";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- import { forwardRef, useId } from "react";
11
- import { cx } from "@linaria/core";
12
- import { stopPropagation } from "@fibery/react/src/stop-propagation";
13
- import { useCallbackRef } from "@fibery/react/src/use-callback-ref";
14
- //#region src/lists/actions-menu-row-surface.tsx
15
- var actionMenuItemSurface = "a17pn820-actionMenuItemSurface";
16
- var ActionMenuItemSurface = forwardRef(({ testId, className, loading, selected, hovered, focused, title, disabled, children, dangerous, ...props }, ref) => {
17
- const id = useId();
18
- const platformSupportsHover = useIsSupportHover();
19
- const showWarning = useActiveDangerousRow() === id;
20
- const onSelect = useCallbackRef(props.onSelect || noop);
21
- const { MenuPrimitive } = useActionsMenuContext();
22
- const setActiveDangerousRow = useSetActiveDangerousRow();
23
- const handleSelect = (e) => {
24
- e.stopPropagation();
25
- if (loading || !id) {
26
- e.preventDefault();
27
- return;
28
- }
29
- if (dangerous && !showWarning) {
30
- e.preventDefault();
31
- setActiveDangerousRow(id);
32
- return;
33
- }
34
- setActiveDangerousRow(null);
35
- onSelect(e);
36
- };
37
- return /* @__PURE__ */ jsx(MenuPrimitive.Item, {
38
- ref,
39
- "data-testid": testId,
40
- onClick: stopPropagation,
41
- onSelect: handleSelect,
42
- title: title ? title : "",
43
- className: cx(listRowSurfaceStylesBase, actionMenuItemSurface, className, platformSupportsHover && hovered === void 0 && "natural-hover", focused === void 0 && "natural-focus", focused && "focus", disabled && "done", selected && "selected", dangerous && "dangerous", showWarning && "warn"),
44
- disabled,
45
- children
46
- });
47
- });
48
- var actionMenuItemDescriptionClass = "a11chqvq-actionMenuItemDescription";
49
- var actionMenuItemContentClass = "aw0iqns-actionMenuItemContent";
50
- var actionMenuItemWithDescription = "aldd35y-actionMenuItemWithDescription";
51
- var ActionMenuItemContent = forwardRef(({ contentClassName, description, ...rest }, ref) => {
52
- return /* @__PURE__ */ jsxs("div", {
53
- className: cx(description && actionMenuItemWithDescription),
54
- children: [/* @__PURE__ */ jsx(ListRowContent, {
55
- contentClassName: cx(contentClassName, actionMenuItemContentClass),
56
- ref,
57
- ...rest
58
- }), description ? /* @__PURE__ */ jsx("div", {
59
- className: cx(textClasses.small, actionMenuItemDescriptionClass),
60
- children: description
61
- }) : null]
62
- });
63
- });
64
- //#endregion
65
- export { ActionMenuItemContent, ActionMenuItemSurface, actionMenuItemSurface };
@@ -1,4 +0,0 @@
1
- .a17pn820-actionMenuItemSurface{margin:0 4px;background-color:var(--colorBgListItemGeneral);}.a17pn820-actionMenuItemSurface.natural-hover:hover,.a17pn820-actionMenuItemSurface[data-highlighted]{background-color:var(--colorBgActionsMenuItemHover);}.a17pn820-actionMenuItemSurface.done,.a17pn820-actionMenuItemSurface[data-disabled]{cursor:not-allowed;color:var(--colorTextListItemGeneralDisabled);background-color:var(--colorBgListItemGeneralDisabled);}.a17pn820-actionMenuItemSurface.done.natural-hover:hover,.a17pn820-actionMenuItemSurface[data-disabled].natural-hover:hover,.a17pn820-actionMenuItemSurface.done.hover>*,.a17pn820-actionMenuItemSurface[data-disabled].hover>*{opacity:var(--opacityListItemGeneralDisabled);}.a17pn820-actionMenuItemSurface.selected{cursor:default;background-color:var(--colorBgActionsMenuItemSelected);}.a17pn820-actionMenuItemSurface.selected.natural-hover:hover,.a17pn820-actionMenuItemSurface.selected.hover,.a17pn820-actionMenuItemSurface.selected[data-highlighted]{background-color:var(--colorBgActionsMenuItemSelectedHover);}.a17pn820-actionMenuItemSurface.dangerous{background-color:var(--colorBgActionsMenuItemDangerActive);}.a17pn820-actionMenuItemSurface.dangerous.natural-hover:hover,.a17pn820-actionMenuItemSurface.dangerous.hover,.a17pn820-actionMenuItemSurface.dangerous[data-highlighted]{background-color:var(--colorBgActionsMenuItemDangerActive);}.a17pn820-actionMenuItemSurface.warm{background-color:var(--colorBgActionsMenuItemDangerActive);color:var(--whiteColor);}.a17pn820-actionMenuItemSurface.warm.natural-hover:hover,.a17pn820-actionMenuItemSurface.warm.hover,.a17pn820-actionMenuItemSurface.warm[data-highlighted]{background-color:var(--colorBgActionsMenuItemDangerActive);color:var(--whiteColor);}
2
- .a11chqvq-actionMenuItemDescription{line-height:1;color:var(--accentTextColor);padding:2px 8px 0;}
3
- .aw0iqns-actionMenuItemContent{line-height:32px;padding:0 8px;}
4
- .aldd35y-actionMenuItemWithDescription{min-height:52px;}
@@ -1,24 +0,0 @@
1
- import { ComponentType, ReactNode } from "react";
2
- //#region src/loading-sausage.d.ts
3
- declare const getRandomInt: (min: number, max: number, seed?: number) => number;
4
- type LoadingSausageProps = {
5
- minWidth?: number;
6
- maxWidth?: number;
7
- height?: number;
8
- inverted?: boolean;
9
- animateAppearance?: boolean;
10
- margins?: boolean;
11
- index?: number;
12
- };
13
- declare const LoadingSausage: import("react").MemoExoticComponent<({ minWidth, maxWidth, index, height, margins, animateAppearance }: LoadingSausageProps) => JSX.Element>;
14
- type SausageListProps = {
15
- amount?: number;
16
- minAmount?: number;
17
- maxAmount?: number;
18
- WrapperComponent?: ComponentType<{
19
- children: ReactNode;
20
- }> | null;
21
- } & Omit<LoadingSausageProps, "index">;
22
- declare const LoadingSausageList: import("react").NamedExoticComponent<SausageListProps>;
23
- //#endregion
24
- export { LoadingSausage, LoadingSausageList, LoadingSausageProps, getRandomInt };
@@ -1,54 +0,0 @@
1
- import "./loading-sausage.wyw-in-js.css";
2
- /* empty css */
3
- import { Fragment, jsx } from "react/jsx-runtime";
4
- import { memo, useState } from "react";
5
- import cx from "classnames";
6
- import { styled } from "@linaria/react";
7
- //#region src/loading-sausage.tsx
8
- var getRandomWithSeed = (seed) => {
9
- const x = Math.sin(seed + 1) * 1e4;
10
- return x - Math.floor(x);
11
- };
12
- var getRandomInt = (min, max, seed) => {
13
- const random = seed !== void 0 ? getRandomWithSeed(seed) : Math.random();
14
- return Math.floor(random * (max - min + 1)) + min;
15
- };
16
- var loadingSausageStyle = "l16t34ge-loadingSausage";
17
- var marginStyle = "m9y52vn-margin";
18
- var loadingSausageWithAnimatedAppearanceStyle = "l13a41xq-loadingSausageWithAnimatedAppearance";
19
- var _exp4 = () => ((props) => `${props.height / 2}px`);
20
- var Container = /*#__PURE__*/ styled("div")({
21
- name: "Container",
22
- class: "c1pjyqzf-Container",
23
- propsAsIs: false,
24
- vars: { "c1pjyqzf-0": [_exp4()] }
25
- });
26
- var LoadingSausage = memo(function LoadingSausage({ minWidth = 80, maxWidth = 120, index, height = 12, margins = true, animateAppearance = false }) {
27
- const [width] = useState(() => getRandomInt(minWidth, maxWidth, index));
28
- return /* @__PURE__ */ jsx(Container, {
29
- height,
30
- style: {
31
- width,
32
- height
33
- },
34
- className: cx(loadingSausageStyle, margins && marginStyle, animateAppearance && loadingSausageWithAnimatedAppearanceStyle)
35
- });
36
- });
37
- var LoadingSausageList = memo(function LoadingSausageList({ amount, minAmount = 1, maxAmount = 1, WrapperComponent, ...restProps }) {
38
- const calculatedAmount = amount || getRandomInt(minAmount, maxAmount);
39
- return /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: calculatedAmount }, (_, index) => {
40
- const style = { opacity: (calculatedAmount - index) / calculatedAmount };
41
- return /* @__PURE__ */ jsx("div", {
42
- style,
43
- children: WrapperComponent ? /* @__PURE__ */ jsx(WrapperComponent, { children: /* @__PURE__ */ jsx(LoadingSausage, {
44
- index: index + 1,
45
- ...restProps
46
- }) }) : /* @__PURE__ */ jsx(LoadingSausage, {
47
- index: index + 1,
48
- ...restProps
49
- })
50
- }, index);
51
- }) });
52
- });
53
- //#endregion
54
- export { LoadingSausage, LoadingSausageList, getRandomInt };
@@ -1,4 +0,0 @@
1
- .l16t34ge-loadingSausage{vertical-align:middle;position:relative;background:none;}.l16t34ge-loadingSausage::before,.l16t34ge-loadingSausage::after{content:"";display:block;position:absolute;top:0;bottom:0;left:0;right:0;}@keyframes OpacityAnim-l16t34ge-loadingSausage{0%{opacity:1;}100%{opacity:0;}}.l16t34ge-loadingSausage::before{background-image:linear-gradient(90deg, transparent 0%, var(--colorBgSkeleton) 100%);animation:OpacityAnim-l16t34ge-loadingSausage 2s ease-in-out 0s infinite alternate;}.l16t34ge-loadingSausage::after{background-image:linear-gradient(90deg, var(--colorBgSkeleton) 0%, transparent 100%);animation:OpacityAnim-l16t34ge-loadingSausage 2s ease-in-out -2s infinite alternate;}
2
- .m9y52vn-margin{margin-top:4px;margin-bottom:4px;}
3
- .l13a41xq-loadingSausageWithAnimatedAppearance{animation:OpacityAnim-l13a41xq-loadingSausageWithAnimatedAppearance 1s cubic-bezier(0.95, 0.05, 0.795, 0.035) 1;}@keyframes OpacityAnim-l13a41xq-loadingSausageWithAnimatedAppearance{0%{opacity:0;}100%{opacity:1;}}
4
- .c1pjyqzf-Container::before,.c1pjyqzf-Container::after{border-radius:var(--c1pjyqzf-0);}
@@ -1 +0,0 @@
1
- export {}
File without changes
@@ -1,4 +0,0 @@
1
- //#region src/not-empty.d.ts
2
- declare function notEmpty<TValue>(value: TValue | null | undefined | false): value is TValue;
3
- //#endregion
4
- export { notEmpty };
package/lib/not-empty.js DELETED
@@ -1,6 +0,0 @@
1
- //#region src/not-empty.ts
2
- function notEmpty(value) {
3
- return value !== null && value !== void 0 && value !== false;
4
- }
5
- //#endregion
6
- export { notEmpty };
@@ -1,4 +0,0 @@
1
- //#region src/use-why-did-you-update.d.ts
2
- declare function useWhyDidYouUpdate(name: string, props: Record<string, unknown>): void;
3
- //#endregion
4
- export { useWhyDidYouUpdate as default };
@@ -1,25 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- //#region src/use-why-did-you-update.tsx
3
- function useWhyDidYouUpdate(name, props) {
4
- const previousProps = useRef();
5
- useEffect(() => {
6
- const current = previousProps.current;
7
- if (current) {
8
- const allKeys = Object.keys({
9
- ...current,
10
- ...props
11
- });
12
- const changesObj = {};
13
- allKeys.forEach((key) => {
14
- if (current[key] !== props[key]) changesObj[key] = {
15
- from: current[key],
16
- to: props[key]
17
- };
18
- });
19
- if (Object.keys(changesObj).length) console.log("[why-did-you-update]", name, changesObj);
20
- }
21
- previousProps.current = props;
22
- });
23
- }
24
- //#endregion
25
- export { useWhyDidYouUpdate as default };
@@ -1,77 +0,0 @@
1
- import { ComponentType } from "react";
2
- //#region src/with-data.d.ts
3
- type FetchState<Value = unknown> = {
4
- fetchState: ":fetch-state/start";
5
- fetchError: null;
6
- fetchValue: null;
7
- } | {
8
- fetchState: ":fetch-state/success";
9
- fetchValue: Value;
10
- fetchError: null;
11
- } | {
12
- fetchState: ":fetch-state/error";
13
- fetchError: Error;
14
- fetchValue: null;
15
- };
16
- type DataSources = Record<string, () => Promise<unknown>>;
17
- type ProvidedState<Sources extends DataSources> = { [Key in keyof Sources]: FetchState<Awaited<ReturnType<Sources[Key]>>>; };
18
- declare function provideData<Sources extends DataSources>({ sources }: {
19
- sources: Sources;
20
- }): <OwnProps extends object>(Component: ComponentType<OwnProps & ProvidedState<Sources>>) => {
21
- new (props: OwnProps): {
22
- state: ProvidedState<Sources>;
23
- _prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
24
- setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
25
- componentDidMount(): void;
26
- setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
27
- componentWillUnmount(): void;
28
- render(): import("react/jsx-runtime").JSX.Element;
29
- context: unknown;
30
- setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
31
- forceUpdate(callback?: (() => void) | undefined): void;
32
- readonly props: Readonly<OwnProps>;
33
- refs: {
34
- [key: string]: import("react").ReactInstance;
35
- };
36
- shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
37
- componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
38
- getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
39
- componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
40
- componentWillMount?(): void;
41
- UNSAFE_componentWillMount?(): void;
42
- componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
43
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
44
- componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
45
- UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
46
- };
47
- new (props: OwnProps, context: any): {
48
- state: ProvidedState<Sources>;
49
- _prefetch: <Key extends keyof Sources>(key: Key, fetch: Sources[Key]) => Promise<void>;
50
- setSourceState<Key extends keyof Sources>(key: Key, value: ProvidedState<Sources>[Key]): void;
51
- componentDidMount(): void;
52
- setStateIfMounted(updater: (prevState: ProvidedState<Sources>) => ProvidedState<Sources>): void;
53
- componentWillUnmount(): void;
54
- render(): import("react/jsx-runtime").JSX.Element;
55
- context: unknown;
56
- setState<K extends keyof Sources>(state: Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | ((prevState: Readonly<ProvidedState<Sources>>, props: Readonly<OwnProps>) => Pick<ProvidedState<Sources>, K> | ProvidedState<Sources> | null) | null, callback?: (() => void) | undefined): void;
57
- forceUpdate(callback?: (() => void) | undefined): void;
58
- readonly props: Readonly<OwnProps>;
59
- refs: {
60
- [key: string]: import("react").ReactInstance;
61
- };
62
- shouldComponentUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): boolean;
63
- componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
64
- getSnapshotBeforeUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>): any;
65
- componentDidUpdate?(prevProps: Readonly<OwnProps>, prevState: Readonly<ProvidedState<Sources>>, snapshot?: any): void;
66
- componentWillMount?(): void;
67
- UNSAFE_componentWillMount?(): void;
68
- componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
69
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OwnProps>, nextContext: any): void;
70
- componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
71
- UNSAFE_componentWillUpdate?(nextProps: Readonly<OwnProps>, nextState: Readonly<ProvidedState<Sources>>, nextContext: any): void;
72
- };
73
- contextType?: import("react").Context<any> | undefined;
74
- };
75
- declare const DefaultDependenciesLoader: () => import("react/jsx-runtime").JSX.Element;
76
- //#endregion
77
- export { DefaultDependenciesLoader, provideData };
package/lib/with-data.js DELETED
@@ -1,55 +0,0 @@
1
- import { asError } from "./errors.js";
2
- import { mapValues, noop } from "@fibery/helpers/src/_";
3
- import { jsx } from "react/jsx-runtime";
4
- import { PureComponent } from "react";
5
- //#region src/with-data.tsx
6
- var makeInitialState = (sources) => mapValues(sources, () => ({
7
- fetchState: ":fetch-state/start",
8
- fetchValue: null,
9
- fetchError: null
10
- }));
11
- function provideData({ sources }) {
12
- return (Component) => class DataProvider extends PureComponent {
13
- state = makeInitialState(sources);
14
- _prefetch = async (key, fetch) => {
15
- try {
16
- const fetchValue = await fetch();
17
- this.setSourceState(key, {
18
- fetchState: ":fetch-state/success",
19
- fetchValue,
20
- fetchError: null
21
- });
22
- } catch (fetchError) {
23
- this.setSourceState(key, {
24
- fetchState: ":fetch-state/error",
25
- fetchValue: null,
26
- fetchError: asError(fetchError)
27
- });
28
- }
29
- };
30
- setSourceState(key, value) {
31
- this.setStateIfMounted((state) => ({
32
- ...state,
33
- [key]: value
34
- }));
35
- }
36
- componentDidMount() {
37
- Object.keys(sources).forEach((key) => this._prefetch(key, sources[key]));
38
- }
39
- setStateIfMounted(updater) {
40
- return this.setState(updater);
41
- }
42
- componentWillUnmount() {
43
- this.setStateIfMounted = noop;
44
- }
45
- render() {
46
- return /* @__PURE__ */ jsx(Component, {
47
- ...this.props,
48
- ...this.state
49
- });
50
- }
51
- };
52
- }
53
- var DefaultDependenciesLoader = () => /* @__PURE__ */ jsx("div", {});
54
- //#endregion
55
- export { DefaultDependenciesLoader, provideData };