@raystack/apsara 0.46.0-rc.4 → 0.46.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/dist/_virtual/index.cjs +2 -2
- package/dist/_virtual/index.js +2 -2
- package/dist/_virtual/index2.cjs +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.cjs +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.2.0/node_modules/use-sync-external-store/shim/index.cjs +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.2.0/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/v1/components/avatar/avatar.cjs +18 -2
- package/dist/v1/components/avatar/avatar.cjs.map +1 -1
- package/dist/v1/components/avatar/avatar.d.ts +2 -1
- package/dist/v1/components/avatar/avatar.d.ts.map +1 -1
- package/dist/v1/components/avatar/avatar.js +18 -3
- package/dist/v1/components/avatar/avatar.js.map +1 -1
- package/dist/v1/components/avatar/utils.cjs +14 -34
- package/dist/v1/components/avatar/utils.cjs.map +1 -1
- package/dist/v1/components/avatar/utils.d.ts +1 -4
- package/dist/v1/components/avatar/utils.d.ts.map +1 -1
- package/dist/v1/components/avatar/utils.js +15 -34
- package/dist/v1/components/avatar/utils.js.map +1 -1
- package/dist/v1/components/breadcrumb/breadcrumb.cjs +35 -19
- package/dist/v1/components/breadcrumb/breadcrumb.cjs.map +1 -1
- package/dist/v1/components/breadcrumb/breadcrumb.d.ts +15 -12
- package/dist/v1/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/v1/components/breadcrumb/breadcrumb.js +37 -21
- package/dist/v1/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.cjs +5 -5
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.cjs.map +1 -1
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.d.ts +3 -3
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.d.ts.map +1 -1
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.js +5 -5
- package/dist/v1/components/dropdown-menu/dropdown-menu-content.js.map +1 -1
- package/dist/v1/components/icon-button/icon-button.cjs +8 -7
- package/dist/v1/components/icon-button/icon-button.cjs.map +1 -1
- package/dist/v1/components/icon-button/icon-button.d.ts +1 -1
- package/dist/v1/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/v1/components/icon-button/icon-button.js +8 -7
- package/dist/v1/components/icon-button/icon-button.js.map +1 -1
- package/dist/v1/components/select/select-content.cjs +16 -7
- package/dist/v1/components/select/select-content.cjs.map +1 -1
- package/dist/v1/components/select/select-content.d.ts +1 -1
- package/dist/v1/components/select/select-content.d.ts.map +1 -1
- package/dist/v1/components/select/select-content.js +16 -7
- package/dist/v1/components/select/select-content.js.map +1 -1
- package/dist/v1/components/select/select-item.cjs +19 -18
- package/dist/v1/components/select/select-item.cjs.map +1 -1
- package/dist/v1/components/select/select-item.d.ts +1 -3
- package/dist/v1/components/select/select-item.d.ts.map +1 -1
- package/dist/v1/components/select/select-item.js +19 -18
- package/dist/v1/components/select/select-item.js.map +1 -1
- package/dist/v1/components/select/select-multiple-value.cjs +67 -0
- package/dist/v1/components/select/select-multiple-value.cjs.map +1 -0
- package/dist/v1/components/select/select-multiple-value.d.ts +8 -0
- package/dist/v1/components/select/select-multiple-value.d.ts.map +1 -0
- package/dist/v1/components/select/select-multiple-value.js +65 -0
- package/dist/v1/components/select/select-multiple-value.js.map +1 -0
- package/dist/v1/components/select/select-root.cjs +64 -22
- package/dist/v1/components/select/select-root.cjs.map +1 -1
- package/dist/v1/components/select/select-root.d.ts +25 -26
- package/dist/v1/components/select/select-root.d.ts.map +1 -1
- package/dist/v1/components/select/select-root.js +64 -22
- package/dist/v1/components/select/select-root.js.map +1 -1
- package/dist/v1/components/select/select-trigger.cjs +18 -20
- package/dist/v1/components/select/select-trigger.cjs.map +1 -1
- package/dist/v1/components/select/select-trigger.d.ts +10 -18
- package/dist/v1/components/select/select-trigger.d.ts.map +1 -1
- package/dist/v1/components/select/select-trigger.js +16 -18
- package/dist/v1/components/select/select-trigger.js.map +1 -1
- package/dist/v1/components/select/select-value.cjs +23 -7
- package/dist/v1/components/select/select-value.cjs.map +1 -1
- package/dist/v1/components/select/select-value.d.ts +8 -2
- package/dist/v1/components/select/select-value.d.ts.map +1 -1
- package/dist/v1/components/select/select-value.js +22 -6
- package/dist/v1/components/select/select-value.js.map +1 -1
- package/dist/v1/components/select/select.d.ts +11 -9
- package/dist/v1/components/select/select.d.ts.map +1 -1
- package/dist/v1/components/select/select.module.css.cjs +1 -1
- package/dist/v1/components/select/select.module.css.js +1 -1
- package/dist/v1/components/select/types.d.ts +7 -0
- package/dist/v1/components/select/types.d.ts.map +1 -0
- package/dist/v1/components/sidebar/sidebar.cjs +26 -26
- package/dist/v1/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/v1/components/sidebar/sidebar.d.ts +8 -8
- package/dist/v1/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/v1/components/sidebar/sidebar.js +26 -26
- package/dist/v1/components/sidebar/sidebar.js.map +1 -1
- package/dist/v1/components/tooltip/tooltip.cjs +34 -12
- package/dist/v1/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/v1/components/tooltip/tooltip.d.ts +16 -9
- package/dist/v1/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/v1/components/tooltip/tooltip.js +35 -13
- package/dist/v1/components/tooltip/tooltip.js.map +1 -1
- package/dist/v1/components/tooltip/tooltip.module.css.cjs +1 -1
- package/dist/v1/components/tooltip/tooltip.module.css.js +1 -1
- package/dist/v1/components/tooltip/utils.cjs +30 -0
- package/dist/v1/components/tooltip/utils.cjs.map +1 -0
- package/dist/v1/components/tooltip/utils.d.ts +10 -0
- package/dist/v1/components/tooltip/utils.d.ts.map +1 -0
- package/dist/v1/components/tooltip/utils.js +28 -0
- package/dist/v1/components/tooltip/utils.js.map +1 -0
- package/dist/v1/hooks/index.cjs +2 -0
- package/dist/v1/hooks/index.cjs.map +1 -1
- package/dist/v1/hooks/index.d.ts +2 -1
- package/dist/v1/hooks/index.d.ts.map +1 -1
- package/dist/v1/hooks/index.js +1 -0
- package/dist/v1/hooks/index.js.map +1 -1
- package/dist/v1/hooks/useMouse.cjs +53 -0
- package/dist/v1/hooks/useMouse.cjs.map +1 -0
- package/dist/v1/hooks/useMouse.d.ts +20 -0
- package/dist/v1/hooks/useMouse.d.ts.map +1 -0
- package/dist/v1/hooks/useMouse.js +51 -0
- package/dist/v1/hooks/useMouse.js.map +1 -0
- package/dist/v1/node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs +0 -2
- package/dist/v1/node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs.map +1 -1
- package/dist/v1/node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.js +1 -2
- package/dist/v1/node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.js.map +1 -1
- package/dist/v1/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
2
|
import { DotsHorizontalIcon, ChevronDownIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
3
|
-
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
3
|
+
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
4
|
+
import { forwardRef, useMemo, cloneElement } from 'react';
|
|
5
5
|
import { DropdownMenu } from '../dropdown-menu/dropdown-menu.js';
|
|
6
6
|
import styles from './breadcrumb.module.css.js';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const BreadcrumbItem = ({ as = jsxRuntimeExports.jsx("a", {}), onItemClick, ...props }) => {
|
|
9
|
+
const { label, href, icon, dropdownItems, isActive } = props;
|
|
10
|
+
if (label === 'ellipsis') {
|
|
11
|
+
return (jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-ellipsis'], children: jsxRuntimeExports.jsx(DotsHorizontalIcon, {}) }));
|
|
12
|
+
}
|
|
13
|
+
if (dropdownItems) {
|
|
14
|
+
return (jsxRuntimeExports.jsxs(DropdownMenu, { children: [jsxRuntimeExports.jsxs(DropdownMenu.Trigger, { className: styles['breadcrumb-dropdown-trigger'], children: [icon && jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-icon'], children: icon }), jsxRuntimeExports.jsx("span", { children: label }), jsxRuntimeExports.jsx(ChevronDownIcon, { className: styles['breadcrumb-dropdown-icon'] })] }), jsxRuntimeExports.jsx(DropdownMenu.Content, { className: styles['breadcrumb-dropdown-content'], children: dropdownItems.map((dropdownItem, dropdownIndex) => (jsxRuntimeExports.jsx(DropdownMenu.Item, { className: styles['breadcrumb-dropdown-item'], onSelect: () => onItemClick?.(dropdownItem), children: dropdownItem.label }, dropdownIndex))) })] }));
|
|
15
|
+
}
|
|
16
|
+
return cloneElement(as, {
|
|
17
|
+
className: cx(styles['breadcrumb-link'], isActive && styles['breadcrumb-link-active']),
|
|
18
|
+
onClick: (e) => {
|
|
19
|
+
if (onItemClick && href !== '#') {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
onItemClick(props);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
href,
|
|
25
|
+
...as.props
|
|
26
|
+
}, jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [icon && jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-icon'], children: icon }), jsxRuntimeExports.jsx("span", { children: label })] }));
|
|
27
|
+
};
|
|
28
|
+
const breadcrumbVariants = cva(styles['breadcrumb'], {
|
|
9
29
|
variants: {
|
|
10
30
|
size: {
|
|
11
31
|
small: styles['breadcrumb-small'],
|
|
@@ -17,24 +37,20 @@ const breadcrumb = cva(styles['breadcrumb'], {
|
|
|
17
37
|
}
|
|
18
38
|
});
|
|
19
39
|
const Breadcrumb = forwardRef(({ className, size = 'medium', items, maxVisibleItems, separator = '/', onItemClick, ...props }, ref) => {
|
|
20
|
-
const visibleItems =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onItemClick(item);
|
|
35
|
-
}
|
|
36
|
-
}, children: [item.icon && (jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-icon'], children: item.icon })), jsxRuntimeExports.jsx("span", { children: item.label })] })), !isLast && (jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-separator'], children: separator }))] }, index));
|
|
37
|
-
return (jsxRuntimeExports.jsx("nav", { className: breadcrumb({ size: size, className }), ref: ref, ...props, children: jsxRuntimeExports.jsx("ol", { className: styles['breadcrumb-list'], children: visibleItems.map((item, index) => renderItem(item, index, index === visibleItems.length - 1)) }) }));
|
|
40
|
+
const visibleItems = useMemo(() => {
|
|
41
|
+
if (maxVisibleItems && items.length > maxVisibleItems) {
|
|
42
|
+
return [
|
|
43
|
+
...items.slice(0, 1),
|
|
44
|
+
{ label: 'ellipsis', href: '#' },
|
|
45
|
+
...items.slice(-Math.min(maxVisibleItems - 1, items.length - 1))
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
return items;
|
|
49
|
+
}, [maxVisibleItems, items]);
|
|
50
|
+
return (jsxRuntimeExports.jsx("nav", { className: breadcrumbVariants({ size, className }), ref: ref, ...props, children: jsxRuntimeExports.jsx("ol", { className: styles['breadcrumb-list'], children: visibleItems.map((item, index) => {
|
|
51
|
+
const isLast = index === visibleItems.length - 1;
|
|
52
|
+
return (jsxRuntimeExports.jsxs("li", { className: styles['breadcrumb-item'], children: [jsxRuntimeExports.jsx(BreadcrumbItem, { ...item, isActive: isLast, onItemClick: onItemClick }), !isLast && (jsxRuntimeExports.jsx("span", { className: styles['breadcrumb-separator'], children: separator }))] }, index));
|
|
53
|
+
}) }) }));
|
|
38
54
|
});
|
|
39
55
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
40
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sources":["../../../../v1/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { ChevronDownIcon, DotsHorizontalIcon } from '@radix-ui/react-icons';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sources":["../../../../v1/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { ChevronDownIcon, DotsHorizontalIcon } from '@radix-ui/react-icons';\nimport { type VariantProps, cva, cx } from 'class-variance-authority';\nimport {\n MouseEvent,\n ReactElement,\n cloneElement,\n forwardRef,\n useMemo\n} from 'react';\nimport { DropdownMenu } from '../dropdown-menu';\nimport styles from './breadcrumb.module.css';\n\ninterface BreadcrumbItemBase {\n label: string;\n href?: string;\n}\ninterface BreadcrumbItem extends BreadcrumbItemBase {\n icon?: React.ReactNode;\n dropdownItems?: BreadcrumbItemBase[];\n as?: ReactElement;\n}\n\ninterface BreadcrumbItemProps extends BreadcrumbItem {\n isActive: boolean;\n onItemClick?: (item: BreadcrumbItem) => void;\n}\n\nconst BreadcrumbItem = ({\n as = <a />,\n onItemClick,\n ...props\n}: BreadcrumbItemProps) => {\n const { label, href, icon, dropdownItems, isActive } = props;\n\n if (label === 'ellipsis') {\n return (\n <span className={styles['breadcrumb-ellipsis']}>\n <DotsHorizontalIcon />\n </span>\n );\n }\n if (dropdownItems) {\n return (\n <DropdownMenu>\n <DropdownMenu.Trigger className={styles['breadcrumb-dropdown-trigger']}>\n {icon && <span className={styles['breadcrumb-icon']}>{icon}</span>}\n <span>{label}</span>\n <ChevronDownIcon className={styles['breadcrumb-dropdown-icon']} />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content className={styles['breadcrumb-dropdown-content']}>\n {dropdownItems.map((dropdownItem, dropdownIndex) => (\n <DropdownMenu.Item\n key={dropdownIndex}\n className={styles['breadcrumb-dropdown-item']}\n onSelect={() => onItemClick?.(dropdownItem)}\n >\n {dropdownItem.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu>\n );\n }\n return cloneElement(\n as,\n {\n className: cx(\n styles['breadcrumb-link'],\n isActive && styles['breadcrumb-link-active']\n ),\n onClick: (e: MouseEvent) => {\n if (onItemClick && href !== '#') {\n e.preventDefault();\n onItemClick(props);\n }\n },\n href,\n ...as.props\n },\n <>\n {icon && <span className={styles['breadcrumb-icon']}>{icon}</span>}\n <span>{label}</span>\n </>\n );\n};\n\nconst breadcrumbVariants = cva(styles['breadcrumb'], {\n variants: {\n size: {\n small: styles['breadcrumb-small'],\n medium: styles['breadcrumb-medium']\n }\n },\n defaultVariants: {\n size: 'medium'\n }\n});\n\ntype BreadcrumbProps = VariantProps<typeof breadcrumbVariants> & {\n items: BreadcrumbItem[];\n maxVisibleItems?: number;\n separator?: React.ReactNode;\n onItemClick?: (item: BreadcrumbItem) => void;\n className?: string;\n size?: 'small' | 'medium';\n};\n\nexport const Breadcrumb = forwardRef<HTMLDivElement, BreadcrumbProps>(\n (\n {\n className,\n size = 'medium',\n items,\n maxVisibleItems,\n separator = '/',\n onItemClick,\n ...props\n },\n ref\n ) => {\n const visibleItems = useMemo(() => {\n if (maxVisibleItems && items.length > maxVisibleItems) {\n return [\n ...items.slice(0, 1),\n { label: 'ellipsis', href: '#' },\n ...items.slice(-Math.min(maxVisibleItems - 1, items.length - 1))\n ];\n }\n return items;\n }, [maxVisibleItems, items]);\n\n return (\n <nav\n className={breadcrumbVariants({ size, className })}\n ref={ref}\n {...props}\n >\n <ol className={styles['breadcrumb-list']}>\n {visibleItems.map((item, index) => {\n const isLast = index === visibleItems.length - 1;\n return (\n <li className={styles['breadcrumb-item']} key={index}>\n <BreadcrumbItem\n {...item}\n isActive={isLast}\n onItemClick={onItemClick}\n />\n {!isLast && (\n <span className={styles['breadcrumb-separator']}>\n {separator}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n }\n);\n\nBreadcrumb.displayName = 'Breadcrumb';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;AA2BA,MAAM,cAAc,GAAG,CAAC,EACtB,EAAE,GAAGA,qBAAA,CAAA,GAAA,EAAA,EAAA,CAAK,EACV,WAAW,EACX,GAAG,KAAK,EACY,KAAI;AACxB,IAAA,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;AAE7D,IAAA,IAAI,KAAK,KAAK,UAAU,EAAE;AACxB,QAAA,QACEA,qBAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAAA,QAAA,EAC5CA,qBAAC,CAAA,kBAAkB,EAAG,EAAA,CAAA,EAAA,CACjB,EACP;KACH;IACD,IAAI,aAAa,EAAE;QACjB,QACEC,uBAAC,YAAY,EAAA,EAAA,QAAA,EAAA,CACXA,uBAAC,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AE,SAAS,EAAE,CAAC,EAClD,GAAG,EAAE,GAAG,EACJ,GAAA,KAAK,EAET,QAAA,EAAAA,qBAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EACrC,QAAA,EAAA,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;gBAChC,MAAM,MAAM,GAAG,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;AACjD,gBAAA,QACEC,sBAAI,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAAA,CACtCD,sBAAC,cAAc,EAAA,EAAA,GACT,IAAI,EACR,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,CAAA,EACD,CAAC,MAAM,KACNA,qBAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAA,QAAA,EAC5C,SAAS,EACL,CAAA,CACR,KAV4C,KAAK,CAW/C,EACL;AACJ,aAAC,CAAC,EAAA,CACC,EACD,CAAA,EACN;AACJ,CAAC,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
-
var React = require('react');
|
|
5
4
|
var VIIRIBF3 = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/VIIRIBF3.cjs');
|
|
6
5
|
var menu = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/menu/menu.cjs');
|
|
7
6
|
var combobox = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/combobox/combobox.cjs');
|
|
8
7
|
var MAXQOH4L = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/MAXQOH4L.cjs');
|
|
9
|
-
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
10
|
-
var dropdownMenu_module = require('./dropdown-menu.module.css.cjs');
|
|
11
8
|
var index$1 = require('../../node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs');
|
|
9
|
+
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
10
|
+
var React = require('react');
|
|
12
11
|
var dropdownMenuRoot = require('./dropdown-menu-root.cjs');
|
|
12
|
+
var dropdownMenu_module = require('./dropdown-menu.module.css.cjs');
|
|
13
13
|
|
|
14
|
-
const DropdownMenuContent = React.forwardRef(({ className, children, asChild, searchPlaceholder =
|
|
14
|
+
const DropdownMenuContent = React.forwardRef(({ className, children, asChild, searchPlaceholder = 'Search...', ...props }, ref) => {
|
|
15
15
|
const menu$1 = VIIRIBF3.useMenuContext();
|
|
16
16
|
const { autocomplete } = dropdownMenuRoot.useDropdownContext();
|
|
17
17
|
const isSubMenu = !!menu$1?.parent;
|
|
18
18
|
const comboboxRef = React.useRef(null);
|
|
19
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(menu.Menu, { ref: ref, modal: true, portal: true, portalElement: typeof window ===
|
|
19
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(menu.Menu, { ref: ref, modal: true, portal: true, portalElement: typeof window === 'undefined' ? null : window?.document?.body, unmountOnHide: true, gutter: isSubMenu ? 2 : 4, className: index.cx(dropdownMenu_module.default.content, autocomplete && dropdownMenu_module.default.comboboxContainer, className), render: asChild ? jsxRuntime.jsxRuntimeExports.jsx(index$1.Slot, {}) : undefined, ...props, children: autocomplete ? (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx(combobox.Combobox, { ref: comboboxRef, placeholder: searchPlaceholder, className: dropdownMenu_module.default.comboboxInput, autoSelect: true, onPointerEnter: e => {
|
|
20
20
|
if (document && document.activeElement !== comboboxRef.current)
|
|
21
21
|
comboboxRef.current?.focus();
|
|
22
22
|
} }), jsxRuntime.jsxRuntimeExports.jsx(MAXQOH4L.ComboboxList, { className: dropdownMenu_module.default.comboboxContent, children: children })] })) : (children) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-content.cjs","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"dropdown-menu-content.cjs","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"sourcesContent":["import { Menu, MenuProps, useMenuContext } from '@ariakit/react';\nimport { Combobox, ComboboxList } from '@ariakit/react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef, useRef } from 'react';\nimport { useDropdownContext } from './dropdown-menu-root';\nimport styles from './dropdown-menu.module.css';\nimport { WithAsChild } from './types';\n\nexport interface MenuContentProps extends WithAsChild<MenuProps> {\n searchPlaceholder?: string;\n}\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof Menu>,\n MenuContentProps\n>(\n (\n { className, children, asChild, searchPlaceholder = 'Search...', ...props },\n ref\n ) => {\n const menu = useMenuContext();\n const { autocomplete } = useDropdownContext();\n const isSubMenu = !!menu?.parent;\n const comboboxRef = useRef<HTMLInputElement>(null);\n\n return (\n <Menu\n ref={ref}\n modal\n portal\n portalElement={\n typeof window === 'undefined' ? null : window?.document?.body\n }\n unmountOnHide\n gutter={isSubMenu ? 2 : 4}\n className={cx(\n styles.content,\n autocomplete && styles.comboboxContainer,\n className\n )}\n render={asChild ? <Slot /> : undefined}\n {...props}\n >\n {autocomplete ? (\n <>\n <Combobox\n ref={comboboxRef}\n placeholder={searchPlaceholder}\n className={styles.comboboxInput}\n autoSelect\n onPointerEnter={e => {\n if (document && document.activeElement !== comboboxRef.current)\n comboboxRef.current?.focus();\n }}\n />\n <ComboboxList className={styles.comboboxContent}>\n {children}\n </ComboboxList>\n </>\n ) : (\n children\n )}\n </Menu>\n );\n }\n);\n"],"names":["forwardRef","menu","useMenuContext","useDropdownContext","useRef","_jsx","Menu","cx","styles","Slot","_jsxs","_Fragment","Combobox","ComboboxList"],"mappings":";;;;;;;;;;;;;AAaa,MAAA,mBAAmB,GAAGA,gBAAU,CAI3C,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,GAAG,KAAK,EAAE,EAC3E,GAAG,KACD;AACF,IAAA,MAAMC,MAAI,GAAGC,uBAAc,EAAE,CAAC;AAC9B,IAAA,MAAM,EAAE,YAAY,EAAE,GAAGC,mCAAkB,EAAE,CAAC;AAC9C,IAAA,MAAM,SAAS,GAAG,CAAC,CAACF,MAAI,EAAE,MAAM,CAAC;AACjC,IAAA,MAAM,WAAW,GAAGG,YAAM,CAAmB,IAAI,CAAC,CAAC;IAEnD,QACEC,iCAACC,SAAI,EAAA,EACH,GAAG,EAAE,GAAG,EACR,KAAK,EACL,IAAA,EAAA,MAAM,QACN,aAAa,EACX,OAAO,MAAM,KAAK,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAE/D,aAAa,QACb,MAAM,EAAE,SAAS,GAAG,CAAC,GAAG,CAAC,EACzB,SAAS,EAAEC,QAAE,CACXC,2BAAM,CAAC,OAAO,EACd,YAAY,IAAIA,2BAAM,CAAC,iBAAiB,EACxC,SAAS,CACV,EACD,MAAM,EAAE,OAAO,GAAGH,gCAAC,CAAAI,YAAI,EAAG,EAAA,CAAA,GAAG,SAAS,EAClC,GAAA,KAAK,EAER,QAAA,EAAA,YAAY,IACXC,iCAAA,CAAAC,qCAAA,EAAA,EAAA,QAAA,EAAA,CACEN,gCAAC,CAAAO,iBAAQ,EACP,EAAA,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAEJ,2BAAM,CAAC,aAAa,EAC/B,UAAU,QACV,cAAc,EAAE,CAAC,IAAG;wBAClB,IAAI,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,WAAW,CAAC,OAAO;AAC5D,4BAAA,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;qBAChC,EAAA,CACD,EACFH,gCAAC,CAAAQ,qBAAY,IAAC,SAAS,EAAEL,2BAAM,CAAC,eAAe,EAAA,QAAA,EAC5C,QAAQ,EACI,CAAA,CAAA,EAAA,CACd,KAEH,QAAQ,CACT,EACI,CAAA,EACP;AACJ,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MenuProps } from
|
|
2
|
-
import { WithAsChild } from
|
|
3
|
-
export interface MenuContentProps extends
|
|
1
|
+
import { MenuProps } from '@ariakit/react';
|
|
2
|
+
import { WithAsChild } from './types';
|
|
3
|
+
export interface MenuContentProps extends WithAsChild<MenuProps> {
|
|
4
4
|
searchPlaceholder?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<Omit<MenuContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-content.d.ts","sourceRoot":"","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown-menu-content.d.ts","sourceRoot":"","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAOjE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,gBAAiB,SAAQ,WAAW,CAAC,SAAS,CAAC;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB,0HAqD/B,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import { forwardRef, useRef } from 'react';
|
|
3
2
|
import { useMenuContext } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/VIIRIBF3.js';
|
|
4
3
|
import { Menu } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/menu/menu.js';
|
|
5
4
|
import { Combobox } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/combobox/combobox.js';
|
|
6
5
|
import { ComboboxList } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/MAXQOH4L.js';
|
|
7
|
-
import { cx } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
8
|
-
import styles from './dropdown-menu.module.css.js';
|
|
9
6
|
import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.js';
|
|
7
|
+
import { cx } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
8
|
+
import { forwardRef, useRef } from 'react';
|
|
10
9
|
import { useDropdownContext } from './dropdown-menu-root.js';
|
|
10
|
+
import styles from './dropdown-menu.module.css.js';
|
|
11
11
|
|
|
12
|
-
const DropdownMenuContent = forwardRef(({ className, children, asChild, searchPlaceholder =
|
|
12
|
+
const DropdownMenuContent = forwardRef(({ className, children, asChild, searchPlaceholder = 'Search...', ...props }, ref) => {
|
|
13
13
|
const menu = useMenuContext();
|
|
14
14
|
const { autocomplete } = useDropdownContext();
|
|
15
15
|
const isSubMenu = !!menu?.parent;
|
|
16
16
|
const comboboxRef = useRef(null);
|
|
17
|
-
return (jsxRuntimeExports.jsx(Menu, { ref: ref, modal: true, portal: true, portalElement: typeof window ===
|
|
17
|
+
return (jsxRuntimeExports.jsx(Menu, { ref: ref, modal: true, portal: true, portalElement: typeof window === 'undefined' ? null : window?.document?.body, unmountOnHide: true, gutter: isSubMenu ? 2 : 4, className: cx(styles.content, autocomplete && styles.comboboxContainer, className), render: asChild ? jsxRuntimeExports.jsx($5e63c961fc1ce211$export$8c6ed5c666ac1360, {}) : undefined, ...props, children: autocomplete ? (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Combobox, { ref: comboboxRef, placeholder: searchPlaceholder, className: styles.comboboxInput, autoSelect: true, onPointerEnter: e => {
|
|
18
18
|
if (document && document.activeElement !== comboboxRef.current)
|
|
19
19
|
comboboxRef.current?.focus();
|
|
20
20
|
} }), jsxRuntimeExports.jsx(ComboboxList, { className: styles.comboboxContent, children: children })] })) : (children) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-content.js","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"dropdown-menu-content.js","sources":["../../../../v1/components/dropdown-menu/dropdown-menu-content.tsx"],"sourcesContent":["import { Menu, MenuProps, useMenuContext } from '@ariakit/react';\nimport { Combobox, ComboboxList } from '@ariakit/react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef, useRef } from 'react';\nimport { useDropdownContext } from './dropdown-menu-root';\nimport styles from './dropdown-menu.module.css';\nimport { WithAsChild } from './types';\n\nexport interface MenuContentProps extends WithAsChild<MenuProps> {\n searchPlaceholder?: string;\n}\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof Menu>,\n MenuContentProps\n>(\n (\n { className, children, asChild, searchPlaceholder = 'Search...', ...props },\n ref\n ) => {\n const menu = useMenuContext();\n const { autocomplete } = useDropdownContext();\n const isSubMenu = !!menu?.parent;\n const comboboxRef = useRef<HTMLInputElement>(null);\n\n return (\n <Menu\n ref={ref}\n modal\n portal\n portalElement={\n typeof window === 'undefined' ? null : window?.document?.body\n }\n unmountOnHide\n gutter={isSubMenu ? 2 : 4}\n className={cx(\n styles.content,\n autocomplete && styles.comboboxContainer,\n className\n )}\n render={asChild ? <Slot /> : undefined}\n {...props}\n >\n {autocomplete ? (\n <>\n <Combobox\n ref={comboboxRef}\n placeholder={searchPlaceholder}\n className={styles.comboboxInput}\n autoSelect\n onPointerEnter={e => {\n if (document && document.activeElement !== comboboxRef.current)\n comboboxRef.current?.focus();\n }}\n />\n <ComboboxList className={styles.comboboxContent}>\n {children}\n </ComboboxList>\n </>\n ) : (\n children\n )}\n </Menu>\n );\n }\n);\n"],"names":["_jsx","Slot","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;AAaa,MAAA,mBAAmB,GAAG,UAAU,CAI3C,CACE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,GAAG,KAAK,EAAE,EAC3E,GAAG,KACD;AACF,IAAA,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAA,MAAM,EAAE,YAAY,EAAE,GAAG,kBAAkB,EAAE,CAAC;AAC9C,IAAA,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;AACjC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEnD,QACEA,sBAAC,IAAI,EAAA,EACH,GAAG,EAAE,GAAG,EACR,KAAK,EACL,IAAA,EAAA,MAAM,QACN,aAAa,EACX,OAAO,MAAM,KAAK,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAE/D,aAAa,QACb,MAAM,EAAE,SAAS,GAAG,CAAC,GAAG,CAAC,EACzB,SAAS,EAAE,EAAE,CACX,MAAM,CAAC,OAAO,EACd,YAAY,IAAI,MAAM,CAAC,iBAAiB,EACxC,SAAS,CACV,EACD,MAAM,EAAE,OAAO,GAAGA,qBAAC,CAAAC,yCAAI,EAAG,EAAA,CAAA,GAAG,SAAS,EAClC,GAAA,KAAK,EAER,QAAA,EAAA,YAAY,IACXC,sBAAA,CAAAC,0BAAA,EAAA,EAAA,QAAA,EAAA,CACEH,qBAAC,CAAA,QAAQ,EACP,EAAA,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,UAAU,QACV,cAAc,EAAE,CAAC,IAAG;wBAClB,IAAI,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,WAAW,CAAC,OAAO;AAC5D,4BAAA,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;qBAChC,EAAA,CACD,EACFA,qBAAC,CAAA,YAAY,IAAC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAA,QAAA,EAC5C,QAAQ,EACI,CAAA,CAAA,EAAA,CACd,KAEH,QAAQ,CACT,EACI,CAAA,EACP;AACJ,CAAC;;;;"}
|
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
4
|
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var flex = require('../flex/flex.cjs');
|
|
6
7
|
var iconButton_module = require('./icon-button.module.css.cjs');
|
|
7
8
|
|
|
8
9
|
const iconButton = index.cva(iconButton_module.default.iconButton, {
|
|
9
10
|
variants: {
|
|
10
11
|
size: {
|
|
11
|
-
1: iconButton_module.default[
|
|
12
|
-
2: iconButton_module.default[
|
|
13
|
-
3: iconButton_module.default[
|
|
14
|
-
4: iconButton_module.default[
|
|
12
|
+
1: iconButton_module.default['iconButton-size-1'],
|
|
13
|
+
2: iconButton_module.default['iconButton-size-2'],
|
|
14
|
+
3: iconButton_module.default['iconButton-size-3'],
|
|
15
|
+
4: iconButton_module.default['iconButton-size-4']
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
defaultVariants: {
|
|
18
|
-
size: 2
|
|
19
|
-
}
|
|
19
|
+
size: 2
|
|
20
|
+
}
|
|
20
21
|
});
|
|
21
|
-
const IconButton = React.forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type:
|
|
22
|
+
const IconButton = React.forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: 'button', "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { "aria-hidden": 'true', align: 'center', justify: 'center', children: children }) })));
|
|
22
23
|
IconButton.displayName = 'IconButton';
|
|
23
24
|
|
|
24
25
|
exports.IconButton = IconButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.cjs","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"icon-button.cjs","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { VariantProps, cva } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport { Flex } from '../flex';\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles['iconButton-size-1'],\n 2: styles['iconButton-size-2'],\n 3: styles['iconButton-size-3'],\n 4: styles['iconButton-size-4']\n }\n },\n defaultVariants: {\n size: 2\n }\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<'button'>, IconButtonProps>(\n (\n {\n className,\n size,\n disabled,\n children,\n 'aria-label': ariaLabel,\n style,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type='button'\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <Flex aria-hidden='true' align='center' justify='center'>\n {children}\n </Flex>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["cva","styles","forwardRef","_jsx","Flex"],"mappings":";;;;;;;;AAMA,MAAM,UAAU,GAAGA,SAAG,CAACC,yBAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASU,MAAA,UAAU,GAAGC,gBAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,gCAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,gBACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,EAAA,GACR,KAAK,EAAA,QAAA,EAETA,iCAACC,SAAI,EAAA,EAAA,aAAA,EAAa,MAAM,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EACrD,QAAA,EAAA,QAAQ,GACJ,EACA,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VariantProps } from
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
declare const iconButton: (props?: ({
|
|
3
3
|
size?: 1 | 2 | 3 | 4 | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAM7D,QAAA,MAAM,UAAU;;8EAYd,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,UAAU,CAAC;IACjC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,+GA4BtB,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
2
|
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Flex } from '../flex/flex.js';
|
|
4
5
|
import styles from './icon-button.module.css.js';
|
|
5
6
|
|
|
6
7
|
const iconButton = cva(styles.iconButton, {
|
|
7
8
|
variants: {
|
|
8
9
|
size: {
|
|
9
|
-
1: styles[
|
|
10
|
-
2: styles[
|
|
11
|
-
3: styles[
|
|
12
|
-
4: styles[
|
|
10
|
+
1: styles['iconButton-size-1'],
|
|
11
|
+
2: styles['iconButton-size-2'],
|
|
12
|
+
3: styles['iconButton-size-3'],
|
|
13
|
+
4: styles['iconButton-size-4']
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
defaultVariants: {
|
|
16
|
-
size: 2
|
|
17
|
-
}
|
|
17
|
+
size: 2
|
|
18
|
+
}
|
|
18
19
|
});
|
|
19
|
-
const IconButton = forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type:
|
|
20
|
+
const IconButton = forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: 'button', "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntimeExports.jsx(Flex, { "aria-hidden": 'true', align: 'center', justify: 'center', children: children }) })));
|
|
20
21
|
IconButton.displayName = 'IconButton';
|
|
21
22
|
|
|
22
23
|
export { IconButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"icon-button.js","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { VariantProps, cva } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport { Flex } from '../flex';\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles['iconButton-size-1'],\n 2: styles['iconButton-size-2'],\n 3: styles['iconButton-size-3'],\n 4: styles['iconButton-size-4']\n }\n },\n defaultVariants: {\n size: 2\n }\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<'button'>, IconButtonProps>(\n (\n {\n className,\n size,\n disabled,\n children,\n 'aria-label': ariaLabel,\n style,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type='button'\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <Flex aria-hidden='true' align='center' justify='center'>\n {children}\n </Flex>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["_jsx"],"mappings":";;;;;;AAMA,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASU,MAAA,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHA,qBAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,gBACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,EAAA,GACR,KAAK,EAAA,QAAA,EAETA,sBAAC,IAAI,EAAA,EAAA,aAAA,EAAa,MAAM,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EACrD,QAAA,EAAA,QAAQ,GACJ,EACA,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var index = require('../../node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs');
|
|
6
4
|
var combobox = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/combobox/combobox.cjs');
|
|
7
5
|
var MAXQOH4L = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/MAXQOH4L.cjs');
|
|
6
|
+
var index = require('../../node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs');
|
|
7
|
+
var index$2 = require('../../node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs');
|
|
8
8
|
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
9
|
-
var
|
|
9
|
+
var React = require('react');
|
|
10
10
|
var selectRoot = require('./select-root.cjs');
|
|
11
|
+
var select_module = require('./select.module.css.cjs');
|
|
11
12
|
|
|
12
|
-
const SelectContent = React.forwardRef(({ className, children, position =
|
|
13
|
-
const { autocomplete } = selectRoot.useSelectContext();
|
|
14
|
-
|
|
13
|
+
const SelectContent = React.forwardRef(({ className, children, position = 'popper', searchPlaceholder = 'Search...', sideOffset = 4, asChild, onEscapeKeyDown: providedOnEscapeKeyDown, onPointerDownOutside: providedOnPointerDownOutside, ...props }, ref) => {
|
|
14
|
+
const { autocomplete, multiple, updateSelectionInProgress } = selectRoot.useSelectContext();
|
|
15
|
+
const onPointerDownOutside = React.useCallback(event => {
|
|
16
|
+
updateSelectionInProgress(false);
|
|
17
|
+
providedOnPointerDownOutside?.(event);
|
|
18
|
+
}, [updateSelectionInProgress, providedOnPointerDownOutside]);
|
|
19
|
+
const onEscapeKeyDown = React.useCallback(event => {
|
|
20
|
+
updateSelectionInProgress(false);
|
|
21
|
+
providedOnEscapeKeyDown?.(event);
|
|
22
|
+
}, [updateSelectionInProgress, providedOnEscapeKeyDown]);
|
|
23
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsx(index.Content, { ref: ref, position: position, sideOffset: sideOffset, className: index$1.cx(select_module.default.content, className), onEscapeKeyDown: multiple ? onEscapeKeyDown : providedOnEscapeKeyDown, onPointerDownOutside: multiple ? onPointerDownOutside : providedOnPointerDownOutside, role: autocomplete ? 'dialog' : 'listbox', "aria-multiselectable": !autocomplete && multiple ? true : undefined, "data-multiselectable": multiple ? true : undefined, ...props, children: jsxRuntime.jsxRuntimeExports.jsx(index.Viewport, { className: index$1.cx(select_module.default.viewport, autocomplete && select_module.default.comboboxViewport), asChild: !autocomplete ? asChild : undefined, children: autocomplete ? (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx(combobox.Combobox, { autoSelect: true, placeholder: searchPlaceholder, className: select_module.default.comboboxInput, onBlurCapture: event => {
|
|
15
24
|
event.preventDefault();
|
|
16
25
|
event.stopPropagation();
|
|
17
|
-
} }), jsxRuntime.jsxRuntimeExports.jsx(MAXQOH4L.ComboboxList, { className: select_module.default.comboboxContent, children: children })] })) : (children) }) }) }));
|
|
26
|
+
} }), jsxRuntime.jsxRuntimeExports.jsx(MAXQOH4L.ComboboxList, { className: select_module.default.comboboxContent, "aria-multiselectable": multiple ? true : undefined, render: asChild ? jsxRuntime.jsxRuntimeExports.jsx(index$2.Slot, {}) : undefined, children: children })] })) : (children) }) }) }));
|
|
18
27
|
});
|
|
19
28
|
SelectContent.displayName = index.Content.displayName;
|
|
20
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-content.cjs","sources":["../../../../v1/components/select/select-content.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"select-content.cjs","sources":["../../../../v1/components/select/select-content.tsx"],"sourcesContent":["import { Combobox, ComboboxList } from '@ariakit/react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef, useCallback } from 'react';\nimport { useSelectContext } from './select-root';\nimport styles from './select.module.css';\n\nexport interface SelectContentProps extends SelectPrimitive.SelectContentProps {\n searchPlaceholder?: string;\n}\n\nexport const SelectContent = forwardRef<\n ElementRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n searchPlaceholder = 'Search...',\n sideOffset = 4,\n asChild,\n onEscapeKeyDown: providedOnEscapeKeyDown,\n onPointerDownOutside: providedOnPointerDownOutside,\n ...props\n },\n ref\n ) => {\n const { autocomplete, multiple, updateSelectionInProgress } =\n useSelectContext();\n\n const onPointerDownOutside = useCallback<\n NonNullable<SelectContentProps['onPointerDownOutside']>\n >(\n event => {\n updateSelectionInProgress(false);\n providedOnPointerDownOutside?.(event);\n },\n [updateSelectionInProgress, providedOnPointerDownOutside]\n );\n\n const onEscapeKeyDown = useCallback<\n NonNullable<SelectContentProps['onEscapeKeyDown']>\n >(\n event => {\n updateSelectionInProgress(false);\n providedOnEscapeKeyDown?.(event);\n },\n [updateSelectionInProgress, providedOnEscapeKeyDown]\n );\n\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n className={cx(styles.content, className)}\n onEscapeKeyDown={multiple ? onEscapeKeyDown : providedOnEscapeKeyDown}\n onPointerDownOutside={\n multiple ? onPointerDownOutside : providedOnPointerDownOutside\n }\n role={autocomplete ? 'dialog' : 'listbox'}\n aria-multiselectable={!autocomplete && multiple ? true : undefined}\n data-multiselectable={multiple ? true : undefined}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cx(\n styles.viewport,\n autocomplete && styles.comboboxViewport\n )}\n asChild={!autocomplete ? asChild : undefined}\n >\n {autocomplete ? (\n <>\n <Combobox\n autoSelect\n placeholder={searchPlaceholder}\n className={styles.comboboxInput}\n onBlurCapture={event => {\n event.preventDefault();\n event.stopPropagation();\n }}\n />\n <ComboboxList\n className={styles.comboboxContent}\n aria-multiselectable={multiple ? true : undefined}\n render={asChild ? <Slot /> : undefined}\n >\n {children}\n </ComboboxList>\n </>\n ) : (\n children\n )}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n }\n);\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n"],"names":["forwardRef","useSelectContext","useCallback","_jsx","SelectPrimitive.Portal","SelectPrimitive.Content","cx","styles","SelectPrimitive.Viewport","_jsxs","_Fragment","Combobox","ComboboxList","Slot"],"mappings":";;;;;;;;;;;;AAYa,MAAA,aAAa,GAAGA,gBAAU,CAIrC,CACE,EACE,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,QAAQ,EACnB,iBAAiB,GAAG,WAAW,EAC/B,UAAU,GAAG,CAAC,EACd,OAAO,EACP,eAAe,EAAE,uBAAuB,EACxC,oBAAoB,EAAE,4BAA4B,EAClD,GAAG,KAAK,EACT,EACD,GAAG,KACD;IACF,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,yBAAyB,EAAE,GACzDC,2BAAgB,EAAE,CAAC;AAErB,IAAA,MAAM,oBAAoB,GAAGC,iBAAW,CAGtC,KAAK,IAAG;QACN,yBAAyB,CAAC,KAAK,CAAC,CAAC;AACjC,QAAA,4BAA4B,GAAG,KAAK,CAAC,CAAC;AACxC,KAAC,EACD,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,CAC1D,CAAC;AAEF,IAAA,MAAM,eAAe,GAAGA,iBAAW,CAGjC,KAAK,IAAG;QACN,yBAAyB,CAAC,KAAK,CAAC,CAAC;AACjC,QAAA,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACnC,KAAC,EACD,CAAC,yBAAyB,EAAE,uBAAuB,CAAC,CACrD,CAAC;AAEF,IAAA,QACEC,gCAAA,CAACC,YAAsB,EACrB,EAAA,QAAA,EAAAD,gCAAA,CAACE,aAAuB,EACtB,EAAA,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAEC,UAAE,CAACC,qBA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"select-content.d.ts","sourceRoot":"","sources":["../../../../v1/components/select/select-content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../v1/components/select/select-content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAO1D,MAAM,WAAW,kBAAmB,SAAQ,eAAe,CAAC,kBAAkB;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,+GA2FzB,CAAC"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Portal, Content as Content2, Viewport } from '../../node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.js';
|
|
4
2
|
import { Combobox } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/combobox/combobox.js';
|
|
5
3
|
import { ComboboxList } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/MAXQOH4L.js';
|
|
4
|
+
import { Portal, Content as Content2, Viewport } from '../../node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.js';
|
|
5
|
+
import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.js';
|
|
6
6
|
import { cx } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
7
|
-
import
|
|
7
|
+
import { forwardRef, useCallback } from 'react';
|
|
8
8
|
import { useSelectContext } from './select-root.js';
|
|
9
|
+
import styles from './select.module.css.js';
|
|
9
10
|
|
|
10
|
-
const SelectContent = forwardRef(({ className, children, position =
|
|
11
|
-
const { autocomplete } = useSelectContext();
|
|
12
|
-
|
|
11
|
+
const SelectContent = forwardRef(({ className, children, position = 'popper', searchPlaceholder = 'Search...', sideOffset = 4, asChild, onEscapeKeyDown: providedOnEscapeKeyDown, onPointerDownOutside: providedOnPointerDownOutside, ...props }, ref) => {
|
|
12
|
+
const { autocomplete, multiple, updateSelectionInProgress } = useSelectContext();
|
|
13
|
+
const onPointerDownOutside = useCallback(event => {
|
|
14
|
+
updateSelectionInProgress(false);
|
|
15
|
+
providedOnPointerDownOutside?.(event);
|
|
16
|
+
}, [updateSelectionInProgress, providedOnPointerDownOutside]);
|
|
17
|
+
const onEscapeKeyDown = useCallback(event => {
|
|
18
|
+
updateSelectionInProgress(false);
|
|
19
|
+
providedOnEscapeKeyDown?.(event);
|
|
20
|
+
}, [updateSelectionInProgress, providedOnEscapeKeyDown]);
|
|
21
|
+
return (jsxRuntimeExports.jsx(Portal, { children: jsxRuntimeExports.jsx(Content2, { ref: ref, position: position, sideOffset: sideOffset, className: cx(styles.content, className), onEscapeKeyDown: multiple ? onEscapeKeyDown : providedOnEscapeKeyDown, onPointerDownOutside: multiple ? onPointerDownOutside : providedOnPointerDownOutside, role: autocomplete ? 'dialog' : 'listbox', "aria-multiselectable": !autocomplete && multiple ? true : undefined, "data-multiselectable": multiple ? true : undefined, ...props, children: jsxRuntimeExports.jsx(Viewport, { className: cx(styles.viewport, autocomplete && styles.comboboxViewport), asChild: !autocomplete ? asChild : undefined, children: autocomplete ? (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Combobox, { autoSelect: true, placeholder: searchPlaceholder, className: styles.comboboxInput, onBlurCapture: event => {
|
|
13
22
|
event.preventDefault();
|
|
14
23
|
event.stopPropagation();
|
|
15
|
-
} }), jsxRuntimeExports.jsx(ComboboxList, { className: styles.comboboxContent, children: children })] })) : (children) }) }) }));
|
|
24
|
+
} }), jsxRuntimeExports.jsx(ComboboxList, { className: styles.comboboxContent, "aria-multiselectable": multiple ? true : undefined, render: asChild ? jsxRuntimeExports.jsx($5e63c961fc1ce211$export$8c6ed5c666ac1360, {}) : undefined, children: children })] })) : (children) }) }) }));
|
|
16
25
|
});
|
|
17
26
|
SelectContent.displayName = Content2.displayName;
|
|
18
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-content.js","sources":["../../../../v1/components/select/select-content.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"select-content.js","sources":["../../../../v1/components/select/select-content.tsx"],"sourcesContent":["import { Combobox, ComboboxList } from '@ariakit/react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef, useCallback } from 'react';\nimport { useSelectContext } from './select-root';\nimport styles from './select.module.css';\n\nexport interface SelectContentProps extends SelectPrimitive.SelectContentProps {\n searchPlaceholder?: string;\n}\n\nexport const SelectContent = forwardRef<\n ElementRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n searchPlaceholder = 'Search...',\n sideOffset = 4,\n asChild,\n onEscapeKeyDown: providedOnEscapeKeyDown,\n onPointerDownOutside: providedOnPointerDownOutside,\n ...props\n },\n ref\n ) => {\n const { autocomplete, multiple, updateSelectionInProgress } =\n useSelectContext();\n\n const onPointerDownOutside = useCallback<\n NonNullable<SelectContentProps['onPointerDownOutside']>\n >(\n event => {\n updateSelectionInProgress(false);\n providedOnPointerDownOutside?.(event);\n },\n [updateSelectionInProgress, providedOnPointerDownOutside]\n );\n\n const onEscapeKeyDown = useCallback<\n NonNullable<SelectContentProps['onEscapeKeyDown']>\n >(\n event => {\n updateSelectionInProgress(false);\n providedOnEscapeKeyDown?.(event);\n },\n [updateSelectionInProgress, providedOnEscapeKeyDown]\n );\n\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n className={cx(styles.content, className)}\n onEscapeKeyDown={multiple ? onEscapeKeyDown : providedOnEscapeKeyDown}\n onPointerDownOutside={\n multiple ? onPointerDownOutside : providedOnPointerDownOutside\n }\n role={autocomplete ? 'dialog' : 'listbox'}\n aria-multiselectable={!autocomplete && multiple ? true : undefined}\n data-multiselectable={multiple ? true : undefined}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cx(\n styles.viewport,\n autocomplete && styles.comboboxViewport\n )}\n asChild={!autocomplete ? asChild : undefined}\n >\n {autocomplete ? (\n <>\n <Combobox\n autoSelect\n placeholder={searchPlaceholder}\n className={styles.comboboxInput}\n onBlurCapture={event => {\n event.preventDefault();\n event.stopPropagation();\n }}\n />\n <ComboboxList\n className={styles.comboboxContent}\n aria-multiselectable={multiple ? true : undefined}\n render={asChild ? <Slot /> : undefined}\n >\n {children}\n </ComboboxList>\n </>\n ) : (\n children\n )}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n }\n);\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n"],"names":["_jsx","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Viewport","_jsxs","_Fragment","Slot"],"mappings":";;;;;;;;;;AAYa,MAAA,aAAa,GAAG,UAAU,CAIrC,CACE,EACE,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,QAAQ,EACnB,iBAAiB,GAAG,WAAW,EAC/B,UAAU,GAAG,CAAC,EACd,OAAO,EACP,eAAe,EAAE,uBAAuB,EACxC,oBAAoB,EAAE,4BAA4B,EA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