@fibery/ui-kit 9.0.2 → 9.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 (189) hide show
  1. package/lib/a11y-color.js +12 -10
  2. package/lib/actions-menu/actions-menu-props.d.ts +2 -0
  3. package/lib/actions-menu/actions-menu-sub-command-menu.js +5 -4
  4. package/lib/actions-menu/actions-menu.d.ts +1 -1
  5. package/lib/actions-menu/actions-menu.js +2 -1
  6. package/lib/actions-menu/contexts/actions-menu-context.js +12 -11
  7. package/lib/ai/max-tokens.js +6 -5
  8. package/lib/antd/ant-modal.d.ts +1 -1
  9. package/lib/antd/ant-modal.js +28 -1
  10. package/lib/antd/ant-upload.d.ts +1 -1
  11. package/lib/antd/ant-upload.js +23 -18
  12. package/lib/antd/input.js +5 -4
  13. package/lib/antd/utils.js +2 -1
  14. package/lib/avatar-colors.js +1 -1
  15. package/lib/avatar.d.ts +1 -10
  16. package/lib/avatar.js +48 -38
  17. package/lib/avatar.wyw-in-js.css +1 -1
  18. package/lib/banner/banner-action.js +2 -1
  19. package/lib/button/button.js +1 -1
  20. package/lib/button/icon-button.js +1 -1
  21. package/lib/canvas-colors.js +2 -2
  22. package/lib/card-container.d.ts +2 -6
  23. package/lib/card-container.js +4 -4
  24. package/lib/color-filter.js +2 -2
  25. package/lib/color-inspect.js +1 -1
  26. package/lib/color-picker/color-picker-or-loader.d.ts +2 -2
  27. package/lib/color-utils.js +1 -1
  28. package/lib/comment.d.ts +1 -0
  29. package/lib/comment.js +29 -20
  30. package/lib/comment.wyw-in-js.css +9 -7
  31. package/lib/context-menu/index.js +1 -0
  32. package/lib/context-menu/index.wyw-in-js.css +1 -1
  33. package/lib/date-picker/autocomplete.js +12 -10
  34. package/lib/date-picker/date-range-input.js +8 -6
  35. package/lib/date-picker/day-with-start-end-buttons.js +0 -2
  36. package/lib/date-picker/get-weekends-for-month.js +4 -2
  37. package/lib/date-picker/single-date-input.js +8 -6
  38. package/lib/day-select/day-select.js +2 -1
  39. package/lib/day-select/week-day-select.d.ts +2 -2
  40. package/lib/day-select/week-day-select.js +4 -3
  41. package/lib/design-system/alpha.js +5 -7
  42. package/lib/design-system/colors-charts.d.ts +4 -0
  43. package/lib/design-system/colors-charts.js +14 -0
  44. package/lib/design-system/colors-js.d.ts +2 -4
  45. package/lib/design-system/colors-js.js +8 -10
  46. package/lib/design-system/fns.enum.js +7 -4
  47. package/lib/design-system/fns.icon.js +1 -1
  48. package/lib/design-system/fns.js +7 -4
  49. package/lib/design-system/theme.d.ts +7 -7
  50. package/lib/design-system/theme.js +7 -12
  51. package/lib/design-system/vars.js +1 -2
  52. package/lib/design-system.d.ts +3 -2
  53. package/lib/design-system.js +3 -2
  54. package/lib/emoji-picker/primitives/content.js +10 -9
  55. package/lib/emoji-picker/primitives/emoji.js +22 -14
  56. package/lib/emoji-picker/primitives/emoji.wyw-in-js.css +4 -3
  57. package/lib/emoji-picker/primitives/grid.js +0 -1
  58. package/lib/emoji-picker/primitives/preview-provider.js +4 -3
  59. package/lib/emoji-picker/primitives/root.js +10 -9
  60. package/lib/emoji-picker/primitives/skin-provider.js +5 -4
  61. package/lib/emoji-picker/stores/emoji-data-store.d.ts +2 -2
  62. package/lib/emoji-picker/stores/emoji-data-store.js +8 -8
  63. package/lib/emoji-picker/stores/static-emoji-data-store.js +2 -1
  64. package/lib/emoji.js +5 -2
  65. package/lib/fibermoji-placeholder.js +5 -7
  66. package/lib/field-type-icon.js +2 -1
  67. package/lib/file-item/file-icon.js +2 -1
  68. package/lib/file-item.js +3 -10
  69. package/lib/highlight-colors.js +2 -1
  70. package/lib/hotkey-scope.js +2 -1
  71. package/lib/icons/ast/index.d.ts +1 -4
  72. package/lib/icons/ast/index.js +2 -5
  73. package/lib/icons/ast/spinner.js +1 -14
  74. package/lib/icons/icon.js +4 -3
  75. package/lib/icons/react/index.d.ts +1 -4
  76. package/lib/icons/react/index.js +2 -5
  77. package/lib/images-gallery/get-gallery-src.js +1 -1
  78. package/lib/images-gallery/slide-buttons.js +8 -4
  79. package/lib/images-gallery/thumbnails-mime-types-white-list.js +1 -1
  80. package/lib/integration-compact-info-button.js +1 -1
  81. package/lib/loading-sausage.js +7 -6
  82. package/lib/mobile-drawer.d.ts +2 -1
  83. package/lib/mobile-drawer.js +24 -12
  84. package/lib/mobile-drawer.wyw-in-js.css +3 -2
  85. package/lib/mobile-keyboard-aware-popup.js +6 -5
  86. package/lib/modal-menu/contexts/modal-menu-context.d.ts +1 -0
  87. package/lib/modal-menu/modal-menu-content.d.ts +1 -1
  88. package/lib/modal-menu/modal-menu-content.js +16 -6
  89. package/lib/modal-menu/modal-menu-drawer-content.d.ts +7 -0
  90. package/lib/modal-menu/modal-menu-drawer-content.js +13 -0
  91. package/lib/modal-menu/modal-menu-root.d.ts +2 -1
  92. package/lib/modal-menu/modal-menu-root.js +24 -21
  93. package/lib/modal-menu/modal-submenu.js +10 -9
  94. package/lib/nested-menu-item.d.ts +1 -1
  95. package/lib/number-input/number-input-inline-with-autosize.d.ts +1 -2
  96. package/lib/number-input/number-input-inline-with-autosize.js +9 -6
  97. package/lib/number-input/number-input-inline-with-autosize.wyw-in-js.css +0 -1
  98. package/lib/number-input/number-input.js +13 -11
  99. package/lib/number-input/styles.d.ts +1 -9
  100. package/lib/number-input/styles.js +3 -9
  101. package/lib/number-input/styles.wyw-in-js.css +2 -3
  102. package/lib/number-input/text-area-auto-sized.d.ts +1 -2
  103. package/lib/number-input/text-area-auto-sized.js +2 -2
  104. package/lib/number-input/text-input-auto-sized.d.ts +1 -2
  105. package/lib/number-input/text-input-auto-sized.js +2 -2
  106. package/lib/online-users.js +2 -2
  107. package/lib/open-popover-tracker.js +7 -6
  108. package/lib/palettes/neutral.js +1 -1
  109. package/lib/palettes/warm.js +1 -1
  110. package/lib/phone.js +1 -1
  111. package/lib/popover/index.d.ts +4 -2
  112. package/lib/popover/index.js +61 -59
  113. package/lib/popover/mobile-popover-context.js +12 -11
  114. package/lib/popover/mobile-popover.js +16 -15
  115. package/lib/popover/modifiers.js +4 -4
  116. package/lib/preference-setting.js +6 -8
  117. package/lib/reactions/reaction-button.js +36 -25
  118. package/lib/reactions/reaction-button.wyw-in-js.css +16 -16
  119. package/lib/reactions/reaction-picker.js +22 -10
  120. package/lib/reactions/reaction-picker.wyw-in-js.css +1 -0
  121. package/lib/reactions/tootltip.js +2 -1
  122. package/lib/select/components/option.js +2 -1
  123. package/lib/select/index.d.ts +2 -1
  124. package/lib/select/select-trigger.d.ts +4 -0
  125. package/lib/select/select-trigger.js +25 -0
  126. package/lib/select/select-trigger.wyw-in-js.css +1 -0
  127. package/lib/select/select.d.ts +6 -2
  128. package/lib/select/select.js +10 -5
  129. package/lib/spinner.d.ts +2 -6
  130. package/lib/spinner.js +11 -7
  131. package/lib/spinner.wyw-in-js.css +1 -0
  132. package/lib/tab-nav/tab-nav.d.ts +4 -2
  133. package/lib/tab-nav/tab-nav.js +2 -2
  134. package/lib/thematic.js +322 -321
  135. package/lib/theme-provider.d.ts +1 -3
  136. package/lib/toast/toast-action.js +2 -1
  137. package/lib/toast/toast-provider.d.ts +1 -2
  138. package/lib/toast/toast-queue.d.ts +1 -2
  139. package/lib/toast/toast-queue.js +7 -8
  140. package/lib/toast/toast.js +7 -6
  141. package/lib/toggle.js +3 -3
  142. package/lib/tooltip-if-overflown.js +2 -1
  143. package/lib/tooltip.js +1 -1
  144. package/lib/type-badge.d.ts +8 -28
  145. package/lib/type-badge.js +39 -50
  146. package/lib/type-badge.wyw-in-js.css +11 -10
  147. package/lib/unit/container.d.ts +12 -0
  148. package/lib/unit/container.js +50 -0
  149. package/lib/unit/context.d.ts +29 -0
  150. package/lib/unit/context.js +9 -0
  151. package/lib/unit/index.d.ts +4 -2
  152. package/lib/unit/index.js +2 -1
  153. package/lib/unit/nav-button.d.ts +12 -0
  154. package/lib/unit/nav-button.js +18 -0
  155. package/lib/unit/styles.d.ts +6 -9
  156. package/lib/unit/styles.js +13 -16
  157. package/lib/unit/styles.wyw-in-js.css +10 -16
  158. package/lib/unit/unit-content-layout.d.ts +4 -3
  159. package/lib/unit/unit-content-layout.js +9 -9
  160. package/lib/unit/unit-content.d.ts +6 -5
  161. package/lib/unit/unit-content.js +83 -18
  162. package/lib/unit/unit-content.wyw-in-js.css +6 -2
  163. package/lib/unit/unit.d.ts +38 -5
  164. package/lib/unit/unit.js +43 -12
  165. package/lib/workflow-progress-icon.js +2 -2
  166. package/package.json +4 -4
  167. package/lib/features.d.ts +0 -8
  168. package/lib/features.js +0 -15
  169. package/lib/flags.d.ts +0 -4
  170. package/lib/flags.js +0 -7
  171. package/lib/icons/ast/alert-triangle.d.ts +0 -5
  172. package/lib/icons/ast/alert-triangle.js +0 -25
  173. package/lib/icons/ast/field-units-large.d.ts +0 -5
  174. package/lib/icons/ast/field-units-large.js +0 -25
  175. package/lib/icons/ast/plus.d.ts +0 -5
  176. package/lib/icons/ast/plus.js +0 -25
  177. package/lib/icons/react/alert-triangle.d.ts +0 -15
  178. package/lib/icons/react/alert-triangle.js +0 -21
  179. package/lib/icons/react/field-units-large.d.ts +0 -15
  180. package/lib/icons/react/field-units-large.js +0 -21
  181. package/lib/icons/react/plus.d.ts +0 -15
  182. package/lib/icons/react/plus.js +0 -21
  183. package/lib/unit/primitive.d.ts +0 -5
  184. package/lib/unit/primitive.js +0 -108
  185. package/lib/unit/primitive.wyw-in-js.css +0 -3
  186. package/lib/unit/types.d.ts +0 -34
  187. package/lib/unit/types.js +0 -0
  188. package/lib/unit/unit-button-group.d.ts +0 -13
  189. package/lib/unit/unit-button-group.js +0 -23
@@ -3,21 +3,18 @@ import { space } from "../design-system/layout.js";
3
3
  import { fontSize } from "../design-system/typography.js";
4
4
  /* empty css */
5
5
  //#region src/unit/styles.ts
6
- var textEllipsisClassName = "tnbrrsv-textEllipsis";
7
- var basicUnitClassName = "b60xcpq-basicUnit";
8
- var alignCenterClassName = "au50b8v-alignCenter";
9
- var regularTextUnitSize = fontSize.sm + space.s8;
6
+ var basicUnitClassName = "bnbrrsv-basicUnit";
7
+ var alignCenterClassName = "a60xcpq-alignCenter";
8
+ var mediumTextUnitSize = fontSize.sm + space.s8;
10
9
  var smallTextUnitSize = fontSize.xs + space.s8;
11
- var bigSizeUnitClassName = "b1yn8ezw-bigSizeUnit";
12
- var bigSizeUnitMinWidthClassName = "b1v5rpy3-bigSizeUnitMinWidth";
13
- var regularSizeUnitClassName = "r45fj0l-regularSizeUnit";
14
- var regularSizeUnitMinWidthClassName = "rpdarf0-regularSizeUnitMinWidth";
15
- var unitMinHeightClassName = "ubaz4qk-unitMinHeight";
16
- var invalidUnitClassName = "i14l2yxo-invalidUnit";
17
- var clickableClassName = "c18mqj2f-clickable";
18
- var borderClassName = "b4mqgwc-border";
19
- var pillRadiusClassName = "p1ebg4ic-pillRadius";
20
- var fullUnitWrapperClassName = "f1kzkp39-fullUnitWrapper";
21
- var positionUnitClass = "prmh9nr-positionUnit";
10
+ var mediumSizeCss = "mu50b8v-mediumSize";
11
+ var mediumSizeMinWidthCss = "m1yn8ezw-mediumSizeMinWidth";
12
+ var smallSizeCss = "s1v5rpy3-smallSize";
13
+ var smallSizeMinWidthCss = "s45fj0l-smallSizeMinWidth";
14
+ var unitMinHeightClassName = "updarf0-unitMinHeight";
15
+ var invalidUnitClassName = "ibaz4qk-invalidUnit";
16
+ var clickableClassName = "c14l2yxo-clickable";
17
+ var borderClassName = "b18mqj2f-border";
18
+ var positionUnitClass = "p4mqgwc-positionUnit";
22
19
  //#endregion
23
- export { alignCenterClassName, basicUnitClassName, bigSizeUnitClassName, bigSizeUnitMinWidthClassName, borderClassName, clickableClassName, fullUnitWrapperClassName, invalidUnitClassName, pillRadiusClassName, positionUnitClass, regularSizeUnitClassName, regularSizeUnitMinWidthClassName, regularTextUnitSize, smallTextUnitSize, textEllipsisClassName, unitMinHeightClassName };
20
+ export { alignCenterClassName, basicUnitClassName, borderClassName, clickableClassName, invalidUnitClassName, mediumSizeCss, mediumSizeMinWidthCss, mediumTextUnitSize, positionUnitClass, smallSizeCss, smallSizeMinWidthCss, smallTextUnitSize, unitMinHeightClassName };
@@ -1,17 +1,11 @@
1
- .tnbrrsv-textEllipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
2
- .b60xcpq-basicUnit{border-radius:6px;border:none;}
3
- .au50b8v-alignCenter{display:flex;align-items:center;justify-content:center;line-height:0;}
4
- .b1yn8ezw-bigSizeUnit{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;line-height:22px;}
5
- .b1v5rpy3-bigSizeUnitMinWidth{min-width:26px;justify-content:center;}
6
- .r45fj0l-regularSizeUnit{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:12px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;line-height:20px;}
7
- .rpdarf0-regularSizeUnitMinWidth{min-width:24px;justify-content:center;}
8
- .ubaz4qk-unitMinHeight{min-height:24px;}
1
+ .bnbrrsv-basicUnit{border-radius:6px;border:none;}
2
+ .a60xcpq-alignCenter{display:flex;align-items:center;justify-content:center;line-height:0;}
3
+ .mu50b8v-mediumSize{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:14px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;letter-spacing:normal;line-height:22px;}
4
+ .m1yn8ezw-mediumSizeMinWidth{min-width:26px;justify-content:center;}
5
+ .s1v5rpy3-smallSize{font-family:"Inter Variable","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:12px;line-height:1.5;font-weight:410;color:var(--textColor);text-transform:none;line-height:20px;}
6
+ .s45fj0l-smallSizeMinWidth{min-width:24px;justify-content:center;}
7
+ .updarf0-unitMinHeight{min-height:24px;}
9
8
 
10
- .c18mqj2f-clickable{cursor:pointer;}
11
- .b4mqgwc-border{position:relative;}.b4mqgwc-border:focus{outline:none;}.b4mqgwc-border::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:var(--inputBorderColor) inset;mix-blend-mode:var(--inputBorderBlendMode);border-radius:6px;pointer-events:none;}.b4mqgwc-border.c18mqj2f-clickable:hover::before{box-shadow:var(--inputBorderHoverColor) inset;}.b4mqgwc-border.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;}.b4mqgwc-border.i14l2yxo-invalidUnit::before{box-shadow:none;border:1px solid var(--colorBorderButtonOutlineAccentDefault);}.b4mqgwc-border.i14l2yxo-invalidUnit.c18mqj2f-clickable:hover::before{box-shadow:none;border:1px solid var(--colorBorderReactionsSelectedHover);}.b4mqgwc-border.i14l2yxo-invalidUnit.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;border:none;}
12
- .p1ebg4ic-pillRadius{border-radius:16px;}.p1ebg4ic-pillRadius::before{border-radius:16px;box-shadow:var(--inputBorderColorThin) inset;}.p1ebg4ic-pillRadius.c18mqj2f-clickable:hover{background-image:linear-gradient(
13
- var(--colorBgButtonGhostNeutralHover),
14
- var(--colorBgButtonGhostNeutralHover)
15
- );}.p1ebg4ic-pillRadius.c18mqj2f-clickable:hover::before{box-shadow:var(--inputBorderHoverColorThin) inset;}.p1ebg4ic-pillRadius.c18mqj2f-clickable:focus::before{box-shadow:var(--inputBorderFocusColorThin) inset;}
16
- .f1kzkp39-fullUnitWrapper{display:flex;align-items:center;padding:6px;border-radius:6px;background-color:var(--cardBg);margin-bottom:4px;}
17
- .prmh9nr-positionUnit{line-height:0;position:relative;}
9
+ .c14l2yxo-clickable{cursor:pointer;}
10
+ .b18mqj2f-border{position:relative;}.b18mqj2f-border:focus{outline:none;}.b18mqj2f-border::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:var(--inputBorderColor) inset;mix-blend-mode:var(--inputBorderBlendMode);border-radius:6px;pointer-events:none;}.b18mqj2f-border.c14l2yxo-clickable:hover::before{box-shadow:var(--inputBorderHoverColor) inset;}.b18mqj2f-border.c14l2yxo-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;}.b18mqj2f-border.ibaz4qk-invalidUnit::before{box-shadow:none;border:1px solid var(--colorBorderButtonOutlineAccentDefault);}.b18mqj2f-border.ibaz4qk-invalidUnit.c14l2yxo-clickable:hover::before{box-shadow:none;border:1px solid var(--colorBorderReactionsSelectedHover);}.b18mqj2f-border.ibaz4qk-invalidUnit.c14l2yxo-clickable:focus::before{box-shadow:var(--inputBorderFocusColor) inset;border:none;}
11
+ .p4mqgwc-positionUnit{line-height:0;position:relative;}
@@ -1,11 +1,12 @@
1
+ import { UnitSize } from "./context.js";
1
2
  //#region src/unit/unit-content-layout.d.ts
2
3
  type Props = {
3
- big: boolean;
4
- iconsLength: number;
4
+ size: UnitSize;
5
+ hasIcon: boolean;
5
6
  hasChildren: boolean;
6
7
  shrinkable?: boolean;
7
8
  };
8
- declare const getHeight: (big: boolean) => number;
9
+ declare const getHeight: (size: UnitSize) => number;
9
10
  declare const UnitContentLayout: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Props>;
10
11
  //#endregion
11
12
  export { UnitContentLayout, getHeight };
@@ -1,19 +1,19 @@
1
1
  import "./unit-content-layout.wyw-in-js.css";
2
- import { regularTextUnitSize, smallTextUnitSize } from "./styles.js";
2
+ import { mediumTextUnitSize, smallTextUnitSize } from "./styles.js";
3
3
  /* empty css */
4
4
  import { styled } from "@linaria/react";
5
5
  //#region src/unit/unit-content-layout.tsx
6
- var getHeight = (big) => {
7
- return big ? regularTextUnitSize : smallTextUnitSize;
6
+ var getHeight = (size) => {
7
+ return size === "medium" ? mediumTextUnitSize : smallTextUnitSize;
8
8
  };
9
- var getUnitGridTemplateRows = ({ big, iconsLength }) => {
10
- if (iconsLength === 0) return "auto";
11
- return `minmax(${getHeight(big)}px, max-content)`;
9
+ var getUnitGridTemplateRows = ({ size, hasIcon }) => {
10
+ if (!hasIcon) return "auto";
11
+ return `minmax(${getHeight(size)}px, max-content)`;
12
12
  };
13
- var getUnitGridTemplateColumns = ({ big, iconsLength, shrinkable = true, hasChildren }) => {
13
+ var getUnitGridTemplateColumns = ({ size, hasIcon, shrinkable = true, hasChildren }) => {
14
14
  const fitContent = "fit-content(200px)";
15
- if (iconsLength === 0) return shrinkable ? "auto" : fitContent;
16
- return `repeat(${iconsLength}, minmax(${getHeight(big)}px, max-content)) ${hasChildren ? shrinkable ? `minmax(auto, 1fr)` : fitContent : ""}`;
15
+ if (!hasIcon) return shrinkable ? "auto" : fitContent;
16
+ return `minmax(${getHeight(size)}px, max-content) ${hasChildren ? shrinkable ? `minmax(auto, 1fr)` : fitContent : ""}`;
17
17
  };
18
18
  var _exp2 = () => getUnitGridTemplateRows;
19
19
  var _exp3 = () => getUnitGridTemplateColumns;
@@ -1,13 +1,14 @@
1
- import { ReactNode } from "react";
1
+ import { KeyboardEvent, ReactNode } from "react";
2
2
  //#region src/unit/unit-content.d.ts
3
3
  type Props = {
4
- big: boolean;
5
- icons?: React.ReactNode[];
4
+ button?: boolean;
5
+ icon?: ReactNode;
6
6
  shrinkable?: boolean;
7
7
  truncate?: boolean;
8
- setNode?: (element: HTMLElement | null) => void;
8
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
9
+ onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
9
10
  children?: ReactNode;
10
11
  };
11
- declare const UnitContent: ({ big, icons, shrinkable, truncate, setNode, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const UnitContent: ({ button, icon, shrinkable, truncate, onClick, onKeyDown, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
13
  //#endregion
13
14
  export { UnitContent };
@@ -1,29 +1,94 @@
1
1
  import "./unit-content.wyw-in-js.css";
2
- import { alignCenterClassName } from "./styles.js";
2
+ import { themeVars } from "../theming.generated.js";
3
+ import { Tooltip } from "../tooltip.js";
4
+ import { useTruncated } from "../tooltip-if-overflown.js";
5
+ import "../styles-utils.js";
6
+ import { FieldIcon } from "../field-icon.js";
7
+ import { useUnitContext } from "./context.js";
8
+ import "./styles.js";
9
+ import { UnitContainer } from "./container.js";
3
10
  import { UnitContentLayout } from "./unit-content-layout.js";
4
11
  /* empty css */
5
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
+ import { forwardRef } from "react";
6
14
  import { cx } from "@linaria/core";
7
15
  //#region src/unit/unit-content.tsx
8
- var contentContainerCss = "c96bd8z-contentContainer";
9
- var contentCss = "ccx18o4-content";
10
- var UnitContent = ({ big, icons, shrinkable, truncate, setNode, children }) => {
11
- return /* @__PURE__ */ jsxs(UnitContentLayout, {
12
- big,
13
- hasChildren: Boolean(children),
14
- iconsLength: icons ? icons.length : 0,
15
- shrinkable,
16
- children: [icons ? icons.map((icon, index) => /* @__PURE__ */ jsx("div", {
17
- className: alignCenterClassName,
18
- children: icon
19
- }, index)) : null, children && /* @__PURE__ */ jsx("div", {
20
- className: contentContainerCss,
21
- children: /* @__PURE__ */ jsx("div", {
22
- ref: setNode,
23
- className: cx(contentCss, truncate && "tnbrrsv-textEllipsis"),
16
+ var resetButtonStylesCss = "r96bd8z-resetButtonStyles";
17
+ var ButtonComponent = forwardRef((props, ref) => {
18
+ return /* @__PURE__ */ jsx("button", {
19
+ ref,
20
+ type: "button",
21
+ ...props,
22
+ className: cx(props.className, resetButtonStylesCss)
23
+ });
24
+ });
25
+ var DivComponent = forwardRef((props, ref) => /* @__PURE__ */ jsx("div", {
26
+ ref,
27
+ ...props
28
+ }));
29
+ var contentContainerCss = "ccx18o4-contentContainer";
30
+ var contentCss = "c1l394rk-content";
31
+ var unitDescriptionCss = "u1he4b8w-unitDescription";
32
+ var fullUnitPreviewCss = "fcmj1jm-fullUnitPreview";
33
+ var tooltipTitleCss = "tum1nu9-tooltipTitle";
34
+ var UnitContent = ({ button = false, icon, shrinkable, truncate, onClick, onKeyDown, children }) => {
35
+ const { size, chipProps, tooltip } = useUnitContext();
36
+ const { truncated, setNode } = useTruncated();
37
+ const body = /* @__PURE__ */ jsx(button ? ButtonComponent : DivComponent, {
38
+ onClick,
39
+ onKeyDown,
40
+ children: jsxs(UnitContentLayout, {
41
+ size,
42
+ hasChildren: Boolean(children),
43
+ hasIcon: Boolean(icon),
44
+ shrinkable,
45
+ children: [icon && /* @__PURE__ */ jsx("div", {
46
+ className: "a60xcpq-alignCenter",
47
+ children: icon
48
+ }), children && /* @__PURE__ */ jsx("div", {
49
+ className: contentContainerCss,
50
+ children: /* @__PURE__ */ jsx("div", {
51
+ ref: tooltip ? setNode : void 0,
52
+ className: cx(contentCss, truncate && "e190sqpi-ellipsis"),
53
+ children
54
+ })
55
+ })]
56
+ })
57
+ });
58
+ if (!tooltip) return body;
59
+ const { title, fieldIcon, description, hint } = tooltip;
60
+ const tooltipTitle = /* @__PURE__ */ jsxs("div", {
61
+ className: tooltipTitleCss,
62
+ children: [fieldIcon && /* @__PURE__ */ jsx(FieldIcon, {
63
+ iconName: fieldIcon,
64
+ iconSize: 14,
65
+ color: themeVars.whiteColor
66
+ }), title]
67
+ });
68
+ const preview = truncated && /* @__PURE__ */ jsx("div", {
69
+ className: fullUnitPreviewCss,
70
+ children: jsx(UnitContainer, {
71
+ ...chipProps,
72
+ children: /* @__PURE__ */ jsx(UnitContent, {
73
+ icon,
24
74
  children
25
75
  })
26
- })]
76
+ })
77
+ });
78
+ return /* @__PURE__ */ jsx(Tooltip, {
79
+ side: "bottom",
80
+ align: "start",
81
+ openOnFocus: false,
82
+ title: tooltipTitle,
83
+ description: (description || preview || hint) && /* @__PURE__ */ jsxs("div", { children: [
84
+ description && /* @__PURE__ */ jsx("div", {
85
+ className: unitDescriptionCss,
86
+ children: description
87
+ }),
88
+ preview,
89
+ hint
90
+ ] }),
91
+ children: body
27
92
  });
28
93
  };
29
94
  //#endregion
@@ -1,2 +1,6 @@
1
- .c96bd8z-contentContainer{overflow:hidden;}
2
- .ccx18o4-content{padding-left:4px;padding-right:4px;}
1
+ .r96bd8z-resetButtonStyles{all:unset;background-color:var(--transparent);--input-focus-border:0 0 0 1px var(--colorAccentStrokeFocus) inset;--input-focus-shadow:0 0 0 2px var(--colorAccentStroke);border-radius:6px;}.r96bd8z-resetButtonStyles:focus{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}.r96bd8z-resetButtonStyles:focus:not(:focus-visible){outline:none;box-shadow:none!important;}.r96bd8z-resetButtonStyles:focus-visible{outline:none;box-shadow:var(--input-focus-border, 0 0 0 1px var(--colorAccentStroke)),var(--input-focus-shadow)!important;transition:box-shadow 120ms ease-in-out;}
2
+ .ccx18o4-contentContainer{overflow:hidden;}
3
+ .c1l394rk-content{padding-left:4px;padding-right:4px;}
4
+ .u1he4b8w-unitDescription{margin-bottom:1px;}
5
+ .fcmj1jm-fullUnitPreview{display:flex;align-items:center;padding:6px;border-radius:6px;background-color:var(--cardBg);margin-top:4px;margin-bottom:4px;}
6
+ .tum1nu9-tooltipTitle{display:flex;align-items:center;gap:4px;}
@@ -1,12 +1,45 @@
1
- import { UnitPrimitiveProps } from "./types.js";
1
+ import { UnitSize } from "./context.js";
2
+ import { UnitContainer } from "./container.js";
3
+ import { UnitNavButton } from "./nav-button.js";
4
+ import { UnitContent } from "./unit-content.js";
5
+ import { KeyboardEvent, ReactNode } from "react";
2
6
  //#region src/unit/unit.d.ts
3
7
  type UnitVariant = "outlined" | "plain";
4
- type UnitSize = "small" | "medium";
5
- type UnitProps = Omit<UnitPrimitiveProps, "big"> & {
8
+ type UnitProps = {
6
9
  variant?: UnitVariant;
7
10
  size?: UnitSize;
8
11
  readOnly?: boolean;
12
+ overflow?: boolean;
13
+ inline?: boolean;
14
+ button?: boolean;
15
+ multiline?: boolean;
16
+ children?: ReactNode;
17
+ title?: ReactNode;
18
+ fieldIcon?: string;
19
+ description?: ReactNode;
20
+ icon?: ReactNode;
21
+ hint?: ReactNode;
22
+ navButton?: ReactNode;
23
+ tooltip?: boolean;
24
+ /** Render the field label above the value (full-size presentation). */
25
+ withLabel?: boolean;
26
+ border?: boolean;
27
+ color?: string;
28
+ bgColor?: string | null;
29
+ fontWeight?: number;
30
+ shrinkable?: boolean;
31
+ clickable?: boolean;
32
+ setMinWidth?: boolean;
33
+ setMinHeight?: boolean;
34
+ onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
35
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
36
+ invalid?: boolean;
37
+ };
38
+ declare const UnitComponent: ({ variant, size, readOnly, overflow, inline, button, multiline, children, title, fieldIcon, description, hint, icon, navButton, tooltip, withLabel, border, color, bgColor, fontWeight, shrinkable, clickable, setMinWidth, setMinHeight, onClick, onKeyDown, invalid }: UnitProps) => import("react/jsx-runtime").JSX.Element;
39
+ declare const Unit: typeof UnitComponent & {
40
+ Container: typeof UnitContainer;
41
+ Content: typeof UnitContent;
42
+ NavButton: typeof UnitNavButton;
9
43
  };
10
- declare const Unit: ({ variant, size, readOnly, withLabel, invalid, color, bgColor, border, button, clickable, onClick, ...rest }: UnitProps) => import("react/jsx-runtime").JSX.Element;
11
44
  //#endregion
12
- export { Unit, UnitProps, UnitSize, UnitVariant };
45
+ export { Unit, UnitProps, type UnitSize, UnitVariant };
package/lib/unit/unit.js CHANGED
@@ -1,22 +1,53 @@
1
1
  import { themeVars } from "../theming.generated.js";
2
- import { UnitPrimitive } from "./primitive.js";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { positionUnitClass } from "./styles.js";
3
+ import { UnitContainer } from "./container.js";
4
+ import { LabeledUnit } from "./labeled-unit.js";
5
+ import { UnitNavButton } from "./nav-button.js";
6
+ import { UnitContent } from "./unit-content.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
4
8
  //#region src/unit/unit.tsx
5
9
  var getVariantBgColor = (variant, readOnly) => variant === "outlined" && readOnly ? themeVars.inputDisabledBgColor : themeVars.transparent;
6
- var Unit = ({ variant = "outlined", size = "small", readOnly = false, withLabel = false, invalid, color, bgColor, border, button, clickable, onClick, ...rest }) => {
10
+ var UnitComponent = ({ variant = "outlined", size = "small", readOnly = false, overflow = true, inline = true, button, multiline = false, children, title, fieldIcon, description = null, hint = null, icon, navButton, tooltip = true, withLabel = false, border, color = themeVars.textColor, bgColor, fontWeight, shrinkable = true, clickable, setMinWidth = true, setMinHeight = true, onClick, onKeyDown, invalid }) => {
7
11
  const interactive = variant === "outlined" && !readOnly;
8
- return /* @__PURE__ */ jsx(UnitPrimitive, {
9
- ...rest,
10
- big: size === "medium",
11
- border: border ?? (variant === "outlined" && !readOnly),
12
- bgColor: bgColor ?? getVariantBgColor(variant, readOnly),
13
- button: button ?? (interactive || Boolean(onClick)),
14
- clickable: clickable ?? interactive,
15
- withLabel,
12
+ const content = /* @__PURE__ */ jsxs(UnitContainer, {
13
+ size,
14
+ inline,
15
+ border: border ?? interactive,
16
16
  invalid,
17
+ clickable: clickable ?? interactive,
18
+ setMinWidth,
19
+ setMinHeight,
17
20
  color,
18
- onClick
21
+ bgColor: bgColor ?? getVariantBgColor(variant, readOnly),
22
+ fontWeight,
23
+ tooltip: tooltip ? {
24
+ title,
25
+ fieldIcon,
26
+ description,
27
+ hint
28
+ } : void 0,
29
+ children: [/* @__PURE__ */ jsx(UnitContent, {
30
+ button: button ?? (interactive || Boolean(onClick)),
31
+ icon,
32
+ shrinkable,
33
+ truncate: !multiline && overflow,
34
+ onClick,
35
+ onKeyDown,
36
+ children
37
+ }), navButton && /* @__PURE__ */ jsx(UnitNavButton, { children: navButton })]
38
+ });
39
+ return /* @__PURE__ */ jsx("div", {
40
+ className: positionUnitClass,
41
+ children: withLabel ? /* @__PURE__ */ jsx(LabeledUnit, {
42
+ label: title,
43
+ children: content
44
+ }) : content
19
45
  });
20
46
  };
47
+ var Unit = Object.assign(UnitComponent, {
48
+ Container: UnitContainer,
49
+ Content: UnitContent,
50
+ NavButton: UnitNavButton
51
+ });
21
52
  //#endregion
22
53
  export { Unit };
@@ -1,7 +1,7 @@
1
1
  import "./workflow-progress-icon.wyw-in-js.css";
2
2
  import { themeVars } from "./theming.generated.js";
3
3
  /* empty css */
4
- import { memoize } from "@fibery/helpers/src/_";
4
+ import { memoizeLeak } from "@fibery/helpers/src/_";
5
5
  import { arc } from "d3-shape";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/workflow-progress-icon.tsx
@@ -32,7 +32,7 @@ var WorkflowProgressIcon = ({ size, index, total, fillProgress = themeVars.progr
32
32
  })
33
33
  });
34
34
  };
35
- var getPath = memoize((index, total, size) => {
35
+ var getPath = memoizeLeak((index, total, size) => {
36
36
  return arc().innerRadius(size / 2.75).outerRadius(size / 2).startAngle(0).endAngle(2 * (index / total) * Math.PI).cornerRadius(1)();
37
37
  }, (...args) => args.join("/"));
38
38
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "9.0.2",
3
+ "version": "9.1.0",
4
4
  "license": "UNLICENSED",
5
5
  "files": [
6
6
  "lib"
@@ -145,10 +145,10 @@
145
145
  "screenfull": "6.0.2",
146
146
  "tabbable": "5.2.1",
147
147
  "vaul": "1.1.2",
148
- "virtua": "0.48.8",
148
+ "virtua": "0.50.4",
149
149
  "@fibery/emoji-data": "3.0.0",
150
- "@fibery/react": "2.0.0",
151
- "@fibery/helpers": "3.2.1"
150
+ "@fibery/react": "2.0.1",
151
+ "@fibery/helpers": "3.3.0"
152
152
  },
153
153
  "peerDependencies": {
154
154
  "react": "18.3.1",
package/lib/features.d.ts DELETED
@@ -1,8 +0,0 @@
1
- //#region src/features.d.ts
2
- declare function FeaturesProvider({ children, value }: {
3
- children: React.ReactNode;
4
- value: unknown;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare function useFeatures<T = unknown>(): T;
7
- //#endregion
8
- export { FeaturesProvider, useFeatures };
package/lib/features.js DELETED
@@ -1,15 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { createContext, useContext } from "react";
3
- //#region src/features.tsx
4
- var featuresContext = createContext({});
5
- function FeaturesProvider({ children, value }) {
6
- return /* @__PURE__ */ jsx(featuresContext.Provider, {
7
- value,
8
- children
9
- });
10
- }
11
- function useFeatures() {
12
- return useContext(featuresContext);
13
- }
14
- //#endregion
15
- export { FeaturesProvider, useFeatures };
package/lib/flags.d.ts DELETED
@@ -1,4 +0,0 @@
1
- //#region src/flags.d.ts
2
- declare const isFlagPresent: (flag: string) => boolean | undefined;
3
- //#endregion
4
- export { isFlagPresent };
package/lib/flags.js DELETED
@@ -1,7 +0,0 @@
1
- //#region src/flags.ts
2
- var isFlagPresent = (flag) => {
3
- const search = globalThis?.window?.location?.search;
4
- return search ? new RegExp(`[?&]${flag}\\b`).test(search) : void 0;
5
- };
6
- //#endregion
7
- export { isFlagPresent };
@@ -1,5 +0,0 @@
1
- import { IconDefinition } from "../types.js";
2
- //#region src/icons/ast/alert-triangle.d.ts
3
- declare const AlertTriangle: IconDefinition;
4
- //#endregion
5
- export { AlertTriangle as default };
@@ -1,25 +0,0 @@
1
- //#region src/icons/ast/alert-triangle.ts
2
- var AlertTriangle = {
3
- "icon": {
4
- "type": "root",
5
- "children": [{
6
- "type": "element",
7
- "tagName": "svg",
8
- "properties": { "viewBox": "0 0 20 20" },
9
- "children": [{
10
- "type": "element",
11
- "tagName": "path",
12
- "properties": {
13
- "fillRule": "evenodd",
14
- "d": "M18.892 14.558 12.183 2.892a2.5 2.5 0 0 0-4.366 0L1.15 14.558a2.5 2.5 0 0 0 2.133 3.775h13.434a2.5 2.5 0 0 0 2.175-3.775M10 6.667a.833.833 0 0 0-.833.833v3.333a.833.833 0 0 0 1.666 0V7.5A.834.834 0 0 0 10 6.667m-.463 6.807a.833.833 0 1 1 .926 1.385.833.833 0 0 1-.926-1.385",
15
- "clipRule": "evenodd"
16
- },
17
- "children": []
18
- }],
19
- "metadata": ""
20
- }]
21
- },
22
- "name": "alert-triangle"
23
- };
24
- //#endregion
25
- export { AlertTriangle as default };
@@ -1,5 +0,0 @@
1
- import { IconDefinition } from "../types.js";
2
- //#region src/icons/ast/field-units-large.d.ts
3
- declare const FieldUnitsLarge: IconDefinition;
4
- //#endregion
5
- export { FieldUnitsLarge as default };
@@ -1,25 +0,0 @@
1
- //#region src/icons/ast/field-units-large.ts
2
- var FieldUnitsLarge = {
3
- "icon": {
4
- "type": "root",
5
- "children": [{
6
- "type": "element",
7
- "tagName": "svg",
8
- "properties": { "viewBox": "0 0 20 20" },
9
- "children": [{
10
- "type": "element",
11
- "tagName": "path",
12
- "properties": {
13
- "fillRule": "evenodd",
14
- "d": "M2 12.75A2.25 2.25 0 0 0 4.25 15h11.5A2.25 2.25 0 0 0 18 12.75v-5.5A2.25 2.25 0 0 0 15.75 5H4.25A2.25 2.25 0 0 0 2 7.25zm1.5 0c0 .414.336.75.75.75h11.5a.75.75 0 0 0 .75-.75v-5.5a.75.75 0 0 0-.75-.75H4.25a.75.75 0 0 0-.75.75zm6.75-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5zM6 8.5a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1z",
15
- "clipRule": "evenodd"
16
- },
17
- "children": []
18
- }],
19
- "metadata": ""
20
- }]
21
- },
22
- "name": "field-units-large"
23
- };
24
- //#endregion
25
- export { FieldUnitsLarge as default };
@@ -1,5 +0,0 @@
1
- import { IconDefinition } from "../types.js";
2
- //#region src/icons/ast/plus.d.ts
3
- declare const Plus: IconDefinition;
4
- //#endregion
5
- export { Plus as default };
@@ -1,25 +0,0 @@
1
- //#region src/icons/ast/plus.ts
2
- var Plus = {
3
- "icon": {
4
- "type": "root",
5
- "children": [{
6
- "type": "element",
7
- "tagName": "svg",
8
- "properties": { "viewBox": "0 0 20 20" },
9
- "children": [{
10
- "type": "element",
11
- "tagName": "path",
12
- "properties": {
13
- "fillRule": "evenodd",
14
- "d": "M10 4.25a.75.75 0 0 1 .75.75v4.25H15a.75.75 0 0 1 0 1.5h-4.25V15a.75.75 0 0 1-1.5 0v-4.25H5a.75.75 0 0 1 0-1.5h4.25V5a.75.75 0 0 1 .75-.75",
15
- "clipRule": "evenodd"
16
- },
17
- "children": []
18
- }],
19
- "metadata": ""
20
- }]
21
- },
22
- "name": "plus"
23
- };
24
- //#endregion
25
- export { Plus as default };
@@ -1,15 +0,0 @@
1
- //#region src/icons/react/alert-triangle.d.ts
2
- /**
3
- * This file was automatically generated. Do not edit manually.
4
- *
5
- * @see import("../svg/alert-triangle.svg")
6
- * @see import("../../scripts/generate-icons.ts")
7
- */
8
- declare const AlertTriangle: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "color" | "ref"> & {
9
- containerSize?: number;
10
- iconSize?: number;
11
- color?: string | null | undefined;
12
- colorProcessed?: boolean;
13
- } & import("react").RefAttributes<SVGSVGElement>>;
14
- //#endregion
15
- export { AlertTriangle as default };
@@ -1,21 +0,0 @@
1
- import { Icon } from "../icon.js";
2
- import AlertTriangle$1 from "../ast/alert-triangle.js";
3
- import { jsx } from "react/jsx-runtime";
4
- import { forwardRef } from "react";
5
- //#region src/icons/react/alert-triangle.tsx
6
- /**
7
- * This file was automatically generated. Do not edit manually.
8
- *
9
- * @see import("../svg/alert-triangle.svg")
10
- * @see import("../../scripts/generate-icons.ts")
11
- */
12
- var AlertTriangle = forwardRef(function AlertTriangle(props, ref) {
13
- return /* @__PURE__ */ jsx(Icon, {
14
- ...props,
15
- className: props.className,
16
- ref,
17
- icon: AlertTriangle$1
18
- });
19
- });
20
- //#endregion
21
- export { AlertTriangle as default };
@@ -1,15 +0,0 @@
1
- //#region src/icons/react/field-units-large.d.ts
2
- /**
3
- * This file was automatically generated. Do not edit manually.
4
- *
5
- * @see import("../svg/field-units-large.svg")
6
- * @see import("../../scripts/generate-icons.ts")
7
- */
8
- declare const FieldUnitsLarge: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "color" | "ref"> & {
9
- containerSize?: number;
10
- iconSize?: number;
11
- color?: string | null | undefined;
12
- colorProcessed?: boolean;
13
- } & import("react").RefAttributes<SVGSVGElement>>;
14
- //#endregion
15
- export { FieldUnitsLarge as default };
@@ -1,21 +0,0 @@
1
- import { Icon } from "../icon.js";
2
- import FieldUnitsLarge$1 from "../ast/field-units-large.js";
3
- import { jsx } from "react/jsx-runtime";
4
- import { forwardRef } from "react";
5
- //#region src/icons/react/field-units-large.tsx
6
- /**
7
- * This file was automatically generated. Do not edit manually.
8
- *
9
- * @see import("../svg/field-units-large.svg")
10
- * @see import("../../scripts/generate-icons.ts")
11
- */
12
- var FieldUnitsLarge = forwardRef(function FieldUnitsLarge(props, ref) {
13
- return /* @__PURE__ */ jsx(Icon, {
14
- ...props,
15
- className: props.className,
16
- ref,
17
- icon: FieldUnitsLarge$1
18
- });
19
- });
20
- //#endregion
21
- export { FieldUnitsLarge as default };