autocasting-ui-library-padimasso 1.2.8 → 1.3.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/.storybook/manager-head.html +11 -0
- package/.storybook/preview.ts +13 -1
- package/dist/components/Actions/Buttons/Button/Button.js +31 -0
- package/dist/components/Actions/Buttons/Button/ButtonRow.js +11 -0
- package/dist/components/Actions/Buttons/GoogleButton/GoogleButton.js +12 -0
- package/dist/components/Actions/Menus/OverflowMenu/OverflowMenu.js +163 -0
- package/dist/components/Actions/Menus/TextDropdownTrigger/TextDropdownTrigger.js +6 -0
- package/dist/components/Brand/Identity/Icon/HilighterSvg.js +7 -0
- package/dist/components/Brand/Identity/Icon/Icon.js +276 -0
- package/dist/components/Brand/Identity/Icons/EditIcon.js +5 -0
- package/dist/components/Brand/Identity/Logo/Logo.js +8 -0
- package/dist/components/Feedback/Loading/Spinner/Spinner.js +15 -0
- package/dist/components/Feedback/Status/Chip/Chip.js +13 -0
- package/dist/components/Feedback/Status/Chip/StatusChip.js +16 -0
- package/dist/components/Flows/Wizard/Wizard.js +21 -0
- package/dist/components/Flows/Wizard/WizardStep.js +7 -0
- package/dist/components/Forms/Fields/FormInputField/FormInputField.js +14 -0
- package/dist/components/Forms/Fields/FormInputField/index.js +5 -0
- package/dist/components/Forms/Fields/FormSelectField/FormSelectField.js +10 -0
- package/dist/components/Forms/Fields/FormSelectField/index.js +5 -0
- package/dist/components/Forms/Search/SearchInput.js +48 -0
- package/dist/components/Forms/Search/SearchWithSuggestions.js +119 -0
- package/dist/components/Forms/Upload/UploadTile/UploadTile.js +99 -0
- package/dist/components/Forms/primitive/EditableInput/EditableInput.js +11 -0
- package/dist/components/Forms/primitive/Input/Input.js +10 -0
- package/dist/components/Forms/primitive/Input/index.js +5 -0
- package/dist/components/Forms/primitive/Label/Label.js +13 -0
- package/dist/components/Forms/primitive/Label/index.js +5 -0
- package/dist/components/Forms/primitive/Select/Select.js +12 -0
- package/dist/components/Forms/primitive/Select/index.js +5 -0
- package/dist/components/Icon/Icon.js +6 -0
- package/dist/components/Layout/Separator/Separator.js +7 -0
- package/dist/components/Media/Images/ImageCarousel/ImageCarousel.js +35 -0
- package/dist/components/Media/Images/PhotoZoomOverlay/PhotoZoomOverlay.js +53 -0
- package/dist/components/Media/Video/UniversalVideoPlayer/UniversalVideoPlayer.js +22 -0
- package/dist/components/Media/Video/UniversalVideoPlayer/utils.js +105 -0
- package/dist/components/Media/Video/VideoPreviewCard.js +10 -0
- package/dist/components/Navigation/Indicators/Chevron/ChevronLeft.js +7 -0
- package/dist/components/Navigation/Indicators/Chevron/ChevronRight.js +7 -0
- package/dist/components/Navigation/Indicators/Chevron/ChevronUpDown.js +7 -0
- package/dist/components/Navigation/Selection/Pills/Pills.js +48 -0
- package/dist/components/Overlays/Dialogs/Modal/Modal.js +42 -0
- package/dist/components/Overlays/Panels/DetailsView/DetailsView.js +37 -0
- package/dist/icons/web-purple.svg.js +3 -0
- package/dist/icons/web.svg.js +3 -0
- package/dist/index.d.ts +156 -153
- package/dist/index.js +32 -32
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/{Button → Actions/Buttons/Button}/Button.stories.tsx +10 -1
- package/src/components/{Button → Actions/Buttons/Button}/Button.tsx +7 -11
- package/src/components/{Button → Actions/Buttons/Button}/ButtonRow.tsx +1 -1
- package/src/components/{Button → Actions/Buttons/Button}/index.ts +0 -1
- package/src/components/{GoogleButton → Actions/Buttons/GoogleButton}/GoogleButton.stories.tsx +1 -1
- package/src/components/{GoogleButton → Actions/Buttons/GoogleButton}/GoogleButton.tsx +3 -3
- package/src/components/Actions/Menus/OverflowMenu/OverflowMenu.stories.tsx +59 -0
- package/src/components/{OverflowMenu → Actions/Menus/OverflowMenu}/OverflowMenu.tsx +38 -32
- package/src/components/{OverflowMenu → Actions/Menus/OverflowMenu}/index.ts +0 -1
- package/src/components/Actions/Menus/OverflowMenu/overflowmenu.types.ts +31 -0
- package/src/components/Actions/Menus/TextDropdownTrigger/TextDropdownTrigger.stories.tsx +28 -0
- package/src/components/{Trigger → Actions/Menus/TextDropdownTrigger}/TextDropdownTrigger.tsx +1 -1
- package/src/components/{Trigger → Actions/Menus/TextDropdownTrigger}/index.ts +0 -1
- package/src/components/{Icon → Brand/Identity/Icon}/Icon.stories.ts +17 -1
- package/src/components/Brand/Identity/Icon/Icon.tsx +344 -0
- package/src/components/Brand/Identity/Icon/index.ts +3 -0
- package/src/components/{Logo → Brand/Identity/Logo}/Logo.stories.tsx +1 -1
- package/src/components/Feedback/Loading/Spinner/Spinner.stories.tsx +18 -0
- package/src/components/{Spinner → Feedback/Loading/Spinner}/index.ts +0 -1
- package/src/components/Feedback/Status/Chip/Chip.stories.tsx +28 -0
- package/src/components/{Chip → Feedback/Status/Chip}/Chip.tsx +3 -3
- package/src/components/Feedback/Status/Chip/StatusChip.stories.tsx +35 -0
- package/src/components/{Chip → Feedback/Status/Chip}/StatusChip.tsx +2 -2
- package/src/components/{Chip → Feedback/Status/Chip}/index.ts +0 -1
- package/src/components/Flows/Wizard/Wizard.stories.tsx +63 -0
- package/src/components/Flows/Wizard/index.ts +3 -0
- package/src/components/{Form → Forms}/Fields/FormInputField/FormInputField.stories.tsx +1 -1
- package/src/components/{Form → Forms}/Fields/FormSelectField/FormSelectField.stories.tsx +15 -1
- package/src/components/{Form → Forms}/Fields/FormSelectField/FormSelectField.tsx +3 -3
- package/src/components/{Search → Forms/Search}/SearchInput.tsx +5 -5
- package/src/components/{Search → Forms/Search}/SearchWithSuggestions.tsx +3 -3
- package/src/components/Forms/Upload/UploadTile/UploadTile.stories.tsx +47 -0
- package/src/components/{UploadTile → Forms/Upload/UploadTile}/UploadTile.tsx +4 -4
- package/src/components/{UploadTile → Forms/Upload/UploadTile}/index.ts +0 -1
- package/src/components/Forms/index.ts +4 -0
- package/src/components/{Form → Forms}/primitive/EditableInput/EditableInput.tsx +6 -6
- package/src/components/{Form → Forms}/primitive/Input/Input.stories.tsx +1 -1
- package/src/components/{Form → Forms}/primitive/Input/Input.tsx +4 -4
- package/src/components/{Form → Forms}/primitive/Label/Label.stories.tsx +1 -1
- package/src/components/{Form → Forms}/primitive/Label/Label.tsx +1 -1
- package/src/components/{Form → Forms}/primitive/Select/Select.stories.tsx +2 -2
- package/src/components/{Form → Forms}/primitive/Select/Select.tsx +3 -3
- package/src/components/{Separator → Layout/Separator}/Separator.stories.tsx +1 -1
- package/src/components/Layout/index.ts +3 -1
- package/src/components/Media/Images/ImageCarousel/ImageCarousel.stories.tsx +56 -0
- package/src/components/{ImageCarousel → Media/Images/ImageCarousel}/ImageCarousel.tsx +1 -1
- package/src/components/{ImageCarousel → Media/Images/ImageCarousel}/index.ts +0 -1
- package/src/components/Media/Images/PhotoZoomOverlay/PhotoZoomOverlay.stories.tsx +74 -0
- package/src/components/{PhotoZoomOverlay → Media/Images/PhotoZoomOverlay}/PhotoZoomOverlay.tsx +1 -1
- package/src/components/{PhotoZoomOverlay → Media/Images/PhotoZoomOverlay}/index.ts +0 -1
- package/src/components/Media/Video/UniversalVideoPlayer/UniversalVideoPlayer.stories.tsx +34 -0
- package/src/components/Media/Video/VideoPreviewCard.stories.tsx +27 -0
- package/src/components/{Video → Media/Video}/index.ts +0 -1
- package/src/components/Navigation/Indicators/Chevron/Chevron.stories.tsx +29 -0
- package/src/components/{Chevron → Navigation/Indicators/Chevron}/index.ts +0 -1
- package/src/components/Navigation/Selection/Pills/Pills.stories.tsx +35 -0
- package/src/components/{Pills → Navigation/Selection/Pills}/Pills.tsx +3 -3
- package/src/components/{Pills → Navigation/Selection/Pills}/index.ts +0 -1
- package/src/components/{Modals → Overlays/Dialogs/Modal}/Modal.stories.tsx +5 -5
- package/src/components/{Modals → Overlays/Dialogs/Modal}/Modal.tsx +2 -2
- package/src/components/Overlays/Panels/DetailsView/DetailsView.stories.tsx +54 -0
- package/src/components/{DetailsView → Overlays/Panels/DetailsView}/DetailsView.tsx +3 -3
- package/src/components/{DetailsView → Overlays/Panels/DetailsView}/index.ts +0 -1
- package/src/icons/web-purple.svg +3 -0
- package/src/icons/web.svg +3 -0
- package/src/index.ts +17 -20
- package/src/stories/Introduction.stories.tsx +84 -33
- package/src/components/Form/index.ts +0 -2
- package/src/components/Icon/Icon.tsx +0 -332
- package/src/components/Icon/index.ts +0 -4
- package/src/components/OverflowMenu/overflowmenu.types.ts +0 -26
- package/src/components/Wizard/index.ts +0 -5
- /package/src/components/{GoogleButton → Actions/Buttons/GoogleButton}/index.ts +0 -0
- /package/src/components/{Icon → Brand/Identity/Icon}/HilighterSvg.tsx +0 -0
- /package/src/components/{Icons → Brand/Identity/Icons}/EditIcon.tsx +0 -0
- /package/src/components/{Icons → Brand/Identity/Icons}/index.ts +0 -0
- /package/src/components/{Logo → Brand/Identity/Logo}/Logo.tsx +0 -0
- /package/src/components/{Logo → Brand/Identity/Logo}/index.ts +0 -0
- /package/src/components/{Spinner → Feedback/Loading/Spinner}/Spinner.tsx +0 -0
- /package/src/components/{Wizard → Flows/Wizard}/Wizard.tsx +0 -0
- /package/src/components/{Wizard → Flows/Wizard}/WizardStep.tsx +0 -0
- /package/src/components/{Form → Forms}/Fields/FormInputField/FormInputField.tsx +0 -0
- /package/src/components/{Form → Forms}/Fields/FormInputField/index.ts +0 -0
- /package/src/components/{Form → Forms}/Fields/FormSelectField/index.ts +0 -0
- /package/src/components/{Form → Forms}/Fields/index.ts +0 -0
- /package/src/components/{Search → Forms/Search}/index.ts +0 -0
- /package/src/components/{Form → Forms}/primitive/Input/index.ts +0 -0
- /package/src/components/{Form → Forms}/primitive/Label/index.ts +0 -0
- /package/src/components/{Form → Forms}/primitive/Select/index.ts +0 -0
- /package/src/components/{Form → Forms}/primitive/index.ts +0 -0
- /package/src/components/{Separator → Layout/Separator}/Separator.tsx +0 -0
- /package/src/components/{Separator → Layout/Separator}/index.ts +0 -0
- /package/src/components/{Video → Media/Video}/UniversalVideoPlayer/UniversalVideoPlayer.tsx +0 -0
- /package/src/components/{Video → Media/Video}/UniversalVideoPlayer/index.ts +0 -0
- /package/src/components/{Video → Media/Video}/UniversalVideoPlayer/types.ts +0 -0
- /package/src/components/{Video → Media/Video}/UniversalVideoPlayer/utils.ts +0 -0
- /package/src/components/{Video → Media/Video}/VideoPreviewCard.tsx +0 -0
- /package/src/components/{Chevron → Navigation/Indicators/Chevron}/ChevronLeft.tsx +0 -0
- /package/src/components/{Chevron → Navigation/Indicators/Chevron}/ChevronRight.tsx +0 -0
- /package/src/components/{Chevron → Navigation/Indicators/Chevron}/ChevronUpDown.tsx +0 -0
- /package/src/components/{Modals → Overlays/Dialogs/Modal}/index.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
(() => {
|
|
3
|
+
const INTRO_PATH = '/story/start-here-introduction--home';
|
|
4
|
+
const url = new URL(window.location.href);
|
|
5
|
+
|
|
6
|
+
if (!url.searchParams.has('path')) {
|
|
7
|
+
url.searchParams.set('path', INTRO_PATH);
|
|
8
|
+
window.location.replace(url.toString());
|
|
9
|
+
}
|
|
10
|
+
})();
|
|
11
|
+
</script>
|
package/.storybook/preview.ts
CHANGED
|
@@ -7,7 +7,19 @@ export default {
|
|
|
7
7
|
controls: { matchers: { color: /(background|color)$/i, date: /Date$/ }, disableSaveFromUi: true },
|
|
8
8
|
options: {
|
|
9
9
|
storySort: {
|
|
10
|
-
order: [
|
|
10
|
+
order: [
|
|
11
|
+
'Start Here',
|
|
12
|
+
'Actions',
|
|
13
|
+
'Forms',
|
|
14
|
+
'Media',
|
|
15
|
+
'Overlays',
|
|
16
|
+
'Feedback',
|
|
17
|
+
'Navigation',
|
|
18
|
+
'Flows',
|
|
19
|
+
'Brand',
|
|
20
|
+
'Layout',
|
|
21
|
+
'*',
|
|
22
|
+
],
|
|
11
23
|
},
|
|
12
24
|
},
|
|
13
25
|
},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { BUTTON_STRUCTURE } from '../../../../styles/style_constants.js';
|
|
5
|
+
|
|
6
|
+
const Button = forwardRef((props, ref) => {
|
|
7
|
+
const { className, variant = 'primary', asChild = false, children, ...rest } = props;
|
|
8
|
+
const { disabled, ...delegated } = rest;
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
primary: 'bg-(--color-primary-purple) text-(--color-primary-white) cursor-pointer',
|
|
11
|
+
danger: 'bg-(--color-alert-error) text-(--color-primary-white) cursor-pointer',
|
|
12
|
+
primaryOutline: 'bg-(--color-primary-white) text-(--color-primary-purple) border border-(--color-primary-purple) cursor-pointer',
|
|
13
|
+
outline: 'bg-(--color-primary-white) text-(--color-primary-black) border border-(--color-secondary-outline) cursor-pointer',
|
|
14
|
+
disabled: 'bg-(--color-secondary-disabled-grey) text-(--color-primary-white) cursor-not-allowed',
|
|
15
|
+
};
|
|
16
|
+
const effectiveVariant = disabled ? 'disabled' : variant;
|
|
17
|
+
const baseLayout = 'inline-flex items-center justify-center leading-none align-middle rounded-lg';
|
|
18
|
+
const computedClass = clsx(BUTTON_STRUCTURE, baseLayout, 'font-semibold text-base transition duration-300 ease-in-out', variantClasses[effectiveVariant], className);
|
|
19
|
+
if (asChild && isValidElement(children)) {
|
|
20
|
+
const childProps = {
|
|
21
|
+
className: clsx(children.props.className, computedClass),
|
|
22
|
+
...delegated,
|
|
23
|
+
disabled,
|
|
24
|
+
};
|
|
25
|
+
return cloneElement(children, childProps);
|
|
26
|
+
}
|
|
27
|
+
return (jsx("button", { ref: ref, className: computedClass, disabled: disabled, ...delegated, children: children }));
|
|
28
|
+
});
|
|
29
|
+
Button.displayName = 'Button';
|
|
30
|
+
|
|
31
|
+
export { Button as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function ButtonRow({ items, className, innerClassName }) {
|
|
6
|
+
if (!items || items.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
return (jsx("div", { className: clsx('flex items-center justify-center', className), children: jsx("div", { className: clsx('inline-flex items-center justify-center rounded-lg bg-white shadow-sm h-11 px-4', innerClassName), children: items.map((item, index) => (jsxs(React.Fragment, { children: [index > 0 && jsx("div", { className: "w-px h-7 mx-4 bg-(--color-secondary-outline)" }), jsx("div", { className: "flex items-center justify-center", children: item })] }, index))) }) }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { ButtonRow as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { BUTTON_STRUCTURE } from '../../../../styles/style_constants.js';
|
|
4
|
+
|
|
5
|
+
const GoogleButton = ({ className, children, ...props }) => {
|
|
6
|
+
const hasBg = className?.includes('bg-');
|
|
7
|
+
const hasText = className?.includes('text-');
|
|
8
|
+
return (jsxs("button", { type: "button", className: clsx(BUTTON_STRUCTURE, 'flex items-center justify-center gap-4 font-light text-base drop-shadow-sm', !hasBg && 'bg-(--color-primary-white)', !hasText && 'text-(--color-primary-black)', className), ...props, children: [jsx(GoogleIcon, {}), jsx("span", { children: children })] }));
|
|
9
|
+
};
|
|
10
|
+
const GoogleIcon = () => (jsxs("svg", { className: "w-6 h-6", viewBox: "0 0 533.5 544.3", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M533.5 278.4c0-17.4-1.6-34.1-4.7-50.4H272v95.3h146.9c-6.4 34-25.6 62.8-54.7 82l89.1 69.2c52.1-48 80.2-118.7 80.2-196.1z", fill: "#4285f4" }), jsx("path", { d: "M272 544.3c72.6 0 133.5-24 178-65.3l-89.1-69.2c-24.8 16.6-56.5 26.3-88.9 26.3-68.2 0-125.9-46-146.7-107.9H35.4v67.6C79.9 482.5 170.6 544.3 272 544.3z", fill: "#34a853" }), jsx("path", { d: "M125.3 327.9c-10-29.4-10-61.3 0-90.7V169.6H35.4c-35.4 70.8-35.4 154.2 0 225z", fill: "#fbbc04" }), jsx("path", { d: "M272 107.7c39.5-.6 77.4 13.7 106.1 39.8l79.2-79.2C409 25.6 341.3 0 272 0 170.6 0 79.9 61.8 35.4 169.6l89.9 67.6C146.1 153.7 203.8 107.7 272 107.7z", fill: "#ea4335" })] }));
|
|
11
|
+
|
|
12
|
+
export { GoogleButton as default };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { Icon } from '../../../Brand/Identity/Icon/Icon.js';
|
|
5
|
+
|
|
6
|
+
function cx(...xs) {
|
|
7
|
+
return xs.filter(Boolean).join(' ');
|
|
8
|
+
}
|
|
9
|
+
function isActionItem(item) {
|
|
10
|
+
return item.type !== 'separator' && item.type !== 'content';
|
|
11
|
+
}
|
|
12
|
+
function isContentItem(item) {
|
|
13
|
+
return item.type === 'content';
|
|
14
|
+
}
|
|
15
|
+
function isVisibleItem(item) {
|
|
16
|
+
return !('hidden' in item && item.hidden);
|
|
17
|
+
}
|
|
18
|
+
const OverflowMenu = ({ items, align = 'end', side = 'bottom', offset = 8, triggerClassName, menuClassName, itemClassName, disabled = false, trigger, }) => {
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
20
|
+
const triggerRef = useRef(null);
|
|
21
|
+
const menuRef = useRef(null);
|
|
22
|
+
const [anchor, setAnchor] = useState(null);
|
|
23
|
+
const [hoverKey, setHoverKey] = useState(null);
|
|
24
|
+
const visibleItems = useMemo(() => (items ?? []).filter(isVisibleItem), [items]);
|
|
25
|
+
const close = useCallback(() => setOpen(false), []);
|
|
26
|
+
const toggleOpen = useCallback(() => {
|
|
27
|
+
if (disabled)
|
|
28
|
+
return;
|
|
29
|
+
setOpen((v) => !v);
|
|
30
|
+
}, [disabled]);
|
|
31
|
+
const measure = useCallback(() => {
|
|
32
|
+
const el = triggerRef.current;
|
|
33
|
+
if (!el)
|
|
34
|
+
return;
|
|
35
|
+
const r = el.getBoundingClientRect();
|
|
36
|
+
if (side === 'bottom') {
|
|
37
|
+
setAnchor({
|
|
38
|
+
x: align === 'end' ? r.right : r.left,
|
|
39
|
+
y: r.bottom + offset,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setAnchor({
|
|
44
|
+
x: align === 'end' ? r.right : r.left,
|
|
45
|
+
y: r.top - offset,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [align, side, offset]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!open)
|
|
51
|
+
return;
|
|
52
|
+
measure();
|
|
53
|
+
}, [open, measure]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!open)
|
|
56
|
+
return;
|
|
57
|
+
const onResize = () => close();
|
|
58
|
+
const onScroll = (e) => {
|
|
59
|
+
const target = e.target;
|
|
60
|
+
if (!target)
|
|
61
|
+
return;
|
|
62
|
+
if (menuRef.current?.contains(target))
|
|
63
|
+
return;
|
|
64
|
+
if (triggerRef.current?.contains(target))
|
|
65
|
+
return;
|
|
66
|
+
close();
|
|
67
|
+
};
|
|
68
|
+
window.addEventListener('resize', onResize);
|
|
69
|
+
window.addEventListener('scroll', onScroll, true);
|
|
70
|
+
return () => {
|
|
71
|
+
window.removeEventListener('resize', onResize);
|
|
72
|
+
window.removeEventListener('scroll', onScroll, true);
|
|
73
|
+
};
|
|
74
|
+
}, [open, close]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!open)
|
|
77
|
+
return;
|
|
78
|
+
const onKey = (e) => {
|
|
79
|
+
if (e.key === 'Escape')
|
|
80
|
+
close();
|
|
81
|
+
};
|
|
82
|
+
const onPointerDown = (e) => {
|
|
83
|
+
const t = e.target;
|
|
84
|
+
if (!t)
|
|
85
|
+
return;
|
|
86
|
+
const inTrigger = !!triggerRef.current?.contains(t);
|
|
87
|
+
const inMenu = !!menuRef.current?.contains(t);
|
|
88
|
+
if (!inTrigger && !inMenu)
|
|
89
|
+
close();
|
|
90
|
+
};
|
|
91
|
+
document.addEventListener('keydown', onKey);
|
|
92
|
+
document.addEventListener('mousedown', onPointerDown, true);
|
|
93
|
+
document.addEventListener('touchstart', onPointerDown, true);
|
|
94
|
+
return () => {
|
|
95
|
+
document.removeEventListener('keydown', onKey);
|
|
96
|
+
document.removeEventListener('mousedown', onPointerDown, true);
|
|
97
|
+
document.removeEventListener('touchstart', onPointerDown, true);
|
|
98
|
+
};
|
|
99
|
+
}, [open, close]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!open)
|
|
102
|
+
return;
|
|
103
|
+
const onFocusIn = (e) => {
|
|
104
|
+
const t = e.target;
|
|
105
|
+
if (!t)
|
|
106
|
+
return;
|
|
107
|
+
const inTrigger = !!triggerRef.current?.contains(t);
|
|
108
|
+
const inMenu = !!menuRef.current?.contains(t);
|
|
109
|
+
if (!inTrigger && !inMenu)
|
|
110
|
+
close();
|
|
111
|
+
};
|
|
112
|
+
document.addEventListener('focusin', onFocusIn, true);
|
|
113
|
+
return () => {
|
|
114
|
+
document.removeEventListener('focusin', onFocusIn, true);
|
|
115
|
+
};
|
|
116
|
+
}, [open, close]);
|
|
117
|
+
const onSelectItem = async (it) => {
|
|
118
|
+
if (!isActionItem(it) || it.disabled)
|
|
119
|
+
return;
|
|
120
|
+
try {
|
|
121
|
+
await it.onSelect?.();
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
const closeOnSelect = it.closeOnSelect ?? true;
|
|
125
|
+
if (closeOnSelect)
|
|
126
|
+
close();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const MenuRenderer = !open || !anchor
|
|
130
|
+
? null
|
|
131
|
+
: createPortal(jsx("div", { ref: menuRef, role: "menu", className: cx('fixed z-[999] min-w-[210px] rounded-2xl shadow-lg', 'bg-(--color-primary-white) border border-(--color-secondary-outline)', 'p-2', menuClassName), style: {
|
|
132
|
+
left: anchor.x,
|
|
133
|
+
top: anchor.y,
|
|
134
|
+
transform: align === 'end'
|
|
135
|
+
? side === 'bottom'
|
|
136
|
+
? 'translateX(-100%) translateY(0)'
|
|
137
|
+
: 'translateX(-100%) translateY(-100%)'
|
|
138
|
+
: side === 'bottom'
|
|
139
|
+
? 'translateX(0) translateY(0)'
|
|
140
|
+
: 'translateX(0) translateY(-100%)',
|
|
141
|
+
}, children: visibleItems.map((it) => {
|
|
142
|
+
if (it.type === 'separator') {
|
|
143
|
+
return jsx("div", { className: "my-2 h-px w-full bg-(--color-secondary-outline) opacity-60" }, it.key);
|
|
144
|
+
}
|
|
145
|
+
if (isContentItem(it)) {
|
|
146
|
+
return (jsx("div", { className: "p-2", children: it.content }, it.key));
|
|
147
|
+
}
|
|
148
|
+
const isDestructive = Boolean(it.destructive);
|
|
149
|
+
const isDisabled = Boolean(it.disabled);
|
|
150
|
+
const iconName = it.iconName;
|
|
151
|
+
const forcedIconVariant = it.iconVariant;
|
|
152
|
+
const resolvedIconVariant = forcedIconVariant ||
|
|
153
|
+
(isDisabled ? 'disabled' : isDestructive ? 'danger' : hoverKey === it.key ? 'primary' : 'default');
|
|
154
|
+
const labelNode = it.label;
|
|
155
|
+
const isStringLabel = typeof labelNode === 'string';
|
|
156
|
+
return (jsxs("button", { type: "button", role: "menuitem", "data-menuitem": "true", disabled: isDisabled, onClick: () => void onSelectItem(it), onMouseEnter: () => setHoverKey(it.key), onMouseLeave: () => setHoverKey(null), className: cx('w-full text-left px-3 py-2 rounded-xl', 'flex items-center gap-3', 'text-sm font-normal', 'cursor-pointer disabled:cursor-not-allowed', isDestructive
|
|
157
|
+
? 'text-(--color-alert-error) hover:bg-red-50'
|
|
158
|
+
: 'text-(--color-primary-black) hover:text-(--color-primary-purple) hover:bg-(--color-secondary-white)', 'transition-colors', 'disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-inherit', itemClassName), children: [iconName && jsx(Icon, { name: iconName, variant: resolvedIconVariant }), isStringLabel ? jsx("span", { className: "select-none", children: labelNode }) : labelNode] }, it.key));
|
|
159
|
+
}) }), document.body);
|
|
160
|
+
return (jsxs(Fragment, { children: [jsx("button", { ref: triggerRef, type: "button", onClick: toggleOpen, "aria-haspopup": "menu", "aria-expanded": open, disabled: disabled, className: cx('disabled:opacity-50 disabled:cursor-not-allowed', triggerClassName), children: trigger ? trigger({ open, disabled }) : jsx(Icon, { name: "overflowmenu", variant: "default" }) }), MenuRenderer] }));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export { OverflowMenu as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import ChevronUpDown from '../../../Navigation/Indicators/Chevron/ChevronUpDown.js';
|
|
3
|
+
|
|
4
|
+
const TextDropdownTrigger = ({ label, open }) => (jsxs("span", { className: "flex items-center gap-1 cursor-pointer select-none", children: [jsx("span", { className: "underline font-normal text-sm", children: label }), jsx("span", { className: open ? 'rotate-180 transition-transform' : 'transition-transform', children: jsx(ChevronUpDown, { open: open, sizePx: 18 }) })] }));
|
|
5
|
+
|
|
6
|
+
export { TextDropdownTrigger as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function HilighterSvg({ width = '100%', height = 56, color = '#AEFF00', ...rest }) {
|
|
4
|
+
return (jsx("svg", { viewBox: "0 0 126 56", width: width, height: height, preserveAspectRatio: "xMidYMid meet", ...rest, children: jsx("path", { d: "M25.5639 7.56735C34.0888 4.52357 48.7621 1.06384 65.2026 0.513101C81.6293 -0.037151 99.9437 2.31166 115.689 11.0156C118.173 12.3887 120.188 13.8198 121.746 15.3219C123.279 16.8001 124.509 18.4794 125.248 20.4655C126.046 22.6107 126.226 25.0159 125.707 27.3628C125.232 29.5056 124.245 31.2857 123.098 32.7731C120.795 35.7602 117.145 38.4557 112.695 40.87C108.2 43.3088 102.726 45.5445 96.6509 47.4956C72.4196 55.2781 37.9998 58.729 16.8252 51.9115C11.561 50.2166 7.73054 48.4323 5.10856 46.5543C3.79828 45.6157 2.71812 44.6043 1.89774 43.481C1.08416 42.367 0.403448 40.9727 0.12962 39.2279C-0.467489 35.4229 1.11541 32.5139 2.48806 30.7479C4.00031 28.8023 6.1481 27.0414 8.51907 25.4598C13.297 22.2726 19.4918 19.4854 24.6984 17.385C27.3123 16.3305 29.6978 15.4415 31.5558 14.756C33.4559 14.055 34.7171 13.5976 35.1855 13.3784L36.0921 19.287C35.5039 19.5623 34.0896 20.0732 32.2797 20.7408C30.4275 21.4241 28.0678 22.3039 25.4868 23.3451C20.3034 25.436 14.3075 28.147 9.76909 31.1744C7.48198 32.7001 5.69024 34.226 4.56593 35.6724C4.00296 36.3967 3.70961 36.9729 3.57926 37.3547C3.52821 37.5043 3.51357 37.5913 3.50973 37.6199C3.52232 37.6834 3.61152 38.0542 4.05906 38.667C4.53237 39.3151 5.29132 40.0734 6.43756 40.8944C8.72867 42.5355 12.2832 44.2294 17.46 45.8962C38.0501 52.5256 72.0003 49.193 96.0173 41.4793C102.005 39.5563 107.335 37.3733 111.656 35.0289C116.023 32.6599 119.202 30.2076 121.01 27.8621C121.919 26.6833 122.308 25.7511 122.439 25.1579C122.525 24.7686 122.54 24.4137 122.31 23.7979C122.022 23.023 121.362 21.9394 120.053 20.6767C118.768 19.4381 116.988 18.15 114.632 16.8474C99.3988 8.42646 81.511 6.08492 65.2698 6.62895C49.0424 7.17254 34.5817 10.5918 26.2657 13.561L25.5639 7.56735Z", fill: color }) }));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { HilighterSvg as default };
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import ApplicantsIconDisabled from '../../../../icons/applicants-disabled.svg.js';
|
|
4
|
+
import ApplicantsIconPurple from '../../../../icons/applicants-purple.svg.js';
|
|
5
|
+
import ApplicantsIcon from '../../../../icons/applicants.svg.js';
|
|
6
|
+
import ArrowLongLeftIconPurple from '../../../../icons/arrow-long-left-purple.svg.js';
|
|
7
|
+
import ArrowLongLeftIcon from '../../../../icons/arrow-long-left.svg.js';
|
|
8
|
+
import BehanceIconPurple from '../../../../icons/behance-purple.svg.js';
|
|
9
|
+
import BehanceIcon from '../../../../icons/behance.svg.js';
|
|
10
|
+
import BurgerCloseIconPurple from '../../../../icons/burger-close-purple.svg.js';
|
|
11
|
+
import BurgerCloseIcon from '../../../../icons/burger-close.svg.js';
|
|
12
|
+
import BurgerIconPurple from '../../../../icons/burger-purple.svg.js';
|
|
13
|
+
import BurgerIcon from '../../../../icons/burger.svg.js';
|
|
14
|
+
import CalendarIconPurple from '../../../../icons/calendar-purple.svg.js';
|
|
15
|
+
import CalendarIcon from '../../../../icons/calendar.svg.js';
|
|
16
|
+
import CatalogIconPurple from '../../../../icons/catalogo-purple.svg.js';
|
|
17
|
+
import CatalogIcon from '../../../../icons/catalogo.svg.js';
|
|
18
|
+
import ClapperManageIconPurple from '../../../../icons/clapper-manage-purple.svg.js';
|
|
19
|
+
import ClapperManageIcon from '../../../../icons/clapper-manage.svg.js';
|
|
20
|
+
import ClapperIconPurple from '../../../../icons/clapper-purple.svg.js';
|
|
21
|
+
import ClapperIcon from '../../../../icons/clapper.svg.js';
|
|
22
|
+
import ClockIconPurple from '../../../../icons/clock-purple.svg.js';
|
|
23
|
+
import ClockIcon from '../../../../icons/clock.svg.js';
|
|
24
|
+
import CopyLinkIconDisabled from '../../../../icons/copy-link-disabled.svg.js';
|
|
25
|
+
import CopyLinkIconPurple from '../../../../icons/copy-link-purple.svg.js';
|
|
26
|
+
import CopyLinkIcon from '../../../../icons/copy-link.svg.js';
|
|
27
|
+
import CrossIconPurple from '../../../../icons/cross-purple.svg.js';
|
|
28
|
+
import CrossIcon from '../../../../icons/cross.svg.js';
|
|
29
|
+
import DeleteIconRed from '../../../../icons/delete-red.svg.js';
|
|
30
|
+
import DeleteIcon from '../../../../icons/delete.svg.js';
|
|
31
|
+
import EditIconPurple from '../../../../icons/edit-purple.svg.js';
|
|
32
|
+
import EditIcon from '../../../../icons/edit.svg.js';
|
|
33
|
+
import FileIconPurple from '../../../../icons/file-purple.svg.js';
|
|
34
|
+
import FileIcon from '../../../../icons/file.svg.js';
|
|
35
|
+
import FilterIconPurple from '../../../../icons/filter-purple.svg.js';
|
|
36
|
+
import FilterIcon from '../../../../icons/filter.svg.js';
|
|
37
|
+
import ImdbIconPurple from '../../../../icons/imdb-purple.svg.js';
|
|
38
|
+
import ImdbIcon from '../../../../icons/imdb.svg.js';
|
|
39
|
+
import InfoIconPurple from '../../../../icons/info-purple.svg.js';
|
|
40
|
+
import InfoIcon from '../../../../icons/info.svg.js';
|
|
41
|
+
import InstagramIconPurple from '../../../../icons/instagram-purple.svg.js';
|
|
42
|
+
import InstagramIcon from '../../../../icons/instagram.svg.js';
|
|
43
|
+
import LinkedInIconPurple from '../../../../icons/linkedin-purple.svg.js';
|
|
44
|
+
import LinkedInIcon from '../../../../icons/linkedin.svg.js';
|
|
45
|
+
import LocationIconPurple from '../../../../icons/location-purple.svg.js';
|
|
46
|
+
import LocationIcon from '../../../../icons/location.svg.js';
|
|
47
|
+
import LogoutIconRed from '../../../../icons/logout-red.svg.js';
|
|
48
|
+
import MailIconPurple from '../../../../icons/message-purple.svg.js';
|
|
49
|
+
import MailIcon from '../../../../icons/message.svg.js';
|
|
50
|
+
import OGIcon from '../../../../icons/og-image.svg.js';
|
|
51
|
+
import OpenIconDisabled from '../../../../icons/open-disabled.svg.js';
|
|
52
|
+
import OpenIconPurple from '../../../../icons/open-purple.svg.js';
|
|
53
|
+
import OpenIcon from '../../../../icons/open.svg.js';
|
|
54
|
+
import OverflowMenuIconPurple from '../../../../icons/overflowmenu-purple.svg.js';
|
|
55
|
+
import OverflowMenuIcon from '../../../../icons/overflowmenu.svg.js';
|
|
56
|
+
import PlayIconPurple from '../../../../icons/play-purple.svg.js';
|
|
57
|
+
import PlayIcon from '../../../../icons/play.svg.js';
|
|
58
|
+
import PlusIconPurple from '../../../../icons/plus-purple.svg.js';
|
|
59
|
+
import PlusIconWhite from '../../../../icons/plus-white.svg.js';
|
|
60
|
+
import PlusIcon from '../../../../icons/plus.svg.js';
|
|
61
|
+
import ProfileIconPurple from '../../../../icons/profile-purple.svg.js';
|
|
62
|
+
import ProfileIcon from '../../../../icons/profile.svg.js';
|
|
63
|
+
import PublishIconDisabled from '../../../../icons/publish-disabled.svg.js';
|
|
64
|
+
import PublishIconPurple from '../../../../icons/publish-purple.svg.js';
|
|
65
|
+
import PublishIcon from '../../../../icons/publish.svg.js';
|
|
66
|
+
import SaveIconPurple from '../../../../icons/save-purple.svg.js';
|
|
67
|
+
import SaveIcon from '../../../../icons/save.svg.js';
|
|
68
|
+
import SearchIconDisabled from '../../../../icons/search-disabled.svg.js';
|
|
69
|
+
import SearchIconPurple from '../../../../icons/search-purple.svg.js';
|
|
70
|
+
import SearchIcon from '../../../../icons/search.svg.js';
|
|
71
|
+
import SettingsIconPurple from '../../../../icons/settings-purple.svg.js';
|
|
72
|
+
import SettingsIcon from '../../../../icons/settings.svg.js';
|
|
73
|
+
import SwitcherIconPurple from '../../../../icons/switcher-purple.svg.js';
|
|
74
|
+
import SwitcherIcon from '../../../../icons/switcher.svg.js';
|
|
75
|
+
import TickIconPurple from '../../../../icons/tick-2-purple.svg.js';
|
|
76
|
+
import TickIcon from '../../../../icons/tick-2.svg.js';
|
|
77
|
+
import TikTokIcon from '../../../../icons/tikTok.svg.js';
|
|
78
|
+
import ViewIconPurple from '../../../../icons/view-purple.svg.js';
|
|
79
|
+
import ViewIcon from '../../../../icons/view.svg.js';
|
|
80
|
+
import VimeoIconPurple from '../../../../icons/vimeo-purple.svg.js';
|
|
81
|
+
import VimeoIcon from '../../../../icons/vimeo.svg.js';
|
|
82
|
+
import WhatsappIconPurple from '../../../../icons/whatsapp-purple.svg.js';
|
|
83
|
+
import WhatsappIcon from '../../../../icons/whatsapp.svg.js';
|
|
84
|
+
import XIconPurple from '../../../../icons/x-purple.svg.js';
|
|
85
|
+
import XIcon from '../../../../icons/x.svg.js';
|
|
86
|
+
import WebIcon from '../../../../icons/web.svg.js';
|
|
87
|
+
import WebIconPurple from '../../../../icons/web-purple.svg.js';
|
|
88
|
+
|
|
89
|
+
const ICONS = {
|
|
90
|
+
switcher: {
|
|
91
|
+
default: SwitcherIcon,
|
|
92
|
+
primary: SwitcherIconPurple,
|
|
93
|
+
},
|
|
94
|
+
tick: {
|
|
95
|
+
default: TickIcon,
|
|
96
|
+
primary: TickIconPurple,
|
|
97
|
+
},
|
|
98
|
+
view: {
|
|
99
|
+
default: ViewIcon,
|
|
100
|
+
primary: ViewIconPurple,
|
|
101
|
+
},
|
|
102
|
+
open: {
|
|
103
|
+
default: OpenIcon,
|
|
104
|
+
primary: OpenIconPurple,
|
|
105
|
+
disabled: OpenIconDisabled,
|
|
106
|
+
},
|
|
107
|
+
burger: {
|
|
108
|
+
default: BurgerIcon,
|
|
109
|
+
primary: BurgerIconPurple,
|
|
110
|
+
},
|
|
111
|
+
burgerClose: {
|
|
112
|
+
default: BurgerCloseIcon,
|
|
113
|
+
primary: BurgerCloseIconPurple,
|
|
114
|
+
},
|
|
115
|
+
catalog: {
|
|
116
|
+
default: CatalogIcon,
|
|
117
|
+
primary: CatalogIconPurple,
|
|
118
|
+
},
|
|
119
|
+
profile: {
|
|
120
|
+
default: ProfileIcon,
|
|
121
|
+
primary: ProfileIconPurple,
|
|
122
|
+
},
|
|
123
|
+
settings: {
|
|
124
|
+
default: SettingsIcon,
|
|
125
|
+
primary: SettingsIconPurple,
|
|
126
|
+
},
|
|
127
|
+
logout: {
|
|
128
|
+
default: LogoutIconRed,
|
|
129
|
+
danger: LogoutIconRed,
|
|
130
|
+
},
|
|
131
|
+
arrowLongLeft: {
|
|
132
|
+
default: ArrowLongLeftIcon,
|
|
133
|
+
primary: ArrowLongLeftIconPurple,
|
|
134
|
+
},
|
|
135
|
+
cross: {
|
|
136
|
+
default: CrossIcon,
|
|
137
|
+
primary: CrossIconPurple,
|
|
138
|
+
},
|
|
139
|
+
copyLink: {
|
|
140
|
+
default: CopyLinkIcon,
|
|
141
|
+
primary: CopyLinkIconPurple,
|
|
142
|
+
disabled: CopyLinkIconDisabled,
|
|
143
|
+
},
|
|
144
|
+
clapper: {
|
|
145
|
+
default: ClapperIcon,
|
|
146
|
+
primary: ClapperIconPurple,
|
|
147
|
+
},
|
|
148
|
+
file: {
|
|
149
|
+
default: FileIcon,
|
|
150
|
+
primary: FileIconPurple,
|
|
151
|
+
},
|
|
152
|
+
delete: {
|
|
153
|
+
default: DeleteIcon,
|
|
154
|
+
danger: DeleteIconRed,
|
|
155
|
+
},
|
|
156
|
+
edit: {
|
|
157
|
+
default: EditIcon,
|
|
158
|
+
primary: EditIconPurple,
|
|
159
|
+
},
|
|
160
|
+
mail: {
|
|
161
|
+
default: MailIcon,
|
|
162
|
+
primary: MailIconPurple,
|
|
163
|
+
},
|
|
164
|
+
behance: {
|
|
165
|
+
default: BehanceIcon,
|
|
166
|
+
primary: BehanceIconPurple,
|
|
167
|
+
},
|
|
168
|
+
imdb: {
|
|
169
|
+
default: ImdbIcon,
|
|
170
|
+
primary: ImdbIconPurple,
|
|
171
|
+
},
|
|
172
|
+
whatsapp: {
|
|
173
|
+
default: WhatsappIcon,
|
|
174
|
+
primary: WhatsappIconPurple,
|
|
175
|
+
},
|
|
176
|
+
vimeo: {
|
|
177
|
+
default: VimeoIcon,
|
|
178
|
+
primary: VimeoIconPurple,
|
|
179
|
+
},
|
|
180
|
+
instagram: {
|
|
181
|
+
default: InstagramIcon,
|
|
182
|
+
primary: InstagramIconPurple,
|
|
183
|
+
},
|
|
184
|
+
x: {
|
|
185
|
+
default: XIcon,
|
|
186
|
+
primary: XIconPurple,
|
|
187
|
+
},
|
|
188
|
+
tikTok: {
|
|
189
|
+
default: TikTokIcon,
|
|
190
|
+
},
|
|
191
|
+
linkedin: {
|
|
192
|
+
default: LinkedInIcon,
|
|
193
|
+
primary: LinkedInIconPurple,
|
|
194
|
+
},
|
|
195
|
+
ogIcon: {
|
|
196
|
+
default: OGIcon,
|
|
197
|
+
},
|
|
198
|
+
filter: {
|
|
199
|
+
default: FilterIcon,
|
|
200
|
+
primary: FilterIconPurple,
|
|
201
|
+
},
|
|
202
|
+
location: {
|
|
203
|
+
default: LocationIcon,
|
|
204
|
+
primary: LocationIconPurple,
|
|
205
|
+
},
|
|
206
|
+
calendar: {
|
|
207
|
+
default: CalendarIcon,
|
|
208
|
+
primary: CalendarIconPurple,
|
|
209
|
+
},
|
|
210
|
+
clock: {
|
|
211
|
+
default: ClockIcon,
|
|
212
|
+
primary: ClockIconPurple,
|
|
213
|
+
},
|
|
214
|
+
plus: {
|
|
215
|
+
default: PlusIcon,
|
|
216
|
+
primary: PlusIconPurple,
|
|
217
|
+
white: PlusIconWhite,
|
|
218
|
+
},
|
|
219
|
+
clapperManage: {
|
|
220
|
+
default: ClapperManageIcon,
|
|
221
|
+
primary: ClapperManageIconPurple,
|
|
222
|
+
},
|
|
223
|
+
save: {
|
|
224
|
+
default: SaveIcon,
|
|
225
|
+
primary: SaveIconPurple,
|
|
226
|
+
},
|
|
227
|
+
publish: {
|
|
228
|
+
default: PublishIcon,
|
|
229
|
+
primary: PublishIconPurple,
|
|
230
|
+
disabled: PublishIconDisabled,
|
|
231
|
+
},
|
|
232
|
+
overflowmenu: {
|
|
233
|
+
default: OverflowMenuIcon,
|
|
234
|
+
primary: OverflowMenuIconPurple,
|
|
235
|
+
},
|
|
236
|
+
applicants: {
|
|
237
|
+
default: ApplicantsIcon,
|
|
238
|
+
primary: ApplicantsIconPurple,
|
|
239
|
+
disabled: ApplicantsIconDisabled,
|
|
240
|
+
},
|
|
241
|
+
search: {
|
|
242
|
+
default: SearchIcon,
|
|
243
|
+
primary: SearchIconPurple,
|
|
244
|
+
disabled: SearchIconDisabled,
|
|
245
|
+
},
|
|
246
|
+
info: {
|
|
247
|
+
default: InfoIcon,
|
|
248
|
+
primary: InfoIconPurple,
|
|
249
|
+
},
|
|
250
|
+
play: {
|
|
251
|
+
default: PlayIcon,
|
|
252
|
+
primary: PlayIconPurple,
|
|
253
|
+
},
|
|
254
|
+
web: {
|
|
255
|
+
default: WebIcon,
|
|
256
|
+
primary: WebIconPurple,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
function Icon({ name, variant = 'default', size = 18, className, alt = '', style, ...rest }) {
|
|
260
|
+
const config = ICONS[name];
|
|
261
|
+
const src = (variant === 'primary' && config.primary) ||
|
|
262
|
+
(variant === 'white' && config.white) ||
|
|
263
|
+
(variant === 'danger' && config.danger) ||
|
|
264
|
+
(variant === 'disabled' && config.disabled) ||
|
|
265
|
+
config.default;
|
|
266
|
+
const finalStyle = {
|
|
267
|
+
width: size,
|
|
268
|
+
height: size,
|
|
269
|
+
...style,
|
|
270
|
+
};
|
|
271
|
+
const hasCustomCursor = /\bcursor-[^\s]+\b/.test(className ?? '');
|
|
272
|
+
const finalClassName = clsx('inline-block', variant === 'disabled' ? 'cursor-not-allowed' : !hasCustomCursor && 'cursor-pointer', className);
|
|
273
|
+
return jsx("img", { src: src, alt: alt, className: finalClassName, style: finalStyle, ...rest });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export { Icon };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
const EditIcon = () => (jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.6123 3.33644L4.69868 10.25C4.60082 10.3486 4.53297 10.4729 4.50511 10.6086L3.44296 15.6694C3.39368 15.9044 3.46582 16.1486 3.63511 16.3186C3.80368 16.4894 4.04725 16.5636 4.28225 16.5165L9.38442 15.4965C9.52299 15.4686 9.65013 15.4008 9.74942 15.3008L16.663 8.38718L11.6123 3.33644ZM12.6223 2.32644L17.673 7.37718L18.9537 6.09717C20.3488 4.70216 20.3488 2.44072 18.9537 1.04572C18.2837 0.37643 17.3759 0 16.4287 0C15.4809 0 14.573 0.37643 13.903 1.04572L12.6223 2.32644Z", fill: "#070707" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.07143 20.0001H18.2144C18.8058 20.0001 19.2858 19.5201 19.2858 18.9287C19.2858 18.3372 18.8058 17.8572 18.2144 17.8572H1.07143C0.480002 17.8572 0 18.3372 0 18.9287C0 19.5201 0.480002 20.0001 1.07143 20.0001Z", fill: "#070707" })] }));
|
|
4
|
+
|
|
5
|
+
export { EditIcon as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
const Logo = ({ horizontal, text, imageSrc, imageSize = 40, className }) => {
|
|
5
|
+
return (jsxs("div", { className: clsx(`flex ${horizontal ? 'flex-row' : 'flex-col'} gap-[10px] items-center justify-center cursor-pointer`, className), children: [imageSrc && (jsx("img", { src: imageSrc, alt: text, width: `${horizontal ? 40 : imageSize}`, height: imageSize, className: "object-contain" })), jsx("span", { className: `${horizontal ? 'text-sm' : 'text-base'} font-bold`, children: text })] }));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Logo as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function Spinner({ color, strokeWidth = 2, className = 'h-9 w-9', ariaLabel = 'Loading...', arc = 0.65, speedMs = 1300, }) {
|
|
4
|
+
const style = {
|
|
5
|
+
...(color ? { color } : {}),
|
|
6
|
+
animationDuration: `${speedMs}ms`,
|
|
7
|
+
};
|
|
8
|
+
const r = 9;
|
|
9
|
+
const C = 2 * Math.PI * r;
|
|
10
|
+
const visible = Math.max(0, Math.min(1, arc)) * C;
|
|
11
|
+
const gap = C - visible;
|
|
12
|
+
return (jsxs("span", { role: "status", "aria-live": "polite", "aria-label": ariaLabel, className: `inline-flex items-center justify-center ${className}`, style: style, children: [jsx("svg", { className: "animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "aria-hidden": "true", children: jsx("circle", { cx: "12", cy: "12", r: r, stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeDasharray: `${visible} ${gap}`, strokeDashoffset: C * 0.25 }) }), jsx("span", { className: "sr-only", children: ariaLabel })] }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Spinner as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../../../Brand/Identity/Icon/Icon.js';
|
|
3
|
+
|
|
4
|
+
function Chip({ label, onRemove, newItem = false }) {
|
|
5
|
+
return (jsxs("span", { className: [
|
|
6
|
+
'flex items-center gap-[6px] rounded-xl border px-3 py-1 lg:text-[14px]',
|
|
7
|
+
newItem
|
|
8
|
+
? 'font-semibold bg-(--color-secondary-white) border-(--color-primary-purple) text-(--color-primary-purple)'
|
|
9
|
+
: 'bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)',
|
|
10
|
+
].join(' '), children: [jsx("p", { className: "text-sm", children: label }), onRemove && jsx(Icon, { name: "cross", variant: "primary", size: 11, onClick: onRemove })] }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Chip as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function StatusChip({ label, dotColor, variant = 'bordered', align = 'inline', className, }) {
|
|
4
|
+
const baseClasses = 'inline-flex items-center gap-2';
|
|
5
|
+
const borderedClasses = 'rounded-xl border px-3 py-1 bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)';
|
|
6
|
+
const inlineClasses = 'text-(--color-primary-black)';
|
|
7
|
+
const alignClasses = align === 'spaced' ? 'w-full justify-between' : '';
|
|
8
|
+
return (jsxs("span", { className: [
|
|
9
|
+
baseClasses,
|
|
10
|
+
alignClasses,
|
|
11
|
+
variant === 'bordered' ? borderedClasses : inlineClasses,
|
|
12
|
+
className ?? '',
|
|
13
|
+
].join(' '), children: [jsx("span", { className: "text-sm", children: label }), dotColor ? (jsx("span", { className: "inline-block h-4 w-4 shrink-0 rounded-full", style: { background: dotColor }, "aria-hidden": "true" })) : null] }));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { StatusChip as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMemo, Children, isValidElement, useState, cloneElement } from 'react';
|
|
2
|
+
|
|
3
|
+
function Wizard({ children }) {
|
|
4
|
+
const steps = useMemo(() => Children.toArray(children).filter(isValidElement), [children]);
|
|
5
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
6
|
+
const totalSteps = steps.length;
|
|
7
|
+
const progress = totalSteps === 0 ? 0 : ((activeIndex + 1) / totalSteps) * 100;
|
|
8
|
+
const goNext = () => setActiveIndex((prev) => Math.min(prev + 1, totalSteps - 1));
|
|
9
|
+
const goBack = () => setActiveIndex((prev) => Math.max(prev - 1, 0));
|
|
10
|
+
const injectedProps = {
|
|
11
|
+
stepIndex: activeIndex,
|
|
12
|
+
totalSteps,
|
|
13
|
+
progress,
|
|
14
|
+
goNext,
|
|
15
|
+
goBack,
|
|
16
|
+
};
|
|
17
|
+
const CurrentStep = steps[activeIndex];
|
|
18
|
+
return cloneElement(CurrentStep, injectedProps);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Wizard as default };
|