@handijitcom/ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -4
- package/build/components/Accordion/index.cjs +1 -1
- package/build/components/AppShell/Nav.cjs +1 -1
- package/build/components/AppShell/Nav.js +1 -1
- package/build/components/AppShell/context.js +2 -2
- package/build/components/AppShell/index.cjs +1 -1
- package/build/components/AppShell/index.cjs.map +1 -1
- package/build/components/AppShell/index.js +62 -55
- package/build/components/AppShell/index.js.map +1 -1
- package/build/components/AppShell/style.css +1 -1
- package/build/components/BottomSheet/index.cjs +1 -1
- package/build/components/BottomSheet/style.css +1 -1
- package/build/components/Breadcrumb/index.cjs +1 -1
- package/build/components/Breadcrumb/index.cjs.map +1 -1
- package/build/components/Breadcrumb/index.d.cts +11 -1
- package/build/components/Breadcrumb/index.d.ts +11 -1
- package/build/components/Breadcrumb/index.js +70 -22
- package/build/components/Breadcrumb/index.js.map +1 -1
- package/build/components/Breadcrumb/style.css +1 -1
- package/build/components/BulkPasteInput/index.cjs +1 -1
- package/build/components/Button/index.cjs +1 -1
- package/build/components/Carousel/index.cjs +1 -1
- package/build/components/ChipGroup/index.cjs +1 -1
- package/build/components/Combobox/index.cjs +1 -1
- package/build/components/CommandPalette/index.cjs +1 -1
- package/build/components/ConfirmDialog/index.cjs +1 -1
- package/build/components/DataTable/index.cjs +1 -1
- package/build/components/DataTable/index.cjs.map +1 -1
- package/build/components/DataTable/index.js +68 -67
- package/build/components/DataTable/index.js.map +1 -1
- package/build/components/DataTable/style.css +1 -1
- package/build/components/DataTableColumnMenu/index.cjs +1 -1
- package/build/components/DateField/index.js +1 -1
- package/build/components/Directory/index.js +1 -1
- package/build/components/Drawer/index.cjs +1 -1
- package/build/components/Drawer/style.css +1 -1
- package/build/components/Eyebrow/index.cjs +1 -1
- package/build/components/Eyebrow/index.cjs.map +1 -1
- package/build/components/Eyebrow/index.d.cts +6 -1
- package/build/components/Eyebrow/index.d.ts +6 -1
- package/build/components/Eyebrow/index.js +25 -6
- package/build/components/Eyebrow/index.js.map +1 -1
- package/build/components/Eyebrow/style.css +1 -1
- package/build/components/FileUpload/index.cjs +1 -1
- package/build/components/FilterBar/index.js +1 -1
- package/build/components/Gallery/index.cjs +1 -1
- package/build/components/Gallery/index.cjs.map +1 -1
- package/build/components/Gallery/index.js +28 -28
- package/build/components/Gallery/index.js.map +1 -1
- package/build/components/Gallery/style.css +1 -1
- package/build/components/Modal/index.cjs +1 -1
- package/build/components/Modal/style.css +1 -1
- package/build/components/MoneyInput/index.cjs +1 -1
- package/build/components/NotificationCenter/index.cjs +1 -1
- package/build/components/PageHeader/index.cjs +1 -1
- package/build/components/PageHeader/index.cjs.map +1 -1
- package/build/components/PageHeader/index.d.cts +5 -0
- package/build/components/PageHeader/index.d.ts +5 -0
- package/build/components/PageHeader/index.js +38 -28
- package/build/components/PageHeader/index.js.map +1 -1
- package/build/components/PageHeader/style.css +1 -1
- package/build/components/Pagination/index.cjs +1 -1
- package/build/components/Panel/index.js +1 -1
- package/build/components/PasswordInput/index.cjs +1 -1
- package/build/components/PercentInput/index.cjs +1 -1
- package/build/components/Popover/style.css +1 -1
- package/build/components/Price/index.cjs +1 -1
- package/build/components/Price/index.cjs.map +1 -1
- package/build/components/Price/index.d.cts +8 -0
- package/build/components/Price/index.d.ts +8 -0
- package/build/components/Price/index.js +44 -35
- package/build/components/Price/index.js.map +1 -1
- package/build/components/Price/style.css +1 -1
- package/build/components/PromptDialog/index.cjs +1 -1
- package/build/components/QuantityInput/index.cjs +1 -1
- package/build/components/RateInput/index.cjs +1 -1
- package/build/components/ScaledInput/index.cjs +1 -1
- package/build/components/SectionHeader/index.cjs +1 -1
- package/build/components/SectionHeader/index.cjs.map +1 -1
- package/build/components/SectionHeader/index.d.cts +2 -0
- package/build/components/SectionHeader/index.d.ts +2 -0
- package/build/components/SectionHeader/index.js +25 -15
- package/build/components/SectionHeader/index.js.map +1 -1
- package/build/components/SectionHeader/style.css +1 -1
- package/build/components/Select/index.cjs +1 -1
- package/build/components/Switch/index.js +4 -4
- package/build/components/Table/style.css +1 -1
- package/build/components/Tabs/index.cjs +1 -1
- package/build/components/Tabs/index.cjs.map +1 -1
- package/build/components/Tabs/index.js +120 -80
- package/build/components/Tabs/index.js.map +1 -1
- package/build/components/Tabs/style.css +1 -1
- package/build/components/Toast/index.cjs +1 -1
- package/build/components/Toast/style.css +1 -1
- package/build/components/ToastPortal/index.cjs +1 -1
- package/build/components/TotalsList/index.cjs +2 -0
- package/build/components/TotalsList/index.cjs.map +1 -0
- package/build/components/TotalsList/index.d.cts +26 -0
- package/build/components/TotalsList/index.d.ts +26 -0
- package/build/components/TotalsList/index.js +22 -0
- package/build/components/TotalsList/index.js.map +1 -0
- package/build/components/TotalsList/style.css +1 -0
- package/build/components/TreeSelect/index.cjs +1 -1
- package/build/components/UserMenu/index.cjs +1 -1
- package/build/constants/breakpoint.constants.cjs +1 -1
- package/build/constants/breakpoint.constants.cjs.map +1 -1
- package/build/constants/breakpoint.constants.d.cts +2 -0
- package/build/constants/breakpoint.constants.d.ts +2 -0
- package/build/constants/breakpoint.constants.js +5 -4
- package/build/constants/breakpoint.constants.js.map +1 -1
- package/build/helpers/scroll.helper.cjs +1 -1
- package/build/helpers/scroll.helper.cjs.map +1 -1
- package/build/helpers/scroll.helper.d.cts +6 -0
- package/build/helpers/scroll.helper.d.ts +6 -0
- package/build/helpers/scroll.helper.js +10 -5
- package/build/helpers/scroll.helper.js.map +1 -1
- package/build/hooks/usePrinting.cjs +2 -0
- package/build/hooks/usePrinting.cjs.map +1 -0
- package/build/hooks/usePrinting.d.cts +8 -0
- package/build/hooks/usePrinting.d.ts +8 -0
- package/build/hooks/usePrinting.js +18 -0
- package/build/hooks/usePrinting.js.map +1 -0
- package/build/index.cjs +1 -1
- package/build/index.d.cts +2 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +88 -86
- package/build/index.js.map +1 -1
- package/build/scss/_mixins.scss +8 -0
- package/build/styles.css +18 -16
- package/build/theme/context.js +2 -2
- package/build/types/theme.type.d.cts +5 -0
- package/build/types/theme.type.d.ts +5 -0
- package/build/types/types/theme.type.d.cts +5 -0
- package/build/types/types/theme.type.d.ts +5 -0
- package/package.json +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/AppShell/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type MouseEvent,\n type ReactNode,\n memo,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { ChevronDoubleLeft, List } from 'react-bootstrap-icons';\n\nimport { ABOVE_TABLET_MEDIA_QUERY } from '../../constants/breakpoint.constants';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport Drawer from '../Drawer';\nimport IconButton from '../IconButton';\nimport AppShellContext, { type AppShellContextValue, type AppShellLabels } from './context';\n\nimport styles from './index.module.scss';\n\nexport {\n AppShellNav,\n AppShellNavGroup,\n AppShellNavItem,\n type AppShellNavGroupProps,\n type AppShellNavItemProps,\n type AppShellNavLink,\n type AppShellNavProps,\n type AppShellNavSection,\n} from './Nav';\nexport type { AppShellLabels } from './context';\n\ntype Props = {\n /** The top of the sidebar: the logo or the product's name (usually a link home). */\n brand?: ReactNode;\n /** The sidebar's navigation, usually `<AppShellNav>`; drawn again in the narrow-window drawer. */\n navigation: ReactNode;\n /** Above the collapse toggle: help, version, a theme switch. */\n sidebarFooter?: ReactNode;\n /** The top bar's start: the page title or a `Breadcrumb`. */\n title?: ReactNode;\n /** The top bar's middle: a search field or a command palette trigger. */\n search?: ReactNode;\n /** The top bar's end: `NotificationCenter`, `UserMenu`… */\n actions?: ReactNode;\n /** The page. */\n children: ReactNode;\n /** The sidebar shows icons only. Controlled; uncontrolled when omitted. Persist it yourself. */\n isCollapsed?: boolean;\n /** The first state of an uncontrolled sidebar. */\n isDefaultCollapsed?: boolean;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n labels?: Partial<AppShellLabels>;\n className?: string;\n testId?: string;\n};\n\n/**\n * The frame of a signed-in panel (3.2): a sidebar that collapses to icons (a drawer below the\n * tablet width), a sticky top bar and the content. Presentational and router-agnostic: links go\n * through `UiProvider`'s `linkComponent`, the current path comes from `AppShellNav.currentPath`.\n *\n * It publishes two lengths on `<html>`: `--app-sidebar-width` (CSS, for `ToastPortal`'s `inset`)\n * and `--ui-header-height` (the top bar's height, read by the sticky components).\n */\nconst AppShell = ({\n brand,\n navigation,\n sidebarFooter,\n title,\n search,\n actions,\n children,\n isCollapsed,\n isDefaultCollapsed = false,\n onCollapsedChange,\n labels: labelProps,\n className,\n testId,\n}: Props) => {\n const { labels: config } = useUi();\n const text = { ...config?.appShell, ...labelProps };\n const mainId = useId();\n const mainRef = useRef<HTMLElement>(null);\n const topbarRef = useRef<HTMLElement>(null);\n\n const [uncontrolledCollapsed, setUncontrolledCollapsed] = useState(isDefaultCollapsed);\n const collapsed = isCollapsed ?? uncontrolledCollapsed;\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (isCollapsed === undefined) setUncontrolledCollapsed(next);\n onCollapsedChange?.(next);\n },\n [isCollapsed, onCollapsedChange],\n );\n\n const closeDrawer = useCallback(() => setIsDrawerOpen(false), []);\n const expandSidebar = useCallback(() => setCollapsed(false), [setCollapsed]);\n\n /* The window grew past the tablet width with the drawer open: the sidebar is back, close it. */\n useEffect(() => {\n if (!isDrawerOpen) return;\n const query = window.matchMedia(ABOVE_TABLET_MEDIA_QUERY);\n if (query.matches) {\n setIsDrawerOpen(false);\n return;\n }\n\n const handleChange = (event: MediaQueryListEvent) => {\n if (event.matches) setIsDrawerOpen(false);\n };\n query.addEventListener('change', handleChange);\n return () => query.removeEventListener('change', handleChange);\n }, [isDrawerOpen]);\n\n /* Sticky components (`DataTable` captions, `DirectoryGroup`) stop below the sticky top bar. */\n useEffect(() => {\n const topbar = topbarRef.current;\n if (!topbar || typeof ResizeObserver === 'undefined') return;\n\n const root = document.documentElement;\n const observer = new ResizeObserver(([entry]) =>\n root.style.setProperty('--ui-header-height', `${entry.contentRect.height}px`),\n );\n observer.observe(topbar);\n\n return () => {\n observer.disconnect();\n root.style.removeProperty('--ui-header-height');\n };\n }, []);\n\n /* A hash link would be read as a route by a hash router (Electron): focus the content instead. */\n const handleSkip = (event: MouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n mainRef.current?.focus();\n };\n\n const sidebarContext = useMemo<AppShellContextValue>(\n () => ({ isCollapsed: collapsed, onExpandSidebar: expandSidebar, labels: labelProps }),\n [collapsed, expandSidebar, labelProps],\n );\n const drawerContext = useMemo<AppShellContextValue>(\n () => ({ isCollapsed: false, onNavigate: closeDrawer, labels: labelProps }),\n [closeDrawer, labelProps],\n );\n\n const navigationLabel = resolveLabel('AppShell.labels.navigation', text.navigation);\n const toggleLabel = collapsed\n ? resolveLabel('AppShell.labels.expand', text.expand)\n : resolveLabel('AppShell.labels.collapse', text.collapse);\n\n return (\n <div\n className={cx(styles.shell, collapsed && styles['shell--collapsed'], className)}\n data-testid={testId}\n >\n <a href={`#${mainId}`} className={styles.shell__skip} onClick={handleSkip}>\n {resolveLabel('AppShell.labels.skipToContent', text.skipToContent)}\n </a>\n\n <aside className={styles.shell__sidebar}>\n {brand && <div className={styles.shell__brand}>{brand}</div>}\n <AppShellContext.Provider value={sidebarContext}>\n <div className={styles.shell__navigation}>{navigation}</div>\n </AppShellContext.Provider>\n <div className={styles.shell__footer}>\n {sidebarFooter}\n <IconButton\n icon={<ChevronDoubleLeft aria-hidden className={styles.shell__toggle} />}\n label={toggleLabel}\n size=\"sm\"\n className={styles['shell__toggle-button']}\n onClick={() => setCollapsed(!collapsed)}\n />\n </div>\n </aside>\n\n <div className={styles.shell__frame}>\n <header ref={topbarRef} className={styles.shell__topbar}>\n <IconButton\n icon={<List aria-hidden />}\n label={resolveLabel('AppShell.labels.openNavigation', text.openNavigation)}\n className={styles['shell__menu-button']}\n aria-expanded={isDrawerOpen}\n onClick={() => setIsDrawerOpen(true)}\n />\n {title && <div className={styles.shell__title}>{title}</div>}\n {search && <div className={styles.shell__search}>{search}</div>}\n {actions && <div className={styles.shell__actions}>{actions}</div>}\n </header>\n\n <main ref={mainRef} id={mainId} tabIndex={-1} className={styles.shell__content}>\n {children}\n </main>\n </div>\n\n <Drawer\n isOpen={isDrawerOpen}\n onClose={closeDrawer}\n title={navigationLabel}\n side=\"start\"\n size=\"sm\"\n className={styles.shell__drawer}\n >\n {/* Drawn only while open: a closed dialog must not hold a second navigation landmark. */}\n {isDrawerOpen && (\n <AppShellContext.Provider value={drawerContext}>\n {brand && <div className={styles['shell__drawer-brand']}>{brand}</div>}\n {navigation}\n </AppShellContext.Provider>\n )}\n </Drawer>\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(AppShell, 'AppShell')) as typeof AppShell;\n"],"names":["AppShell","brand","navigation","sidebarFooter","title","search","actions","children","isCollapsed","isDefaultCollapsed","onCollapsedChange","labelProps","className","testId","config","useUi","text","mainId","useId","mainRef","useRef","topbarRef","uncontrolledCollapsed","setUncontrolledCollapsed","useState","collapsed","isDrawerOpen","setIsDrawerOpen","setCollapsed","useCallback","next","closeDrawer","expandSidebar","useEffect","query","ABOVE_TABLET_MEDIA_QUERY","handleChange","event","topbar","root","observer","entry","handleSkip","_a","sidebarContext","useMemo","drawerContext","navigationLabel","resolveLabel","toggleLabel","jsxs","cx","styles","jsx","AppShellContext","IconButton","ChevronDoubleLeft","List","Drawer","index","memo","named"],"mappings":";;;;;;;;;;;;;AAuEA,MAAMA,KAAW,CAAC;AAAA,EAChB,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAA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UAAU,IAAI,WAAWmC,EAAO,gBAC7D,UAAA7C,EAAA,CACH;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA8C;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQhC;AAAA,YACR,SAASK;AAAA,YACT,OAAOgB;AAAA,YACP,MAAK;AAAA,YACL,MAAK;AAAA,YACL,WAAWK,EAAO;AAAA,YAGjB,eACC,gBAAAF,EAACI,EAAgB,UAAhB,EAAyB,OAAOR,GAC9B,UAAA;AAAA,cAAA7C,uBAAU,OAAA,EAAI,WAAWmD,EAAO,qBAAqB,GAAI,UAAAnD,GAAM;AAAA,cAC/DC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEAyD,KAA6B,gBAAAC,EAAmB,gBAAAC,EAAM7D,IAAU,UAAU,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/AppShell/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type MouseEvent,\n type ReactNode,\n memo,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { ChevronDoubleLeft, List } from 'react-bootstrap-icons';\n\nimport { ABOVE_TABLET_MEDIA_QUERY } from '../../constants/breakpoint.constants';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport Drawer from '../Drawer';\nimport IconButton from '../IconButton';\nimport AppShellContext, { type AppShellContextValue, type AppShellLabels } from './context';\n\nimport styles from './index.module.scss';\n\nexport {\n AppShellNav,\n AppShellNavGroup,\n AppShellNavItem,\n type AppShellNavGroupProps,\n type AppShellNavItemProps,\n type AppShellNavLink,\n type AppShellNavProps,\n type AppShellNavSection,\n} from './Nav';\nexport type { AppShellLabels } from './context';\n\ntype Props = {\n /** The top of the sidebar: the logo or the product's name (usually a link home). */\n brand?: ReactNode;\n /** The sidebar's navigation, usually `<AppShellNav>`; drawn again in the narrow-window drawer. */\n navigation: ReactNode;\n /** Above the collapse toggle: help, version, a theme switch. */\n sidebarFooter?: ReactNode;\n /** The top bar's start: the page title or a `Breadcrumb`. */\n title?: ReactNode;\n /** The top bar's middle: a search field or a command palette trigger. */\n search?: ReactNode;\n /** The top bar's end: `NotificationCenter`, `UserMenu`… */\n actions?: ReactNode;\n /** The page. */\n children: ReactNode;\n /** The sidebar shows icons only. Controlled; uncontrolled when omitted. Persist it yourself. */\n isCollapsed?: boolean;\n /** The first state of an uncontrolled sidebar. */\n isDefaultCollapsed?: boolean;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n labels?: Partial<AppShellLabels>;\n className?: string;\n testId?: string;\n};\n\n/**\n * The frame of a signed-in panel (3.2): a sidebar that collapses to icons (a drawer below the\n * tablet width), a sticky top bar and the content. Presentational and router-agnostic: links go\n * through `UiProvider`'s `linkComponent`, the current path comes from `AppShellNav.currentPath`.\n *\n * It publishes two lengths on `<html>`: `--app-sidebar-width` (CSS, for `ToastPortal`'s `inset`)\n * and `--ui-header-height` (the top bar's height, read by the sticky components).\n */\nconst AppShell = ({\n brand,\n navigation,\n sidebarFooter,\n title,\n search,\n actions,\n children,\n isCollapsed,\n isDefaultCollapsed = false,\n onCollapsedChange,\n labels: labelProps,\n className,\n testId,\n}: Props) => {\n const { labels: config } = useUi();\n const text = { ...config?.appShell, ...labelProps };\n const mainId = useId();\n const mainRef = useRef<HTMLElement>(null);\n const topbarRef = useRef<HTMLElement>(null);\n\n const [uncontrolledCollapsed, setUncontrolledCollapsed] = useState(isDefaultCollapsed);\n const collapsed = isCollapsed ?? uncontrolledCollapsed;\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (isCollapsed === undefined) setUncontrolledCollapsed(next);\n onCollapsedChange?.(next);\n },\n [isCollapsed, onCollapsedChange],\n );\n\n const closeDrawer = useCallback(() => setIsDrawerOpen(false), []);\n const expandSidebar = useCallback(() => setCollapsed(false), [setCollapsed]);\n\n /* The window grew past the tablet width with the drawer open: the sidebar is back, close it. */\n useEffect(() => {\n if (!isDrawerOpen) return;\n const query = window.matchMedia(ABOVE_TABLET_MEDIA_QUERY);\n if (query.matches) {\n setIsDrawerOpen(false);\n return;\n }\n\n const handleChange = (event: MediaQueryListEvent) => {\n if (event.matches) setIsDrawerOpen(false);\n };\n query.addEventListener('change', handleChange);\n return () => query.removeEventListener('change', handleChange);\n }, [isDrawerOpen]);\n\n /* Sticky components (`DataTable` captions, `DirectoryGroup`) stop below the sticky top bar. */\n useEffect(() => {\n const topbar = topbarRef.current;\n if (!topbar || typeof ResizeObserver === 'undefined') return;\n\n const root = document.documentElement;\n const observer = new ResizeObserver(([entry]) =>\n root.style.setProperty('--ui-header-height', `${entry.contentRect.height}px`),\n );\n observer.observe(topbar);\n\n return () => {\n observer.disconnect();\n root.style.removeProperty('--ui-header-height');\n };\n }, []);\n\n /* A hash link would be read as a route by a hash router (Electron): focus the content instead. */\n const handleSkip = (event: MouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n mainRef.current?.focus();\n };\n\n const handleDrawerBrandClick = (event: MouseEvent<HTMLDivElement>) => {\n if ((event.target as Element).closest('a')) closeDrawer();\n };\n\n const sidebarContext = useMemo<AppShellContextValue>(\n () => ({ isCollapsed: collapsed, onExpandSidebar: expandSidebar, labels: labelProps }),\n [collapsed, expandSidebar, labelProps],\n );\n const drawerContext = useMemo<AppShellContextValue>(\n () => ({ isCollapsed: false, onNavigate: closeDrawer, labels: labelProps }),\n [closeDrawer, labelProps],\n );\n\n const navigationLabel = resolveLabel('AppShell.labels.navigation', text.navigation);\n const toggleLabel = collapsed\n ? resolveLabel('AppShell.labels.expand', text.expand)\n : resolveLabel('AppShell.labels.collapse', text.collapse);\n\n return (\n <div\n className={cx(styles.shell, collapsed && styles['shell--collapsed'], className)}\n data-testid={testId}\n >\n <a href={`#${mainId}`} className={styles.shell__skip} onClick={handleSkip}>\n {resolveLabel('AppShell.labels.skipToContent', text.skipToContent)}\n </a>\n\n {/*\n The column paints the background and the rule down the whole page; the inner box is the\n sticky, viewport-tall part that holds the brand, the scrolling links and the toggle (3.2.1).\n */}\n <aside className={styles.shell__sidebar}>\n <div className={styles['shell__sidebar-inner']}>\n {brand && <div className={styles.shell__brand}>{brand}</div>}\n <AppShellContext.Provider value={sidebarContext}>\n <div className={styles.shell__navigation}>{navigation}</div>\n </AppShellContext.Provider>\n <div className={styles.shell__footer}>\n {sidebarFooter}\n <IconButton\n icon={<ChevronDoubleLeft aria-hidden className={styles.shell__toggle} />}\n label={toggleLabel}\n size=\"sm\"\n className={styles['shell__toggle-button']}\n onClick={() => setCollapsed(!collapsed)}\n />\n </div>\n </div>\n </aside>\n\n <div className={styles.shell__frame}>\n <header ref={topbarRef} className={styles.shell__topbar}>\n <IconButton\n icon={<List aria-hidden />}\n label={resolveLabel('AppShell.labels.openNavigation', text.openNavigation)}\n className={styles['shell__menu-button']}\n aria-expanded={isDrawerOpen}\n onClick={() => setIsDrawerOpen(true)}\n />\n {title && <div className={styles.shell__title}>{title}</div>}\n {search && <div className={styles.shell__search}>{search}</div>}\n {actions && <div className={styles.shell__actions}>{actions}</div>}\n </header>\n\n <main ref={mainRef} id={mainId} tabIndex={-1} className={styles.shell__content}>\n {children}\n </main>\n </div>\n\n <Drawer\n isOpen={isDrawerOpen}\n onClose={closeDrawer}\n title={navigationLabel}\n side=\"start\"\n size=\"sm\"\n className={styles.shell__drawer}\n >\n {/* Drawn only while open: a closed dialog must not hold a second navigation landmark. */}\n {isDrawerOpen && (\n <AppShellContext.Provider value={drawerContext}>\n {brand && (\n /* The brand is usually a link home: following it closes the drawer like a nav link. */\n <div className={styles['shell__drawer-brand']} onClick={handleDrawerBrandClick}>\n {brand}\n </div>\n )}\n {navigation}\n </AppShellContext.Provider>\n )}\n </Drawer>\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(AppShell, 'AppShell')) as typeof AppShell;\n"],"names":["AppShell","brand","navigation","sidebarFooter","title","search","actions","children","isCollapsed","isDefaultCollapsed","onCollapsedChange","labelProps","className","testId","config","useUi","text","mainId","useId","mainRef","useRef","topbarRef","uncontrolledCollapsed","setUncontrolledCollapsed","useState","collapsed","isDrawerOpen","setIsDrawerOpen","setCollapsed","useCallback","next","closeDrawer","expandSidebar","useEffect","query","ABOVE_TABLET_MEDIA_QUERY","handleChange","event","topbar","root","observer","entry","handleSkip","_a","handleDrawerBrandClick","sidebarContext","useMemo","drawerContext","navigationLabel","resolveLabel","toggleLabel","jsxs","cx","styles","jsx","AppShellContext","IconButton","ChevronDoubleLeft","List","Drawer","index","memo","named"],"mappings":";;;;;;;;;;;;;;AAuEA,MAAMA,KAAW,CAAC;AAAA,EAChB,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,mBAAAC;AAAA,EACA,QAAQC;AAAA,EACR,WAAAC;AAAA,EACA,QAAAC;AACF,MAAa;AACX,QAAM,EAAE,QAAQC,EAAA,IAAWC,GAAA,GACrBC,IAAO,EAAE,GAAGF,KAAA,gBAAAA,EAAQ,UAAU,GAAGH,EAAA,GACjCM,IAASC,EAAA,GACTC,IAAUC,EAAoB,IAAI,GAClCC,IAAYD,EAAoB,IAAI,GAEpC,CAACE,GAAuBC,CAAwB,IAAIC,EAASf,CAAkB,GAC/EgB,IAAYjB,KAAec,GAC3B,CAACI,GAAcC,CAAe,IAAIH,EAAS,EAAK,GAEhDI,IAAeC;AAAA,IACnB,CAACC,MAAkB;AACjB,MAAItB,MAAgB,UAAWe,EAAyBO,CAAI,GAC5DpB,KAAA,QAAAA,EAAoBoB;AAAA,IACtB;AAAA,IACA,CAACtB,GAAaE,CAAiB;AAAA,EAAA,GA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A,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEA0D,KAA6B,gBAAAC,EAAmB,gBAAAC,EAAM9D,IAAU,UAAU,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer ui{:root:has(.ui-shell-DdJz9){--app-sidebar-width: 232px}:root:has(.ui-shell--collapsed-mBfej){--app-sidebar-width: 56px}@media (max-width: 1024px){:root:has(.ui-shell-DdJz9){--app-sidebar-width: 0px}}.ui-srOnly--wftu{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell-DdJz9{display:grid;grid-template-columns:232px minmax(0,1fr);min-height:100dvh;background-color:var(--hd-bg-page);color:var(--hd-text);transition:grid-template-columns var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-shell-DdJz9{transition:none}}@media (max-width: 1024px){.ui-shell-DdJz9{grid-template-columns:minmax(0,1fr)}}.ui-shell--collapsed-mBfej{grid-template-columns:56px minmax(0,1fr)}@media (max-width: 1024px){.ui-shell--collapsed-mBfej{grid-template-columns:minmax(0,1fr)}}.ui-shell__skip-hqzkw{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell__skip-hqzkw:focus-visible{position:fixed;inset-block-start:var(--hd-space-2);inset-inline-start:var(--hd-space-2);z-index:var(--hd-z-tooltip);width:auto;height:auto;margin:0;padding:var(--hd-space-2) var(--hd-space-3);overflow:visible;clip-path:none;white-space:nowrap;border-radius:var(--hd-radius-sm);background-color:var(--hd-bg-raised);box-shadow:var(--hd-shadow-2);color:var(--hd-primary-text);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-semibold);text-decoration:none;outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-shell__sidebar-59ryl{position:sticky;inset-block-start:0;display:flex;flex-direction:column;height:100dvh;min-width:0;border-inline-end:1px solid var(--hd-border);background-color:var(--hd-bg-surface)}@media (max-width: 1024px){.ui-shell__sidebar-59ryl{display:none}}.ui-shell__brand-Mph-k{display:flex;align-items:center;flex-shrink:0;min-height:52px;padding-inline:var(--hd-space-4);overflow:hidden;border-block-end:1px solid var(--hd-border);font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text)}.ui-shell__navigation-quAVK{position:relative;flex:1;min-height:0;overflow-y:auto;padding:var(--hd-space-3) var(--hd-space-2);scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-shell__navigation-quAVK::-webkit-scrollbar{width:8px;height:8px}.ui-shell__navigation-quAVK::-webkit-scrollbar-track{background:transparent}.ui-shell__navigation-quAVK::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-shell__navigation-quAVK::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-shell__footer-gGr9S{display:flex;align-items:center;gap:var(--hd-space-2);flex-shrink:0;justify-content:flex-end;padding:var(--hd-space-2);border-block-start:1px solid var(--hd-border)}.ui-shell--collapsed-mBfej .ui-shell__footer-gGr9S{flex-direction:column;justify-content:center}.ui-shell--collapsed-mBfej .ui-shell__brand-Mph-k{justify-content:center;padding-inline:var(--hd-space-2)}[dir=rtl] .ui-shell__toggle--vukn{transform:scaleX(-1)}.ui-shell__toggle--vukn{transition:rotate var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-shell__toggle--vukn{transition:none}}.ui-shell--collapsed-mBfej .ui-shell__toggle--vukn{rotate:180deg}.ui-shell__frame-4Cwe2{display:flex;flex-direction:column;min-width:0}.ui-shell__topbar-HH2s0{display:flex;align-items:center;gap:var(--hd-space-3);position:sticky;inset-block-start:0;z-index:var(--hd-z-sticky);min-height:52px;padding-inline:var(--hd-space-4);border-block-end:1px solid var(--hd-border);background-color:var(--hd-bg-surface)}@media (max-width: 640px){.ui-shell__topbar-HH2s0{gap:var(--hd-space-2);padding-inline:var(--hd-space-3)}}.ui-shell__menu-button-8CeT4{display:none}@media (max-width: 1024px){.ui-shell__menu-button-8CeT4{display:inline-flex}}.ui-shell__title--Z5jA{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;min-width:0}.ui-shell__search-4Tij9{flex:1 1 auto;min-width:0;max-width:480px}.ui-shell__actions-RU34x{display:flex;align-items:center;gap:var(--hd-space-2);flex-shrink:0;margin-inline-start:auto}.ui-shell__content-nbbhQ{flex:1;min-width:0;padding:var(--hd-space-6)}.ui-shell__content-nbbhQ:focus{outline:none}@media (max-width: 1024px){.ui-shell__content-nbbhQ{padding:var(--hd-space-4)}}.ui-shell__drawer-brand-3MgNr{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);margin-block-end:var(--hd-space-3)}.ui-nav-3I7Ws{display:flex;flex-direction:column;gap:var(--hd-space-4)}.ui-nav__section-label-0CMnM{font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);letter-spacing:.045em;text-transform:uppercase;color:var(--hd-text-2);margin:0;padding:0 var(--hd-space-3) var(--hd-space-1);color:var(--hd-text-3)}.ui-nav__list-Wotlu,.ui-nav__sublist-8ut6O{display:flex;flex-direction:column;gap:var(--hd-space-0);margin:0;padding:0;list-style:none}.ui-nav__sublist-8ut6O{margin-inline-start:calc(var(--hd-space-3) + 18px / 2);padding-inline-start:var(--hd-space-2);border-inline-start:1px solid var(--hd-border)}.ui-nav__sublist-8ut6O[hidden]{display:none}.ui-nav__item-RvDle{display:flex;align-items:center;gap:var(--hd-space-2);background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-nav__item-RvDle:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-nav__item-RvDle:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-nav__item-RvDle{transition:none}.ui-nav__item-RvDle:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-nav__item-RvDle:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-nav__item-RvDle{position:relative;width:100%;min-height:36px;padding:0 var(--hd-space-3);border:0;border-radius:var(--hd-radius-sm);color:var(--hd-text-2);font-family:var(--hd-font-body);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-medium);line-height:var(--hd-type-h4-line-height);text-align:start;text-decoration:none;cursor:pointer}.ui-nav__item-RvDle:hover{color:var(--hd-text)}@media (hover: none) and (pointer: coarse){.ui-nav__item-RvDle{min-height:44px}}.ui-nav__item--active-Lg028{background-color:var(--hd-primary-soft);color:var(--hd-primary-text);font-weight:var(--hd-font-weight-semibold)}.ui-nav__item--active-Lg028:hover:not(:disabled){background-color:var(--hd-primary-soft-hover);color:var(--hd-primary-text)}.ui-nav__item--disabled-CcOTO{color:var(--hd-text-3)}@media (forced-colors: active){.ui-nav__item--disabled-CcOTO{color:GrayText}}.ui-nav__item--disabled-CcOTO{cursor:default}.ui-nav__item--disabled-CcOTO:hover{background-color:transparent;color:var(--hd-text-3)}.ui-nav__icon-NVN6X{display:inline-flex;flex-shrink:0;font-size:18px}.ui-nav__label-nlEMg{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.ui-nav__badge-aR8RE{flex-shrink:0;min-width:18px;height:18px;padding-inline:var(--hd-space-1);border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);color:var(--hd-on-primary);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);line-height:18px;text-align:center;font-variant-numeric:tabular-nums;box-sizing:border-box}@media (forced-colors: active){.ui-nav__badge-aR8RE{border:1px solid CanvasText}}.ui-nav__chevron-ZrqW9{flex-shrink:0;font-size:14px;transition:rotate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-nav__chevron--open-56sZo{rotate:180deg}@media (prefers-reduced-motion: reduce){.ui-nav__chevron-ZrqW9{transition:none}}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__section-label-0CMnM,.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__label-nlEMg{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__section-hkG3J+.ui-nav__section-hkG3J{padding-block-start:var(--hd-space-3);border-block-start:1px solid var(--hd-border)}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__item-RvDle{justify-content:center;padding:0}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__chevron-ZrqW9{display:none}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__badge-aR8RE{position:absolute;inset-block-start:2px;inset-inline-end:2px;min-width:14px;height:14px;padding-inline:3px;font-size:10px;line-height:14px}}
|
|
1
|
+
@layer ui{:root:has(.ui-shell-DdJz9){--app-sidebar-width: 232px}:root:has(.ui-shell--collapsed-mBfej){--app-sidebar-width: 56px}@media (max-width: 1024px){:root:has(.ui-shell-DdJz9){--app-sidebar-width: 0px}}.ui-srOnly--wftu{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell-DdJz9{display:grid;grid-template-columns:232px minmax(0,1fr);min-height:100dvh;background-color:var(--hd-bg-page);color:var(--hd-text);transition:grid-template-columns var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-shell-DdJz9{transition:none}}@media (max-width: 1024px){.ui-shell-DdJz9{grid-template-columns:minmax(0,1fr)}}.ui-shell--collapsed-mBfej{grid-template-columns:56px minmax(0,1fr)}@media (max-width: 1024px){.ui-shell--collapsed-mBfej{grid-template-columns:minmax(0,1fr)}}.ui-shell__skip-hqzkw{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell__skip-hqzkw:focus-visible{position:fixed;inset-block-start:var(--hd-space-2);inset-inline-start:var(--hd-space-2);z-index:var(--hd-z-tooltip);width:auto;height:auto;margin:0;padding:var(--hd-space-2) var(--hd-space-3);overflow:visible;clip-path:none;white-space:nowrap;border-radius:var(--hd-radius-sm);background-color:var(--hd-bg-raised);box-shadow:var(--hd-shadow-2);color:var(--hd-primary-text);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-semibold);text-decoration:none;outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-shell__sidebar-59ryl{min-width:0;border-inline-end:1px solid var(--hd-border);background-color:var(--hd-bg-surface)}@media (max-width: 1024px){.ui-shell__sidebar-59ryl{display:none}}.ui-shell__sidebar-inner-iIXhF{position:sticky;inset-block-start:0;display:flex;flex-direction:column;height:100dvh}.ui-shell__brand-Mph-k{display:flex;align-items:center;gap:var(--hd-space-2);flex-shrink:0;min-height:52px;padding-inline:var(--hd-space-4);overflow:hidden;border-block-end:1px solid var(--hd-border);font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text)}.ui-shell__brand-Mph-k :where(a),.ui-shell__brand-Mph-k :where(a)>:where(span){display:inline-flex;align-items:center;gap:var(--hd-space-2);min-width:0}.ui-shell__brand-Mph-k :where(svg){flex-shrink:0}.ui-shell__navigation-quAVK{position:relative;flex:1;min-height:0;overflow-y:auto;padding:var(--hd-space-3) var(--hd-space-2);scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-shell__navigation-quAVK::-webkit-scrollbar{width:8px;height:8px}.ui-shell__navigation-quAVK::-webkit-scrollbar-track{background:transparent}.ui-shell__navigation-quAVK::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-shell__navigation-quAVK::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-shell__footer-gGr9S{display:flex;align-items:center;gap:var(--hd-space-2);flex-shrink:0;justify-content:flex-end;padding:var(--hd-space-2);border-block-start:1px solid var(--hd-border)}.ui-shell--collapsed-mBfej .ui-shell__footer-gGr9S{flex-direction:column;justify-content:center}.ui-shell--collapsed-mBfej .ui-shell__brand-Mph-k{justify-content:center;padding-inline:var(--hd-space-2)}[dir=rtl] .ui-shell__toggle--vukn{transform:scaleX(-1)}.ui-shell__toggle--vukn{transition:rotate var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-shell__toggle--vukn{transition:none}}.ui-shell--collapsed-mBfej .ui-shell__toggle--vukn{rotate:180deg}.ui-shell__frame-4Cwe2{display:flex;flex-direction:column;min-width:0}.ui-shell__topbar-HH2s0{display:flex;align-items:center;gap:var(--hd-space-3);position:sticky;inset-block-start:0;z-index:var(--hd-z-sticky);min-height:52px;padding-inline:var(--hd-space-4);border-block-end:1px solid var(--hd-border);background-color:var(--hd-bg-surface)}@media (max-width: 640px){.ui-shell__topbar-HH2s0{gap:var(--hd-space-2);padding-inline:var(--hd-space-3)}}.ui-shell__menu-button-8CeT4{display:none}@media (max-width: 1024px){.ui-shell__menu-button-8CeT4{display:inline-flex}}.ui-shell__title--Z5jA{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;min-width:0}.ui-shell__search-4Tij9{flex:1 1 auto;min-width:0;max-width:480px}.ui-shell__actions-RU34x{display:flex;align-items:center;gap:var(--hd-space-2);flex-shrink:0;margin-inline-start:auto}.ui-shell__content-nbbhQ{flex:1;min-width:0;padding:var(--hd-space-6)}.ui-shell__content-nbbhQ:focus{outline:none}@media (max-width: 1024px){.ui-shell__content-nbbhQ{padding:var(--hd-space-4)}}.ui-shell__drawer-brand-3MgNr{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text)}.ui-shell__drawer-brand-3MgNr :where(a),.ui-shell__drawer-brand-3MgNr :where(a)>:where(span){display:inline-flex;align-items:center;gap:var(--hd-space-2);min-width:0}.ui-shell__drawer-brand-3MgNr :where(svg){flex-shrink:0}.ui-shell__drawer-brand-3MgNr{margin-block-end:var(--hd-space-3)}.ui-nav-3I7Ws{display:flex;flex-direction:column;gap:var(--hd-space-4)}.ui-nav__section-label-0CMnM{font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);letter-spacing:.045em;text-transform:uppercase;color:var(--hd-text-2);margin:0;padding:0 var(--hd-space-3) var(--hd-space-1);color:var(--hd-text-3)}.ui-nav__list-Wotlu,.ui-nav__sublist-8ut6O{display:flex;flex-direction:column;gap:var(--hd-space-0);margin:0;padding:0;list-style:none}.ui-nav__sublist-8ut6O{margin-inline-start:calc(var(--hd-space-3) + 18px / 2);padding-inline-start:var(--hd-space-2);border-inline-start:1px solid var(--hd-border)}.ui-nav__sublist-8ut6O[hidden]{display:none}.ui-nav__item-RvDle{display:flex;align-items:center;gap:var(--hd-space-2);background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-nav__item-RvDle:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-nav__item-RvDle:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-nav__item-RvDle{transition:none}.ui-nav__item-RvDle:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-nav__item-RvDle:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-nav__item-RvDle{position:relative;width:100%;min-height:36px;padding:0 var(--hd-space-3);border:0;border-radius:var(--hd-radius-sm);color:var(--hd-text-2);font-family:var(--hd-font-body);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-medium);line-height:var(--hd-type-h4-line-height);text-align:start;text-decoration:none;cursor:pointer}.ui-nav__item-RvDle:hover{color:var(--hd-text)}@media (hover: none) and (pointer: coarse){.ui-nav__item-RvDle{min-height:44px}}.ui-nav__item--active-Lg028{background-color:var(--hd-primary-soft);color:var(--hd-primary-text);font-weight:var(--hd-font-weight-semibold)}.ui-nav__item--active-Lg028:hover:not(:disabled){background-color:var(--hd-primary-soft-hover);color:var(--hd-primary-text)}.ui-nav__item--disabled-CcOTO{color:var(--hd-text-3)}@media (forced-colors: active){.ui-nav__item--disabled-CcOTO{color:GrayText}}.ui-nav__item--disabled-CcOTO{cursor:default}.ui-nav__item--disabled-CcOTO:hover{background-color:transparent;color:var(--hd-text-3)}.ui-nav__icon-NVN6X{display:inline-flex;flex-shrink:0;font-size:18px}.ui-nav__label-nlEMg{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.ui-nav__badge-aR8RE{flex-shrink:0;min-width:18px;height:18px;padding-inline:var(--hd-space-1);border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);color:var(--hd-on-primary);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);line-height:18px;text-align:center;font-variant-numeric:tabular-nums;box-sizing:border-box}@media (forced-colors: active){.ui-nav__badge-aR8RE{border:1px solid CanvasText}}.ui-nav__chevron-ZrqW9{flex-shrink:0;font-size:14px;transition:rotate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-nav__chevron--open-56sZo{rotate:180deg}@media (prefers-reduced-motion: reduce){.ui-nav__chevron-ZrqW9{transition:none}}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__section-label-0CMnM,.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__label-nlEMg{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__section-hkG3J+.ui-nav__section-hkG3J{padding-block-start:var(--hd-space-3);border-block-start:1px solid var(--hd-border)}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__item-RvDle{justify-content:center;padding:0}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__chevron-ZrqW9{display:none}.ui-shell--collapsed-mBfej .ui-shell__sidebar-59ryl .ui-nav__badge-aR8RE{position:absolute;inset-block-start:2px;inset-inline-end:2px;min-width:14px;height:14px;padding-inline:3px;font-size:10px;line-height:14px}@media print{.ui-shell-DdJz9,.ui-shell--collapsed-mBfej{display:block;min-height:0;background:none}.ui-shell__skip-hqzkw,.ui-shell__sidebar-59ryl,.ui-shell__topbar-HH2s0{display:none}.ui-shell__content-nbbhQ{padding:0}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),j=require("react-dom"),k=require("@handijitcom/utils"),v=require("../../constants/breakpoint.constants.cjs"),M=require("react-bootstrap-icons"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),j=require("react-dom"),k=require("@handijitcom/utils"),v=require("../../constants/breakpoint.constants.cjs"),M=require("react-bootstrap-icons"),B=require("../../helpers/class-name.helper.cjs"),a=require("../../helpers/focus.helper.cjs"),E=require("../../helpers/label.helper.cjs"),L=require("../../theme/context.cjs"),N=require("../../hooks/useScrollLock.cjs"),S=require("../../hooks/useSheetViewport.cjs"),y=require("../IconButton/index.cjs"),r={default:{"sheet":"ui-sheet-GEvdE","sheet__header":"ui-sheet__header-NJgw-","sheet__title":"ui-sheet__title-f-b07","sheet__toolbar":"ui-sheet__toolbar-eyhmW","sheet__body":"ui-sheet__body-eJ2KB","sheet__footer":"ui-sheet__footer-NpsY5"}},I=({title:_,closeLabel:m,onClose:c,children:p,toolbar:i,footer:d,closeAbove:h=v.ABOVE_MOBILE_MEDIA_QUERY,className:q,testId:b})=>{const{labels:o}=L.useUi(),f=s.useId(),n=s.useRef(null);S.default(),N.default(),s.useEffect(()=>{const e=a.captureFocus(),{token:u,pop:l}=a.pushModal();return n.current=u,()=>{l(),n.current=null,e()}},[]),s.useEffect(()=>{const e=window.matchMedia(h),u=l=>{l.matches&&c()};return e.addEventListener("change",u),()=>e.removeEventListener("change",u)},[h,c]);const x=s.useCallback(e=>{!e||e.open||(e.showModal(),a.focusFirstMeaningful(e,`.${r.default.sheet__header} button`),a.preventAutoKeyboard(e))},[]),g=s.useCallback(e=>{e.target===e.currentTarget&&c()},[c]);return k.isClient()?j.createPortal(t.jsxs("dialog",{ref:x,className:B.cx(r.default.sheet,q),"aria-labelledby":f,"data-testid":b,onCancel:e=>{e.preventDefault(),!(n.current&&!a.isTopModal(n.current))&&c()},onClick:g,children:[t.jsxs("header",{className:r.default.sheet__header,children:[t.jsx("h2",{id:f,className:r.default.sheet__title,children:_}),t.jsx(y.default,{icon:t.jsx(M.XLg,{"aria-hidden":!0}),label:E.resolveLabel("BottomSheet.closeLabel",m,o==null?void 0:o.close),variant:"ghost",size:"sm",onClick:c})]}),i&&t.jsx("div",{className:r.default.sheet__toolbar,children:i}),t.jsx("div",{className:r.default.sheet__body,children:p}),d&&t.jsx("div",{className:r.default.sheet__footer,children:d})]}),document.body):null},R=s.memo(I);exports.default=R;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer ui{.ui-sheet-GEvdE{display:none}.ui-sheet-GEvdE[open]{display:flex;flex-direction:column;position:fixed;inset:auto 0 max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)) 0;width:100%;max-width:none;max-height:max(min(50dvh,320px),min(80dvh,var(--ui-sheet-height, 100dvh) - var(--hd-space-5) - env(safe-area-inset-top,0px)));margin:0;padding:0;border:none;border-radius:var(--hd-radius-lg) var(--hd-radius-lg) 0 0;background-color:var(--hd-bg-overlay);color:var(--hd-text);box-shadow:var(--hd-shadow-3);overflow:hidden;animation:var(--ui-anim-slide-up) var(--hd-duration-base) var(--hd-ease-standard)}.ui-sheet-GEvdE[open]:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-sheet-GEvdE[open]::backdrop{background-color:var(--hd-scrim);animation:var(--ui-anim-fade-in) var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-sheet-GEvdE[open]{animation:none}.ui-sheet-GEvdE[open]::backdrop{animation:none}}.ui-sheet__header-NJgw-{display:flex;align-items:center;gap:var(--hd-space-3);justify-content:space-between;padding:var(--hd-space-3) var(--hd-space-4);border-bottom:1px solid var(--hd-border);flex-shrink:0;padding-left:max(var(--hd-space-4),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-4),env(safe-area-inset-right,0px))}.ui-sheet__title-f-b07{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);margin:0}.ui-sheet__toolbar-eyhmW{padding:var(--hd-space-2) var(--hd-space-3);border-bottom:1px solid var(--hd-border);flex-shrink:0;padding-left:max(var(--hd-space-3),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-3),env(safe-area-inset-right,0px))}.ui-sheet__body-eJ2KB{flex:1 1 auto;min-height:0;position:relative;overflow-y:auto;overscroll-behavior:contain;padding:var(--hd-space-2) var(--hd-space-3);padding-left:max(var(--hd-space-3),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-3),env(safe-area-inset-right,0px));scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-sheet__body-eJ2KB::-webkit-scrollbar{width:8px;height:8px}.ui-sheet__body-eJ2KB::-webkit-scrollbar-track{background:transparent}.ui-sheet__body-eJ2KB::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-sheet__body-eJ2KB::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-sheet__body-eJ2KB:last-child{padding-bottom:max(var(--hd-space-3),env(safe-area-inset-bottom,0px) - max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)))}.ui-sheet__footer-NpsY5{display:flex;align-items:center;gap:var(--hd-space-3);padding:var(--hd-space-3) var(--hd-space-4);padding-left:max(var(--hd-space-4),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-4),env(safe-area-inset-right,0px));padding-bottom:max(var(--hd-space-3),env(safe-area-inset-bottom,0px) - max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)));border-top:1px solid var(--hd-border);flex-shrink:0}.ui-sheet__footer-NpsY5>*{flex:1}}
|
|
1
|
+
@layer ui{.ui-sheet-GEvdE{display:none}.ui-sheet-GEvdE[open]{display:flex;flex-direction:column;position:fixed;inset:auto 0 max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)) 0;width:100%;max-width:none;max-height:max(min(50dvh,320px),min(80dvh,var(--ui-sheet-height, 100dvh) - var(--hd-space-5) - env(safe-area-inset-top,0px)));margin:0;padding:0;border:none;border-radius:var(--hd-radius-lg) var(--hd-radius-lg) 0 0;background-color:var(--hd-bg-overlay);color:var(--hd-text);box-shadow:var(--hd-shadow-3);overflow:hidden;animation:var(--ui-anim-slide-up) var(--hd-duration-base) var(--hd-ease-standard)}.ui-sheet-GEvdE[open]:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-sheet-GEvdE[open]::backdrop{background-color:var(--hd-scrim);animation:var(--ui-anim-fade-in) var(--hd-duration-base) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-sheet-GEvdE[open]{animation:none}.ui-sheet-GEvdE[open]::backdrop{animation:none}}.ui-sheet__header-NJgw-{display:flex;align-items:center;gap:var(--hd-space-3);justify-content:space-between;padding:var(--hd-space-3) var(--hd-space-4);border-bottom:1px solid var(--hd-border);flex-shrink:0;padding-left:max(var(--hd-space-4),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-4),env(safe-area-inset-right,0px))}.ui-sheet__title-f-b07{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);margin:0}.ui-sheet__toolbar-eyhmW{padding:var(--hd-space-2) var(--hd-space-3);border-bottom:1px solid var(--hd-border);flex-shrink:0;padding-left:max(var(--hd-space-3),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-3),env(safe-area-inset-right,0px))}.ui-sheet__body-eJ2KB{flex:1 1 auto;min-height:0;position:relative;overflow-y:auto;overscroll-behavior:contain;padding:var(--hd-space-2) var(--hd-space-3);padding-left:max(var(--hd-space-3),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-3),env(safe-area-inset-right,0px));scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-sheet__body-eJ2KB::-webkit-scrollbar{width:8px;height:8px}.ui-sheet__body-eJ2KB::-webkit-scrollbar-track{background:transparent}.ui-sheet__body-eJ2KB::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-sheet__body-eJ2KB::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-sheet__body-eJ2KB:last-child{padding-bottom:max(var(--hd-space-3),env(safe-area-inset-bottom,0px) - max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)))}.ui-sheet__footer-NpsY5{display:flex;align-items:center;gap:var(--hd-space-3);padding:var(--hd-space-3) var(--hd-space-4);padding-left:max(var(--hd-space-4),env(safe-area-inset-left,0px));padding-right:max(var(--hd-space-4),env(safe-area-inset-right,0px));padding-bottom:max(var(--hd-space-3),env(safe-area-inset-bottom,0px) - max(env(safe-area-inset-bottom,0px),var(--ui-sheet-inset-bottom, 0px)));border-top:1px solid var(--hd-border);flex-shrink:0}.ui-sheet__footer-NpsY5>*{flex:1}@media print{.ui-sheet-GEvdE,.ui-sheet-GEvdE[open]{display:none}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),s=require("react"),R=require("react-bootstrap-icons"),f=require("../../helpers/class-name.helper.cjs"),v=require("../../helpers/label.helper.cjs"),S=require("../../theme/context.cjs"),C=require("../Link/index.cjs"),e={default:{"breadcrumb":"ui-breadcrumb-amB9n","breadcrumb__item":"ui-breadcrumb__item-Icv1S","breadcrumb__item--collapsible":"ui-breadcrumb__item--collapsible--78Bh","breadcrumb__item--current":"ui-breadcrumb__item--current-n8TP2","breadcrumb__more":"ui-breadcrumb__more--Qlht","breadcrumb__expand":"ui-breadcrumb__expand-rVebA","breadcrumb__link":"ui-breadcrumb__link-eVkPq","breadcrumb__current":"ui-breadcrumb__current-8XjhU","breadcrumb__separator":"ui-breadcrumb__separator-vvaUi","breadcrumb--expanded":"ui-breadcrumb--expanded-W2irv"}},L=3,y=({items:c,label:m,expandLabel:p,linkProps:_,className:h,testId:x})=>{const{labels:l}=S.useUi(),[u,j]=s.useState(!1),o=s.useRef(null),d=s.useRef(!1),i=c.length>L&&!u,q=c.slice(1,-2);s.useEffect(()=>{var r,t;d.current&&(d.current=!1,(t=(r=o.current)==null?void 0:r.querySelector(":scope > li:nth-child(2) a"))==null||t.focus())},[u]);const g=()=>{d.current=!0,j(!0)},b=a.jsx(R.CaretRightFill,{"aria-hidden":!0,className:e.default.breadcrumb__separator});return a.jsx("nav",{className:h,"aria-label":v.resolveLabel("Breadcrumb.label",m,l==null?void 0:l.breadcrumb),"data-testid":x,children:a.jsx("ol",{ref:o,className:f.cx(e.default.breadcrumb,u&&e.default["breadcrumb--expanded"]),children:c.map((r,t)=>{const n=t===c.length-1,N=i&&t>0&&t<c.length-2;return a.jsxs(s.Fragment,{children:[a.jsxs("li",{className:f.cx(e.default.breadcrumb__item,N&&e.default["breadcrumb__item--collapsible"],n&&e.default["breadcrumb__item--current"]),children:[r.href&&!n?a.jsx(C.default,{href:r.href,className:e.default.breadcrumb__link,..._,children:r.label}):a.jsx("span",{className:e.default.breadcrumb__current,"aria-current":"page",title:n?r.label:void 0,children:r.label}),!n&&b]}),t===0&&i&&a.jsxs("li",{className:e.default.breadcrumb__more,children:[a.jsx("button",{type:"button",className:e.default.breadcrumb__expand,"aria-expanded":!1,"aria-label":p??(l==null?void 0:l.breadcrumbExpand)??q.map(E=>E.label).join(", "),onClick:g,children:"…"}),b]})]},`${r.label}-${t}`)})})})},B=s.memo(y);exports.default=B;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo } from 'react';\n\nimport { CaretRightFill } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport UiLink from '../Link';\n\nimport styles from './index.module.scss';\n\nexport type Crumb = {\n label: string;\n /** Son öğede verilmez: bulunduğumuz sayfa bağlantı olmaz. */\n href?: string;\n};\n\ntype Props = {\n items: Crumb[];\n /** Gezinme bölgesinin erişilebilir adı. */\n label?: string;\n /** Yönlendiriciye geçirilecek ek props. */\n linkProps?: UiLinkExtraProps;\n className?: string;\n testId?: string;\n};\n\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, Fragment, memo, useEffect, useRef, useState } from 'react';\n\nimport { CaretRightFill } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport UiLink from '../Link';\n\nimport styles from './index.module.scss';\n\nexport type Crumb = {\n label: string;\n /** Son öğede verilmez: bulunduğumuz sayfa bağlantı olmaz. */\n href?: string;\n};\n\ntype Props = {\n items: Crumb[];\n /** Gezinme bölgesinin erişilebilir adı. */\n label?: string;\n /**\n * The name of the \"…\" button that shows the whole trail on a narrow screen (\"Tüm yolu göster\";\n * `UiLabels.breadcrumbExpand`). Without one it is named by the crumbs it hides (3.2.1).\n */\n expandLabel?: string;\n /** Yönlendiriciye geçirilecek ek props. */\n linkProps?: UiLinkExtraProps;\n className?: string;\n testId?: string;\n};\n\n/*\n * A trail longer than this collapses on a narrow screen to the first crumb, \"…\", the parent and the\n * current page (3.2.1).\n */\nconst COLLAPSE_AFTER = 3;\n\n/**\n * Kırıntı yolu. On a narrow screen (≤ tablet portrait) it stays on one line: the middle crumbs fold\n * into a \"…\" button that unfolds the whole trail, and the current page is cut with an ellipsis (its\n * full text in `title`). The page never scrolls sideways (3.2.1; until 3.2.0 the trail was a\n * scrolling strip that ran to the screen's edge).\n */\nconst Breadcrumb: FC<Props> = ({ items, label, expandLabel, linkProps, className, testId }) => {\n const { labels } = useUi();\n const [isExpanded, setIsExpanded] = useState(false);\n const listRef = useRef<HTMLOListElement>(null);\n const didExpandRef = useRef(false);\n\n const isCollapsible = items.length > COLLAPSE_AFTER && !isExpanded;\n const hidden = items.slice(1, -2);\n\n /* The button that had the focus is gone: the focus moves to the first crumb it revealed. */\n useEffect(() => {\n if (!didExpandRef.current) return;\n didExpandRef.current = false;\n listRef.current?.querySelector<HTMLElement>(':scope > li:nth-child(2) a')?.focus();\n }, [isExpanded]);\n\n const expand = () => {\n didExpandRef.current = true;\n setIsExpanded(true);\n };\n\n const separator = <CaretRightFill aria-hidden className={styles.breadcrumb__separator} />;\n\n return (\n <nav\n className={className}\n aria-label={resolveLabel('Breadcrumb.label', label, labels?.breadcrumb)}\n data-testid={testId}\n >\n <ol\n ref={listRef}\n className={cx(styles.breadcrumb, isExpanded && styles['breadcrumb--expanded'])}\n >\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const isHidden = isCollapsible && index > 0 && index < items.length - 2;\n\n return (\n <Fragment key={`${item.label}-${index}`}>\n <li\n className={cx(\n styles.breadcrumb__item,\n isHidden && styles['breadcrumb__item--collapsible'],\n isLast && styles['breadcrumb__item--current'],\n )}\n >\n {item.href && !isLast ? (\n <UiLink href={item.href} className={styles.breadcrumb__link} {...linkProps}>\n {item.label}\n </UiLink>\n ) : (\n <span\n className={styles.breadcrumb__current}\n aria-current=\"page\"\n title={isLast ? item.label : undefined}\n >\n {item.label}\n </span>\n )}\n\n {!isLast && separator}\n </li>\n\n {index === 0 && isCollapsible && (\n <li className={styles.breadcrumb__more}>\n <button\n type=\"button\"\n className={styles.breadcrumb__expand}\n aria-expanded={false}\n aria-label={\n expandLabel ??\n labels?.breadcrumbExpand ??\n hidden.map(crumb => crumb.label).join(', ')\n }\n onClick={expand}\n >\n …\n </button>\n {separator}\n </li>\n )}\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nexport default /*#__PURE__*/ memo(Breadcrumb) as typeof Breadcrumb;\n"],"names":["COLLAPSE_AFTER","Breadcrumb","items","label","expandLabel","linkProps","className","testId","labels","useUi","isExpanded","setIsExpanded","useState","listRef","useRef","didExpandRef","isCollapsible","hidden","useEffect","_b","_a","expand","separator","jsx","CaretRightFill","styles","resolveLabel","cx","item","index","isLast","isHidden","Fragment","jsxs","UiLink","crumb"],"mappings":"0ZAsCMA,EAAiB,EAQjBC,EAAwB,CAAC,CAAE,MAAAC,EAAO,MAAAC,EAAO,YAAAC,EAAa,UAAAC,EAAW,UAAAC,EAAW,OAAAC,KAAa,CAC7F,KAAM,CAAE,OAAAC,CAAA,EAAWC,QAAA,EACb,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAK,EAC5CC,EAAUC,EAAAA,OAAyB,IAAI,EACvCC,EAAeD,EAAAA,OAAO,EAAK,EAE3BE,EAAgBd,EAAM,OAASF,GAAkB,CAACU,EAClDO,EAASf,EAAM,MAAM,EAAG,EAAE,EAGhCgB,EAAAA,UAAU,IAAM,SACTH,EAAa,UAClBA,EAAa,QAAU,IACvBI,GAAAC,EAAAP,EAAQ,UAAR,YAAAO,EAAiB,cAA2B,gCAA5C,MAAAD,EAA2E,QAC7E,EAAG,CAACT,CAAU,CAAC,EAEf,MAAMW,EAAS,IAAM,CACnBN,EAAa,QAAU,GACvBJ,EAAc,EAAI,CACpB,EAEMW,EAAYC,MAACC,EAAAA,eAAA,CAAe,cAAW,GAAC,UAAWC,UAAO,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KAAK,IAAIC,CAAK,EA2CrC,CAEJ,CAAC,CAAA,CAAA,CACH,CAAA,CAGN,EAEAA,SAAkC5B,CAAU"}
|
|
@@ -9,12 +9,22 @@ type Props = {
|
|
|
9
9
|
items: Crumb[];
|
|
10
10
|
/** Gezinme bölgesinin erişilebilir adı. */
|
|
11
11
|
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the "…" button that shows the whole trail on a narrow screen ("Tüm yolu göster";
|
|
14
|
+
* `UiLabels.breadcrumbExpand`). Without one it is named by the crumbs it hides (3.2.1).
|
|
15
|
+
*/
|
|
16
|
+
expandLabel?: string;
|
|
12
17
|
/** Yönlendiriciye geçirilecek ek props. */
|
|
13
18
|
linkProps?: UiLinkExtraProps;
|
|
14
19
|
className?: string;
|
|
15
20
|
testId?: string;
|
|
16
21
|
};
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Kırıntı yolu. On a narrow screen (≤ tablet portrait) it stays on one line: the middle crumbs fold
|
|
24
|
+
* into a "…" button that unfolds the whole trail, and the current page is cut with an ellipsis (its
|
|
25
|
+
* full text in `title`). The page never scrolls sideways (3.2.1; until 3.2.0 the trail was a
|
|
26
|
+
* scrolling strip that ran to the screen's edge).
|
|
27
|
+
*/
|
|
18
28
|
declare const Breadcrumb: FC<Props>;
|
|
19
29
|
declare const _default: typeof Breadcrumb;
|
|
20
30
|
export default _default;
|
|
@@ -9,12 +9,22 @@ type Props = {
|
|
|
9
9
|
items: Crumb[];
|
|
10
10
|
/** Gezinme bölgesinin erişilebilir adı. */
|
|
11
11
|
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the "…" button that shows the whole trail on a narrow screen ("Tüm yolu göster";
|
|
14
|
+
* `UiLabels.breadcrumbExpand`). Without one it is named by the crumbs it hides (3.2.1).
|
|
15
|
+
*/
|
|
16
|
+
expandLabel?: string;
|
|
12
17
|
/** Yönlendiriciye geçirilecek ek props. */
|
|
13
18
|
linkProps?: UiLinkExtraProps;
|
|
14
19
|
className?: string;
|
|
15
20
|
testId?: string;
|
|
16
21
|
};
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Kırıntı yolu. On a narrow screen (≤ tablet portrait) it stays on one line: the middle crumbs fold
|
|
24
|
+
* into a "…" button that unfolds the whole trail, and the current page is cut with an ellipsis (its
|
|
25
|
+
* full text in `title`). The page never scrolls sideways (3.2.1; until 3.2.0 the trail was a
|
|
26
|
+
* scrolling strip that ran to the screen's edge).
|
|
27
|
+
*/
|
|
18
28
|
declare const Breadcrumb: FC<Props>;
|
|
19
29
|
declare const _default: typeof Breadcrumb;
|
|
20
30
|
export default _default;
|
|
@@ -1,31 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { CaretRightFill as
|
|
2
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { memo as j, useState as k, useRef as b, useEffect as v, Fragment as y } from "react";
|
|
4
|
+
import { CaretRightFill as F } from "react-bootstrap-icons";
|
|
5
5
|
import { cx as p } from "../../helpers/class-name.helper.js";
|
|
6
|
-
import { resolveLabel as
|
|
7
|
-
import { useUi as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const { labels:
|
|
12
|
-
|
|
6
|
+
import { resolveLabel as S } from "../../helpers/label.helper.js";
|
|
7
|
+
import { useUi as A } from "../../theme/context.js";
|
|
8
|
+
import B from "../Link/index.js";
|
|
9
|
+
const e = {"breadcrumb":"ui-breadcrumb-amB9n","breadcrumb__item":"ui-breadcrumb__item-Icv1S","breadcrumb__item--collapsible":"ui-breadcrumb__item--collapsible--78Bh","breadcrumb__item--current":"ui-breadcrumb__item--current-n8TP2","breadcrumb__more":"ui-breadcrumb__more--Qlht","breadcrumb__expand":"ui-breadcrumb__expand-rVebA","breadcrumb__link":"ui-breadcrumb__link-eVkPq","breadcrumb__current":"ui-breadcrumb__current-8XjhU","breadcrumb__separator":"ui-breadcrumb__separator-vvaUi","breadcrumb--expanded":"ui-breadcrumb--expanded-W2irv"};
|
|
10
|
+
const U = 3, $ = ({ items: t, label: f, expandLabel: h, linkProps: _, className: x, testId: E }) => {
|
|
11
|
+
const { labels: c } = A(), [s, N] = k(!1), i = b(null), o = b(!1), u = t.length > U && !s, g = t.slice(1, -2);
|
|
12
|
+
v(() => {
|
|
13
|
+
var r, a;
|
|
14
|
+
o.current && (o.current = !1, (a = (r = i.current) == null ? void 0 : r.querySelector(":scope > li:nth-child(2) a")) == null || a.focus());
|
|
15
|
+
}, [s]);
|
|
16
|
+
const L = () => {
|
|
17
|
+
o.current = !0, N(!0);
|
|
18
|
+
}, m = /* @__PURE__ */ l(F, { "aria-hidden": !0, className: e.breadcrumb__separator });
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
13
20
|
"nav",
|
|
14
21
|
{
|
|
15
|
-
className:
|
|
16
|
-
"aria-label":
|
|
17
|
-
"data-testid":
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
className: x,
|
|
23
|
+
"aria-label": S("Breadcrumb.label", f, c == null ? void 0 : c.breadcrumb),
|
|
24
|
+
"data-testid": E,
|
|
25
|
+
children: /* @__PURE__ */ l(
|
|
26
|
+
"ol",
|
|
27
|
+
{
|
|
28
|
+
ref: i,
|
|
29
|
+
className: p(e.breadcrumb, s && e["breadcrumb--expanded"]),
|
|
30
|
+
children: t.map((r, a) => {
|
|
31
|
+
const n = a === t.length - 1, R = u && a > 0 && a < t.length - 2;
|
|
32
|
+
return /* @__PURE__ */ d(y, { children: [
|
|
33
|
+
/* @__PURE__ */ d(
|
|
34
|
+
"li",
|
|
35
|
+
{
|
|
36
|
+
className: p(
|
|
37
|
+
e.breadcrumb__item,
|
|
38
|
+
R && e["breadcrumb__item--collapsible"],
|
|
39
|
+
n && e["breadcrumb__item--current"]
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
r.href && !n ? /* @__PURE__ */ l(B, { href: r.href, className: e.breadcrumb__link, ..._, children: r.label }) : /* @__PURE__ */ l(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: e.breadcrumb__current,
|
|
46
|
+
"aria-current": "page",
|
|
47
|
+
title: n ? r.label : void 0,
|
|
48
|
+
children: r.label
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
!n && m
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
a === 0 && u && /* @__PURE__ */ d("li", { className: e.breadcrumb__more, children: [
|
|
56
|
+
/* @__PURE__ */ l(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
type: "button",
|
|
60
|
+
className: e.breadcrumb__expand,
|
|
61
|
+
"aria-expanded": !1,
|
|
62
|
+
"aria-label": h ?? (c == null ? void 0 : c.breadcrumbExpand) ?? g.map((C) => C.label).join(", "),
|
|
63
|
+
onClick: L,
|
|
64
|
+
children: "…"
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
m
|
|
68
|
+
] })
|
|
69
|
+
] }, `${r.label}-${a}`);
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
)
|
|
25
73
|
}
|
|
26
74
|
);
|
|
27
|
-
},
|
|
75
|
+
}, D = /* @__PURE__ */ j($);
|
|
28
76
|
export {
|
|
29
|
-
|
|
77
|
+
D as default
|
|
30
78
|
};
|
|
31
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo } from 'react';\n\nimport { CaretRightFill } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport UiLink from '../Link';\n\nimport styles from './index.module.scss';\n\nexport type Crumb = {\n label: string;\n /** Son öğede verilmez: bulunduğumuz sayfa bağlantı olmaz. */\n href?: string;\n};\n\ntype Props = {\n items: Crumb[];\n /** Gezinme bölgesinin erişilebilir adı. */\n label?: string;\n /** Yönlendiriciye geçirilecek ek props. */\n linkProps?: UiLinkExtraProps;\n className?: string;\n testId?: string;\n};\n\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, Fragment, memo, useEffect, useRef, useState } from 'react';\n\nimport { CaretRightFill } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport UiLink from '../Link';\n\nimport styles from './index.module.scss';\n\nexport type Crumb = {\n label: string;\n /** Son öğede verilmez: bulunduğumuz sayfa bağlantı olmaz. */\n href?: string;\n};\n\ntype Props = {\n items: Crumb[];\n /** Gezinme bölgesinin erişilebilir adı. */\n label?: string;\n /**\n * The name of the \"…\" button that shows the whole trail on a narrow screen (\"Tüm yolu göster\";\n * `UiLabels.breadcrumbExpand`). Without one it is named by the crumbs it hides (3.2.1).\n */\n expandLabel?: string;\n /** Yönlendiriciye geçirilecek ek props. */\n linkProps?: UiLinkExtraProps;\n className?: string;\n testId?: string;\n};\n\n/*\n * A trail longer than this collapses on a narrow screen to the first crumb, \"…\", the parent and the\n * current page (3.2.1).\n */\nconst COLLAPSE_AFTER = 3;\n\n/**\n * Kırıntı yolu. On a narrow screen (≤ tablet portrait) it stays on one line: the middle crumbs fold\n * into a \"…\" button that unfolds the whole trail, and the current page is cut with an ellipsis (its\n * full text in `title`). The page never scrolls sideways (3.2.1; until 3.2.0 the trail was a\n * scrolling strip that ran to the screen's edge).\n */\nconst Breadcrumb: FC<Props> = ({ items, label, expandLabel, linkProps, className, testId }) => {\n const { labels } = useUi();\n const [isExpanded, setIsExpanded] = useState(false);\n const listRef = useRef<HTMLOListElement>(null);\n const didExpandRef = useRef(false);\n\n const isCollapsible = items.length > COLLAPSE_AFTER && !isExpanded;\n const hidden = items.slice(1, -2);\n\n /* The button that had the focus is gone: the focus moves to the first crumb it revealed. */\n useEffect(() => {\n if (!didExpandRef.current) return;\n didExpandRef.current = false;\n listRef.current?.querySelector<HTMLElement>(':scope > li:nth-child(2) a')?.focus();\n }, [isExpanded]);\n\n const expand = () => {\n didExpandRef.current = true;\n setIsExpanded(true);\n };\n\n const separator = <CaretRightFill aria-hidden className={styles.breadcrumb__separator} />;\n\n return (\n <nav\n className={className}\n aria-label={resolveLabel('Breadcrumb.label', label, labels?.breadcrumb)}\n data-testid={testId}\n >\n <ol\n ref={listRef}\n className={cx(styles.breadcrumb, isExpanded && styles['breadcrumb--expanded'])}\n >\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const isHidden = isCollapsible && index > 0 && index < items.length - 2;\n\n return (\n <Fragment key={`${item.label}-${index}`}>\n <li\n className={cx(\n styles.breadcrumb__item,\n isHidden && styles['breadcrumb__item--collapsible'],\n isLast && styles['breadcrumb__item--current'],\n )}\n >\n {item.href && !isLast ? (\n <UiLink href={item.href} className={styles.breadcrumb__link} {...linkProps}>\n {item.label}\n </UiLink>\n ) : (\n <span\n className={styles.breadcrumb__current}\n aria-current=\"page\"\n title={isLast ? item.label : undefined}\n >\n {item.label}\n </span>\n )}\n\n {!isLast && separator}\n </li>\n\n {index === 0 && isCollapsible && (\n <li className={styles.breadcrumb__more}>\n <button\n type=\"button\"\n className={styles.breadcrumb__expand}\n aria-expanded={false}\n aria-label={\n expandLabel ??\n labels?.breadcrumbExpand ??\n hidden.map(crumb => crumb.label).join(', ')\n }\n onClick={expand}\n >\n …\n </button>\n {separator}\n </li>\n )}\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nexport default /*#__PURE__*/ memo(Breadcrumb) as typeof Breadcrumb;\n"],"names":["COLLAPSE_AFTER","Breadcrumb","items","label","expandLabel","linkProps","className","testId","labels","useUi","isExpanded","setIsExpanded","useState","listRef","useRef","didExpandRef","isCollapsible","hidden","useEffect","_b","_a","expand","separator","jsx","CaretRightFill","styles","resolveLabel","cx","item","index","isLast","isHidden","Fragment","jsxs","UiLink","crumb"],"mappings":";;;;;;;;;AAsCA,MAAMA,IAAiB,GAQjBC,IAAwB,CAAC,EAAE,OAAAC,GAAO,OAAAC,GAAO,aAAAC,GAAa,WAAAC,GAAW,WAAAC,GAAW,QAAAC,QAAa;AAC7F,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACb,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5CC,IAAUC,EAAyB,IAAI,GACvCC,IAAeD,EAAO,EAAK,GAE3BE,IAAgBd,EAAM,SAASF,KAAkB,CAACU,GAClDO,IAASf,EAAM,MAAM,GAAG,EAAE;AAGhC,EAAAgB,EAAU,MAAM;;AACd,IAAKH,EAAa,YAClBA,EAAa,UAAU,KACvBI,KAAAC,IAAAP,EAAQ,YAAR,gBAAAO,EAAiB,cAA2B,kCAA5C,QAAAD,EAA2E;AAAA,EAC7E,GAAG,CAACT,CAAU,CAAC;AAEf,QAAMW,IAAS,MAAM;AACnB,IAAAN,EAAa,UAAU,IACvBJ,EAAc,EAAI;AAAA,EACpB,GAEMW,IAAY,gBAAAC,EAACC,GAAA,EAAe,eAAW,IAAC,WAAWC,EAAO,uBAAuB;AAEvF,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAAjB;AAAA,MACA,cAAYoB,EAAa,oBAAoBvB,GAAOK,KAAA,gBAAAA,EAAQ,UAAU;AAAA,MACtE,eAAaD;AAAA,MAEb,UAAA,gBAAAgB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKV;AAAA,UACL,WAAWc,EAAGF,EAAO,YAAYf,KAAce,EAAO,sBAAsB,CAAC;AAAA,UAE5E,UAAAvB,EAA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MAAA;AAAA,IACH;AAAA,EAAA;AAGN,GAEAA,sBAAkC5B,CAAU;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer ui{.ui-breadcrumb-amB9n{display:flex;align-items:center;flex-wrap:wrap;gap:var(--hd-space-1);list-style:none;margin:0;padding:0;font-size:var(--hd-type-caption-size)}@media (max-width: 768px){.ui-breadcrumb-amB9n{display:flex;gap:var(--hd-space-1);
|
|
1
|
+
@layer ui{.ui-breadcrumb-amB9n{display:flex;align-items:center;flex-wrap:wrap;gap:var(--hd-space-1);list-style:none;margin:0;padding:0;font-size:var(--hd-type-caption-size)}@media (max-width: 768px){.ui-breadcrumb-amB9n{flex-wrap:nowrap;min-width:0}}.ui-breadcrumb__item-Icv1S{display:inline-flex;align-items:center;gap:var(--hd-space-1);min-width:0;white-space:nowrap}@media (max-width: 768px){.ui-breadcrumb__item-Icv1S{flex-shrink:0;max-inline-size:45%}.ui-breadcrumb__item--collapsible--78Bh{display:none}.ui-breadcrumb__item--current-n8TP2{flex-shrink:1;max-inline-size:none}}.ui-breadcrumb__more--Qlht{display:none;align-items:center;gap:var(--hd-space-1);flex-shrink:0}@media (max-width: 768px){.ui-breadcrumb__more--Qlht{display:inline-flex}}.ui-breadcrumb__expand-rVebA{position:relative}.ui-breadcrumb__expand-rVebA:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:max(100%,44px);height:max(100%,44px)}.ui-breadcrumb__expand-rVebA{padding:0 var(--hd-space-1);border:none;border-radius:var(--hd-radius-xs);background:none;color:var(--hd-text-2);font:inherit;line-height:inherit;cursor:pointer}.ui-breadcrumb__expand-rVebA:hover{color:var(--hd-primary-text)}.ui-breadcrumb__expand-rVebA:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-breadcrumb__link-eVkPq,.ui-breadcrumb__current-8XjhU{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ui-breadcrumb__link-eVkPq{color:var(--hd-text-2);text-decoration:none;transition:color var(--hd-duration-fast) var(--hd-ease-standard)}.ui-breadcrumb__link-eVkPq:hover{color:var(--hd-primary-text);text-decoration:underline}.ui-breadcrumb__link-eVkPq:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}@media (prefers-reduced-motion: reduce){.ui-breadcrumb__link-eVkPq{transition:none}}.ui-breadcrumb__current-8XjhU{color:var(--hd-text-2);font-weight:var(--hd-font-weight-medium)}[dir=rtl] .ui-breadcrumb__separator-vvaUi{transform:scaleX(-1)}.ui-breadcrumb__separator-vvaUi{color:var(--hd-text-3);font-size:14px;flex-shrink:0}@media (max-width: 768px){.ui-breadcrumb--expanded-W2irv{flex-wrap:wrap}.ui-breadcrumb--expanded-W2irv .ui-breadcrumb__item-Icv1S{max-inline-size:100%}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("react"),C=require("react-bootstrap-icons"),L=require("../../helpers/aria.helper.cjs"),v=require("../../helpers/bulk-paste.helper.cjs"),R=require("../../helpers/class-name.helper.cjs"),E=require("../../helpers/component.helper.cjs"),i=require("../../helpers/label.helper.cjs"),M=require("../../theme/context.cjs"),O=require("../Textarea/index.cjs"),s={default:{"bulkPaste":"ui-bulkPaste-0253L","field":"ui-field-72YYR","summary":"ui-summary-zFZmI","count":"ui-count-b0m99","invalidCount":"ui-invalidCount--sJWx","invalid":"ui-invalid-qxcOP","invalid__line":"ui-invalid__line-SG08k","invalid__number":"ui-invalid__number-2QaG9","invalid__text":"ui-invalid__text-6JmsT","invalid__reason":"ui-invalid__reason-PEYK3"}},U=t.forwardRef(({value:h,defaultValue:f,onChange:u,onParse:d,defaultQuantity:c,isMergingDuplicates:o,labels:j,rows:k=6,className:q,testId:B,"aria-describedby":N,"aria-invalid":I,...P},y)=>{const{labels:m}=M.useUi(),b=t.useId(),[F,S]=t.useState(f??""),l=h??F,T={defaultQuantity:c,isMergingDuplicates:o},x=t.useMemo(()=>v.parseBulkPaste(l,{defaultQuantity:c,isMergingDuplicates:o}),[l,c,o]),r={...m==null?void 0:m.bulkPaste,...j},w=a=>{const p=a.target.value;h===void 0&&S(p),u==null||u(a),d==null||d(v.parseBulkPaste(p,T),p)},_=l.trim().length>0,n=x.invalid.length;return e.jsxs("div",{className:R.cx(s.default.bulkPaste,q),"data-testid":B,children:[e.jsx(O.default,{ref:y,rows:k,value:l,onChange:w,spellCheck:!1,"aria-describedby":L.idList(_&&b,N),"aria-invalid":n>0||I||void 0,className:s.default.field,...P}),e.jsx("div",{id:b,role:"status",className:s.default.summary,children:_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:s.default.count,children:i.resolveFormatter("BulkPasteInput.labels.summary",r.summary,x.rows.length)}),n>0&&e.jsxs("span",{className:s.default.invalidCount,children:[e.jsx(C.ExclamationCircleFill,{"aria-hidden":!0}),i.resolveFormatter("BulkPasteInput.labels.invalidSummary",r.invalidSummary,n)]})]})}),n>0&&e.jsx("ul",{className:s.default.invalid,children:x.invalid.map(a=>e.jsxs("li",{className:s.default.invalid__line,children:[e.jsx("span",{className:s.default.invalid__number,children:i.resolveFormatter("BulkPasteInput.labels.line",r.line,a.line)}),e.jsx("code",{className:s.default.invalid__text,children:a.text}),e.jsx("span",{className:s.default.invalid__reason,children:i.resolveLabel(`BulkPasteInput.labels.${a.reason}`,r[a.reason])})]},a.line))})]})}),$=t.memo(E.named(U,"BulkPasteInput"));exports.parseBulkPaste=v.parseBulkPaste;exports.default=$;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),m=require("react"),h=require("../../helpers/class-name.helper.cjs"),k=require("../../helpers/component.helper.cjs"),v=require("../../enums/ui-size.enum.cjs"),C=require("../../enums/ui-variant.enum.cjs"),R=require("../Link/index.cjs")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),m=require("react"),h=require("../../helpers/class-name.helper.cjs"),k=require("../../helpers/component.helper.cjs"),v=require("../../enums/ui-size.enum.cjs"),C=require("../../enums/ui-variant.enum.cjs"),R=require("../Link/index.cjs"),S=require("../Spinner/index.cjs"),e={default:{"button":"ui-button-SRu4R","button__icon":"ui-button__icon-giom6","button__spinner":"ui-button__spinner-vexVG","button__label":"ui-button__label-qiMHm","button--inert":"ui-button--inert-iUGId","button--full":"ui-button--full-CwPHR","button--loading":"ui-button--loading-O-naJ","button--xsmall":"ui-button--xsmall-MmjpU","button--pill":"ui-button--pill-VFBYN","button--small":"ui-button--small-TF9Hz","button--medium":"ui-button--medium-JDjkH","button--large":"ui-button--large-btadu","button--primary":"ui-button--primary-ym7RJ","button--accent":"ui-button--accent--hgUf","button--secondary":"ui-button--secondary-56m1d","button--outline":"ui-button--outline-ZI8sw","button--soft":"ui-button--soft-xKGjx","button--ghost":"ui-button--ghost-rijnZ","button--danger":"ui-button--danger-TNGd2","button--on-brand":"ui-button--on-brand-lH26K"}},w=m.forwardRef(({variant:f=C.default.PRIMARY,size:_=v.default.MEDIUM,shape:x="rounded",isLoading:n,isFullWidth:p,startIcon:c,endIcon:i,className:j,children:q,disabled:d,href:a,isExternal:N,linkProps:B,testId:o,...u},M)=>{const l=!!d||!!n,r=h.cx(e.default.button,e.default[`button--${f.toLowerCase().replace("_","-")}`],e.default[`button--${_.toLowerCase()}`],x==="pill"&&e.default["button--pill"],p&&e.default["button--full"],n&&e.default["button--loading"],a&&l&&e.default["button--inert"],j),s=t.jsxs(t.Fragment,{children:[n&&t.jsx(S.default,{size:"sm",className:e.default.button__spinner,label:""}),!n&&c&&t.jsx("span",{className:e.default.button__icon,children:c}),t.jsx("span",{className:e.default.button__label,children:q}),i&&t.jsx("span",{className:e.default.button__icon,children:i})]}),b={"aria-busy":n,"aria-disabled":l||void 0,tabIndex:l?-1:u.tabIndex,onClick:l?void 0:u.onClick};return a&&N?t.jsx("a",{...u,...b,href:a,className:r,target:"_blank",rel:"noopener noreferrer","data-testid":o,children:s}):a?t.jsx(R.default,{...u,...b,href:a,className:r,"data-testid":o,...B,children:s}):t.jsx("button",{ref:M,className:r,disabled:d||n,"aria-busy":n,"data-testid":o,...u,children:s})}),y=m.memo(k.named(w,"Button"));exports.default=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),s=require("react"),p=require("react-bootstrap-icons"),b=require("../../helpers/class-name.helper.cjs"),z=require("../../helpers/component.helper.cjs"),x=require("../IconButton/index.cjs"),r={default:{"carousel":"ui-carousel-GJXkW","carousel__controls":"ui-carousel__controls-hm5ij","carousel__arrowIcon":"ui-carousel__arrowIcon-adFey","carousel__track":"ui-carousel__track-mAux5","carousel__dots":"ui-carousel__dots-iU8RJ","carousel__dot":"ui-carousel__dot-JTLCB","carousel__dot--active":"ui-carousel__dot--active-riNMm"}},F=({children:d,label:f,previousLabel:S,nextLabel:C,formatDotLabel:m,itemWidth:j,itemMinWidth:y,className:g,testId:k})=>{const o=s.useRef(null),[w,N]=s.useState(!1),[q,B]=s.useState(!1),[_,M]=s.useState(0),[u,R]=s.useState(1),[i,I]=s.useState(!1),n=s.useCallback(()=>{const t=o.current;if(!t)return;const{scrollLeft:e,scrollWidth:c,clientWidth:l}=t;N(e>1),B(e+l<c-1),M(l>0?Math.round(e/l):0),R(l>0?Math.max(1,Math.ceil(c/l)):1),I(c>l&&t.querySelector("a, button, input, select, textarea, [tabindex]")===null)},[]);s.useEffect(()=>{const t=o.current;if(!t)return;n(),t.addEventListener("scroll",n,{passive:!0});const e=typeof ResizeObserver>"u"?null:new ResizeObserver(n);return e==null||e.observe(t),()=>{t.removeEventListener("scroll",n),e==null||e.disconnect()}},[n,d]);const h=()=>{var t;return typeof window<"u"&&((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)?"auto":"smooth"},v=t=>{var e;return(e=o.current)==null?void 0:e.scrollBy({left:t*o.current.clientWidth,behavior:h()})};return a.jsxs("section",{className:b.cx(r.default.carousel,g),"aria-label":f,"data-testid":k,children:[a.jsxs("div",{className:r.default.carousel__controls,children:[a.jsx(x.default,{icon:a.jsx(p.CaretLeftFill,{"aria-hidden":!0,className:r.default.carousel__arrowIcon}),label:S,variant:"secondary",size:"sm",disabled:!w,onClick:()=>v(-1)}),a.jsx(x.default,{icon:a.jsx(p.CaretRightFill,{"aria-hidden":!0,className:r.default.carousel__arrowIcon}),label:C,variant:"secondary",size:"sm",disabled:!q,onClick:()=>v(1)})]}),a.jsx("div",{ref:o,className:r.default.carousel__track,style:{"--ui-carousel-item-default":`${j??y??240}px`},tabIndex:i?0:void 0,role:i?"group":void 0,"aria-label":i?f:void 0,children:d}),m&&u>1&&a.jsx("div",{className:r.default.carousel__dots,children:Array.from({length:u},(t,e)=>a.jsx("button",{type:"button",className:b.cx(r.default.carousel__dot,e===_&&r.default["carousel__dot--active"]),"aria-label":m(e+1,u),"aria-current":e===_?"true":void 0,onClick:()=>{var c;return(c=o.current)==null?void 0:c.scrollTo({left:e*o.current.clientWidth,behavior:h()})}},e))})]})},P=s.memo(z.named(F,"Carousel"));exports.default=P;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),h=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),h=require("react"),j=require("../../helpers/class-name.helper.cjs"),A=require("../Chip/index.cjs"),t={default:{"group":"ui-group-0tnVf","group--scrollable":"ui-group--scrollable-PMu6V","group--readOnly":"ui-group--readOnly-uqpPV"}},I=({options:i,label:p,size:g="md",isScrollable:x,isDisabled:n,isReadOnly:l,id:M,required:m,"aria-describedby":y,"aria-invalid":q,className:w,...r})=>{var c;const s=h.useRef(null),C=e=>r.isMultiple?r.value.includes(e):r.value===e,D=e=>{if(!l){if(r.isMultiple){const a=r.value.includes(e)?r.value.filter(u=>u!==e):[...r.value,e];r.onChange(a);return}r.onChange(r.value===e?null:e)}},S=e=>{var o,v;if(r.isMultiple)return;const a=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(a===0||(e.preventDefault(),l||n))return;const u=i.filter(d=>!d.isDisabled);if(u.length===0)return;const k=u.findIndex(d=>d.value===r.value),f=u[(k+a+u.length)%u.length];r.onChange(f.value),(v=(o=s.current)==null?void 0:o.querySelector(`[data-chip-value="${f.value}"]`))==null||v.focus()},_=r.isMultiple?null:r.value??((c=i.find(e=>!e.isDisabled))==null?void 0:c.value)??null;return b.jsx("div",{ref:s,className:j.cx(t.default.group,x&&t.default["group--scrollable"],l&&t.default["group--readOnly"],w),id:M,role:r.isMultiple?"group":"radiogroup","aria-label":p,"aria-describedby":y,"aria-invalid":q||void 0,"aria-required":!r.isMultiple&&m||void 0,"aria-readonly":!r.isMultiple&&l||void 0,onKeyDown:S,children:i.map(e=>b.jsx(A.default,{size:g,icon:e.icon,count:e.count,isSelected:C(e.value),disabled:n||e.isDisabled,role:r.isMultiple?void 0:"radio",tabIndex:r.isMultiple||e.value===_?0:-1,"data-chip-value":e.value,onClick:()=>D(e.value),children:e.label},e.value))})},K=h.memo(I);exports.default=K;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),r=require("react"),Le=require("react-dom"),D=require("react-bootstrap-icons"),Ce=require("../../constants/breakpoint.constants.cjs"),E=require("../../helpers/class-name.helper.cjs"),Ee=require("../../helpers/component.helper.cjs"),we=require("../../helpers/ref.helper.cjs"),S=require("../../helpers/label.helper.cjs"),ae=require("../../helpers/text.helper.cjs"),Ie=require("../../hooks/useAsyncSearch.cjs"),Me=require("../../hooks/useListboxNavigation.cjs"),De=require("../../hooks/usePortalSurface.cjs"),Se=require("../../hooks/usePositioning.cjs"),Re=require("../../hooks/useVirtualList.cjs"),Te=require("../../theme/context.cjs"),Pe=require("../BottomSheet/index.cjs"),ke=require("../Spinner/index.cjs"),R=require("../../constants/combobox.constants.cjs"),o={default:{"combobox":"ui-combobox-NtZoV","combobox__trigger":"ui-combobox__trigger-2riRR","combobox__trigger--empty":"ui-combobox__trigger--empty-RxwCq","combobox__trigger--open":"ui-combobox__trigger--open-rw1ZS","combobox__trigger--invalid":"ui-combobox__trigger--invalid-iZgiN","combobox__trigger--readOnly":"ui-combobox__trigger--readOnly-o2wH-","combobox__trigger--sm":"ui-combobox__trigger--sm-2xG91","combobox__trigger--clearable":"ui-combobox__trigger--clearable-shq9I","combobox__chevron":"ui-combobox__chevron-g-QzQ","combobox__leadingIcon":"ui-combobox__leadingIcon-it2xz","combobox__value":"ui-combobox__value-acDlr","combobox__clear":"ui-combobox__clear-EXOsc","combobox__chevron--open":"ui-combobox__chevron--open-9kj1j","combobox__panel":"ui-combobox__panel-srBxl","combobox__search":"ui-combobox__search-THjer","combobox__searchIcon":"ui-combobox__searchIcon-vr4Bg","combobox__searchInput":"ui-combobox__searchInput-JPp5h","combobox__list":"ui-combobox__list-p-eCs","combobox__list--sheet":"ui-combobox__list--sheet-r3MzB","combobox__option":"ui-combobox__option-CLWh-","combobox__option--active":"ui-combobox__option--active--75Vq","combobox__option--selected":"ui-combobox__option--selected-DVFGy","combobox__option--disabled":"ui-combobox__option--disabled-e6VjI","combobox__optionText":"ui-combobox__optionText-Zm0D6","combobox__optionLabel":"ui-combobox__optionLabel-WvT4W","combobox__optionDescription":"ui-combobox__optionDescription-8OEzi","combobox__check":"ui-combobox__check-MKlLz","combobox__empty":"ui-combobox__empty-mZwBq","combobox__srName":"ui-combobox__srName-9PNXF"}},$e=({options:g,value:v,onChange:O,onBlur:B,labels:d,isSearchHidden:K,onSearch:T,isLoading:U,isDisabled:y,isReadOnly:m,isClearable:V,icon:z,size:ne="md",id:le,required:ce,className:ie,testId:ue,"aria-describedby":de,"aria-invalid":G},Q)=>{const{labels:s}=Te.useUi(),j={get search(){var e;return S.resolveLabel("Combobox.searchPlaceholder",d.searchPlaceholder,(e=s==null?void 0:s.combobox)==null?void 0:e.searchPlaceholder)},get empty(){var e;return S.resolveLabel("Combobox.emptyMessage",d.emptyMessage,(e=s==null?void 0:s.combobox)==null?void 0:e.emptyMessage)},get loading(){var e;return S.resolveLabel("Combobox.loadingMessage",d.loadingMessage,(e=s==null?void 0:s.combobox)==null?void 0:e.loadingMessage)},get clear(){var e;return S.resolveLabel("Combobox.clearLabel",d.clearLabel,(e=s==null?void 0:s.combobox)==null?void 0:e.clearLabel)}},be=r.useId(),u=le??be,P=`${u}-listbox`,k=r.useRef(null),w=r.useRef(null),N=r.useRef(null),F=r.useRef(null),me=r.useCallback(e=>{w.current=e,we.assignRef(Q,e)},[Q]),[l,W]=r.useState(null),c=l!==null,[q,$]=r.useState(""),[fe,I]=r.useState(null),i=r.useMemo(()=>{if(T||q.trim()==="")return g;const e=q.trim();return g.filter(a=>ae.matchesSearch(a.label,e)||(a.description?ae.matchesSearch(a.description,e):!1))},[g,q,T]),p=g.find(e=>e.value===v)??null;r.useEffect(()=>{p?I(p.label):v===null&&I(null)},[p,v]);const L=(p==null?void 0:p.label)??fe;Ie.default(q,c,T,R.SEARCH_DEBOUNCE_MS);const _=r.useCallback(()=>{W(null),$("")},[]),X=r.useCallback(()=>{y||m||(W(window.matchMedia(Ce.SHEET_MEDIA_QUERY).matches?"sheet":"popover"),$(""))},[y,m]);r.useEffect(()=>{if(l!=="popover")return;const e=a=>{var h,b;const n=a.target;(h=k.current)!=null&&h.contains(n)||(b=N.current)!=null&&b.contains(n)||_()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[l,_]),r.useEffect(()=>{var e;l==="popover"&&((e=F.current)==null||e.focus({preventScroll:!0}))},[l]);const Y=e=>{e.isDisabled||(I(e.label),O(e.value),_())},J=r.useRef(!1);r.useEffect(()=>{var e;J.current&&!c&&((e=w.current)==null||e.focus()),J.current=c},[c]);const A=Se.default(w,N,{side:"bottom",align:"start",isOpen:c&&l==="popover"}),M=De.default(l==="popover",w,N),{activeIndex:C,setActiveIndex:Z,listRef:xe,handleKeyDown:ee}=Me.default({count:i.length,isOpen:c,initialIndex:Math.max(g.findIndex(e=>e.value===v),0),onSelect:e=>{const a=i[e];a&&Y(a)},onClose:_}),he=i.some(e=>!!e.description),f=l==="popover"&&!he&&i.length>R.VIRTUAL_THRESHOLD,{scrollRef:pe,range:x,scrollToIndex:oe}=Re.default(i.length,{rowHeight:R.OPTION_HEIGHT,isEnabled:f});r.useEffect(()=>{f&&oe(C)},[C,f,oe]);const _e=e=>{xe.current=e,pe.current=e},ge=ee,ve=e=>{if(K){if(!c){["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),X());return}ee(e)}},te=r.useRef(l);te.current=l;const ye=e=>{var n,h;if(!B||te.current==="sheet")return;const a=e.relatedTarget;a instanceof Node&&((n=k.current)!=null&&n.contains(a)||(h=N.current)!=null&&h.contains(a))||B(e)},je=()=>{O(null),I(null)},re=K?null:t.jsxs("div",{className:o.default.combobox__search,children:[t.jsx(D.Search,{"aria-hidden":!0,className:o.default.combobox__searchIcon}),t.jsx("input",{ref:F,type:"text",className:o.default.combobox__searchInput,value:q,placeholder:j.search,autoComplete:"off","aria-autocomplete":"list","aria-controls":P,"aria-activedescendant":i[C]?`${u}-option-${C}`:void 0,"aria-label":j.search,onChange:e=>{$(e.target.value),Z(0)},onKeyDown:ge}),U&&t.jsx(ke.default,{size:"sm",label:""})]}),se=e=>{const a=i.slice(x.start,x.end);return t.jsxs("ul",{ref:_e,id:P,role:"listbox",className:E.cx(o.default.combobox__list,e&&o.default["combobox__list--sheet"]),children:[f&&x.offset>0&&t.jsx("li",{"aria-hidden":!0,style:{height:x.offset}}),a.map((n,h)=>{const b=x.start+h,Ne=b===C,H=n.value===v;return t.jsxs("li",{id:`${u}-option-${b}`,role:"option","data-index":b,"aria-setsize":f?i.length:void 0,"aria-posinset":f?b+1:void 0,"aria-selected":H,"aria-disabled":n.isDisabled,className:E.cx(o.default.combobox__option,Ne&&o.default["combobox__option--active"],H&&o.default["combobox__option--selected"],n.isDisabled&&o.default["combobox__option--disabled"]),onMouseEnter:()=>Z(b),onMouseDown:qe=>qe.preventDefault(),onClick:()=>Y(n),children:[t.jsxs("span",{className:o.default.combobox__optionText,children:[t.jsx("span",{className:o.default.combobox__optionLabel,children:n.label}),n.description&&t.jsx("span",{className:o.default.combobox__optionDescription,children:n.description})]}),H&&t.jsx(D.CheckLg,{"aria-hidden":!0,className:o.default.combobox__check})]},n.value)}),f&&x.end<i.length&&t.jsx("li",{"aria-hidden":!0,style:{height:(i.length-x.end)*R.OPTION_HEIGHT}}),i.length===0&&t.jsx("li",{className:o.default.combobox__empty,children:U?j.loading:j.empty})]})};return t.jsxs("div",{ref:k,className:E.cx(o.default.combobox,ie),"data-testid":ue,onBlur:ye,children:[t.jsxs("button",{ref:me,id:u,type:"button",className:E.cx(o.default.combobox__trigger,ne==="sm"&&o.default["combobox__trigger--sm"],!L&&o.default["combobox__trigger--empty"],c&&o.default["combobox__trigger--open"],G&&o.default["combobox__trigger--invalid"],m&&o.default["combobox__trigger--readOnly"],V&&L&&!y&&!m&&o.default["combobox__trigger--clearable"]),disabled:y,role:"combobox","aria-haspopup":"listbox","aria-expanded":c,"aria-controls":P,"aria-labelledby":L?`${u}-name ${u}-value`:`${u}-name`,"aria-describedby":de,"aria-invalid":G||void 0,"aria-required":ce||void 0,"aria-readonly":m||void 0,onClick:()=>c?_():X(),onKeyDown:ve,children:[z&&t.jsx("span",{className:o.default.combobox__leadingIcon,"aria-hidden":!0,children:z}),t.jsx("span",{id:`${u}-name`,className:o.default.combobox__srName,children:d.placeholder}),t.jsx("span",{id:`${u}-value`,className:o.default.combobox__value,children:L??d.placeholder}),!m&&t.jsx(D.CaretDownFill,{"aria-hidden":!0,className:E.cx(o.default.combobox__chevron,c&&o.default["combobox__chevron--open"])})]}),V&&L&&!y&&!m&&t.jsx("button",{type:"button",className:o.default.combobox__clear,"aria-label":j.clear,onClick:je,children:t.jsx(D.XLg,{"aria-hidden":!0})}),l==="popover"&&M.container&&Le.createPortal(t.jsxs("div",{ref:N,className:o.default.combobox__panel,...M.attributes,style:{...A.style,...M.style,width:A.anchorWidth||void 0,visibility:A.isPositioned?void 0:"hidden"},children:[re,se(!1)]}),M.container),l==="sheet"&&t.jsx(Pe.default,{title:d.placeholder,closeLabel:d.closeLabel??(s==null?void 0:s.close),onClose:_,toolbar:re??void 0,children:se(!0)})]})},Ae=r.forwardRef($e),He=r.memo(Ee.named(Ae,"Combobox"));exports.default=He;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),l=require("react"),C=require("react-bootstrap-icons"),E=require("../../helpers/class-name.helper.cjs"),P=require("../../helpers/scroll.helper.cjs"),A=require("../../helpers/component.helper.cjs"),b=require("../../helpers/focus.helper.cjs"),I=require("../../helpers/text.helper.cjs"),F=require("../../hooks/useScrollLock.cjs"),T=require("../Kbd/index.cjs"),s={default:{"palette":"ui-palette-ag-P9","palette__search":"ui-palette__search-G3aYv","palette__searchIcon":"ui-palette__searchIcon-2UYj-","palette__input":"ui-palette__input-vvLvt","palette__list":"ui-palette__list--KWiH","palette__group":"ui-palette__group-KPj5Q","palette__item":"ui-palette__item-UZzkp","palette__item--active":"ui-palette__item--active-XHcka","palette__icon":"ui-palette__icon-Fg0Lt","palette__text":"ui-palette__text-flfN9","palette__label":"ui-palette__label-8-UHe","palette__description":"ui-palette__description-eRlk9","palette__shortcut":"ui-palette__shortcut-DwYKX","palette__empty":"ui-palette__empty-vg-I3"}},B=({isOpen:f,onClose:u,items:v,label:k,searchPlaceholder:w,emptyMessage:M,hotkey:g,onOpen:_,className:R,testId:K})=>{const y=l.useId(),N=`${y}-listbox`,p=l.useRef(null),q=l.useRef(null),m=l.useRef(null),j=l.useRef(null),[x,D]=l.useState(""),[c,o]=l.useState(0),i=l.useMemo(()=>{if(x.trim()==="")return v;const e=x.trim();return v.filter(t=>I.matchesSearch(t.label,e)||(t.description?I.matchesSearch(t.description,e):!1))},[v,x]);F.default(f),l.useEffect(()=>{var h;const e=p.current;if(!e)return;if(!f){e.open&&e.close();return}const t=b.captureFocus();e.open||e.showModal(),(h=q.current)==null||h.focus({preventScroll:!0}),D(""),o(0);const{token:r,pop:d}=b.pushModal();return m.current=r,()=>{e.open&&e.close(),d(),m.current=null,t();const n=j.current;j.current=null,n==null||n()}},[f]),l.useEffect(()=>{if(!g)return;const e=g.toLowerCase().split("+"),t=e.at(-1),r=n=>e.includes(n),d=/Mac|iPhone|iPad/.test(navigator.platform),h=n=>{const $=d?n.metaKey:n.ctrlKey;if(n.key.toLowerCase()===t&&!(r("mod")!==$||r("shift")!==n.shiftKey||r("alt")!==n.altKey)){if(f){n.preventDefault(),u();return}b.hasOpenSurface()||(n.preventDefault(),_==null||_())}};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[g,f,u,_]),l.useEffect(()=>{const e=p.current;if(!e)return;const t=r=>{r.preventDefault(),!(m.current&&!b.isTopModal(m.current))&&u()};return e.addEventListener("cancel",t),()=>e.removeEventListener("cancel",t)},[u]),l.useEffect(()=>{var e;P.scrollIntoViewIfPossible((e=p.current)==null?void 0:e.querySelector(`[data-index="${c}"]`),{block:"nearest"})},[c]);const S=e=>{j.current=e.onSelect,u()},L=e=>{const t=i.length-1;switch(e.key){case"ArrowDown":e.preventDefault(),o(r=>r>=t?0:r+1);break;case"ArrowUp":e.preventDefault(),o(r=>r<=0?t:r-1);break;case"Home":e.preventDefault(),o(0);break;case"End":e.preventDefault(),o(t);break;case"Enter":{e.preventDefault();const r=i[c];r&&S(r);break}}};return a.jsxs("dialog",{ref:p,className:E.cx(s.default.palette,R),"aria-label":k,"data-testid":K,onClick:e=>e.target===p.current&&u(),children:[a.jsxs("div",{className:s.default.palette__search,children:[a.jsx(C.Search,{"aria-hidden":!0,className:s.default.palette__searchIcon}),a.jsx("input",{ref:q,type:"text",role:"combobox",className:s.default.palette__input,value:x,placeholder:w,"aria-label":w,autoComplete:"off","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":N,"aria-activedescendant":i[c]?`${y}-option-${c}`:void 0,onChange:e=>{D(e.target.value),o(0)},onKeyDown:L})]}),a.jsxs("ul",{id:N,role:"listbox","aria-label":k,className:s.default.palette__list,children:[i.map((e,t)=>{var d;const r=e.group!==void 0&&e.group!==((d=i[t-1])==null?void 0:d.group);return a.jsxs("li",{role:"presentation",children:[r&&a.jsx("span",{className:s.default.palette__group,"aria-hidden":!0,children:e.group}),a.jsxs("div",{id:`${y}-option-${t}`,role:"option","data-index":t,"aria-selected":t===c,className:E.cx(s.default.palette__item,t===c&&s.default["palette__item--active"]),onMouseEnter:()=>o(t),onClick:()=>S(e),children:[e.icon&&a.jsx("span",{className:s.default.palette__icon,"aria-hidden":!0,children:e.icon}),a.jsxs("span",{className:s.default.palette__text,children:[a.jsx("span",{className:s.default.palette__label,children:e.label}),e.description&&a.jsx("span",{className:s.default.palette__description,children:e.description})]}),e.shortcut&&a.jsx(T.default,{keys:[e.shortcut],className:s.default.palette__shortcut,"aria-hidden":!0})]})]},e.id)}),i.length===0&&a.jsx("li",{role:"presentation",className:s.default.palette__empty,children:M})]})]})},G=l.memo(A.named(B,"CommandPalette"));exports.default=G;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|