@via-profit/ui-kit 0.8.0 → 0.9.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 (68) hide show
  1. package/Autocomplete/AutocompleteContainer.d.ts +13 -0
  2. package/Autocomplete/AutocompleteContainer.js +46 -7
  3. package/Badge/BadgeBase.d.ts +10 -1
  4. package/Badge/BadgeBase.js +9 -2
  5. package/Badge/BadgeDot.d.ts +4 -0
  6. package/Badge/BadgeDot.js +20 -0
  7. package/Badge/BadgeStyled.js +67 -26
  8. package/Badge/index.d.ts +4 -4
  9. package/CHANGELOG.md +12 -0
  10. package/EmptyState/EmptyStateAction.d.ts +4 -0
  11. package/EmptyState/EmptyStateAction.js +16 -0
  12. package/EmptyState/EmptyStateContainer.d.ts +8 -0
  13. package/EmptyState/EmptyStateContainer.js +34 -0
  14. package/EmptyState/EmptyStateContent.d.ts +4 -0
  15. package/EmptyState/EmptyStateContent.js +15 -0
  16. package/EmptyState/EmptyStateIcon.d.ts +4 -0
  17. package/EmptyState/EmptyStateIcon.js +38 -0
  18. package/EmptyState/EmptyStateTitle.d.ts +4 -0
  19. package/EmptyState/EmptyStateTitle.js +13 -0
  20. package/EmptyState/index.d.ts +82 -0
  21. package/EmptyState/index.js +61 -0
  22. package/FileDropzone/FileDropzoneArea.d.ts +24 -0
  23. package/FileDropzone/FileDropzoneArea.js +81 -0
  24. package/FileDropzone/index.d.ts +107 -0
  25. package/FileDropzone/index.js +169 -0
  26. package/FileDropzone/utils.d.ts +9 -0
  27. package/FileDropzone/utils.js +42 -0
  28. package/HintPopover/HintPopoverButton.d.ts +4 -0
  29. package/HintPopover/HintPopoverButton.js +67 -0
  30. package/HintPopover/HintPopoverContainer.d.ts +4 -0
  31. package/HintPopover/HintPopoverContainer.js +52 -0
  32. package/HintPopover/index.d.ts +67 -0
  33. package/HintPopover/index.js +71 -0
  34. package/InfoNote/InfoNoteContainer.d.ts +14 -0
  35. package/InfoNote/InfoNoteContainer.js +56 -0
  36. package/InfoNote/InfoNoteContent.d.ts +4 -0
  37. package/InfoNote/InfoNoteContent.js +16 -0
  38. package/InfoNote/InfoNoteIcon.d.ts +9 -0
  39. package/InfoNote/InfoNoteIcon.js +47 -0
  40. package/InfoNote/InfoNoteTitle.d.ts +4 -0
  41. package/InfoNote/InfoNoteTitle.js +13 -0
  42. package/InfoNote/index.d.ts +65 -0
  43. package/InfoNote/index.js +59 -0
  44. package/Skeleton/index.d.ts +39 -0
  45. package/Skeleton/index.js +69 -0
  46. package/esm/Autocomplete/AutocompleteContainer.js +46 -7
  47. package/esm/Badge/BadgeBase.js +9 -2
  48. package/esm/Badge/BadgeDot.js +15 -0
  49. package/esm/Badge/BadgeStyled.js +67 -26
  50. package/esm/EmptyState/EmptyStateAction.js +11 -0
  51. package/esm/EmptyState/EmptyStateContainer.js +29 -0
  52. package/esm/EmptyState/EmptyStateContent.js +10 -0
  53. package/esm/EmptyState/EmptyStateIcon.js +33 -0
  54. package/esm/EmptyState/EmptyStateTitle.js +8 -0
  55. package/esm/EmptyState/index.js +42 -0
  56. package/esm/FileDropzone/FileDropzoneArea.js +76 -0
  57. package/esm/FileDropzone/index.js +148 -0
  58. package/esm/FileDropzone/utils.js +37 -0
  59. package/esm/HintPopover/HintPopoverButton.js +62 -0
  60. package/esm/HintPopover/HintPopoverContainer.js +47 -0
  61. package/esm/HintPopover/index.js +52 -0
  62. package/esm/InfoNote/InfoNoteContainer.js +49 -0
  63. package/esm/InfoNote/InfoNoteContent.js +11 -0
  64. package/esm/InfoNote/InfoNoteIcon.js +42 -0
  65. package/esm/InfoNote/InfoNoteTitle.js +8 -0
  66. package/esm/InfoNote/index.js +40 -0
  67. package/esm/Skeleton/index.js +64 -0
  68. package/package.json +121 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The file matches `accept` of the input: the MIME types (`image/png`), the groups (`image/*`)
3
+ * and the extensions (`.pdf`). The empty `accept` takes any file
4
+ */
5
+ export const isFileAccepted = (file, accept) => {
6
+ if (!accept) {
7
+ return true;
8
+ }
9
+ const name = file.name.toLowerCase();
10
+ const type = file.type.toLowerCase();
11
+ return accept
12
+ .split(',')
13
+ .map(item => item.trim().toLowerCase())
14
+ .filter(Boolean)
15
+ .some(item => {
16
+ if (item.startsWith('.')) {
17
+ return name.endsWith(item);
18
+ }
19
+ if (item.endsWith('/*')) {
20
+ return type.startsWith(item.slice(0, -1));
21
+ }
22
+ return type === item;
23
+ });
24
+ };
25
+ /**
26
+ * «54.1 KB», «2.3 MB»: the decimal units, as the file managers show
27
+ */
28
+ export const formatFileSize = (bytes) => {
29
+ const units = ['B', 'KB', 'MB', 'GB'];
30
+ let value = bytes;
31
+ let unit = 0;
32
+ while (value >= 1000 && unit < units.length - 1) {
33
+ value /= 1000;
34
+ unit += 1;
35
+ }
36
+ return `${unit === 0 ? value : value.toFixed(1).replace(/\.0$/, '')} ${units[unit]}`;
37
+ };
@@ -0,0 +1,62 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import styled from '@emotion/styled';
14
+ /**
15
+ * The color of the text around: the button stands in the text, in the label of a field,
16
+ * in a colored header of the dialog
17
+ */
18
+ const StyledButton = styled.button `
19
+ box-sizing: content-box;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ margin: 0 0.15em;
24
+ padding: 0.2em;
25
+ border: none;
26
+ border-radius: 50%;
27
+ background: none;
28
+ font: inherit;
29
+ font-size: 1em;
30
+ line-height: 1;
31
+ color: inherit;
32
+ opacity: 0.6;
33
+ cursor: pointer;
34
+ vertical-align: middle;
35
+ transition:
36
+ opacity 120ms ease-out,
37
+ background-color 120ms ease-out;
38
+
39
+ &:hover,
40
+ &:focus-visible,
41
+ &[aria-expanded='true'] {
42
+ opacity: 1;
43
+ background-color: color-mix(in srgb, currentColor 15%, transparent);
44
+ }
45
+
46
+ &:focus-visible {
47
+ outline: 2px solid ${({ theme }) => theme.color.accentPrimary.toString()};
48
+ outline-offset: 1px;
49
+ }
50
+ `;
51
+ const Path = styled.path `
52
+ fill: currentColor;
53
+ `;
54
+ /**
55
+ * «?» in the circle. `children` replaces the icon
56
+ */
57
+ const HintPopoverButton = (props, ref) => {
58
+ const { children } = props, nativeProps = __rest(props, ["children"]);
59
+ return (React.createElement(StyledButton, Object.assign({ type: "button" }, nativeProps, { ref: ref }), children !== null && children !== void 0 ? children : (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", "aria-hidden": true },
60
+ React.createElement(Path, { d: "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" })))));
61
+ };
62
+ export default React.forwardRef(HintPopoverButton);
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import styled from '@emotion/styled';
3
+ import { keyframes } from '@emotion/react';
4
+ import { elevation } from '../ThemeProvider/tokens';
5
+ const appear = keyframes `
6
+ from {
7
+ opacity: 0;
8
+ transform: scale(0.96);
9
+ }
10
+ to {
11
+ opacity: 1;
12
+ transform: scale(1);
13
+ }
14
+ `;
15
+ const StyledContainer = styled.div `
16
+ box-sizing: border-box;
17
+ max-width: 22em;
18
+ padding: 0.7em 0.9em;
19
+ font-size: 0.875rem;
20
+ font-weight: normal;
21
+ line-height: 1.45;
22
+ text-align: left;
23
+ white-space: normal;
24
+ overflow-wrap: break-word;
25
+ color: ${({ theme }) => theme.color.textPrimary.toString()};
26
+ background-color: ${({ theme }) => theme.color.surface.toString()};
27
+ border-radius: ${({ theme }) => theme.shape.radiusFactor * 1.6}em;
28
+ box-shadow: ${({ theme }) => elevation(theme, 'popup')};
29
+ animation: ${appear} 120ms ease-out;
30
+
31
+ & p {
32
+ margin: 0 0 0.5em;
33
+ }
34
+
35
+ & p:last-child {
36
+ margin-bottom: 0;
37
+ }
38
+
39
+ @media (prefers-reduced-motion: reduce) {
40
+ animation: none;
41
+ }
42
+ `;
43
+ /**
44
+ * The bubble with the content of the hint
45
+ */
46
+ const HintPopoverContainer = (props, ref) => React.createElement(StyledContainer, Object.assign({}, props, { ref: ref }));
47
+ export default React.forwardRef(HintPopoverContainer);
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { useTheme } from '@emotion/react';
3
+ import Popper from '../Popper';
4
+ import ClickOutside from '../ClickOutside';
5
+ import Button from './HintPopoverButton';
6
+ import Container from './HintPopoverContainer';
7
+ /**
8
+ * «?» next to a field, a button or a title: the explanation in the popper by the click.
9
+ * For what is needed sometimes; what everybody must know goes into InfoNote.
10
+ * Closes by the outside click and by Escape, Escape returns the focus to the button
11
+ */
12
+ const HintPopover = props => {
13
+ const { children, label = 'Hint', icon, placement = 'bottom-start', isOpen, onOpenChange, offset = 6, zIndex, id, overrides, } = props;
14
+ const theme = useTheme();
15
+ const generatedId = `hint-popover-${React.useId().replace(/:/g, '')}`;
16
+ const hintId = id || generatedId;
17
+ const [button, setButton] = React.useState(null);
18
+ const [internalOpen, setInternalOpen] = React.useState(false);
19
+ const isControlled = typeof isOpen !== 'undefined';
20
+ const open = isControlled ? Boolean(isOpen) : internalOpen;
21
+ const overridesMap = React.useMemo(() => ({
22
+ Button: (overrides === null || overrides === void 0 ? void 0 : overrides.Button) || Button,
23
+ Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || Container,
24
+ }), [overrides]);
25
+ const setOpen = React.useCallback((next) => {
26
+ if (!isControlled) {
27
+ setInternalOpen(next);
28
+ }
29
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(next);
30
+ }, [isControlled, onOpenChange]);
31
+ React.useEffect(() => {
32
+ if (!open) {
33
+ return undefined;
34
+ }
35
+ const onKeyDown = (event) => {
36
+ if (event.key === 'Escape') {
37
+ setOpen(false);
38
+ button === null || button === void 0 ? void 0 : button.focus();
39
+ }
40
+ };
41
+ document.addEventListener('keydown', onKeyDown);
42
+ return () => document.removeEventListener('keydown', onKeyDown);
43
+ }, [open, setOpen, button]);
44
+ return (React.createElement(React.Fragment, null,
45
+ React.createElement(overridesMap.Button, { ref: setButton, title: label, "aria-label": label, "aria-expanded": open, "aria-controls": open ? hintId : undefined, onClick: () => setOpen(!open) }, icon),
46
+ React.createElement(ClickOutside, { onOutsideClick: () => open && setOpen(false), ignoreElements: [button] },
47
+ React.createElement(Popper, { isOpen: open, anchorElement: button, anchorPos: placement, autoFlip: true, offset: offset, viewportMargin: 8, zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : theme.zIndex.modal + 1, id: hintId },
48
+ React.createElement(overridesMap.Container, null, children)))));
49
+ };
50
+ export * from './HintPopoverButton';
51
+ export * from './HintPopoverContainer';
52
+ export default HintPopover;
@@ -0,0 +1,49 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import styled from '@emotion/styled';
14
+ /**
15
+ * The color of the variant: the border, the icon and the tint of the background
16
+ */
17
+ export const variantColor = (theme, variant) => {
18
+ switch (variant) {
19
+ case 'success':
20
+ return theme.color.success;
21
+ case 'warning':
22
+ return theme.color.warning;
23
+ case 'error':
24
+ return theme.color.error;
25
+ default:
26
+ return theme.color.accentPrimary;
27
+ }
28
+ };
29
+ const StyledContainer = styled.div `
30
+ box-sizing: border-box;
31
+ display: flex;
32
+ gap: 0.6em;
33
+ align-items: flex-start;
34
+ padding: 0.6em 0.8em;
35
+ font-size: 0.875em;
36
+ line-height: 1.4;
37
+ overflow-wrap: break-word;
38
+ color: ${({ theme }) => theme.color.textPrimary.toString()};
39
+ border-radius: ${({ theme }) => theme.shape.radiusFactor * 1.6}em;
40
+ border-left: 3px solid ${({ theme, $variant }) => variantColor(theme, $variant).toString()};
41
+ background-color: ${({ theme, $variant }) => variantColor(theme, $variant)
42
+ .alpha($variant === 'warning' ? 0.14 : 0.1)
43
+ .toString()};
44
+ `;
45
+ const InfoNoteContainer = (props, ref) => {
46
+ const { variant, children } = props, nativeProps = __rest(props, ["variant", "children"]);
47
+ return (React.createElement(StyledContainer, Object.assign({}, nativeProps, { "$variant": variant, ref: ref }), children));
48
+ };
49
+ export default React.forwardRef(InfoNoteContainer);
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import styled from '@emotion/styled';
3
+ const StyledContent = styled.div `
4
+ flex: 1;
5
+ min-width: 0;
6
+ `;
7
+ /**
8
+ * The title and the text, to the right of the icon
9
+ */
10
+ const InfoNoteContent = (props, ref) => React.createElement(StyledContent, Object.assign({}, props, { ref: ref }));
11
+ export default React.forwardRef(InfoNoteContent);
@@ -0,0 +1,42 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import styled from '@emotion/styled';
14
+ import { variantColor } from './InfoNoteContainer';
15
+ const StyledIcon = styled.span `
16
+ flex: none;
17
+ display: inline-flex;
18
+ font-size: 1.15em;
19
+ color: ${({ theme, $variant }) => variantColor(theme, $variant).toString()};
20
+ `;
21
+ const Path = styled.path `
22
+ fill: currentColor;
23
+ `;
24
+ /**
25
+ * The paths of the default icons, 24×24: the circle with «i», the check, the triangle with «!»
26
+ * and the circle with «!»
27
+ */
28
+ const PATHS = {
29
+ info: 'M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z',
30
+ success: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z',
31
+ warning: 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z',
32
+ error: 'M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z',
33
+ };
34
+ /**
35
+ * The icon of the variant. `children` replaces the default icon
36
+ */
37
+ const InfoNoteIcon = (props, ref) => {
38
+ const { variant, children } = props, nativeProps = __rest(props, ["variant", "children"]);
39
+ return (React.createElement(StyledIcon, Object.assign({}, nativeProps, { "$variant": variant, "aria-hidden": true, ref: ref }), children !== null && children !== void 0 ? children : (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24" },
40
+ React.createElement(Path, { d: PATHS[variant] })))));
41
+ };
42
+ export default React.forwardRef(InfoNoteIcon);
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import styled from '@emotion/styled';
3
+ const StyledTitle = styled.div `
4
+ font-weight: 600;
5
+ margin-bottom: 0.15em;
6
+ `;
7
+ const InfoNoteTitle = (props, ref) => React.createElement(StyledTitle, Object.assign({}, props, { ref: ref }));
8
+ export default React.forwardRef(InfoNoteTitle);
@@ -0,0 +1,40 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import Container from './InfoNoteContainer';
14
+ import Icon from './InfoNoteIcon';
15
+ import Title from './InfoNoteTitle';
16
+ import Content from './InfoNoteContent';
17
+ /**
18
+ * The short text in the form or the card which must be seen right here, without a click:
19
+ * «only the completed orders get into the revision». The longer explanation which is needed
20
+ * sometimes goes into HintPopover
21
+ */
22
+ const InfoNote = (props, ref) => {
23
+ const { variant = 'info', title, icon, children, overrides } = props, nativeProps = __rest(props, ["variant", "title", "icon", "children", "overrides"]);
24
+ const overridesMap = React.useMemo(() => ({
25
+ Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || Container,
26
+ Icon: (overrides === null || overrides === void 0 ? void 0 : overrides.Icon) || Icon,
27
+ Title: (overrides === null || overrides === void 0 ? void 0 : overrides.Title) || Title,
28
+ Content: (overrides === null || overrides === void 0 ? void 0 : overrides.Content) || Content,
29
+ }), [overrides]);
30
+ return (React.createElement(overridesMap.Container, Object.assign({ role: "note" }, nativeProps, { variant: variant, ref: ref }),
31
+ icon !== false && React.createElement(overridesMap.Icon, { variant: variant }, icon),
32
+ React.createElement(overridesMap.Content, null,
33
+ title && React.createElement(overridesMap.Title, null, title),
34
+ children)));
35
+ };
36
+ export * from './InfoNoteContainer';
37
+ export * from './InfoNoteIcon';
38
+ export * from './InfoNoteTitle';
39
+ export * from './InfoNoteContent';
40
+ export default React.forwardRef(InfoNote);
@@ -0,0 +1,64 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import styled from '@emotion/styled';
14
+ import { css, keyframes } from '@emotion/react';
15
+ const size = (value) => (typeof value === 'number' ? `${value}em` : value);
16
+ const DEFAULT_HEIGHT = {
17
+ text: '0.8em',
18
+ rect: '3em',
19
+ circle: '2.5em',
20
+ pill: '1.6em',
21
+ };
22
+ /**
23
+ * The solid shape fades in and out: calmer than the moving gradient and does not depend on the width
24
+ */
25
+ const pulse = keyframes `
26
+ 0%,
27
+ 100% {
28
+ opacity: 1;
29
+ }
30
+ 50% {
31
+ opacity: 0.4;
32
+ }
33
+ `;
34
+ const StyledSkeleton = styled.span `
35
+ display: block;
36
+ flex-shrink: 0;
37
+ width: ${({ $width }) => $width};
38
+ max-width: 100%;
39
+ height: ${({ $height }) => $height};
40
+ border-radius: ${({ theme, $variant }) => $variant === 'circle' || $variant === 'pill'
41
+ ? '999em'
42
+ : `${theme.shape.radiusFactor * ($variant === 'rect' ? 1.5 : 0.75)}em`};
43
+ background-color: ${({ theme }) => theme.color.textPrimary.alpha(0.08).toString()};
44
+ animation: ${pulse} 1.6s ease-in-out infinite;
45
+
46
+ ${({ $variant, $height }) => $variant === 'circle' &&
47
+ css `
48
+ aspect-ratio: 1;
49
+ width: ${$height};
50
+ `}
51
+
52
+ @media (prefers-reduced-motion: reduce) {
53
+ animation: none;
54
+ }
55
+ `;
56
+ /**
57
+ * The placeholder of the content which is loaded: the gray shape which fades in and out.
58
+ * Shows the structure of the content instead of the spinner
59
+ */
60
+ const Skeleton = (props, ref) => {
61
+ const { variant = 'text', width = '100%', height } = props, nativeProps = __rest(props, ["variant", "width", "height"]);
62
+ return (React.createElement(StyledSkeleton, Object.assign({ "aria-hidden": true }, nativeProps, { ref: ref, "$variant": variant, "$width": size(width), "$height": height !== undefined ? size(height) : DEFAULT_HEIGHT[variant] })));
63
+ };
64
+ export default React.forwardRef(Skeleton);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@via-profit/ui-kit",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "UI Kit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -150,6 +150,11 @@
150
150
  "import": "./esm/Badge/BadgeDeleteButton.js",
151
151
  "require": "./Badge/BadgeDeleteButton.js"
152
152
  },
153
+ "./Badge/BadgeDot": {
154
+ "types": "./Badge/BadgeDot.d.ts",
155
+ "import": "./esm/Badge/BadgeDot.js",
156
+ "require": "./Badge/BadgeDot.js"
157
+ },
153
158
  "./Badge/BadgeIconWrapper": {
154
159
  "types": "./Badge/BadgeIconWrapper.d.ts",
155
160
  "import": "./esm/Badge/BadgeIconWrapper.js",
@@ -505,6 +510,41 @@
505
510
  "import": "./esm/DatePicker/useDatePickerFormat.js",
506
511
  "require": "./DatePicker/useDatePickerFormat.js"
507
512
  },
513
+ "./EmptyState/EmptyStateAction": {
514
+ "types": "./EmptyState/EmptyStateAction.d.ts",
515
+ "import": "./esm/EmptyState/EmptyStateAction.js",
516
+ "require": "./EmptyState/EmptyStateAction.js"
517
+ },
518
+ "./EmptyState/EmptyStateContainer": {
519
+ "types": "./EmptyState/EmptyStateContainer.d.ts",
520
+ "import": "./esm/EmptyState/EmptyStateContainer.js",
521
+ "require": "./EmptyState/EmptyStateContainer.js"
522
+ },
523
+ "./EmptyState/EmptyStateContent": {
524
+ "types": "./EmptyState/EmptyStateContent.d.ts",
525
+ "import": "./esm/EmptyState/EmptyStateContent.js",
526
+ "require": "./EmptyState/EmptyStateContent.js"
527
+ },
528
+ "./EmptyState/EmptyStateIcon": {
529
+ "types": "./EmptyState/EmptyStateIcon.d.ts",
530
+ "import": "./esm/EmptyState/EmptyStateIcon.js",
531
+ "require": "./EmptyState/EmptyStateIcon.js"
532
+ },
533
+ "./EmptyState/EmptyStateTitle": {
534
+ "types": "./EmptyState/EmptyStateTitle.d.ts",
535
+ "import": "./esm/EmptyState/EmptyStateTitle.js",
536
+ "require": "./EmptyState/EmptyStateTitle.js"
537
+ },
538
+ "./EmptyState/index": {
539
+ "types": "./EmptyState/index.d.ts",
540
+ "import": "./esm/EmptyState/index.js",
541
+ "require": "./EmptyState/index.js"
542
+ },
543
+ "./EmptyState": {
544
+ "types": "./EmptyState/index.d.ts",
545
+ "import": "./esm/EmptyState/index.js",
546
+ "require": "./EmptyState/index.js"
547
+ },
508
548
  "./ErrorBoundary/RenderError": {
509
549
  "types": "./ErrorBoundary/RenderError.d.ts",
510
550
  "import": "./esm/ErrorBoundary/RenderError.js",
@@ -520,6 +560,26 @@
520
560
  "import": "./esm/ErrorBoundary/index.js",
521
561
  "require": "./ErrorBoundary/index.js"
522
562
  },
563
+ "./FileDropzone/FileDropzoneArea": {
564
+ "types": "./FileDropzone/FileDropzoneArea.d.ts",
565
+ "import": "./esm/FileDropzone/FileDropzoneArea.js",
566
+ "require": "./FileDropzone/FileDropzoneArea.js"
567
+ },
568
+ "./FileDropzone/index": {
569
+ "types": "./FileDropzone/index.d.ts",
570
+ "import": "./esm/FileDropzone/index.js",
571
+ "require": "./FileDropzone/index.js"
572
+ },
573
+ "./FileDropzone": {
574
+ "types": "./FileDropzone/index.d.ts",
575
+ "import": "./esm/FileDropzone/index.js",
576
+ "require": "./FileDropzone/index.js"
577
+ },
578
+ "./FileDropzone/utils": {
579
+ "types": "./FileDropzone/utils.d.ts",
580
+ "import": "./esm/FileDropzone/utils.js",
581
+ "require": "./FileDropzone/utils.js"
582
+ },
523
583
  "./Grid/index": {
524
584
  "types": "./Grid/index.d.ts",
525
585
  "import": "./esm/Grid/index.js",
@@ -555,6 +615,26 @@
555
615
  "import": "./esm/Highlighted/index.js",
556
616
  "require": "./Highlighted/index.js"
557
617
  },
618
+ "./HintPopover/HintPopoverButton": {
619
+ "types": "./HintPopover/HintPopoverButton.d.ts",
620
+ "import": "./esm/HintPopover/HintPopoverButton.js",
621
+ "require": "./HintPopover/HintPopoverButton.js"
622
+ },
623
+ "./HintPopover/HintPopoverContainer": {
624
+ "types": "./HintPopover/HintPopoverContainer.d.ts",
625
+ "import": "./esm/HintPopover/HintPopoverContainer.js",
626
+ "require": "./HintPopover/HintPopoverContainer.js"
627
+ },
628
+ "./HintPopover/index": {
629
+ "types": "./HintPopover/index.d.ts",
630
+ "import": "./esm/HintPopover/index.js",
631
+ "require": "./HintPopover/index.js"
632
+ },
633
+ "./HintPopover": {
634
+ "types": "./HintPopover/index.d.ts",
635
+ "import": "./esm/HintPopover/index.js",
636
+ "require": "./HintPopover/index.js"
637
+ },
558
638
  "./Image/index": {
559
639
  "types": "./Image/index.d.ts",
560
640
  "import": "./esm/Image/index.js",
@@ -565,6 +645,36 @@
565
645
  "import": "./esm/Image/index.js",
566
646
  "require": "./Image/index.js"
567
647
  },
648
+ "./InfoNote/InfoNoteContainer": {
649
+ "types": "./InfoNote/InfoNoteContainer.d.ts",
650
+ "import": "./esm/InfoNote/InfoNoteContainer.js",
651
+ "require": "./InfoNote/InfoNoteContainer.js"
652
+ },
653
+ "./InfoNote/InfoNoteContent": {
654
+ "types": "./InfoNote/InfoNoteContent.d.ts",
655
+ "import": "./esm/InfoNote/InfoNoteContent.js",
656
+ "require": "./InfoNote/InfoNoteContent.js"
657
+ },
658
+ "./InfoNote/InfoNoteIcon": {
659
+ "types": "./InfoNote/InfoNoteIcon.d.ts",
660
+ "import": "./esm/InfoNote/InfoNoteIcon.js",
661
+ "require": "./InfoNote/InfoNoteIcon.js"
662
+ },
663
+ "./InfoNote/InfoNoteTitle": {
664
+ "types": "./InfoNote/InfoNoteTitle.d.ts",
665
+ "import": "./esm/InfoNote/InfoNoteTitle.js",
666
+ "require": "./InfoNote/InfoNoteTitle.js"
667
+ },
668
+ "./InfoNote/index": {
669
+ "types": "./InfoNote/index.d.ts",
670
+ "import": "./esm/InfoNote/index.js",
671
+ "require": "./InfoNote/index.js"
672
+ },
673
+ "./InfoNote": {
674
+ "types": "./InfoNote/index.d.ts",
675
+ "import": "./esm/InfoNote/index.js",
676
+ "require": "./InfoNote/index.js"
677
+ },
568
678
  "./LoadingIndicator/LoadingOverlay": {
569
679
  "types": "./LoadingIndicator/LoadingOverlay.d.ts",
570
680
  "import": "./esm/LoadingIndicator/LoadingOverlay.js",
@@ -1075,6 +1185,16 @@
1075
1185
  "import": "./esm/Selectbox/index.js",
1076
1186
  "require": "./Selectbox/index.js"
1077
1187
  },
1188
+ "./Skeleton/index": {
1189
+ "types": "./Skeleton/index.d.ts",
1190
+ "import": "./esm/Skeleton/index.js",
1191
+ "require": "./Skeleton/index.js"
1192
+ },
1193
+ "./Skeleton": {
1194
+ "types": "./Skeleton/index.d.ts",
1195
+ "import": "./esm/Skeleton/index.js",
1196
+ "require": "./Skeleton/index.js"
1197
+ },
1078
1198
  "./Slider/SliderContainer": {
1079
1199
  "types": "./Slider/SliderContainer.d.ts",
1080
1200
  "import": "./esm/Slider/SliderContainer.js",