@consumidor-positivo/aurora 0.1.2 → 0.2.4
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/README.md +1 -1
- package/dist/components/Alert/index.es.js +1 -1
- package/dist/components/Calendar/index.es.js +2 -2
- package/dist/components/CalendarHeader/index.es.js +2 -2
- package/dist/components/Checkbox/index.es.js +1 -1
- package/dist/components/Datepicker/index.es.js +3 -3
- package/dist/components/Header/index.es.js +15 -12
- package/dist/components/Header/index.es.js.map +1 -1
- package/dist/components/Header/parts/HeaderProfile.d.ts +9 -4
- package/dist/components/Header/styles.css +1 -1
- package/dist/components/PortalHolder/index.es.js +1 -1
- package/dist/components/Segment/index.es.js +1 -1
- package/dist/components/SelectField/index.es.js +1 -1
- package/dist/components/Tag/index.es.js +1 -1
- package/dist/{index-BkeRYinJ.js → index-AOefAAO5.js} +2 -2
- package/dist/{index-BkeRYinJ.js.map → index-AOefAAO5.js.map} +1 -1
- package/dist/{index-BIEl3o0B.js → index-B0Ush_Ua.js} +2 -2
- package/dist/{index-BIEl3o0B.js.map → index-B0Ush_Ua.js.map} +1 -1
- package/dist/{index-DAA8IiTr.js → index-Chb8MRUv.js} +3 -3
- package/dist/{index-DAA8IiTr.js.map → index-Chb8MRUv.js.map} +1 -1
- package/dist/main.es.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@ import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
|
8
8
|
import { IconClock } from "../icons/IconClock/index.es.js";
|
|
9
9
|
import { IconInfo } from "../icons/IconInfo/index.es.js";
|
|
10
10
|
import { IconX } from "../icons/IconX/index.es.js";
|
|
11
|
+
import { d as COLOR_NEUTRAL_70, C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, e as COLOR_WARNING_50, f as COLOR_INFO_50 } from "../../tokens-D_iASp38.js";
|
|
11
12
|
import { Conditional } from "../Conditional/index.es.js";
|
|
12
13
|
import { Text } from "../Text/index.es.js";
|
|
13
|
-
import { d as COLOR_NEUTRAL_70, C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, e as COLOR_WARNING_50, f as COLOR_INFO_50 } from "../../tokens-D_iASp38.js";
|
|
14
14
|
import './styles.css';const Alert = ({
|
|
15
15
|
showIcon = true,
|
|
16
16
|
status = "info",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../index-BXRA68j0.js";
|
|
3
|
-
import "../../index-
|
|
3
|
+
import "../../index-B0Ush_Ua.js";
|
|
4
4
|
import "../Button/index.es.js";
|
|
5
5
|
import "../PortalHolder/index.es.js";
|
|
6
|
-
import { a } from "../../index-
|
|
6
|
+
import { a } from "../../index-Chb8MRUv.js";
|
|
7
7
|
export {
|
|
8
8
|
a as DatepickerCalendar
|
|
9
9
|
};
|
|
@@ -3,8 +3,8 @@ import "../../index-BXRA68j0.js";
|
|
|
3
3
|
import "../Icon/index.es.js";
|
|
4
4
|
import "../icons/IconChevronLeft/index.es.js";
|
|
5
5
|
import "../icons/IconChevronRight/index.es.js";
|
|
6
|
-
import "../../index-
|
|
7
|
-
import { C } from "../../index-
|
|
6
|
+
import "../../index-AOefAAO5.js";
|
|
7
|
+
import { C } from "../../index-B0Ush_Ua.js";
|
|
8
8
|
export {
|
|
9
9
|
C as CalendarHeader
|
|
10
10
|
};
|
|
@@ -3,9 +3,9 @@ import $dbSRa$react__default, { useState, useEffect } from "react";
|
|
|
3
3
|
import { c as classNames } from "../../index-BXRA68j0.js";
|
|
4
4
|
import "../Icon/index.es.js";
|
|
5
5
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
6
|
+
import { h as COLOR_NEUTRAL_00 } from "../../tokens-D_iASp38.js";
|
|
6
7
|
import { F as Field } from "../../index-ZE6zszxw.js";
|
|
7
8
|
import { Conditional } from "../Conditional/index.es.js";
|
|
8
|
-
import { h as COLOR_NEUTRAL_00 } from "../../tokens-D_iASp38.js";
|
|
9
9
|
import { Text } from "../Text/index.es.js";
|
|
10
10
|
import './styles.css';const CheckboxField = ({
|
|
11
11
|
label,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { B as BREAKPOINT_MD, c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
2
3
|
import "../../index-BXRA68j0.js";
|
|
3
4
|
import "../Icon/index.es.js";
|
|
4
5
|
import { IconCalendar } from "../icons/IconCalendar/index.es.js";
|
|
5
6
|
import { InputField } from "../InputField/index.es.js";
|
|
6
|
-
import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-
|
|
7
|
+
import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-Chb8MRUv.js";
|
|
7
8
|
import { useRef, useState, useMemo, useEffect } from "react";
|
|
8
9
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
9
|
-
import { u as useOutsideClick } from "../../index-
|
|
10
|
-
import { B as BREAKPOINT_MD, c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
10
|
+
import { u as useOutsideClick } from "../../index-AOefAAO5.js";
|
|
11
11
|
import './styles.css';function useDatepicker({
|
|
12
12
|
value,
|
|
13
13
|
defaultValue = "empty",
|
|
@@ -135,25 +135,28 @@ const HeaderNavigation = ({ children }) => {
|
|
|
135
135
|
return /* @__PURE__ */ jsx("div", { className: "au-header__navigation", children });
|
|
136
136
|
};
|
|
137
137
|
const HeaderProfile = ({
|
|
138
|
-
onClickNotifications,
|
|
139
|
-
onClickMenu,
|
|
140
138
|
fullName,
|
|
141
|
-
|
|
139
|
+
onClickMenu,
|
|
140
|
+
notifications = {}
|
|
142
141
|
}) => {
|
|
143
142
|
const initialLetters = getInitialLetters(fullName);
|
|
143
|
+
const { visible = true, hasUnread = false, count, onClick } = notifications;
|
|
144
|
+
const shouldShowBadge = count && count > 0 || hasUnread;
|
|
144
145
|
return /* @__PURE__ */ jsxs("div", { className: "au-header__profile", children: [
|
|
145
146
|
/* @__PURE__ */ jsx(
|
|
146
147
|
Conditional,
|
|
147
148
|
{
|
|
148
|
-
condition:
|
|
149
|
-
renderIf: /* @__PURE__ */
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
condition: visible,
|
|
150
|
+
renderIf: /* @__PURE__ */ jsxs("div", { className: "au-header__profile-notifications", onClick, children: [
|
|
151
|
+
/* @__PURE__ */ jsx(IconBell, {}),
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
Conditional,
|
|
154
|
+
{
|
|
155
|
+
condition: !!shouldShowBadge,
|
|
156
|
+
renderIf: /* @__PURE__ */ jsx("div", { className: "au-header__profile-notifications-badge", children: count && count > 0 ? count : null })
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
157
160
|
}
|
|
158
161
|
),
|
|
159
162
|
/* @__PURE__ */ jsx("div", { className: "au-header__profile-menu-mobile", onClick: onClickMenu, children: /* @__PURE__ */ jsx(IconMenu, {}) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Header/parts/HeaderActions.tsx","../../../lib/components/Header/parts/HeaderBadges.tsx","../../../lib/components/Header/parts/HeaderButton.tsx","../../../lib/components/Header/parts/HeaderHamburger.tsx","../../../lib/components/Header/parts/HeaderLogo.tsx","../../../lib/components/Header/parts/HeaderNavbar.tsx","../../../lib/components/Header/parts/HeaderNavbarLink.tsx","../../../lib/components/Header/parts/HeaderNavigation.tsx","../../../lib/components/Header/parts/HeaderProfile.tsx","../../../lib/components/Header/parts/HeaderWrap.tsx","../../../lib/components/Header/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderActionsProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n divider?: boolean\n}\n\nexport const HeaderActions = ({ children, divider }: HeaderActionsProps) => {\n return (\n <div\n className={classNames('au-header__actions', {\n 'au-header__actions--divider': divider,\n })}>\n {children}\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderBadgesProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n limitBadgeWidth?: boolean\n}\n\nexport const HeaderBadges = ({\n children,\n limitBadgeWidth = true,\n}: HeaderBadgesProps) => {\n const componentClass = classNames('au-header__badges', {\n 'au-header__badges--limited-width': limitBadgeWidth,\n })\n return <div className={componentClass}>{children}</div>\n}\n","import { ReactNode } from 'react'\n\nexport type HeaderButtonProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n onClick: () => void\n}\n\nexport const HeaderButton = ({ children, onClick }: HeaderButtonProps) => {\n return (\n <div className=\"au-header__button\" onClick={onClick}>\n {children}\n </div>\n )\n}\n","import { IconMenu } from '@components/icons/default'\n\nexport type HeaderHamburgerProps = {\n onClick?: () => void\n}\n\nexport const HeaderHamburger = ({ onClick }: HeaderHamburgerProps) => {\n return (\n <div className=\"au-header__hamburger\">\n <div className=\"au-header__hamburger\" onClick={onClick}>\n <IconMenu />\n </div>\n </div>\n )\n}\n","import { ReactNode } from 'react'\nimport { Conditional } from '@components/misc'\n\nexport type HeaderLogoProps = {\n children?: ReactNode | string | JSX.Element | JSX.Element[]\n renderMobile?: ReactNode | string | JSX.Element | JSX.Element[]\n renderDesktop?: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderLogo = ({\n children,\n renderMobile,\n renderDesktop,\n}: HeaderLogoProps) => {\n return (\n <div className=\"au-header__logo\">\n <Conditional\n condition={!!renderMobile}\n renderIf={<div className=\"au-header__logo--mobile\">{renderMobile}</div>}\n />\n <Conditional\n condition={!!renderDesktop}\n renderIf={\n <div className=\"au-header__logo--desktop\">{renderDesktop}</div>\n }\n />\n {children}\n </div>\n )\n}\n","import { ReactNode } from 'react'\nimport { NavbarDataProps } from '../types'\n\nexport type HeaderNavbarProps = {\n data: NavbarDataProps[]\n renderItem: (\n item: NavbarDataProps,\n ) => ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderNavbar = ({ data, renderItem }: HeaderNavbarProps) => {\n return (\n <nav role=\"navigation\" className=\"au-header__navbar\">\n {data?.map((item) => {\n return renderItem(item)\n })}\n </nav>\n )\n}\n","import classNames from 'classnames'\nimport { Text } from '@components/Text'\nimport { IconChevronDown } from '@components/icons/default'\nimport { Conditional } from '@components/misc'\nimport { NavbarDataProps } from '../types'\n\nexport const HeaderNavbarLink = (navItem: NavbarDataProps) => {\n const { name, dropdown, active, href } = navItem\n const isDropdown = !!dropdown && dropdown.length\n\n function handleItemClick(item: NavbarDataProps, ev: React.MouseEvent) {\n if (item.onClick) {\n ev.preventDefault()\n item.onClick()\n }\n }\n\n return (\n <div\n className={classNames('au-header__navbar-item', {\n 'au-header__navbar-item--is-dropdown': dropdown,\n 'au-header__navbar-item--is-active': active,\n })}>\n <Text\n as={isDropdown ? 'div' : 'a'}\n variant=\"heading-micro\"\n weight=\"light\"\n href={href}\n onClick={(ev) => handleItemClick(navItem, ev)}\n title={name}\n className={classNames('au-header__navbar-link', {\n 'au-header__navbar-link--is-dropdown': dropdown,\n 'au-header__navbar-link--is-active': active,\n })}>\n {name}\n <Conditional\n condition={!!dropdown?.length}\n renderIf={<IconChevronDown />}\n />\n </Text>\n\n <Conditional\n condition={!!dropdown?.length}\n renderIf={\n <>\n <div className=\"au-header__dropdown\">\n {dropdown?.map((item) => {\n return (\n <Text\n key={item.name}\n as=\"a\"\n variant=\"heading-micro\"\n href={item.href}\n onClick={(ev) => handleItemClick(item, ev)}\n weight=\"light\"\n className={classNames('au-header__dropdown-link', {\n 'au-header__dropdown-link--is-active': item.active,\n })}\n title={item.name}>\n {item.name}\n </Text>\n )\n })}\n </div>\n </>\n }\n />\n </div>\n )\n}\n","import { ReactNode } from 'react'\n\nexport type HeaderNavigationProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderNavigation = ({ children }: HeaderNavigationProps) => {\n return <div className=\"au-header__navigation\">{children}</div>\n}\n","import { getInitialLetters } from '@core/utils/getInitialLetters'\nimport { IconBell, IconChevronDown, IconMenu } from '@components/icons/default'\nimport { Conditional } from '@components/misc'\n\nexport type HeaderProfileProps = {\n onClickNotifications?: () => void\n onClickMenu?: () => void\n fullName: string\n showNotifications?: boolean\n}\n\nexport const HeaderProfile = ({\n onClickNotifications,\n onClickMenu,\n fullName,\n showNotifications = true,\n}: HeaderProfileProps) => {\n const initialLetters = getInitialLetters(fullName)\n return (\n <div className=\"au-header__profile\">\n <Conditional\n condition={showNotifications}\n renderIf={\n <div\n className=\"au-header__profile-notifications\"\n onClick={onClickNotifications}>\n <IconBell />\n </div>\n }\n />\n\n <div className=\"au-header__profile-menu-mobile\" onClick={onClickMenu}>\n <IconMenu />\n </div>\n\n <div className=\"au-header__profile-menu\" onClick={onClickMenu}>\n <div className=\"au-header__profile-letters\">{initialLetters}</div>\n <IconChevronDown />\n </div>\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderWrapProps = {\n position?: 'static' | 'fixed'\n children: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderWrap = ({\n children,\n position = 'static',\n}: HeaderWrapProps) => {\n return (\n <header\n role=\"banner\"\n className={classNames('au-header', {\n 'au-header--fixed': position === 'fixed',\n 'au-header--static': position === 'static',\n })}>\n <div className=\"au-header__container\">{children}</div>\n </header>\n )\n}\n","import { HeaderActions, HeaderActionsProps } from './parts/HeaderActions'\nimport { HeaderBadges, HeaderBadgesProps } from './parts/HeaderBadges'\nimport { HeaderButton, HeaderButtonProps } from './parts/HeaderButton'\nimport { HeaderHamburger, HeaderHamburgerProps } from './parts/HeaderHamburger'\nimport { HeaderLogo, HeaderLogoProps } from './parts/HeaderLogo'\nimport { HeaderNavbar, HeaderNavbarProps } from './parts/HeaderNavbar'\nimport { HeaderNavbarLink } from './parts/HeaderNavbarLink'\nimport {\n HeaderNavigation,\n HeaderNavigationProps,\n} from './parts/HeaderNavigation'\nimport { HeaderProfile, HeaderProfileProps } from './parts/HeaderProfile'\nimport { HeaderWrap as Header, HeaderWrapProps } from './parts/HeaderWrap'\nimport { NavbarDataProps } from './types'\n\nimport './styles.scss'\n\ntype Components = {\n Actions: React.FC<HeaderActionsProps>\n Badges: React.FC<HeaderBadgesProps>\n Button: React.FC<HeaderButtonProps>\n Hamburger: React.FC<HeaderHamburgerProps>\n Logo: React.FC<HeaderLogoProps>\n Navbar: React.FC<HeaderNavbarProps>\n NavbarLink: React.FC<NavbarDataProps>\n Navigation: React.FC<HeaderNavigationProps>\n Profile: React.FC<HeaderProfileProps>\n Root: React.FC<HeaderWrapProps>\n}\n\nconst components: Components = {\n Actions: HeaderActions,\n Badges: HeaderBadges,\n Button: HeaderButton,\n Hamburger: HeaderHamburger,\n Logo: HeaderLogo,\n Navbar: HeaderNavbar,\n NavbarLink: HeaderNavbarLink,\n Navigation: HeaderNavigation,\n Profile: HeaderProfile,\n Root: Header,\n}\n\nObject.keys(components).forEach((key) => {\n const component = components[key as keyof Components]\n component.displayName = `Header.${key}`\n})\n\nexport { components as Header }\n"],"names":["Header"],"mappings":";;;;;;;;;AAQO,MAAM,gBAAgB,CAAC,EAAE,UAAU,cAAkC;AAExE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,WAAW,sBAAsB;AAAA,QAC1C,+BAA+B;AAAA,MAAA,CAChC;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGP;ACTO,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,kBAAkB;AACpB,MAAyB;AACjB,QAAA,iBAAiB,WAAW,qBAAqB;AAAA,IACrD,oCAAoC;AAAA,EAAA,CACrC;AACD,SAAQ,oBAAA,OAAA,EAAI,WAAW,gBAAiB,SAAS,CAAA;AACnD;ACTO,MAAM,eAAe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AAE,QAAQ,CAAC,QAAQ;AACjC,QAAA,YAAY,WAAW,GAAuB;AAC1C,YAAA,cAAc,UAAU,GAAG;AACvC,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Header/parts/HeaderActions.tsx","../../../lib/components/Header/parts/HeaderBadges.tsx","../../../lib/components/Header/parts/HeaderButton.tsx","../../../lib/components/Header/parts/HeaderHamburger.tsx","../../../lib/components/Header/parts/HeaderLogo.tsx","../../../lib/components/Header/parts/HeaderNavbar.tsx","../../../lib/components/Header/parts/HeaderNavbarLink.tsx","../../../lib/components/Header/parts/HeaderNavigation.tsx","../../../lib/components/Header/parts/HeaderProfile.tsx","../../../lib/components/Header/parts/HeaderWrap.tsx","../../../lib/components/Header/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderActionsProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n divider?: boolean\n}\n\nexport const HeaderActions = ({ children, divider }: HeaderActionsProps) => {\n return (\n <div\n className={classNames('au-header__actions', {\n 'au-header__actions--divider': divider,\n })}>\n {children}\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderBadgesProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n limitBadgeWidth?: boolean\n}\n\nexport const HeaderBadges = ({\n children,\n limitBadgeWidth = true,\n}: HeaderBadgesProps) => {\n const componentClass = classNames('au-header__badges', {\n 'au-header__badges--limited-width': limitBadgeWidth,\n })\n return <div className={componentClass}>{children}</div>\n}\n","import { ReactNode } from 'react'\n\nexport type HeaderButtonProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n onClick: () => void\n}\n\nexport const HeaderButton = ({ children, onClick }: HeaderButtonProps) => {\n return (\n <div className=\"au-header__button\" onClick={onClick}>\n {children}\n </div>\n )\n}\n","import { IconMenu } from '@components/icons/default'\n\nexport type HeaderHamburgerProps = {\n onClick?: () => void\n}\n\nexport const HeaderHamburger = ({ onClick }: HeaderHamburgerProps) => {\n return (\n <div className=\"au-header__hamburger\">\n <div className=\"au-header__hamburger\" onClick={onClick}>\n <IconMenu />\n </div>\n </div>\n )\n}\n","import { ReactNode } from 'react'\nimport { Conditional } from '@components/misc'\n\nexport type HeaderLogoProps = {\n children?: ReactNode | string | JSX.Element | JSX.Element[]\n renderMobile?: ReactNode | string | JSX.Element | JSX.Element[]\n renderDesktop?: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderLogo = ({\n children,\n renderMobile,\n renderDesktop,\n}: HeaderLogoProps) => {\n return (\n <div className=\"au-header__logo\">\n <Conditional\n condition={!!renderMobile}\n renderIf={<div className=\"au-header__logo--mobile\">{renderMobile}</div>}\n />\n <Conditional\n condition={!!renderDesktop}\n renderIf={\n <div className=\"au-header__logo--desktop\">{renderDesktop}</div>\n }\n />\n {children}\n </div>\n )\n}\n","import { ReactNode } from 'react'\nimport { NavbarDataProps } from '../types'\n\nexport type HeaderNavbarProps = {\n data: NavbarDataProps[]\n renderItem: (\n item: NavbarDataProps,\n ) => ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderNavbar = ({ data, renderItem }: HeaderNavbarProps) => {\n return (\n <nav role=\"navigation\" className=\"au-header__navbar\">\n {data?.map((item) => {\n return renderItem(item)\n })}\n </nav>\n )\n}\n","import classNames from 'classnames'\nimport { Text } from '@components/Text'\nimport { IconChevronDown } from '@components/icons/default'\nimport { Conditional } from '@components/misc'\nimport { NavbarDataProps } from '../types'\n\nexport const HeaderNavbarLink = (navItem: NavbarDataProps) => {\n const { name, dropdown, active, href } = navItem\n const isDropdown = !!dropdown && dropdown.length\n\n function handleItemClick(item: NavbarDataProps, ev: React.MouseEvent) {\n if (item.onClick) {\n ev.preventDefault()\n item.onClick()\n }\n }\n\n return (\n <div\n className={classNames('au-header__navbar-item', {\n 'au-header__navbar-item--is-dropdown': dropdown,\n 'au-header__navbar-item--is-active': active,\n })}>\n <Text\n as={isDropdown ? 'div' : 'a'}\n variant=\"heading-micro\"\n weight=\"light\"\n href={href}\n onClick={(ev) => handleItemClick(navItem, ev)}\n title={name}\n className={classNames('au-header__navbar-link', {\n 'au-header__navbar-link--is-dropdown': dropdown,\n 'au-header__navbar-link--is-active': active,\n })}>\n {name}\n <Conditional\n condition={!!dropdown?.length}\n renderIf={<IconChevronDown />}\n />\n </Text>\n\n <Conditional\n condition={!!dropdown?.length}\n renderIf={\n <>\n <div className=\"au-header__dropdown\">\n {dropdown?.map((item) => {\n return (\n <Text\n key={item.name}\n as=\"a\"\n variant=\"heading-micro\"\n href={item.href}\n onClick={(ev) => handleItemClick(item, ev)}\n weight=\"light\"\n className={classNames('au-header__dropdown-link', {\n 'au-header__dropdown-link--is-active': item.active,\n })}\n title={item.name}>\n {item.name}\n </Text>\n )\n })}\n </div>\n </>\n }\n />\n </div>\n )\n}\n","import { ReactNode } from 'react'\n\nexport type HeaderNavigationProps = {\n children: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderNavigation = ({ children }: HeaderNavigationProps) => {\n return <div className=\"au-header__navigation\">{children}</div>\n}\n","import { getInitialLetters } from '@core/utils/getInitialLetters'\nimport { IconBell, IconChevronDown, IconMenu } from '@components/icons/default'\nimport { Conditional } from '@components/misc'\n\nexport type NotificationsConfig = {\n visible?: boolean\n count?: number\n hasUnread?: boolean\n onClick?: () => void\n}\n\nexport type HeaderProfileProps = {\n fullName: string\n onClickMenu?: () => void\n notifications?: NotificationsConfig\n}\n\nexport const HeaderProfile = ({\n fullName,\n onClickMenu,\n notifications = {},\n}: HeaderProfileProps) => {\n const initialLetters = getInitialLetters(fullName)\n\n const { visible = true, hasUnread = false, count, onClick } = notifications\n const shouldShowBadge = (count && count > 0) || hasUnread\n\n return (\n <div className=\"au-header__profile\">\n <Conditional\n condition={visible}\n renderIf={\n <div className=\"au-header__profile-notifications\" onClick={onClick}>\n <IconBell />\n <Conditional\n condition={!!shouldShowBadge}\n renderIf={\n <div className=\"au-header__profile-notifications-badge\">\n {count && count > 0 ? count : null}\n </div>\n }\n />\n </div>\n }\n />\n\n <div className=\"au-header__profile-menu-mobile\" onClick={onClickMenu}>\n <IconMenu />\n </div>\n\n <div className=\"au-header__profile-menu\" onClick={onClickMenu}>\n <div className=\"au-header__profile-letters\">{initialLetters}</div>\n <IconChevronDown />\n </div>\n </div>\n )\n}\n","import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type HeaderWrapProps = {\n position?: 'static' | 'fixed'\n children: ReactNode | string | JSX.Element | JSX.Element[]\n}\n\nexport const HeaderWrap = ({\n children,\n position = 'static',\n}: HeaderWrapProps) => {\n return (\n <header\n role=\"banner\"\n className={classNames('au-header', {\n 'au-header--fixed': position === 'fixed',\n 'au-header--static': position === 'static',\n })}>\n <div className=\"au-header__container\">{children}</div>\n </header>\n )\n}\n","import { HeaderActions, HeaderActionsProps } from './parts/HeaderActions'\nimport { HeaderBadges, HeaderBadgesProps } from './parts/HeaderBadges'\nimport { HeaderButton, HeaderButtonProps } from './parts/HeaderButton'\nimport { HeaderHamburger, HeaderHamburgerProps } from './parts/HeaderHamburger'\nimport { HeaderLogo, HeaderLogoProps } from './parts/HeaderLogo'\nimport { HeaderNavbar, HeaderNavbarProps } from './parts/HeaderNavbar'\nimport { HeaderNavbarLink } from './parts/HeaderNavbarLink'\nimport {\n HeaderNavigation,\n HeaderNavigationProps,\n} from './parts/HeaderNavigation'\nimport { HeaderProfile, HeaderProfileProps } from './parts/HeaderProfile'\nimport { HeaderWrap as Header, HeaderWrapProps } from './parts/HeaderWrap'\nimport { NavbarDataProps } from './types'\n\nimport './styles.scss'\n\ntype Components = {\n Actions: React.FC<HeaderActionsProps>\n Badges: React.FC<HeaderBadgesProps>\n Button: React.FC<HeaderButtonProps>\n Hamburger: React.FC<HeaderHamburgerProps>\n Logo: React.FC<HeaderLogoProps>\n Navbar: React.FC<HeaderNavbarProps>\n NavbarLink: React.FC<NavbarDataProps>\n Navigation: React.FC<HeaderNavigationProps>\n Profile: React.FC<HeaderProfileProps>\n Root: React.FC<HeaderWrapProps>\n}\n\nconst components: Components = {\n Actions: HeaderActions,\n Badges: HeaderBadges,\n Button: HeaderButton,\n Hamburger: HeaderHamburger,\n Logo: HeaderLogo,\n Navbar: HeaderNavbar,\n NavbarLink: HeaderNavbarLink,\n Navigation: HeaderNavigation,\n Profile: HeaderProfile,\n Root: Header,\n}\n\nObject.keys(components).forEach((key) => {\n const component = components[key as keyof Components]\n component.displayName = `Header.${key}`\n})\n\nexport { components as Header }\n"],"names":["Header"],"mappings":";;;;;;;;;AAQO,MAAM,gBAAgB,CAAC,EAAE,UAAU,cAAkC;AAExE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,WAAW,sBAAsB;AAAA,QAC1C,+BAA+B;AAAA,MAAA,CAChC;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGP;ACTO,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,kBAAkB;AACpB,MAAyB;AACjB,QAAA,iBAAiB,WAAW,qBAAqB;AAAA,IACrD,oCAAoC;AAAA,EAAA,CACrC;AACD,SAAQ,oBAAA,OAAA,EAAI,WAAW,gBAAiB,SAAS,CAAA;AACnD;ACTO,MAAM,eAAe,CAAC,EAAE,UAAU,cAAiC;AACxE,SACG,oBAAA,OAAA,EAAI,WAAU,qBAAoB,SAChC,SACH,CAAA;AAEJ;ACPO,MAAM,kBAAkB,CAAC,EAAE,cAAoC;AACpE,SACG,oBAAA,OAAA,EAAI,WAAU,wBACb,UAAC,oBAAA,OAAA,EAAI,WAAU,wBAAuB,SACpC,UAAA,oBAAC,UAAS,EAAA,EAAA,CACZ,EACF,CAAA;AAEJ;ACLO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AAEnB,SAAA,qBAAC,OAAI,EAAA,WAAU,mBACb,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,CAAC,CA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|
+
hasUnread?: boolean;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
1
7
|
export type HeaderProfileProps = {
|
|
2
|
-
onClickNotifications?: () => void;
|
|
3
|
-
onClickMenu?: () => void;
|
|
4
8
|
fullName: string;
|
|
5
|
-
|
|
9
|
+
onClickMenu?: () => void;
|
|
10
|
+
notifications?: NotificationsConfig;
|
|
6
11
|
};
|
|
7
|
-
export declare const HeaderProfile: ({
|
|
12
|
+
export declare const HeaderProfile: ({ fullName, onClickMenu, notifications, }: HeaderProfileProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-header{height:80px;border-bottom:1px solid #e2e4e9;background-color:#fff}.au-header--fixed{position:fixed;top:0;left:0;width:100%;z-index:5}.au-header--static{position:relative}.au-header__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-header__container{padding:0 16px}}.au-header__container{height:100%;display:flex;justify-content:space-between;align-items:center;gap:16px}.au-header__logo{display:flex;align-items:center}.au-header__logo .au-text{padding-left:16px;margin-left:16px;border-left:1px solid #e2e4e9}.au-header__logo--mobile{display:block}@media (min-width: 1024px){.au-header__logo--mobile{display:none}}.au-header__logo--desktop{display:none}@media (min-width: 1024px){.au-header__logo--desktop{display:block}}.au-header__link,.au-header__button{cursor:pointer}.au-header__badges{display:flex;align-items:center}.au-header__badges>*+*{padding-left:16px;margin-left:16px;position:relative}.au-header__badges>*+*:before{content:"";height:24px;width:1px;background-color:#e2e4e9;position:absolute;left:0;top:calc(50% - 12px)}.au-header__badges .au-logo img{width:100%}.au-header__badges--limited-width .au-logo{max-width:56px}.au-header__navigation{height:100%;display:flex}.au-header__navigation>*+*{margin-left:24px}.au-header__navbar{color:#16181d;display:none}@media (min-width: 1024px){.au-header__navbar{display:flex;align-items:center;gap:24px}}.au-header__navbar-item{position:relative}.au-header__navbar-item--is-dropdown{height:calc(100% + 8px);align-self:flex-start;display:flex;align-items:center;justify-content:center;padding-bottom:8px;gap:8px}.au-header__navbar-item--is-dropdown .au-icon{transition:transform .25s ease}.au-header__navbar-item--is-dropdown:hover .au-icon,.au-header__navbar-item--is-dropdown:focus .au-icon{transform:rotate(-180deg)}.au-header__navbar-item--is-dropdown:hover .au-header__dropdown,.au-header__navbar-item--is-dropdown:focus .au-header__dropdown{opacity:1;visibility:visible;transform:translateY(0)}.au-header__navbar-link{height:100%;cursor:pointer;text-decoration:none}.au-header__navbar-link--is-dropdown{position:relative;display:flex;align-items:center;justify-content:center;gap:8px}.au-header__navbar-link--is-active,.au-header__navbar-link:hover,.au-header__navbar-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link:hover,.au-header__navbar-link:focus{color:#16181d}.au-header__navbar-link--is-active{color:#0048db}.au-header__navbar-link--is-active:hover,.au-header__navbar-link--is-active:focus{color:#0048db}.au-header__dropdown{background-color:#fff;border-radius:16px;border:1px solid #e2e4e9;box-shadow:0 2px 8px #a9b1c514,0 4px 4px #0048db0a;max-width:230px;min-width:230px;position:absolute;overflow:hidden;z-index:2;top:100%;width:100%;left:-8px;opacity:0;visibility:hidden;transition:opacity .25s ease-in-out,transform .2s linear,visibility .25s ease-in-out;transform:translateY(-8px)}.au-header__dropdown-link{display:inline-block;padding:16px 24px;width:100%;display:flex;text-decoration:none;justify-content:space-between;cursor:pointer}.au-header__dropdown-link--is-active,.au-header__dropdown-link:hover,.au-header__dropdown-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__dropdown-link--is-active{color:#0048db;background-color:#fafbff;border-top:1px solid #e2e4e9}.au-header__actions{display:flex;align-items:center;gap:8px;margin-block:16px}@media (min-width: 1024px){.au-header__actions--divider{border-left:1px solid #e2e4e9;padding-left:16px;margin-left:24px}}.au-header__profile{display:flex;align-items:center;gap:24px}.au-header__profile-notifications{cursor:pointer}.au-header__profile-menu{display:none;align-items:center;gap:8px;cursor:pointer}@media (min-width: 1024px){.au-header__profile-menu{display:flex}}.au-header__profile-menu-mobile{display:block;cursor:pointer}@media (min-width: 1024px){.au-header__profile-menu-mobile{display:none}}.au-header__profile-letters{display:flex;align-items:center;justify-content:center;border-radius:50%;width:40px;height:40px;background-color:#9abcff;font-weight:500;font-family:Lexend Deca,sans-serif;color:#16181d;font-size:16px;text-transform:uppercase}.au-header__hamburger{cursor:pointer}@media (min-width: 1024px){.au-header__hamburger{display:none}}
|
|
1
|
+
.au-header{height:80px;border-bottom:1px solid #e2e4e9;background-color:#fff}.au-header--fixed{position:fixed;top:0;left:0;width:100%;z-index:5}.au-header--static{position:relative}.au-header__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media (min-width: 1024px){.au-header__container{padding:0 16px}}.au-header__container{height:100%;display:flex;justify-content:space-between;align-items:center;gap:16px}.au-header__logo{display:flex;align-items:center}.au-header__logo .au-text{padding-left:16px;margin-left:16px;border-left:1px solid #e2e4e9}.au-header__logo--mobile{display:block}@media (min-width: 1024px){.au-header__logo--mobile{display:none}}.au-header__logo--desktop{display:none}@media (min-width: 1024px){.au-header__logo--desktop{display:block}}.au-header__link,.au-header__button{cursor:pointer}.au-header__badges{display:flex;align-items:center}.au-header__badges>*+*{padding-left:16px;margin-left:16px;position:relative}.au-header__badges>*+*:before{content:"";height:24px;width:1px;background-color:#e2e4e9;position:absolute;left:0;top:calc(50% - 12px)}.au-header__badges .au-logo img{width:100%}.au-header__badges--limited-width .au-logo{max-width:56px}.au-header__navigation{height:100%;display:flex}.au-header__navigation>*+*{margin-left:24px}.au-header__navbar{color:#16181d;display:none}@media (min-width: 1024px){.au-header__navbar{display:flex;align-items:center;gap:24px}}.au-header__navbar-item{position:relative}.au-header__navbar-item--is-dropdown{height:calc(100% + 8px);align-self:flex-start;display:flex;align-items:center;justify-content:center;padding-bottom:8px;gap:8px}.au-header__navbar-item--is-dropdown .au-icon{transition:transform .25s ease}.au-header__navbar-item--is-dropdown:hover .au-icon,.au-header__navbar-item--is-dropdown:focus .au-icon{transform:rotate(-180deg)}.au-header__navbar-item--is-dropdown:hover .au-header__dropdown,.au-header__navbar-item--is-dropdown:focus .au-header__dropdown{opacity:1;visibility:visible;transform:translateY(0)}.au-header__navbar-link{height:100%;cursor:pointer;text-decoration:none}.au-header__navbar-link--is-dropdown{position:relative;display:flex;align-items:center;justify-content:center;gap:8px}.au-header__navbar-link--is-active,.au-header__navbar-link:hover,.au-header__navbar-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link:hover,.au-header__navbar-link:focus{color:#16181d}.au-header__navbar-link--is-active{color:#0048db}.au-header__navbar-link--is-active:hover,.au-header__navbar-link--is-active:focus{color:#0048db}.au-header__dropdown{background-color:#fff;border-radius:16px;border:1px solid #e2e4e9;box-shadow:0 2px 8px #a9b1c514,0 4px 4px #0048db0a;max-width:230px;min-width:230px;position:absolute;overflow:hidden;z-index:2;top:100%;width:100%;left:-8px;opacity:0;visibility:hidden;transition:opacity .25s ease-in-out,transform .2s linear,visibility .25s ease-in-out;transform:translateY(-8px)}.au-header__dropdown-link{display:inline-block;padding:16px 24px;width:100%;display:flex;text-decoration:none;justify-content:space-between;cursor:pointer}.au-header__dropdown-link--is-active,.au-header__dropdown-link:hover,.au-header__dropdown-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__dropdown-link--is-active{color:#0048db;background-color:#fafbff;border-top:1px solid #e2e4e9}.au-header__actions{display:flex;align-items:center;gap:8px;margin-block:16px}@media (min-width: 1024px){.au-header__actions--divider{border-left:1px solid #e2e4e9;padding-left:16px;margin-left:24px}}.au-header__profile{display:flex;align-items:center;gap:24px}.au-header__profile-notifications{cursor:pointer;position:relative}.au-header__profile-notifications-badge{position:absolute;top:-4px;right:-4px;background-color:#e52222;border-radius:999px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:700;height:18px;min-width:18px;padding:2px;border:1px solid #ffffff}.au-header__profile-notifications-badge:empty{width:12px;height:12px;min-width:12px;padding:0 4px;top:0;right:0}.au-header__profile-menu{display:none;align-items:center;gap:8px;cursor:pointer}@media (min-width: 1024px){.au-header__profile-menu{display:flex}}.au-header__profile-menu-mobile{display:block;cursor:pointer}@media (min-width: 1024px){.au-header__profile-menu-mobile{display:none}}.au-header__profile-letters{display:flex;align-items:center;justify-content:center;border-radius:50%;width:40px;height:40px;background-color:#9abcff;font-weight:500;font-family:Lexend Deca,sans-serif;color:#16181d;font-size:16px;text-transform:uppercase}.au-header__hamburger{cursor:pointer}@media (min-width: 1024px){.au-header__hamburger{display:none}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
3
|
-
import { Portal } from "../Portal/index.es.js";
|
|
4
3
|
import { B as BREAKPOINT_MD } from "../../tokens-D_iASp38.js";
|
|
4
|
+
import { Portal } from "../Portal/index.es.js";
|
|
5
5
|
const PortalHolder = ({ withPortal, children }) => {
|
|
6
6
|
const shouldUsePortal = !above(BREAKPOINT_MD) && withPortal;
|
|
7
7
|
if (shouldUsePortal) return /* @__PURE__ */ jsx(Portal, { children });
|
|
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
|
|
|
4
4
|
import "../icons/IconChevronDown/index.es.js";
|
|
5
5
|
import "../icons/IconChevronLeft/index.es.js";
|
|
6
6
|
import "../icons/IconX/index.es.js";
|
|
7
|
-
import { S } from "../../index-
|
|
7
|
+
import { S } from "../../index-AOefAAO5.js";
|
|
8
8
|
export {
|
|
9
9
|
S as Segment
|
|
10
10
|
};
|
|
@@ -9,10 +9,10 @@ import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
|
9
9
|
import { Modal } from "../Modal/index.es.js";
|
|
10
10
|
import { Text } from "../Text/index.es.js";
|
|
11
11
|
import { Conditional } from "../Conditional/index.es.js";
|
|
12
|
+
import { c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
12
13
|
import { i as isMobile } from "../../isMobile-RyKhTreE.js";
|
|
13
14
|
import { F as Field } from "../../index-ZE6zszxw.js";
|
|
14
15
|
import { useState, useRef, useEffect } from "react";
|
|
15
|
-
import { c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
16
16
|
import './styles.css';const useSelectField = (options, initialValue, onChange, onBlur, disabled, register, autocomplete = false, fullScreenOptions = false) => {
|
|
17
17
|
var _a;
|
|
18
18
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
@@ -6,8 +6,8 @@ import { IconAlertTriangle } from "../icons/IconAlertTriangle/index.es.js";
|
|
|
6
6
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
7
7
|
import { IconInfo } from "../icons/IconInfo/index.es.js";
|
|
8
8
|
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
9
|
-
import { Conditional } from "../Conditional/index.es.js";
|
|
10
9
|
import { C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, e as COLOR_WARNING_50, f as COLOR_INFO_50, g as COLOR_BRAND_CYAN_50, d as COLOR_NEUTRAL_70 } from "../../tokens-D_iASp38.js";
|
|
10
|
+
import { Conditional } from "../Conditional/index.es.js";
|
|
11
11
|
import './styles.css';const Tag = ({
|
|
12
12
|
status,
|
|
13
13
|
border = "square",
|
|
@@ -5,8 +5,8 @@ import { IconChevronDown } from "./components/icons/IconChevronDown/index.es.js"
|
|
|
5
5
|
import { IconChevronLeft } from "./components/icons/IconChevronLeft/index.es.js";
|
|
6
6
|
import { IconX } from "./components/icons/IconX/index.es.js";
|
|
7
7
|
import { useState, useRef, useEffect } from "react";
|
|
8
|
-
import { a as above } from "./screen-DfYo7XQ_.js";
|
|
9
8
|
import { B as BREAKPOINT_MD } from "./tokens-D_iASp38.js";
|
|
9
|
+
import { a as above } from "./screen-DfYo7XQ_.js";
|
|
10
10
|
import './components/index/styles3.css';function useOutsideClick({
|
|
11
11
|
rootEl,
|
|
12
12
|
breakpoint,
|
|
@@ -138,4 +138,4 @@ export {
|
|
|
138
138
|
Segment as S,
|
|
139
139
|
useOutsideClick as u
|
|
140
140
|
};
|
|
141
|
-
//# sourceMappingURL=index-
|
|
141
|
+
//# sourceMappingURL=index-AOefAAO5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-AOefAAO5.js","sources":["../lib/core/hooks/useOutsideClick.ts","../lib/components/form/Datepicker/Segment/hook.ts","../lib/components/form/Datepicker/Segment/index.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { above } from '../utils/screen'\n\ntype UseOutsideClickProps = {\n rootEl: React.RefObject<HTMLDivElement>\n breakpoint?: string\n onLoseFocusCB: () => void\n}\n\nexport function useOutsideClick({\n rootEl,\n breakpoint,\n onLoseFocusCB,\n}: UseOutsideClickProps) {\n const [setupListener, setSetupListener] = useState(false)\n\n function listenOutsideClick() {\n if (breakpoint && !above(breakpoint)) return\n document.addEventListener('mousedown', handleLoseFocus)\n setSetupListener(true)\n }\n\n function clearOutsideClickListenner() {\n if (setupListener) {\n document.removeEventListener('mousedown', handleLoseFocus)\n setSetupListener(false)\n }\n }\n\n function handleLoseFocus(ev: MouseEvent | FocusEvent) {\n if (!rootEl.current) return\n\n const clickedOutside = !rootEl.current.contains(ev.target as Node)\n\n if (clickedOutside) {\n onLoseFocusCB()\n clearOutsideClickListenner()\n }\n }\n\n return {\n listenOutsideClick,\n }\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { BREAKPOINT_MD } from '@core/tokens'\nimport { useOutsideClick } from '@core/hooks/useOutsideClick'\n\nimport { SegmentItem } from '../types'\n\ntype UseSegmentProps = {\n options: SegmentItem[]\n currentValue: string | number\n onSelect: (option: SegmentItem) => void\n}\n\nexport function useSegment({\n options,\n currentValue,\n onSelect,\n}: UseSegmentProps) {\n const [isListOpen, setIsListOpen] = useState(false)\n const rootEl = useRef<HTMLDivElement>(null)\n const selectedItem = useRef<HTMLLIElement>(null)\n const currentItem = options.find((item) => item.value === currentValue)\n const { listenOutsideClick } = useOutsideClick({\n rootEl,\n breakpoint: BREAKPOINT_MD,\n onLoseFocusCB: closeList,\n })\n\n useEffect(() => {\n if (selectedItem.current && isListOpen) {\n selectedItem.current.scrollIntoView({ block: 'center', inline: 'center' })\n }\n }, [isListOpen])\n\n function openList() {\n setIsListOpen(true)\n listenOutsideClick()\n }\n\n function closeList() {\n setIsListOpen(false)\n }\n\n function handleSelectItem(option: SegmentItem) {\n onSelect(option)\n setIsListOpen(false)\n }\n\n return {\n openList,\n closeList,\n isListOpen,\n rootEl,\n currentItem,\n handleSelectItem,\n selectedItem,\n }\n}\n","import classNames from 'classnames'\nimport { IconChevronDown, IconChevronLeft, IconX } from '@components/icons'\n\nimport { useSegment } from './hook'\nimport { SegmentItem } from '../types'\nimport './styles.scss'\n\ntype SegmentProps = {\n mobileTitle: string\n options: SegmentItem[]\n onSelect: (option: SegmentItem) => void\n currentValue: string | number\n minValue?: Date\n maxValue?: Date\n}\n\nexport const Segment = ({\n currentValue,\n options,\n mobileTitle,\n onSelect,\n}: SegmentProps) => {\n const {\n rootEl,\n isListOpen,\n openList,\n closeList,\n currentItem,\n handleSelectItem,\n selectedItem,\n } = useSegment({\n options,\n currentValue,\n onSelect,\n })\n\n return (\n <div\n ref={rootEl}\n tabIndex={0}\n className={classNames('au-datepicker__segment', {\n 'au-datepicker__segment--open': isListOpen,\n })}>\n <div className=\"au-datepicker__segment-input\" onClick={openList}>\n {currentItem?.label}\n <IconChevronDown />\n </div>\n <div className=\"au-datepicker__segment-list-holder\">\n <div className=\"au-datepicker__segment-list-header\">\n <div onClick={closeList}>\n <IconChevronLeft />\n </div>\n <h4 className=\"au-datepicker__segment-title\">{mobileTitle}</h4>\n <div onClick={closeList}>\n <IconX />\n </div>\n </div>\n <ul className=\"au-datepicker__segment-list\">\n {options.map((option, idx) => {\n const isSelectedItem = option.value === currentValue\n return (\n <li\n key={`au-datepicker-segment-li-${option.value}-${idx}`}\n onClick={() => handleSelectItem(option)}\n ref={isSelectedItem ? selectedItem : null}\n className={classNames('au-datepicker__segment-list-item', {\n 'au-datep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AiB,MAAM;AAAA,gBACtC,KAAK,iBAAiB,eAAe;AAAA,gBACrC,WAAW,WAAW,oCAAoC;AAAA,kBACxD,4CAA4C;AAAA,gBAAA,CAC7C;AAAA,gBACA,UAAO,OAAA;AAAA,cAAA;AAAA,cANH,4BAA4B,OAAO,KAAK,IAAI,GAAG;AAAA,YAAA;AAAA,UASzD,CAAA,GACH;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -3,7 +3,7 @@ import "./index-BXRA68j0.js";
|
|
|
3
3
|
import "./components/Icon/index.es.js";
|
|
4
4
|
import { IconChevronLeft } from "./components/icons/IconChevronLeft/index.es.js";
|
|
5
5
|
import { IconChevronRight } from "./components/icons/IconChevronRight/index.es.js";
|
|
6
|
-
import { S as Segment } from "./index-
|
|
6
|
+
import { S as Segment } from "./index-AOefAAO5.js";
|
|
7
7
|
import $dbSRa$react__default, { createContext, useContext, useState, useRef, useCallback, useEffect, useMemo, forwardRef } from "react";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
createContext(null);
|
|
@@ -5686,4 +5686,4 @@ export {
|
|
|
5686
5686
|
$dfd62f934fc76fed$export$e11f8ba65d857bff as e,
|
|
5687
5687
|
$dfd62f934fc76fed$export$5d847498420df57b as f
|
|
5688
5688
|
};
|
|
5689
|
-
//# sourceMappingURL=index-
|
|
5689
|
+
//# sourceMappingURL=index-B0Ush_Ua.js.map
|