@fibery/ui-kit 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "main": "index.ts",
5
5
  "private": false,
6
6
  "files": [
@@ -15,13 +15,14 @@
15
15
  "src/form-field-loader.tsx",
16
16
  "src/ThemeProvider.tsx",
17
17
  "src/Item.tsx",
18
- "src/Loaders.d.ts",
19
- "src/Loaders.js",
18
+ "src/loaders.tsx",
20
19
  "src/loading-sausage.tsx",
21
20
  "src/icons/**/*.ts*",
22
21
  "src/Select",
23
22
  "src/error-alert.tsx",
24
- "src/Pallete.ts"
23
+ "src/Pallete.ts",
24
+ "src/tooltip.tsx",
25
+ "src/antd/ant-tooltip.tsx"
25
26
  ],
26
27
  "license": "UNLICENSED",
27
28
  "scripts": {
@@ -31,7 +32,7 @@
31
32
  "generate-icons": "node scripts/generate-icons.mjs"
32
33
  },
33
34
  "dependencies": {
34
- "@fibery/helpers": "1.0.0",
35
+ "@fibery/helpers": "1.0.2",
35
36
  "@fibery/react": "1.0.0",
36
37
  "@linaria/core": "3.0.0-beta.15",
37
38
  "@linaria/react": "3.0.0-beta.15",
@@ -39,9 +40,11 @@
39
40
  "@radix-ui/react-dropdown-menu": "1.0.0",
40
41
  "antd": "4.18.8",
41
42
  "chroma-js": "2.1.2",
43
+ "chrono-node": "^2.4.1",
42
44
  "classnames": "2.3.1",
43
45
  "color-hash": "1.0.3",
44
46
  "d3-shape": "1.3.7",
47
+ "date-fns": "^2.29.2",
45
48
  "emoji-mart": "3.0.1",
46
49
  "invariant": "2.2.4",
47
50
  "lodash": "4.17.21",
@@ -52,7 +55,7 @@
52
55
  "rc-menu": "9.3.2",
53
56
  "rc-progress": "3.2.4",
54
57
  "react-color": "2.13.8",
55
- "react-day-picker": "7.4.8",
58
+ "react-day-picker": "8.1.3",
56
59
  "react-popper": "2.2.5",
57
60
  "react-select": "5.3.2",
58
61
  "react-select-country-list": "2.2.1",
package/src/Button.js CHANGED
@@ -9,7 +9,7 @@ import {border, colors, fontWeight, getDarkenColor, getOpacities, opacity, textS
9
9
  import MoreIcon from "./icons/react/More";
10
10
  import MoreCompactIcon from "./icons/react/MoreCompact";
11
11
  import {Item} from "./Item";
12
- import {Spinner} from "./Loaders";
12
+ import {Spinner} from "./loaders";
13
13
  import {useTheme} from "./ThemeProvider";
14
14
 
15
15
  const baseSize = 14;
@@ -110,9 +110,9 @@ const getHoverBorderColor = ({mainColor, borderless, primary, hoverBgColor}) =>
110
110
  return mainColor;
111
111
  };
112
112
 
113
- const getTextColor = ({mainColor, primary}) => {
113
+ const getTextColor = ({mainColor, primary, theme}) => {
114
114
  if (primary) {
115
- return themeVars.buttonPrimaryTextColor;
115
+ return theme.buttonPrimaryTextColor;
116
116
  }
117
117
  return mainColor;
118
118
  };
@@ -250,13 +250,14 @@ export const Button = forwardRef(
250
250
  onClick,
251
251
  className,
252
252
  shortcut,
253
+ noOverflow = true,
253
254
  ...rest
254
255
  },
255
256
  forwardedRef
256
257
  ) => {
257
258
  const theme = useTheme();
258
259
  const mainColor = getMainColor({color, dangerous, theme});
259
- const textColor = getTextColor({mainColor, primary});
260
+ const textColor = getTextColor({mainColor, primary, theme});
260
261
  const spinnerBgColor = getOpacities(textColor).light;
261
262
  const spinnerColor = getSpinnerColor({mainColor, primary});
262
263
  const bgColor = getBgColor({mainColor, primary});
@@ -315,7 +316,7 @@ export const Button = forwardRef(
315
316
  }}
316
317
  containerClassName={cx({[leftContainerClassName]: leftContainer && hasNonEmptyChild(children)})}
317
318
  rightContainer={shortcut && <span className={cx(shortcutStyle)}>{shortcut}</span>}
318
- noOverflow
319
+ noOverflow={noOverflow}
319
320
  >
320
321
  {children}
321
322
  </Item>
@@ -10,6 +10,9 @@ import BaseSelect, {
10
10
  OptionProps,
11
11
  SingleValueProps,
12
12
  MultiValueProps,
13
+ SingleValue,
14
+ MultiValue,
15
+ mergeStyles,
13
16
  } from "react-select";
14
17
  import BaseCreatableSelect from "react-select/creatable";
15
18
  import WindowedSelect, {components, WindowedMenuList} from "react-windowed-select";
@@ -18,7 +21,16 @@ import {useTheme} from "../ThemeProvider";
18
21
  import {ClearIndicator, DropdownIndicator, NoOptionsMessage, Option as OptionComponent} from "./components";
19
22
  import {componentsStyles, singleLineComponentsStyle} from "./styles";
20
23
 
21
- export type {OptionsOrGroups, GroupBase, StylesConfig, OptionProps, SingleValueProps, MultiValueProps};
24
+ export type {
25
+ OptionsOrGroups,
26
+ GroupBase,
27
+ StylesConfig,
28
+ OptionProps,
29
+ SingleValueProps,
30
+ MultiValueProps,
31
+ SingleValue,
32
+ MultiValue,
33
+ };
22
34
 
23
35
  function GroupHeading<
24
36
  Option = unknown,
@@ -46,24 +58,8 @@ export function combineStyles<
46
58
  Option,
47
59
  IsMulti extends boolean = boolean,
48
60
  Group extends GroupBase<Option> = GroupBase<Option>
49
- >(stylesArray: StylesConfig<Option, IsMulti, Group>[]): StylesConfig<Option, IsMulti, Group> {
50
- return stylesArray.reduce<StylesConfig<Option, IsMulti, Group>>((acc, style) => {
51
- Object.keys(style).forEach((key) => {
52
- /* eslint-disable @typescript-eslint/ban-ts-comment */
53
- // @ts-ignore
54
- if (acc[key]) {
55
- // @ts-ignore
56
- const temp = acc[key];
57
- // @ts-ignore
58
- acc[key] = (provided, state) => style[key](temp(provided, state), state);
59
- } else {
60
- // @ts-ignore
61
- acc[key] = (provided, state) => style[key](provided, state);
62
- }
63
- /* eslint-enable @typescript-eslint/ban-ts-comment */
64
- });
65
- return acc;
66
- }, {});
61
+ >(stylesConfigs: StylesConfig<Option, IsMulti, Group>[]) {
62
+ return stylesConfigs.reduce(mergeStyles, {});
67
63
  }
68
64
 
69
65
  export type SelectProps<
@@ -75,6 +71,7 @@ export type SelectProps<
75
71
  isCollectionMode?: IsMulti;
76
72
  disabled?: boolean;
77
73
  };
74
+
78
75
  export function SingleRowSelect<
79
76
  Option = unknown,
80
77
  IsMulti extends boolean = boolean,
@@ -0,0 +1,5 @@
1
+ import Tooltip, {TooltipPlacement} from "antd/lib/tooltip";
2
+ import "antd/lib/tooltip/style/css";
3
+
4
+ export type {TooltipPlacement};
5
+ export {Tooltip as AntTooltip};
@@ -207,9 +207,13 @@ const lightColors = {
207
207
  floatEditorMenuBg: slate.slate1,
208
208
  floatEditorActiveColor: indigoDark.indigo10,
209
209
  commentColor: getOpacities(yellow.yellow6).opacity60,
210
+ cellBackgroundColor: sage.sage2,
211
+ cellBackgroundHoverColor: getOpacities(sage.sage6).opacity30,
210
212
  cellBorderColor: getOpacities(slate.slate8).opacity50,
211
213
  tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
212
214
  errorBgColor: getOpacities(red.red9).opacity60,
215
+ errorTextColor: red.red12,
216
+ errorButtonColor: red.red9,
213
217
  warningBgColor: getOpacities(yellow.yellow6).opacity60,
214
218
  warningButtonColor: yellow.yellow11,
215
219
  infoBox: getOpacities(yellow.yellow4).opacity50,
@@ -234,7 +238,6 @@ const lightColors = {
234
238
  }`,
235
239
  selectedColorBorder: getOpacities(slate.slate6).opacity50,
236
240
  //end
237
- placeholderTextColor: "#65788B",
238
241
  disabledInversedTextColor: shades.light,
239
242
  danger: brandColors.red,
240
243
  active: brandColors.red,
@@ -242,8 +245,6 @@ const lightColors = {
242
245
  cardBg: "#FFFFFF",
243
246
  cardSelected: "#FFFB8F",
244
247
  cardSelectedHover: "rgba(240, 244, 247, 0.6)",
245
- errorBg: "rgba(255, 241, 240, 1)",
246
- timelineCard: "#FCE07D",
247
248
  transparent,
248
249
  shades: lights,
249
250
  lights: shades,
@@ -283,7 +284,7 @@ const darkColors = {
283
284
  sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slateDark.slate1).opacity80}`,
284
285
  textColor: slate.slate6,
285
286
  textSelectionColor: getOpacities(blueDark.blue10).opacity40,
286
- accentTextColor: slate.slate10,
287
+ accentTextColor: slateDark.slate10,
287
288
  disabledTextColor: slateDark.slate9,
288
289
  inversedTextColor: slateDark.slate6,
289
290
  linkColor: indigoDark.indigo11,
@@ -331,10 +332,10 @@ const darkColors = {
331
332
  iconColor: slate.slate9,
332
333
  appIconColor: getOpacities(slate.slate2).opacity70,
333
334
  mentionBgColor: slateDark.slate5,
334
- entityCardBgColor: slateDark.slate4,
335
+ entityCardBgColor: slateDark.slate5,
335
336
  entityCardSelectedColor: slateDark.slate5,
336
- entityCardHoverColor: getOpacities(slateDark.slate5).opacity95,
337
- entityCardDoneColor: slateDark.slate3,
337
+ entityCardHoverColor: getOpacities(slateDark.slate6).opacity50,
338
+ entityCardDoneColor: getOpacities(slateDark.slate5).opacity30,
338
339
  entityCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
339
340
  getOpacities(slateDark.slate2).opacity20
340
341
  }`,
@@ -351,12 +352,16 @@ const darkColors = {
351
352
  floatEditorMenuBg: slateDark.slate6,
352
353
  floatEditorActiveColor: indigoDark.indigo11,
353
354
  commentColor: getOpacities(yellowDark.yellow9).opacity40,
355
+ cellBackgroundColor: slateDark.slate2,
356
+ cellBackgroundHoverColor: getOpacities(slateDark.slate6).opacity30,
354
357
  cellBorderColor: getOpacities(slateDark.slate9).opacity50,
355
358
  tableRowWarningColor: getOpacities(yellowDark.yellow9).opacity40,
356
359
  errorBgColor: getOpacities(redDark.red9).opacity60,
360
+ errorTextColor: redDark.red12,
361
+ errorButtonColor: redDark.red10,
357
362
  warningBgColor: getOpacities(yellowDark.yellow8).opacity60,
358
363
  warningButtonColor: yellowDark.yellow11,
359
- infoBox: getOpacities(yellowDark.yellow8).opacity40,
364
+ infoBox: getOpacities(yellowDark.yellow9).opacity20,
360
365
  appCardBgColor: slateDark.slate2,
361
366
  appCardHoverColor: slateDark.slate2,
362
367
  appCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity50}, 0 2px 4px -4px ${
@@ -376,7 +381,6 @@ const darkColors = {
376
381
  instrumentsMenuShadow: `0px 2px 8px ${getOpacities(slate.slate2).opacity95}`,
377
382
  selectedColorBorder: getOpacities(slate.slate6).opacity20,
378
383
  //end
379
- placeholderTextColor: "#65788B",
380
384
  disabledInversedTextColor: lights.light,
381
385
  danger: redDark.red9,
382
386
  active: brandColors.red,
@@ -384,8 +388,6 @@ const darkColors = {
384
388
  cardBg: slateDark.slate6,
385
389
  cardSelected: slateDark.slate5,
386
390
  cardSelectedHover: slateDark.slate5,
387
- errorBg: "rgba(255, 241, 240, 1)",
388
- timelineCard: "#FCE07D",
389
391
  transparent,
390
392
  shades,
391
393
  lights,
@@ -550,7 +552,6 @@ export const colors = {
550
552
  brandColors,
551
553
  stateColors,
552
554
  textColor: "#2A3844",
553
- placeholderTextColor: "#65788B",
554
555
  disabledTextColor: shades.regular,
555
556
  inversedTextColor: "#FFFFFF",
556
557
  disabledInversedTextColor: lights.light,
@@ -564,7 +565,6 @@ export const colors = {
564
565
  unitBg: "rgba(220, 224, 228, 0.33)",
565
566
  infoBox: "rgba(255, 212, 0, 0.2)",
566
567
  errorBg: "rgba(255, 241, 240, 1)",
567
- timelineCard: "#FCE07D",
568
568
  timelineScaleSelectBorderColor: chroma("#FFFFFF").alpha(opacity.regular).css(),
569
569
  transparent,
570
570
  shades,
@@ -846,8 +846,6 @@ export const textStyles = {
846
846
  lineHeight: lineHeight.regular,
847
847
  fontWeight: fontWeight.regular,
848
848
  color: themeVars.textColor,
849
- backgroundColor: colors.timelineCard,
850
- border: `1px solid ${colors.timelineCard}`,
851
849
  borderRadius: radius,
852
850
  },
853
851
  important: {
@@ -1,29 +1,29 @@
1
1
  import {css} from "@linaria/core";
2
- import {colors, getOpacities, layout, radius, space, textStyles} from "./designSystem";
2
+ import {layout, border, space, textStyles, themeVars} from "./designSystem";
3
3
  import {Button} from "./Button";
4
4
  import CloseIcon from "./icons/react/Close";
5
+ import {useTheme} from "@fibery/ui-kit/src/ThemeProvider";
5
6
 
6
7
  const errorAlert = css`
7
- border: 1px solid ${colors.stateColors.error};
8
- background-color: ${colors.errorBg};
9
- padding: 0 ${space.l}px;
8
+ background-color: ${themeVars.errorBgColor};
9
+ padding: ${space.m}px ${space.l}px;
10
10
  min-height: ${layout.itemHeight}px;
11
- border-radius: ${radius}px;
11
+ border-radius: ${border.radius6}px;
12
12
  display: flex;
13
13
  gap: ${space.s}px;
14
14
  align-items: center;
15
15
  `;
16
16
 
17
17
  const messageStyle = css`
18
- ${textStyles.heading5}
18
+ ${textStyles.heading5};
19
+ color: ${themeVars.errorTextColor};
19
20
  `;
20
21
 
21
22
  const descriptionStyle = css`
22
- ${textStyles.regular}
23
+ ${textStyles.regular};
24
+ color: ${themeVars.errorTextColor};
23
25
  `;
24
26
 
25
- const buttonColor = getOpacities(colors.placeholderTextColor).overlay;
26
-
27
27
  export function ErrorAlert({
28
28
  message,
29
29
  description,
@@ -35,6 +35,8 @@ export function ErrorAlert({
35
35
  closable?: boolean;
36
36
  onClose?: () => void;
37
37
  }): JSX.Element {
38
+ const theme = useTheme();
39
+ const buttonColor = theme.errorButtonColor;
38
40
  return (
39
41
  <div className={errorAlert}>
40
42
  <div
@@ -47,7 +49,7 @@ export function ErrorAlert({
47
49
  </div>
48
50
  {closable && onClose ? (
49
51
  <div>
50
- <Button borderless onClick={onClose} color={buttonColor} Icon={CloseIcon} width={26} />
52
+ <Button borderless onClick={onClose} color={buttonColor} Icon={CloseIcon} width={24} />
51
53
  </div>
52
54
  ) : null}
53
55
  </div>
@@ -0,0 +1,32 @@
1
+ // This icon file is generated automatically.
2
+
3
+ import {IconDefinition} from "../types";
4
+
5
+ const Github: IconDefinition = {
6
+ icon: {
7
+ type: "root",
8
+ children: [
9
+ {
10
+ type: "element",
11
+ tagName: "svg",
12
+ properties: {viewBox: "0 0 20 20"},
13
+ children: [
14
+ {
15
+ type: "element",
16
+ tagName: "path",
17
+ properties: {
18
+ clipRule: "evenodd",
19
+ d: "M10 2c-4.42 0-8 3.58-8 8 0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 18 10c0-4.42-3.58-8-8-8z",
20
+ fillRule: "evenodd",
21
+ },
22
+ children: [],
23
+ },
24
+ ],
25
+ metadata: "",
26
+ },
27
+ ],
28
+ },
29
+ name: "github",
30
+ };
31
+
32
+ export default Github;
@@ -0,0 +1,30 @@
1
+ // This icon file is generated automatically.
2
+
3
+ import {IconDefinition} from "../types";
4
+
5
+ const Gitlab: IconDefinition = {
6
+ icon: {
7
+ type: "root",
8
+ children: [
9
+ {
10
+ type: "element",
11
+ tagName: "svg",
12
+ properties: {viewBox: "0 0 20 20"},
13
+ children: [
14
+ {
15
+ type: "element",
16
+ tagName: "path",
17
+ properties: {
18
+ d: "m17.734 8.636-.022-.058-2.178-5.717a.57.57 0 0 0-.89-.236.586.586 0 0 0-.194.295l-1.47 4.526H7.025L5.555 2.92a.575.575 0 0 0-.194-.296.581.581 0 0 0-.666-.036.575.575 0 0 0-.224.272L2.289 8.575l-.022.058a4.09 4.09 0 0 0-.11 2.576 4.069 4.069 0 0 0 1.452 2.125l.007.006.02.014 3.318 2.5 1.64 1.249 1 .76a.67.67 0 0 0 .814 0l1-.76 1.64-1.25 3.338-2.514.009-.007a4.07 4.07 0 0 0 1.448-2.123 4.092 4.092 0 0 0-.109-2.573Z",
19
+ },
20
+ children: [],
21
+ },
22
+ ],
23
+ metadata: "",
24
+ },
25
+ ],
26
+ },
27
+ name: "gitlab",
28
+ };
29
+
30
+ export default Gitlab;