@economic/taco 1.23.0 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Header/Header.d.ts +28 -0
- package/dist/components/Header/components/AgreementSelector.d.ts +18 -0
- package/dist/components/Header/components/Agreements/AgreementDetails.d.ts +20 -0
- package/dist/components/Header/components/Button.d.ts +11 -0
- package/dist/components/Header/components/Link.d.ts +21 -0
- package/dist/components/Header/components/Logo.d.ts +3 -0
- package/dist/components/Header/components/MenuButton.d.ts +5 -0
- package/dist/components/Header/components/PrimaryNavigation.d.ts +3 -0
- package/dist/components/Header/components/SecondaryNavigation.d.ts +3 -0
- package/dist/components/Layout/Layout.d.ts +16 -0
- package/dist/components/Layout/components/Content.d.ts +3 -0
- package/dist/components/Layout/components/Context.d.ts +6 -0
- package/dist/components/Layout/components/Page.d.ts +3 -0
- package/dist/components/Layout/components/Sidebar.d.ts +3 -0
- package/dist/components/Layout/components/Top.d.ts +7 -0
- package/dist/components/Navigation2/Navigation2.d.ts +17 -0
- package/dist/components/Navigation2/components/Content.d.ts +3 -0
- package/dist/components/Navigation2/components/Group.d.ts +9 -0
- package/dist/components/Navigation2/components/Link.d.ts +24 -0
- package/dist/components/Navigation2/components/Section.d.ts +7 -0
- package/dist/components/Provider/Localization.d.ts +27 -17
- package/dist/esm/packages/taco/src/components/Card/Card.js +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/Header.js +30 -0
- package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +134 -0
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js +73 -0
- package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +23 -0
- package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +48 -0
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js +73 -0
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +16 -0
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +134 -0
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +13 -0
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/Layout.js +28 -0
- package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js +13 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js +9 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js +13 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +83 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js +15 -0
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +31 -0
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +19 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +46 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +71 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +24 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -11
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +4 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +3 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +6 -0
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -0
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +18 -0
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -0
- package/dist/esm/packages/taco/src/index.js +9 -0
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/Collection.js +3 -0
- package/dist/esm/packages/taco/src/primitives/Collection/Collection.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +4 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +1 -0
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/hooks/useIsLargeScreen.d.ts +1 -0
- package/dist/hooks/useMatchMedia.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/taco.cjs.development.js +809 -17
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/types.json +538 -101
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -26
- package/dist/components/Alert/Alert.stories.d.ts +0 -36
- package/dist/components/AlertDialog/AlertDialog.stories.d.ts +0 -10
- package/dist/components/Backdrop/Backdrop.stories.d.ts +0 -7
- package/dist/components/BadgeIcon/BadgeIcon.stories.d.ts +0 -12
- package/dist/components/Banner/Banner.stories.d.ts +0 -5
- package/dist/components/Button/Button.stories.d.ts +0 -77
- package/dist/components/Calendar/Calendar.stories.d.ts +0 -13
- package/dist/components/Card/Card.stories.d.ts +0 -12
- package/dist/components/Datepicker/Datepicker.stories.d.ts +0 -43
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -57
- package/dist/components/Field/Field.stories.d.ts +0 -14
- package/dist/components/Form/Form.stories.d.ts +0 -14
- package/dist/components/Group/Group.stories.d.ts +0 -23
- package/dist/components/Hanger/Hanger.stories.d.ts +0 -11
- package/dist/components/HoverCard/HoverCard.stories.d.ts +0 -16
- package/dist/components/Icon/Icon.stories.d.ts +0 -8
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -12
- package/dist/components/Input/Input.stories.d.ts +0 -17
- package/dist/components/Listbox/Listbox.stories.d.ts +0 -44
- package/dist/components/Menu/Menu.stories.d.ts +0 -73
- package/dist/components/Navigation/Navigation.stories.d.ts +0 -7
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -28
- package/dist/components/Popover/Popover.stories.d.ts +0 -29
- package/dist/components/Progress/Progress.stories.d.ts +0 -9
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -49
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts +0 -8
- package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -38
- package/dist/components/Select/Select.stories.d.ts +0 -35
- package/dist/components/Select2/Select2.stories.d.ts +0 -57
- package/dist/components/Spinner/Spinner.stories.d.ts +0 -15
- package/dist/components/Table/Table.stories.d.ts +0 -32
- package/dist/components/Table2/Table2.stories.d.ts +0 -48
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -19
- package/dist/components/Tag/Tag.stories.d.ts +0 -9
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -40
- package/dist/components/Toast/Toast.stories.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -26
- package/dist/components/Tour/Tour.stories.d.ts +0 -11
- package/dist/css/Typography.stories.d.ts +0 -6
- package/dist/hooks/useIsRefOverflowing.d.ts +0 -2
- package/dist/primitives/Collection/Collection.stories.d.ts +0 -8
- package/dist/primitives/Listbox2/Listbox2.stories.d.ts +0 -16
- package/dist/primitives/Sortable/Sortable.stories.d.ts +0 -14
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Button } from './components/Button';
|
3
|
+
import { Link } from './components/Link';
|
4
|
+
import { Logo } from './components/Logo';
|
5
|
+
import { PrimaryNavigation } from './components/PrimaryNavigation';
|
6
|
+
import { SecondaryNavigation } from './components/SecondaryNavigation';
|
7
|
+
import { MenuButton } from './components/MenuButton';
|
8
|
+
import { AgreementDisplay, AgreementSelector } from './components/AgreementSelector';
|
9
|
+
export declare type HeaderTexts = {
|
10
|
+
addAgreement: string;
|
11
|
+
logout: string;
|
12
|
+
more: string;
|
13
|
+
new: string;
|
14
|
+
search: string;
|
15
|
+
};
|
16
|
+
declare type HeaderProps = React.HTMLAttributes<HTMLElement>;
|
17
|
+
export declare type ForwardedHeaderWithStatics = React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLDivElement>> & {
|
18
|
+
AgreementDisplay: typeof AgreementDisplay;
|
19
|
+
AgreementSelector: typeof AgreementSelector;
|
20
|
+
Button: typeof Button;
|
21
|
+
Link: typeof Link;
|
22
|
+
Logo: typeof Logo;
|
23
|
+
PrimaryNavigation: typeof PrimaryNavigation;
|
24
|
+
SecondaryNavigation: typeof SecondaryNavigation;
|
25
|
+
MenuButton: typeof MenuButton;
|
26
|
+
};
|
27
|
+
export declare const Header: ForwardedHeaderWithStatics;
|
28
|
+
export {};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Agreement } from './Agreements/AgreementDetails';
|
3
|
+
export declare type AgreementDisplayProps = React.HTMLAttributes<HTMLDivElement> & {
|
4
|
+
currentAgreement: Agreement;
|
5
|
+
fallbackImageSrc: string;
|
6
|
+
};
|
7
|
+
export declare function AgreementDisplay(props: AgreementDisplayProps): JSX.Element;
|
8
|
+
export declare type AgreementSelectorProps = AgreementDisplayProps & {
|
9
|
+
agreements: Agreement[];
|
10
|
+
filterAgreement: (agreement: Agreement, filter: (agreement: Agreement) => boolean) => void;
|
11
|
+
filterClientAgreement: (agreement: Agreement, filter: (agreement: Agreement) => boolean) => void;
|
12
|
+
onAddAgreement?: () => void;
|
13
|
+
onChangeAgreement: (agreement: Agreement) => void;
|
14
|
+
onLogout: () => void;
|
15
|
+
open?: boolean;
|
16
|
+
setOpen?: (open: boolean) => void;
|
17
|
+
};
|
18
|
+
export declare function AgreementSelector(props: AgreementSelectorProps): JSX.Element;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare type Agreement = {
|
3
|
+
adminAgreementNumber?: number;
|
4
|
+
number: number;
|
5
|
+
name: string;
|
6
|
+
userId: string;
|
7
|
+
clients?: Agreement[];
|
8
|
+
favorite?: boolean;
|
9
|
+
imageSrc?: string;
|
10
|
+
isAdministrator?: boolean;
|
11
|
+
isDeveloper?: boolean;
|
12
|
+
statuses?: any[];
|
13
|
+
secure: boolean;
|
14
|
+
};
|
15
|
+
export declare type AgreementDetailsProps = Agreement & {
|
16
|
+
children?: JSX.Element | null;
|
17
|
+
className?: string;
|
18
|
+
fallbackImageSrc: string;
|
19
|
+
};
|
20
|
+
export declare const AgreementDetails: (props: AgreementDetailsProps) => JSX.Element;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IconButtonProps } from '../../IconButton/IconButton';
|
3
|
+
export declare type ButtonProps = Omit<IconButtonProps, 'appearance' | 'aria-label'> & {
|
4
|
+
as?: string;
|
5
|
+
'aria-label': string;
|
6
|
+
};
|
7
|
+
export declare const Button: React.ForwardRefExoticComponent<Pick<IconButtonProps, "autoFocus" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "dialog" | "hanger" | "icon" | "menu" | "popover" | "rounded" | "tooltip"> & {
|
8
|
+
as?: string | undefined;
|
9
|
+
'aria-label': string;
|
10
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
11
|
+
export declare const getButtonClasses: () => string;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IconName } from '../../Icon/Icon';
|
3
|
+
export declare type BaseLinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
4
|
+
as?: string;
|
5
|
+
tooltip?: string;
|
6
|
+
};
|
7
|
+
interface LinkPropsWithoutIcon extends BaseLinkProps {
|
8
|
+
children: JSX.Element | string;
|
9
|
+
icon?: never;
|
10
|
+
isNew?: never;
|
11
|
+
}
|
12
|
+
interface LinkPropsWithIcon extends Omit<BaseLinkProps, 'aria-label'> {
|
13
|
+
'aria-label': string;
|
14
|
+
children?: never;
|
15
|
+
icon: IconName;
|
16
|
+
isNew?: boolean;
|
17
|
+
}
|
18
|
+
export declare type LinkProps = LinkPropsWithoutIcon | LinkPropsWithIcon;
|
19
|
+
export declare const Link: React.ForwardRefExoticComponent<(LinkPropsWithoutIcon & React.RefAttributes<HTMLAnchorElement>) | (LinkPropsWithIcon & React.RefAttributes<HTMLAnchorElement>)>;
|
20
|
+
export declare const getLinkClasses: (icon?: IconName | undefined) => string;
|
21
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Content } from './components/Content';
|
3
|
+
import { Sidebar } from './components/Sidebar';
|
4
|
+
import { Top } from './components/Top';
|
5
|
+
import { Page } from './components/Page';
|
6
|
+
export declare type LayoutProps = React.HTMLAttributes<HTMLDivElement>;
|
7
|
+
export declare const Layout: React.ForwardRefExoticComponent<LayoutProps> & {
|
8
|
+
Top: typeof Top;
|
9
|
+
Page: typeof Page;
|
10
|
+
Sidebar: typeof Sidebar;
|
11
|
+
Content: typeof Content;
|
12
|
+
};
|
13
|
+
export type { LayoutContentProps } from './components/Content';
|
14
|
+
export type { LayoutPageProps } from './components/Page';
|
15
|
+
export type { LayoutSidebarProps } from './components/Sidebar';
|
16
|
+
export type { LayoutTopProps } from './components/Top';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare type LayoutTopProps = {
|
3
|
+
children: React.ReactNode | React.ReactNode[] | (({ toggleSidebar }: {
|
4
|
+
toggleSidebar: any;
|
5
|
+
}) => React.ReactNode | React.ReactNode[]);
|
6
|
+
};
|
7
|
+
export declare const Top: (props: LayoutTopProps) => any;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Group } from './components/Group';
|
3
|
+
import { Link } from './components/Link';
|
4
|
+
import { Section } from './components/Section';
|
5
|
+
import { Content } from './components/Content';
|
6
|
+
export declare type Navigation2Props = React.HTMLAttributes<HTMLUListElement>;
|
7
|
+
export declare const Navigation2: React.ForwardRefExoticComponent<Navigation2Props> & {
|
8
|
+
Group: typeof Group;
|
9
|
+
Link: typeof Link;
|
10
|
+
Section: typeof Section;
|
11
|
+
Content: typeof Content;
|
12
|
+
};
|
13
|
+
export { getNavigationLinkClasses } from './components/Link';
|
14
|
+
export type { Navigation2ContentProps } from './components/Content';
|
15
|
+
export type { Navigation2GroupProps } from './components/Group';
|
16
|
+
export type { Navigation2LinkProps } from './components/Link';
|
17
|
+
export type { Navigation2SectionProps } from './components/Section';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare type Navigation2GroupProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
3
|
+
defaultExpanded?: boolean;
|
4
|
+
heading: string | JSX.Element;
|
5
|
+
};
|
6
|
+
export declare const Group: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
7
|
+
defaultExpanded?: boolean | undefined;
|
8
|
+
heading: string | JSX.Element;
|
9
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IconName } from '../../Icon/Icon';
|
3
|
+
import { MenuProps } from '../../Menu/Menu';
|
4
|
+
export declare const getNavigationLinkClasses: (isDraggedOver?: boolean) => string;
|
5
|
+
export declare type Navigation2LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
6
|
+
active?: boolean;
|
7
|
+
icon?: IconName;
|
8
|
+
/** Menu component associated with the button. */
|
9
|
+
menu?: (props: Partial<MenuProps>) => JSX.Element;
|
10
|
+
/** Handler to be used when dropping a dragged element over the Navigation2 link */
|
11
|
+
onDrop?: React.DragEventHandler;
|
12
|
+
/** Total shown inside a Badge component */
|
13
|
+
total?: number;
|
14
|
+
};
|
15
|
+
export declare const Link: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
16
|
+
active?: boolean | undefined;
|
17
|
+
icon?: "account-preview" | "accounting-year-cancel" | "accounting-year" | "accounting" | "arrow-bottom" | "arrow-down" | "arrow-end" | "arrow-left" | "arrow-right" | "arrow-start" | "arrow-top" | "arrow-up" | "attach-auto" | "attach-cancel" | "attach" | "autotext-insert" | "autotext" | "basic-tabs" | "basic" | "bell-solid" | "book" | "booking" | "budget" | "calendar" | "cash-account" | "cash-reports" | "chat-solid" | "chat" | "chevron-down-double" | "chevron-down-solid" | "chevron-down" | "chevron-left-double" | "chevron-left-solid" | "chevron-left" | "chevron-right-double" | "chevron-right-solid" | "chevron-right" | "chevron-up-double" | "chevron-up-solid" | "chevron-up" | "circle-close" | "circle-minus" | "circle-plus" | "circle-tick" | "clamp-open" | "clamp" | "close" | "columns" | "connection-enable" | "connection-revoke" | "contacts" | "copy" | "courses" | "credit" | "delete-permanently" | "delete" | "density-comfortable" | "density-compact" | "density-normal" | "density-spacious" | "depecriate" | "developer" | "distribution-template" | "document-approve" | "document-create-entry" | "document-cut" | "document-error" | "document-isolate-page" | "document-merge" | "document-move" | "document-preview" | "document-received" | "document-rejected-request" | "document-split" | "document-time" | "document" | "download" | "drag" | "e-copedia" | "e-signature" | "edit" | "ellipsis-horizontal" | "ellipsis-vertical" | "entries-on-account" | "entries-open" | "entries-warning" | "entry-type-customer-invoice" | "entry-type-customer-payment" | "entry-type-journal-entry" | "entry-type-manual-customer-invoice" | "entry-type-supplier-invoice" | "entry-type-supplier-payment" | "envelope-approved" | "envelope" | "expand-view" | "expenses" | "export-to-excel" | "export-to-pdf" | "export" | "filter-solid" | "filter" | "graph-solid" | "hash" | "home" | "images" | "import" | "inbox-einvoicing" | "inbox-scanning" | "inbox-smart" | "inbox" | "info" | "inventory-matrix" | "inventory" | "journal-pro" | "layout-both" | "layout-first" | "layout-last" | "layout-none" | "layout" | "ledger-card-customer-reminder" | "ledger-card-manual-customer-invoice" | "ledger-card-obsolete-stock" | "ledger-card-opening-entry" | "ledger-card-reserved-entry" | "ledger-card-shrinkage-pilferage" | "ledger-card-stock-adjustment" | "ledger-card-transferred-opening-entry" | "ledger-card" | "lightbulb" | "line" | "list-bulleted" | "list-search" | "list" | "lock-open" | "log-out" | "log" | "market" | "match-amount" | "match-entries" | "menu" | "mileage" | "modal-resize" | "modal-shrink" | "more-solid" | "more" | "move" | "navigation-list" | "note-follow-up" | "note-read" | "note" | "numbers" | "partner-api" | "period" | "person-change" | "person-minus" | "person-plus" | "person-tick" | "play" | "plus-minus" | "print" | "process-payment" | "product-ledger-card" | "profile" | "project-cards" | "projects" | "quicklinks" | "rating-bankruptcy" | "rating-payment-problems" | "reconciled" | "refresh" | "report-solid" | "report" | "restore" | "rotate-left" | "rotate-right" | "sales" | "search-bold" | "search" | "secure-tick" | "secure" | "settings-solid" | "settings" | "shortcuts" | "show-all" | "show-less" | "show-more" | "show-template" | "sliders" | "smartpay" | "sort-by" | "star-solid" | "star" | "subscriptions" | "system-entries" | "tag" | "template-override" | "templates" | "thumb-both" | "thumb-down-solid" | "thumb-down" | "thumb-up-solid" | "thumb-up" | "tick-bold" | "tick" | "time" | "transfer-cancel" | "transfer-locked" | "transfer" | "undo" | "undock" | "unreconciled" | "warning" | "webshop" | "website" | "workflow" | "zoom" | undefined;
|
18
|
+
/** Menu component associated with the button. */
|
19
|
+
menu?: ((props: Partial<MenuProps>) => JSX.Element) | undefined;
|
20
|
+
/** Handler to be used when dropping a dragged element over the Navigation2 link */
|
21
|
+
onDrop?: ((event: React.DragEvent<Element>) => void) | undefined;
|
22
|
+
/** Total shown inside a Badge component */
|
23
|
+
total?: number | undefined;
|
24
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare type Navigation2SectionProps = React.LiHTMLAttributes<HTMLLIElement> & {
|
3
|
+
heading?: string;
|
4
|
+
};
|
5
|
+
export declare const Section: React.ForwardRefExoticComponent<React.LiHTMLAttributes<HTMLLIElement> & {
|
6
|
+
heading?: string | undefined;
|
7
|
+
} & React.RefAttributes<HTMLLIElement>>;
|
@@ -7,6 +7,7 @@ import { PaginationTexts } from '../Pagination/Pagination';
|
|
7
7
|
import { ListboxTexts } from '../Listbox/Listbox';
|
8
8
|
import { ToastsTexts } from '../Toast/Toast';
|
9
9
|
import { DatepickerTexts } from '../Datepicker/Datepicker';
|
10
|
+
import { HeaderTexts } from '../Header/Header';
|
10
11
|
import { HangerTexts } from '../Hanger/Hanger';
|
11
12
|
import { SelectTexts } from '../Select/Select';
|
12
13
|
import { TourTexts } from '../Tour/Tour';
|
@@ -16,26 +17,30 @@ import { SearchInputTexts } from '../SearchInput/SearchInput';
|
|
16
17
|
import { Select2Texts } from '../Select2/Select2';
|
17
18
|
import { BannerTexts } from '../Banner/Banner';
|
18
19
|
export declare type LocalizationTexts = {
|
20
|
+
/** Localized texts and aria-labels for [Banner](component:banner) component */
|
21
|
+
banner: BannerTexts;
|
19
22
|
/** Localized texts and aria-labels for [Calendar](component:calendar) component */
|
20
23
|
calendar: CalendarTexts;
|
21
24
|
/** Localized texts and aria-labels for [Combobox](component:combobox) component */
|
22
25
|
combobox: ComboboxTexts;
|
23
26
|
/** Localized texts and aria-labels for [DatePicker](component:datepicker) component */
|
24
27
|
datepicker: DatepickerTexts;
|
28
|
+
/** Localized texts and aria-labels for [Dialog](component:dialog) component */
|
29
|
+
dialog: DialogTexts;
|
25
30
|
/** Localized texts and aria-labels for [Hanger](component:hanger) component */
|
26
31
|
hanger: HangerTexts;
|
27
|
-
/** Localized texts and aria-labels for [
|
28
|
-
|
32
|
+
/** Localized texts and aria-labels for [Header](component:header) component */
|
33
|
+
header: HeaderTexts;
|
29
34
|
/** Localized texts and aria-labels for [Listbox](component:listbox) component */
|
30
35
|
listbox: ListboxTexts;
|
31
|
-
/** Localized texts and aria-labels for [Dialog](component:dialog) component */
|
32
|
-
dialog: DialogTexts;
|
33
36
|
/** Localized texts and aria-labels for [Pagination](component:pagination) component */
|
34
37
|
pagination: PaginationTexts;
|
35
38
|
/** Localized texts and aria-labels for [Table](component:table) component */
|
36
39
|
table: TableTexts;
|
37
40
|
/** Localized texts and aria-labels for [Table2](component:table2) component */
|
38
41
|
table2: Table2Texts;
|
42
|
+
/** Localized texts and aria-labels for [SearchInput](component:searchinput) component */
|
43
|
+
searchInput: SearchInputTexts;
|
39
44
|
/** Localized texts and aria-labels for [Select](component:select) component */
|
40
45
|
select: SelectTexts;
|
41
46
|
/** Localized texts and aria-labels for [Select2](component:select2) component */
|
@@ -44,8 +49,6 @@ export declare type LocalizationTexts = {
|
|
44
49
|
toasts: ToastsTexts;
|
45
50
|
/** Localized texts and aria-labels for [Tour](component:tour) component */
|
46
51
|
tour: TourTexts;
|
47
|
-
/** Localized texts and aria-labels for [SearchInput](component:searchinput) component */
|
48
|
-
searchInput: SearchInputTexts;
|
49
52
|
};
|
50
53
|
export declare type Localization = {
|
51
54
|
/**
|
@@ -62,6 +65,9 @@ export declare type Localization = {
|
|
62
65
|
};
|
63
66
|
};
|
64
67
|
export declare const defaultLocalisationTexts: {
|
68
|
+
banner: {
|
69
|
+
close: string;
|
70
|
+
};
|
65
71
|
calendar: {
|
66
72
|
months: string[];
|
67
73
|
weekdaysShort: string[];
|
@@ -82,21 +88,25 @@ export declare const defaultLocalisationTexts: {
|
|
82
88
|
expand: string;
|
83
89
|
shortcuts: string;
|
84
90
|
};
|
85
|
-
|
91
|
+
dialog: {
|
86
92
|
close: string;
|
93
|
+
drag: string;
|
87
94
|
};
|
88
|
-
|
95
|
+
hanger: {
|
89
96
|
close: string;
|
90
97
|
};
|
98
|
+
header: {
|
99
|
+
addAgreement: string;
|
100
|
+
logout: string;
|
101
|
+
more: string;
|
102
|
+
new: string;
|
103
|
+
search: string;
|
104
|
+
};
|
91
105
|
listbox: {
|
92
106
|
loading: string;
|
93
107
|
empty: string;
|
94
108
|
allOption: string;
|
95
109
|
};
|
96
|
-
dialog: {
|
97
|
-
close: string;
|
98
|
-
drag: string;
|
99
|
-
};
|
100
110
|
pagination: {
|
101
111
|
label: string;
|
102
112
|
pageSize: string;
|
@@ -207,6 +217,11 @@ export declare const defaultLocalisationTexts: {
|
|
207
217
|
collapseRow: string;
|
208
218
|
};
|
209
219
|
};
|
220
|
+
searchInput: {
|
221
|
+
button: string;
|
222
|
+
placeholder: string;
|
223
|
+
clear: string;
|
224
|
+
};
|
210
225
|
select: {
|
211
226
|
allOptionsSelected: string;
|
212
227
|
};
|
@@ -232,11 +247,6 @@ export declare const defaultLocalisationTexts: {
|
|
232
247
|
next: string;
|
233
248
|
open: string;
|
234
249
|
};
|
235
|
-
searchInput: {
|
236
|
-
button: string;
|
237
|
-
placeholder: string;
|
238
|
-
clear: string;
|
239
|
-
};
|
240
250
|
};
|
241
251
|
export declare const LocalizationContext: React.Context<Localization>;
|
242
252
|
export interface LocalizationProviderProps {
|
@@ -21,7 +21,7 @@ const Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
|
|
21
21
|
menu,
|
22
22
|
children
|
23
23
|
} = props;
|
24
|
-
const className = cn('bg-white flex flex-col rounded-xl
|
24
|
+
const className = cn('bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500', props.className);
|
25
25
|
return /*#__PURE__*/createElement("div", {
|
26
26
|
className: className,
|
27
27
|
"data-taco": "card",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mt-4 mb-2 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;AAUA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAW,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAI,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,kHAAkH,EAClHF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import cn from 'classnames';
|
3
|
+
import { Button } from './components/Button.js';
|
4
|
+
import { Link } from './components/Link.js';
|
5
|
+
import { Logo } from './components/Logo.js';
|
6
|
+
import { PrimaryNavigation } from './components/PrimaryNavigation.js';
|
7
|
+
import { SecondaryNavigation } from './components/SecondaryNavigation.js';
|
8
|
+
import { MenuButton } from './components/MenuButton.js';
|
9
|
+
import { AgreementDisplay, AgreementSelector } from './components/AgreementSelector.js';
|
10
|
+
|
11
|
+
const Header = /*#__PURE__*/React__default.forwardRef(function Header(props, ref) {
|
12
|
+
const className = cn('bg-blue-900 flex h-16 w-full shrink-0 items-center gap-4 pl-2', '[&>a:focus-visible]:yt-focus-dark [&>a]:px-2 [&>a]:rounded [&>a]:h-[calc(100%-14px)]',
|
13
|
+
// styles for logo wrapped inside an anchor
|
14
|
+
props.className);
|
15
|
+
return /*#__PURE__*/React__default.createElement("header", Object.assign({}, props, {
|
16
|
+
className: className,
|
17
|
+
ref: ref
|
18
|
+
}));
|
19
|
+
});
|
20
|
+
Header.AgreementDisplay = AgreementDisplay;
|
21
|
+
Header.AgreementSelector = AgreementSelector;
|
22
|
+
Header.Button = Button;
|
23
|
+
Header.Link = Link;
|
24
|
+
Header.Logo = Logo;
|
25
|
+
Header.PrimaryNavigation = PrimaryNavigation;
|
26
|
+
Header.SecondaryNavigation = SecondaryNavigation;
|
27
|
+
Header.MenuButton = MenuButton;
|
28
|
+
|
29
|
+
export { Header };
|
30
|
+
//# sourceMappingURL=Header.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../../../src/components/Header/Header.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Button } from './components/Button';\nimport { Link } from './components/Link';\nimport { Logo } from './components/Logo';\nimport { PrimaryNavigation } from './components/PrimaryNavigation';\nimport { SecondaryNavigation } from './components/SecondaryNavigation';\nimport { MenuButton } from './components/MenuButton';\nimport { AgreementDisplay, AgreementSelector } from './components/AgreementSelector';\n\nexport type HeaderTexts = {\n addAgreement: string;\n logout: string;\n more: string;\n new: string;\n search: string;\n};\n\ntype HeaderProps = React.HTMLAttributes<HTMLElement>;\n\nexport type ForwardedHeaderWithStatics = React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLDivElement>> & {\n AgreementDisplay: typeof AgreementDisplay;\n AgreementSelector: typeof AgreementSelector;\n Button: typeof Button;\n Link: typeof Link;\n Logo: typeof Logo;\n PrimaryNavigation: typeof PrimaryNavigation;\n SecondaryNavigation: typeof SecondaryNavigation;\n MenuButton: typeof MenuButton;\n};\n\nexport const Header = React.forwardRef<HTMLDivElement, HeaderProps>(function Header(props, ref) {\n const className = cn(\n 'bg-blue-900 flex h-16 w-full shrink-0 items-center gap-4 pl-2',\n '[&>a:focus-visible]:yt-focus-dark [&>a]:px-2 [&>a]:rounded [&>a]:h-[calc(100%-14px)]', // styles for logo wrapped inside an anchor\n props.className\n );\n\n return <header {...props} className={className} ref={ref} />;\n}) as ForwardedHeaderWithStatics;\n\nHeader.AgreementDisplay = AgreementDisplay;\nHeader.AgreementSelector = AgreementSelector;\nHeader.Button = Button;\nHeader.Link = Link;\nHeader.Logo = Logo;\nHeader.PrimaryNavigation = PrimaryNavigation;\nHeader.SecondaryNavigation = SecondaryNavigation;\nHeader.MenuButton = MenuButton;\n"],"names":["Header","React","forwardRef","props","ref","className","cn","AgreementDisplay","AgreementSelector","Button","Link","Logo","PrimaryNavigation","SecondaryNavigation","MenuButton"],"mappings":";;;;;;;;;;MA+BaA,MAAM,gBAAGC,cAAK,CAACC,UAAU,CAA8B,SAASF,MAAM,CAACG,KAAK,EAAEC,GAAG;EAC1F,MAAMC,SAAS,GAAGC,EAAE,CAChB,+DAA+D,EAC/D,sFAAsF;;EACtFH,KAAK,CAACE,SAAS,CAClB;EAED,oBAAOJ,yDAAYE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAChE,CAAC;AAEDJ,MAAM,CAACO,gBAAgB,GAAGA,gBAAgB;AAC1CP,MAAM,CAACQ,iBAAiB,GAAGA,iBAAiB;AAC5CR,MAAM,CAACS,MAAM,GAAGA,MAAM;AACtBT,MAAM,CAACU,IAAI,GAAGA,IAAI;AAClBV,MAAM,CAACW,IAAI,GAAGA,IAAI;AAClBX,MAAM,CAACY,iBAAiB,GAAGA,iBAAiB;AAC5CZ,MAAM,CAACa,mBAAmB,GAAGA,mBAAmB;AAChDb,MAAM,CAACc,UAAU,GAAGA,UAAU;;;;"}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { Icon } from '../../Icon/Icon.js';
|
3
|
+
import { useLocalization } from '../../Provider/Localization.js';
|
4
|
+
import { Button } from '../../Button/Button.js';
|
5
|
+
import { Root, Trigger, Content } from '@radix-ui/react-popover';
|
6
|
+
import { createCustomKeyboardEvent } from '../../../utils/input.js';
|
7
|
+
import { SearchInput } from '../../SearchInput/SearchInput.js';
|
8
|
+
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
9
|
+
import { Root as Root$1 } from '../../../primitives/Collection/components/Root.js';
|
10
|
+
import '../../../primitives/Collection/Collection.js';
|
11
|
+
import { AgreementDetails } from './Agreements/AgreementDetails.js';
|
12
|
+
|
13
|
+
const Container = props => {
|
14
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
15
|
+
className: "-ml-3 flex flex-shrink-0 flex-grow-0 items-center gap-2 xl:ml-auto xl:w-64 xl:pr-2"
|
16
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
17
|
+
className: "hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex"
|
18
|
+
}), props.children);
|
19
|
+
};
|
20
|
+
function AgreementDisplay(props) {
|
21
|
+
const {
|
22
|
+
currentAgreement,
|
23
|
+
fallbackImageSrc
|
24
|
+
} = props;
|
25
|
+
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, currentAgreement, {
|
26
|
+
className: "h-12 [&>span>span]:hidden xl:[&>span>span]:flex ",
|
27
|
+
fallbackImageSrc: fallbackImageSrc
|
28
|
+
})));
|
29
|
+
}
|
30
|
+
function AgreementSelector(props) {
|
31
|
+
const {
|
32
|
+
agreements,
|
33
|
+
currentAgreement,
|
34
|
+
fallbackImageSrc,
|
35
|
+
filterAgreement = () => true,
|
36
|
+
filterClientAgreement = () => true,
|
37
|
+
onAddAgreement: handleAddAgreement,
|
38
|
+
onChangeAgreement,
|
39
|
+
onLogout: handleLogout,
|
40
|
+
open: prop,
|
41
|
+
setOpen: onChange
|
42
|
+
} = props;
|
43
|
+
const {
|
44
|
+
texts
|
45
|
+
} = useLocalization();
|
46
|
+
const collectionRef = React__default.useRef(null);
|
47
|
+
const [open, setOpen] = useControllableState({
|
48
|
+
onChange,
|
49
|
+
prop
|
50
|
+
});
|
51
|
+
const [search, setSearch] = React__default.useState('');
|
52
|
+
React__default.useEffect(() => {
|
53
|
+
setSearch('');
|
54
|
+
}, [open]);
|
55
|
+
const handleKeyDown = event => {
|
56
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter') {
|
57
|
+
var _collectionRef$curren;
|
58
|
+
event.preventDefault();
|
59
|
+
(_collectionRef$curren = collectionRef.current) === null || _collectionRef$curren === void 0 ? void 0 : _collectionRef$curren.dispatchEvent(createCustomKeyboardEvent(event));
|
60
|
+
}
|
61
|
+
};
|
62
|
+
const handleChangeAgreement = agreement => {
|
63
|
+
onChangeAgreement(agreement);
|
64
|
+
setOpen(false);
|
65
|
+
};
|
66
|
+
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(Root, {
|
67
|
+
open: open,
|
68
|
+
onOpenChange: setOpen
|
69
|
+
}, /*#__PURE__*/React__default.createElement(Trigger, {
|
70
|
+
className: "xl:focus-visible:yt-focus-dark [&:focus-visible_img]:yt-focus-dark w-full rounded outline-none xl:[&:focus-visible_img]:shadow-none"
|
71
|
+
}, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, currentAgreement, {
|
72
|
+
className: "h-12 flex-grow xl:hover:bg-white/[0.16] [&>span>span]:hidden xl:[&>span>span]:flex [[aria-current='true']>&]:bg-white/[0.16]",
|
73
|
+
fallbackImageSrc: fallbackImageSrc
|
74
|
+
}), agreements ? /*#__PURE__*/React__default.createElement(Icon, {
|
75
|
+
className: "ml-auto hidden flex-shrink-0 flex-grow-0 text-white xl:flex",
|
76
|
+
name: open ? 'chevron-up' : 'chevron-down'
|
77
|
+
}) : null)), /*#__PURE__*/React__default.createElement(Content, {
|
78
|
+
className: "z-[996] mt-2 flex h-[calc(100vh_-_theme(spacing.16))] w-64 flex-col gap-1 bg-blue-900"
|
79
|
+
}, /*#__PURE__*/React__default.createElement(SearchInput, {
|
80
|
+
autoFocus: true,
|
81
|
+
className: "focus-visible:!yt-focus-dark mx-2 !border-transparent !bg-white/[0.08] !text-white hover:!bg-white/[0.16] hover:!shadow-none focus:!bg-white/[0.16] active:!bg-white/[0.16] [&+div>button]:!text-white",
|
82
|
+
onChange: event => setSearch(event.target.value),
|
83
|
+
onKeyDown: handleKeyDown,
|
84
|
+
placeholder: texts.header.search
|
85
|
+
}), /*#__PURE__*/React__default.createElement(Root$1, {
|
86
|
+
querySelector: "button",
|
87
|
+
className: "-my-1 flex w-full flex-grow flex-col gap-1 overflow-auto px-2 py-1 outline-none",
|
88
|
+
ref: collectionRef,
|
89
|
+
tabIndex: -1
|
90
|
+
}, agreements === null || agreements === void 0 ? void 0 : agreements.filter(agreement => filterAgreement(agreement, filterBySearchValue(search))).map(agreement => {
|
91
|
+
const button = createAgreementButton(agreement, fallbackImageSrc, handleChangeAgreement, isCurrentAgreement(agreement, currentAgreement));
|
92
|
+
if (agreement.clients) {
|
93
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
94
|
+
className: "flex flex-col gap-px [&>*:first-child>span]:!rounded-t [&>*:last-child>span]:!rounded-b [&>*>span]:!rounded-none",
|
95
|
+
key: `${agreement.number}_${agreement.userId}_clients`
|
96
|
+
}, filterBySearchValue(search)(agreement) ? button : null, agreement.clients.filter(agreement => filterClientAgreement(agreement, filterBySearchValue(search))).map(clientAgreement => createAgreementButton(clientAgreement, fallbackImageSrc, handleChangeAgreement, isCurrentAgreement(clientAgreement, currentAgreement))));
|
97
|
+
}
|
98
|
+
return button;
|
99
|
+
})), handleAddAgreement ? /*#__PURE__*/React__default.createElement(Button, {
|
100
|
+
className: "focus-visible:!yt-focus-dark my-1 mx-2 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]",
|
101
|
+
onClick: handleAddAgreement
|
102
|
+
}, texts.header.addAgreement) : null, /*#__PURE__*/React__default.createElement("hr", {
|
103
|
+
className: "my-0 h-px w-full bg-white/[0.08]"
|
104
|
+
}), /*#__PURE__*/React__default.createElement("a", {
|
105
|
+
className: "focus-visible:yt-focus-dark mx-2 mb-2 flex h-8 shrink-0 items-center justify-center rounded text-white hover:cursor-pointer hover:text-white hover:underline focus-visible:outline-none",
|
106
|
+
onClick: handleLogout,
|
107
|
+
tabIndex: 0
|
108
|
+
}, texts.header.logout))));
|
109
|
+
}
|
110
|
+
const filterBySearchValue = search => agreement => {
|
111
|
+
if (!search || !search.length) {
|
112
|
+
return true;
|
113
|
+
}
|
114
|
+
const matchesAgreementNumber = String(agreement.number).indexOf(search) > -1;
|
115
|
+
const matchesCompanyName = agreement.name.toLowerCase().indexOf(search.toLowerCase()) > -1;
|
116
|
+
return matchesAgreementNumber || matchesCompanyName;
|
117
|
+
};
|
118
|
+
const isCurrentAgreement = (agreement, currentAgreement) => {
|
119
|
+
return agreement.number === currentAgreement.number && agreement.userId === currentAgreement.userId;
|
120
|
+
};
|
121
|
+
const createAgreementButton = (agreement, fallbackImageSrc, onChangeAgreement, isCurrentAgreement = false) => /*#__PURE__*/React__default.createElement("button", {
|
122
|
+
"aria-current": isCurrentAgreement ? 'true' : undefined,
|
123
|
+
className: "focus:yt-focus-dark w-full rounded outline-none",
|
124
|
+
key: `${agreement.number}_${agreement.userId}`,
|
125
|
+
onClick: () => onChangeAgreement(agreement),
|
126
|
+
onKeyDown: () => onChangeAgreement(agreement),
|
127
|
+
tabIndex: 0
|
128
|
+
}, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, agreement, {
|
129
|
+
className: "h-14 bg-white/[0.08] xl:hover:bg-white/[0.16] [[aria-current='true']>&]:bg-white/[0.16]",
|
130
|
+
fallbackImageSrc: fallbackImageSrc
|
131
|
+
})));
|
132
|
+
|
133
|
+
export { AgreementDisplay, AgreementSelector };
|
134
|
+
//# sourceMappingURL=AgreementSelector.js.map
|