@atom-learning/components 10.0.1 → 10.1.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/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/components/badge/BadgeText.js +1 -1
- package/dist/components/badge/BadgeText.js.map +1 -1
- package/dist/components/banner/BannerContainer.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
- package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
- package/dist/components/calendar/Calendar.js +2 -2
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/carousel/Carousel.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupAllItem.js +3 -2
- package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupChecked.context.js +1 -1
- package/dist/components/checkbox-group/CheckboxGroupChecked.context.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupMounted.context.js +1 -1
- package/dist/components/checkbox-group/CheckboxGroupMounted.context.js.map +1 -1
- package/dist/components/chip/Chip.js +2 -2
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js +5 -5
- package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
- package/dist/components/data-table/DataTableHeaderCell.js +8 -8
- package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
- package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
- package/dist/components/data-table/getNewAsyncData.js +1 -1
- package/dist/components/data-table/getNewAsyncData.js.map +1 -1
- package/dist/components/date-input/DateInput.js.map +1 -1
- package/dist/components/file-drop/FileDrop.js +2 -2
- package/dist/components/file-drop/FileDrop.js.map +1 -1
- package/dist/components/form/useFieldError.js +2 -1
- package/dist/components/form/useFieldError.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.js +1 -1
- package/dist/components/navigation/NavigationMenu.js.map +1 -1
- package/dist/components/pagination/PaginationItems.js +2 -2
- package/dist/components/pagination/PaginationItems.js.map +1 -1
- package/dist/components/pagination/pagination.helper.js +5 -3
- package/dist/components/pagination/pagination.helper.js.map +1 -1
- package/dist/components/select-menu/SelectMenu.d.ts +16 -9
- package/dist/components/select-menu/SelectMenu.js +6 -4
- package/dist/components/select-menu/SelectMenu.js.map +1 -1
- package/dist/components/select-menu/SelectMenuContent.d.ts +5 -3
- package/dist/components/select-menu/SelectMenuContent.js +24 -65
- package/dist/components/select-menu/SelectMenuContent.js.map +1 -1
- package/dist/components/select-menu/SelectMenuItem.d.ts +5 -3
- package/dist/components/select-menu/SelectMenuItem.js +15 -15
- package/dist/components/select-menu/SelectMenuItem.js.map +1 -1
- package/dist/components/select-menu/SelectMenuLabel.d.ts +2 -2
- package/dist/components/select-menu/SelectMenuLabel.js +2 -2
- package/dist/components/select-menu/SelectMenuLabel.js.map +1 -1
- package/dist/components/select-menu/SelectMenuSeparator.d.ts +2 -2
- package/dist/components/select-menu/SelectMenuSeparator.js +2 -2
- package/dist/components/select-menu/SelectMenuSeparator.js.map +1 -1
- package/dist/components/select-menu/SelectMenuTrigger.d.ts +3 -2
- package/dist/components/select-menu/SelectMenuTrigger.js +12 -12
- package/dist/components/select-menu/SelectMenuTrigger.js.map +1 -1
- package/dist/components/select-menu-field/SelectMenuField.js +5 -5
- package/dist/components/select-menu-field/SelectMenuField.js.map +1 -1
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/slider-field/SliderField.js +2 -1
- package/dist/components/slider-field/SliderField.js.map +1 -1
- package/dist/components/stepper/Stepper.js +1 -1
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/stepper/StepperSteps.js +7 -5
- package/dist/components/stepper/StepperSteps.js.map +1 -1
- package/dist/components/table/useStickyColumnsCss.js +1 -1
- package/dist/components/table/useStickyColumnsCss.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +131 -159
- package/dist/index.cjs.js.map +1 -1
- package/dist/styled.js +15 -11
- package/dist/styled.js.map +1 -1
- package/dist/utilities/hooks/useResizeObserver.js +1 -3
- package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
- package/dist/utilities/uri/index.js +2 -1
- package/dist/utilities/uri/index.js.map +1 -1
- package/package.json +15 -7
|
@@ -29,12 +29,12 @@ var FileDrop = ({ children, accept, multiple, onDrop, ...rest }) => {
|
|
|
29
29
|
const handleDrop = (fileList) => {
|
|
30
30
|
if (!fileList) return;
|
|
31
31
|
setIsDragging(false);
|
|
32
|
-
const files =
|
|
32
|
+
const files = [...fileList];
|
|
33
33
|
onDrop(files);
|
|
34
34
|
setFiles(files);
|
|
35
35
|
};
|
|
36
36
|
const handleKeyDown = (event) => {
|
|
37
|
-
if (
|
|
37
|
+
if ("Space" === event.key || "Enter" === event.key) fileUploadInputRef.current?.click();
|
|
38
38
|
};
|
|
39
39
|
const value = React$1.useMemo(() => ({
|
|
40
40
|
isDragging,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDrop.js","names":[],"sources":["../../../src/components/file-drop/FileDrop.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { FileDropContext } from './FileDrop.context'\nimport { type FileDropContextValue } from './types'\n\ninterface FileDropProps extends Omit<\n React.ComponentProps<'div'>,\n 'onDrop' | 'ref' | 'children'\n> {\n onDrop: (files: File[]) => void\n children?:\n | React.ReactNode\n | ((value: FileDropContextValue) => React.ReactNode)\n accept?: React.InputHTMLAttributes<HTMLInputElement>['accept']\n multiple?: React.InputHTMLAttributes<HTMLInputElement>['multiple']\n}\n\nconst StyledContainer = styled('div', {\n base: [\n 'flex',\n 'flex-col',\n 'gap-6',\n 'items-center',\n 'border',\n 'border-dashed',\n 'border-grey-500',\n 'px-12',\n 'py-8',\n 'rounded-md',\n 'cursor-pointer',\n '**:pointer-events-none'\n ]\n})\n\nexport const FileDrop = ({\n children,\n accept,\n multiple,\n onDrop,\n ...rest\n}: FileDropProps) => {\n const [isDragging, setIsDragging] = React.useState(false)\n const [files, setFiles] = React.useState<File[]>([])\n const fileUploadInputRef = React.useRef<HTMLInputElement>(null)\n\n const handleDragOver = (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n setIsDragging(true)\n }\n\n const handleDragLeave = () => setIsDragging(false)\n\n const handleDrop = (fileList: FileList | null) => {\n if (!fileList) return\n\n setIsDragging(false)\n\n const files =
|
|
1
|
+
{"version":3,"file":"FileDrop.js","names":[],"sources":["../../../src/components/file-drop/FileDrop.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { FileDropContext } from './FileDrop.context'\nimport { type FileDropContextValue } from './types'\n\ninterface FileDropProps extends Omit<\n React.ComponentProps<'div'>,\n 'onDrop' | 'ref' | 'children'\n> {\n onDrop: (files: File[]) => void\n children?:\n | React.ReactNode\n | ((value: FileDropContextValue) => React.ReactNode)\n accept?: React.InputHTMLAttributes<HTMLInputElement>['accept']\n multiple?: React.InputHTMLAttributes<HTMLInputElement>['multiple']\n}\n\nconst StyledContainer = styled('div', {\n base: [\n 'flex',\n 'flex-col',\n 'gap-6',\n 'items-center',\n 'border',\n 'border-dashed',\n 'border-grey-500',\n 'px-12',\n 'py-8',\n 'rounded-md',\n 'cursor-pointer',\n '**:pointer-events-none'\n ]\n})\n\nexport const FileDrop = ({\n children,\n accept,\n multiple,\n onDrop,\n ...rest\n}: FileDropProps) => {\n const [isDragging, setIsDragging] = React.useState(false)\n const [files, setFiles] = React.useState<File[]>([])\n const fileUploadInputRef = React.useRef<HTMLInputElement>(null)\n\n const handleDragOver = (event: React.DragEvent<HTMLDivElement>) => {\n event.preventDefault()\n setIsDragging(true)\n }\n\n const handleDragLeave = () => setIsDragging(false)\n\n const handleDrop = (fileList: FileList | null) => {\n if (!fileList) return\n\n setIsDragging(false)\n\n const files = [...fileList]\n onDrop(files)\n setFiles(files)\n }\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if ('Space' === event.key || 'Enter' === event.key) {\n fileUploadInputRef.current?.click()\n }\n }\n\n // Memoized: consumers otherwise re-render at drag-over event frequency.\n const value = React.useMemo<FileDropContextValue>(\n () => ({ isDragging, files }),\n [isDragging, files]\n )\n\n return (\n <FileDropContext value={value}>\n <StyledContainer\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={(event) => {\n event.preventDefault()\n handleDrop(event.dataTransfer.files)\n }}\n onClick={() => fileUploadInputRef.current?.click()}\n // A drop zone wraps a file input and arbitrary (possibly interactive)\n // children, which a native <button> may not contain, so the button role\n // lives on this container instead.\n // eslint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"button\"\n onKeyDown={handleKeyDown}\n tabIndex={0}\n {...rest}\n >\n {typeof children === 'function' ? children(value) : children}\n <input\n type=\"file\"\n ref={fileUploadInputRef}\n style={{ visibility: 'hidden' }}\n accept={accept}\n multiple={multiple}\n onChange={(event) => {\n handleDrop(event.target.files)\n }}\n />\n </StyledContainer>\n </FileDropContext>\n )\n}\n\nFileDrop.displayName = 'FileDrop'\n"],"mappings":";;;;;AAkBA,IAAM,kBAAkB,OAAO,OAAO,EACpC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAa,YAAY,EACvB,UACA,QACA,UACA,QACA,GAAG,WACgB;CACnB,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,KAAK;CACxD,MAAM,CAAC,OAAO,YAAY,QAAM,SAAiB,CAAC,CAAC;CACnD,MAAM,qBAAqB,QAAM,OAAyB,IAAI;CAE9D,MAAM,kBAAkB,UAA2C;EACjE,MAAM,eAAe;EACrB,cAAc,IAAI;CACpB;CAEA,MAAM,wBAAwB,cAAc,KAAK;CAEjD,MAAM,cAAc,aAA8B;EAChD,IAAI,CAAC,UAAU;EAEf,cAAc,KAAK;EAEnB,MAAM,QAAQ,CAAC,GAAG,QAAQ;EAC1B,OAAO,KAAK;EACZ,SAAS,KAAK;CAChB;CAEA,MAAM,iBAAiB,UAA+C;EACpE,IAAI,YAAY,MAAM,OAAO,YAAY,MAAM,KAC7C,mBAAmB,SAAS,MAAM;CAEtC;CAGA,MAAM,QAAQ,QAAM,eACX;EAAE;EAAY;CAAM,IAC3B,CAAC,YAAY,KAAK,CACpB;CAEA,OACE,oBAAC,iBAAD;EAAwB;YACtB,qBAAC,iBAAD;GACE,YAAY;GACZ,aAAa;GACb,SAAS,UAAU;IACjB,MAAM,eAAe;IACrB,WAAW,MAAM,aAAa,KAAK;GACrC;GACA,eAAe,mBAAmB,SAAS,MAAM;GAKjD,MAAK;GACL,WAAW;GACX,UAAU;GACV,GAAI;aAfN,CAiBG,OAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACpD,oBAAC,SAAD;IACE,MAAK;IACL,KAAK;IACL,OAAO,EAAE,YAAY,SAAS;IACtB;IACE;IACV,WAAW,UAAU;KACnB,WAAW,MAAM,OAAO,KAAK;IAC/B;GACD,CAAA,CACc;;CACF,CAAA;AAErB;AAEA,SAAS,cAAc"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useFormContext } from "react-hook-form";
|
|
2
2
|
import delve from "dlv";
|
|
3
3
|
//#region src/components/form/useFieldError.ts
|
|
4
|
+
var FIELD_PATH_SEPARATOR_RE = /[,[\].]+?/;
|
|
4
5
|
var useFieldError = (fieldName) => {
|
|
5
6
|
const { errors } = useFormContext();
|
|
6
|
-
const fieldPath = fieldName.split(
|
|
7
|
+
const fieldPath = fieldName.split(FIELD_PATH_SEPARATOR_RE).filter(Boolean);
|
|
7
8
|
const getErrors = () => delve(errors, fieldPath);
|
|
8
9
|
return { error: getErrors()?.message };
|
|
9
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldError.js","names":[],"sources":["../../../src/components/form/useFieldError.ts"],"sourcesContent":["import delve from 'dlv'\nimport { useFormContext } from 'react-hook-form'\n\nexport const useFieldError = (fieldName: string) => {\n const { errors } = useFormContext()\n\n // in case of migration to a newer version of react-hook-form the path needs to updated to account for dynamic fields naming convention\n const fieldPath = fieldName.split(
|
|
1
|
+
{"version":3,"file":"useFieldError.js","names":[],"sources":["../../../src/components/form/useFieldError.ts"],"sourcesContent":["import delve from 'dlv'\nimport { useFormContext } from 'react-hook-form'\n\n// Splits react-hook-form field paths on their `,` `[` `]` `.` separators.\nconst FIELD_PATH_SEPARATOR_RE = /[,[\\].]+?/\n\nexport const useFieldError = (fieldName: string) => {\n const { errors } = useFormContext()\n\n // in case of migration to a newer version of react-hook-form the path needs to updated to account for dynamic fields naming convention\n const fieldPath = fieldName.split(FIELD_PATH_SEPARATOR_RE).filter(Boolean)\n\n const getErrors = () => delve(errors, fieldPath)\n\n return {\n error: getErrors()?.message\n }\n}\n"],"mappings":";;;AAIA,IAAM,0BAA0B;AAEhC,IAAa,iBAAiB,cAAsB;CAClD,MAAM,EAAE,WAAW,eAAe;CAGlC,MAAM,YAAY,UAAU,MAAM,uBAAuB,CAAC,CAAC,OAAO,OAAO;CAEzE,MAAM,kBAAkB,MAAM,QAAQ,SAAS;CAE/C,OAAO,EACL,OAAO,UAAU,CAAC,EAAE,QACtB;AACF"}
|
|
@@ -41,7 +41,7 @@ var NavigationMenuComponent = ({ children, className, ...rest }) => {
|
|
|
41
41
|
}, [React$1.Children.toArray(children).length]);
|
|
42
42
|
React$1.useEffect(() => {
|
|
43
43
|
let timer;
|
|
44
|
-
if (activeItem === "") timer = setTimeout(
|
|
44
|
+
if (activeItem === "") timer = setTimeout(setOffset, 200, null);
|
|
45
45
|
return () => {
|
|
46
46
|
if (timer !== null) clearTimeout(timer);
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenu.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled, cn } from '../../styled'\nimport { colorSchemes as navigationMenuColorSchemes } from './NavigationMenu.colorscheme.config'\nimport { NavigationMenuContext } from './NavigationMenu.context'\nimport { NavigationMenuDropdown } from './NavigationMenuDropdown'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport {\n NavigationMenuDropdownItem,\n NavigationMenuDropdownItemTitle\n} from './NavigationMenuDropdownItem'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nconst StyledMenu = styled(NavigationMenuPrimitive.Root, {\n base: ['flex', 'justify-center', 'relative']\n})\n\nconst StyledList = styled(NavigationMenuPrimitive.List, {\n base: ['flex', 'justify-center', 'items-center', 'gap-1', 'list-none']\n})\n\nconst StyledViewport = styled(NavigationMenuPrimitive.Viewport, {\n base: ['z-2147483647']\n})\n\nconst ViewportPosition = styled('div', {\n base: ['absolute', 'left-0', 'top-full', 'w-full', 'flex', 'justify-center']\n})\n\nconst NavigationMenuComponent = ({\n children,\n className,\n ...rest\n}: React.ComponentProps<typeof StyledMenu>) => {\n const [offset, setOffset] = React.useState<number | null | undefined>()\n const [activeItem, setActiveItem] = React.useState<string | undefined>()\n const listRef = React.useRef<HTMLUListElement>(null)\n const listWidthRef = React.useRef(0)\n\n // Cache the resting list width. It must be measured while the menu is closed:\n // as a dropdown opens, its content is briefly laid out inline in the trigger\n // row, so a width read during the open transition is inflated. Held in a ref\n // (not state) since it only feeds the imperative offset calc below and never\n // renders. Re-measured when the item count changes; stale on resize.\n React.useLayoutEffect(() => {\n if (listRef.current) {\n listWidthRef.current = listRef.current.offsetWidth\n }\n }, [React.Children.toArray(children).length])\n\n React.useEffect(() => {\n let timer: ReturnType<typeof setTimeout>\n\n // Delay transitioning back to initial position\n // to allow enough time for fadeOut animation to complete\n if (activeItem === '') {\n timer = setTimeout(
|
|
1
|
+
{"version":3,"file":"NavigationMenu.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled, cn } from '../../styled'\nimport { colorSchemes as navigationMenuColorSchemes } from './NavigationMenu.colorscheme.config'\nimport { NavigationMenuContext } from './NavigationMenu.context'\nimport { NavigationMenuDropdown } from './NavigationMenuDropdown'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport {\n NavigationMenuDropdownItem,\n NavigationMenuDropdownItemTitle\n} from './NavigationMenuDropdownItem'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nconst StyledMenu = styled(NavigationMenuPrimitive.Root, {\n base: ['flex', 'justify-center', 'relative']\n})\n\nconst StyledList = styled(NavigationMenuPrimitive.List, {\n base: ['flex', 'justify-center', 'items-center', 'gap-1', 'list-none']\n})\n\nconst StyledViewport = styled(NavigationMenuPrimitive.Viewport, {\n base: ['z-2147483647']\n})\n\nconst ViewportPosition = styled('div', {\n base: ['absolute', 'left-0', 'top-full', 'w-full', 'flex', 'justify-center']\n})\n\nconst NavigationMenuComponent = ({\n children,\n className,\n ...rest\n}: React.ComponentProps<typeof StyledMenu>) => {\n const [offset, setOffset] = React.useState<number | null | undefined>()\n const [activeItem, setActiveItem] = React.useState<string | undefined>()\n const listRef = React.useRef<HTMLUListElement>(null)\n const listWidthRef = React.useRef(0)\n\n // Cache the resting list width. It must be measured while the menu is closed:\n // as a dropdown opens, its content is briefly laid out inline in the trigger\n // row, so a width read during the open transition is inflated. Held in a ref\n // (not state) since it only feeds the imperative offset calc below and never\n // renders. Re-measured when the item count changes; stale on resize.\n React.useLayoutEffect(() => {\n if (listRef.current) {\n listWidthRef.current = listRef.current.offsetWidth\n }\n }, [React.Children.toArray(children).length])\n\n React.useEffect(() => {\n let timer: ReturnType<typeof setTimeout>\n\n // Delay transitioning back to initial position\n // to allow enough time for fadeOut animation to complete\n if (activeItem === '') {\n timer = setTimeout(setOffset, 200, null)\n }\n\n return () => {\n if (timer !== null) {\n clearTimeout(timer)\n }\n }\n }, [activeItem])\n\n // Radix has no built-in way to align the viewport with the active trigger, so\n // the offset is computed here. https://github.com/radix-ui/primitives/issues/1462\n const onNodeUpdate = React.useCallback(\n (trigger: HTMLButtonElement, itemValue: string) => {\n const listWidth = listWidthRef.current\n if (trigger && listWidth && activeItem === itemValue) {\n const listCenter = listWidth / 2\n\n const triggerOffsetRight =\n listWidth -\n trigger.offsetLeft -\n trigger.offsetWidth +\n trigger.offsetWidth / 2\n\n setOffset(Math.round(listCenter - triggerOffsetRight))\n }\n\n return trigger\n },\n [activeItem]\n )\n\n const contextValue = React.useMemo(() => ({ onNodeUpdate }), [onNodeUpdate])\n\n return (\n <NavigationMenuContext value={contextValue}>\n <StyledMenu\n className={cn(className)}\n style={navigationMenuColorSchemes['light']}\n onValueChange={setActiveItem}\n {...rest}\n >\n <StyledList ref={listRef}>{children}</StyledList>\n <ViewportPosition>\n <StyledViewport\n style={{ '--navigation-menu-viewport-offset': `${offset || 0}px` }}\n className={cn([\n 'data-[state=open]:animate-fade-in',\n 'data-[state=closed]:animate-fade-out',\n 'translate-x-(--navigation-menu-viewport-offset)'\n ])}\n />\n </ViewportPosition>\n </StyledMenu>\n </NavigationMenuContext>\n )\n}\n\nexport const NavigationMenu = /* @__PURE__ */ Object.assign(\n NavigationMenuComponent,\n {\n Link: NavigationMenuLink,\n Dropdown: NavigationMenuDropdown,\n DropdownContent: NavigationMenuDropdownContent,\n DropdownItem: NavigationMenuDropdownItem,\n DropdownItemTitle: NavigationMenuDropdownItemTitle,\n DropdownTrigger: NavigationMenuDropdownTrigger\n }\n)\n\nNavigationMenuComponent.displayName = 'NavigationMenu'\n"],"mappings":";;;;;;;;;;;;AAeA,IAAM,aAAa,OAAO,wBAAwB,MAAM,EACtD,MAAM;CAAC;CAAQ;CAAkB;AAAU,EAC7C,CAAC;AAED,IAAM,aAAa,OAAO,wBAAwB,MAAM,EACtD,MAAM;CAAC;CAAQ;CAAkB;CAAgB;CAAS;AAAW,EACvE,CAAC;AAED,IAAM,iBAAiB,OAAO,wBAAwB,UAAU,EAC9D,MAAM,CAAC,cAAc,EACvB,CAAC;AAED,IAAM,mBAAmB,OAAO,OAAO,EACrC,MAAM;CAAC;CAAY;CAAU;CAAY;CAAU;CAAQ;AAAgB,EAC7E,CAAC;AAED,IAAM,2BAA2B,EAC/B,UACA,WACA,GAAG,WAC0C;CAC7C,MAAM,CAAC,QAAQ,aAAa,QAAM,SAAoC;CACtE,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAA6B;CACvE,MAAM,UAAU,QAAM,OAAyB,IAAI;CACnD,MAAM,eAAe,QAAM,OAAO,CAAC;CAOnC,QAAM,sBAAsB;EAC1B,IAAI,QAAQ,SACV,aAAa,UAAU,QAAQ,QAAQ;CAE3C,GAAG,CAAC,QAAM,SAAS,QAAQ,QAAQ,CAAC,CAAC,MAAM,CAAC;CAE5C,QAAM,gBAAgB;EACpB,IAAI;EAIJ,IAAI,eAAe,IACjB,QAAQ,WAAW,WAAW,KAAK,IAAI;EAGzC,aAAa;GACX,IAAI,UAAU,MACZ,aAAa,KAAK;EAEtB;CACF,GAAG,CAAC,UAAU,CAAC;CAIf,MAAM,eAAe,QAAM,aACxB,SAA4B,cAAsB;EACjD,MAAM,YAAY,aAAa;EAC/B,IAAI,WAAW,aAAa,eAAe,WAAW;GACpD,MAAM,aAAa,YAAY;GAE/B,MAAM,qBACJ,YACA,QAAQ,aACR,QAAQ,cACR,QAAQ,cAAc;GAExB,UAAU,KAAK,MAAM,aAAa,kBAAkB,CAAC;EACvD;EAEA,OAAO;CACT,GACA,CAAC,UAAU,CACb;CAIA,OACE,oBAAC,uBAAD;EAAuB,OAHJ,QAAM,eAAe,EAAE,aAAa,IAAI,CAAC,YAAY,CAG1C;YAC5B,qBAAC,YAAD;GACE,WAAW,GAAG,SAAS;GACvB,OAAO,aAA2B;GAClC,eAAe;GACf,GAAI;aAJN,CAME,oBAAC,YAAD;IAAY,KAAK;IAAU;GAAqB,CAAA,GAChD,oBAAC,kBAAD,EAAA,UACE,oBAAC,gBAAD;IACE,OAAO,EAAE,qCAAqC,GAAG,UAAU,EAAE,IAAI;IACjE,WAAW,GAAG;KACZ;KACA;KACA;IACF,CAAC;GACF,CAAA,EACe,CAAA,CACR;;CACS,CAAA;AAE3B;AAEA,IAAa,iBAAiC,uBAAO,OACnD,yBACA;CACE,MAAM;CACN,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,mBAAmB;CACnB,iBAAiB;AACnB,CACF;AAEA,wBAAwB,cAAc"}
|
|
@@ -9,9 +9,9 @@ import { Fragment, jsx } from "react/jsx-runtime";
|
|
|
9
9
|
//#region src/components/pagination/PaginationItems.tsx
|
|
10
10
|
var PaginationItems = () => {
|
|
11
11
|
const { paginationItems } = usePagination();
|
|
12
|
-
return /* @__PURE__ */ jsx(Fragment, { children: paginationItems.map((paginationItem
|
|
12
|
+
return /* @__PURE__ */ jsx(Fragment, { children: paginationItems.map((paginationItem) => {
|
|
13
13
|
switch (paginationItem) {
|
|
14
|
-
case VIEW_ALL_POPOVER: return /* @__PURE__ */ jsx(PaginationPopover, {}, paginationItem
|
|
14
|
+
case VIEW_ALL_POPOVER: return /* @__PURE__ */ jsx(PaginationPopover, {}, paginationItem);
|
|
15
15
|
case GO_TO_PREVIOUS_PAGE: return /* @__PURE__ */ jsx(PaginationPreviousButton, {}, paginationItem);
|
|
16
16
|
case GO_TO_NEXT_PAGE: return /* @__PURE__ */ jsx(PaginationNextButton, {}, paginationItem);
|
|
17
17
|
default: return /* @__PURE__ */ jsx(PaginationPage, { pageNumber: paginationItem }, paginationItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = () => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem
|
|
1
|
+
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = () => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem) => {\n switch (paginationItem) {\n case VIEW_ALL_POPOVER:\n return <PaginationPopover key={paginationItem} />\n case GO_TO_PREVIOUS_PAGE:\n return <PaginationPreviousButton key={paginationItem} />\n case GO_TO_NEXT_PAGE:\n return <PaginationNextButton key={paginationItem} />\n default:\n return (\n <PaginationPage\n key={paginationItem}\n pageNumber={paginationItem}\n />\n )\n }\n })}\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAaA,IAAa,wBAAwB;CACnC,MAAM,EAAE,oBAAoB,cAAc;CAE1C,OACE,oBAAA,UAAA,EAAA,UACG,gBAAgB,KAAK,mBAAmB;EACvC,QAAQ,gBAAR;GACE,KAAK,kBACH,OAAO,oBAAC,mBAAD,CAAyC,GAAjB,cAAiB;GAClD,KAAK,qBACH,OAAO,oBAAC,0BAAD,CAAgD,GAAjB,cAAiB;GACzD,KAAK,iBACH,OAAO,oBAAC,sBAAD,CAA4C,GAAjB,cAAiB;GACrD,SACE,OACE,oBAAC,gBAAD,EAEE,YAAY,eACb,GAFM,cAEN;EAEP;CACF,CAAC,EACD,CAAA;AAEN"}
|
|
@@ -29,7 +29,7 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
|
|
|
29
29
|
if (canFitViewAllPopover) visiblePagesCount -= 1;
|
|
30
30
|
if (canFitEdgePage) visiblePagesCount -= 1;
|
|
31
31
|
const firstPage = paginationPages[0];
|
|
32
|
-
const lastPage = paginationPages
|
|
32
|
+
const lastPage = paginationPages.at(-1);
|
|
33
33
|
/**
|
|
34
34
|
* If we're truncating and current page is at the start of the page list,
|
|
35
35
|
* render the initial truncated page list, e.g.
|
|
@@ -104,14 +104,16 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
|
|
|
104
104
|
};
|
|
105
105
|
var findNextAvailablePage = (startPage, disabledPages, pagesCount) => {
|
|
106
106
|
if (startPage > pagesCount) return;
|
|
107
|
+
const disabledSet = new Set(disabledPages);
|
|
107
108
|
let nextPage = startPage;
|
|
108
|
-
while (
|
|
109
|
+
while (disabledSet.has(nextPage)) nextPage++;
|
|
109
110
|
return nextPage;
|
|
110
111
|
};
|
|
111
112
|
var findPreviousAvailablePage = (startPage, disabledPages) => {
|
|
112
113
|
if (startPage < 1) return;
|
|
114
|
+
const disabledSet = new Set(disabledPages);
|
|
113
115
|
let previousPage = startPage;
|
|
114
|
-
while (
|
|
116
|
+
while (disabledSet.has(previousPage)) previousPage--;
|
|
115
117
|
return previousPage;
|
|
116
118
|
};
|
|
117
119
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport type { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n const lastPage = paginationPages
|
|
1
|
+
{"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport type { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n // Non-null: this line is only reached when pagesCount exceeds the visible\n // threshold, so paginationPages always has a last element. `.at()` widens to\n // `T | undefined`, which the index access it replaced did not.\n const lastPage = paginationPages.at(-1)!\n\n /**\n * If we're truncating and current page is at the start of the page list,\n * render the initial truncated page list, e.g.\n *\n * pagesCount: 8\n * currentPage: 1/2\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | … | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage < visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitPages) {\n newPaginationItems.push(...paginationPages.slice(0, visiblePagesCount))\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitEdgePage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page is towards the end of the\n * page list (depending on visibleElementsCount),\n * render a truncated page list from the end, e.g.\n *\n * pagesCount: 8\n * currentPage: 7/8\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, VIEW_ALL_POPOVER, 7, 8, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | … | | 7 | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage > pagesCount - visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitEdgePage) {\n newPaginationItems.push(firstPage)\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitPages) {\n newPaginationItems.push(\n ...paginationPages.slice(pagesCount - visiblePagesCount, pagesCount)\n )\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page doesn't meet any of the previous conditions\n * (we're in the middle)\n * render a truncated page list from a specific index relative to `currentPage`, e.g.\n *\n * currentPage: 4\n * visibleElementsCount: 6 // VisibleElementsAmount.LESS\n * returns [GO_TO_PREVIOUS_PAGE, 3, 4, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 3 | | 4 | | … | | 6 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n * currentPage: 6\n * visibleElementsCount: 8 // VisibleElementsAmount.MORE\n * returns [GO_TO_PREVIOUS_PAGE, 4, 5, 6, 7, VIEW_ALL_POPOVER, 10, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 4 | | 5 | | 6 | | 7 | | … | | 10 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n */\n const canFitCurrentPage = canFitPages\n const canFitCurrentPageAndPreviousPage = visibleElementsCount >= 6\n const canFitCurrentPageAndPreviousPageAndNextPage = visibleElementsCount >= 7\n const canFitLastPage = canFitEdgePage\n\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitCurrentPageAndPreviousPageAndNextPage) {\n newPaginationItems.push(\n ...paginationPages.slice(\n currentPage + 1 - visiblePagesCount,\n currentPage + 1\n )\n )\n } else if (canFitCurrentPageAndPreviousPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - visiblePagesCount, currentPage)\n )\n } else if (canFitCurrentPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - 1, currentPage - 1 + 1)\n )\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitLastPage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n}\n\nexport const findNextAvailablePage = (\n startPage: number,\n disabledPages: number[],\n pagesCount: number\n): number | undefined => {\n if (startPage > pagesCount) return\n const disabledSet = new Set(disabledPages)\n let nextPage = startPage\n while (disabledSet.has(nextPage)) {\n nextPage++\n }\n return nextPage\n}\n\nexport const findPreviousAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number | undefined => {\n if (startPage < 1) return\n const disabledSet = new Set(disabledPages)\n let previousPage = startPage\n while (disabledSet.has(previousPage)) {\n previousPage--\n }\n return previousPage\n}\n"],"mappings":";;AAOA,IAAa,iCACX,aACA,YACA,yBAC4B;CAC5B,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,WAAW,IACpB,GAAG,UAAU,QAAQ,CACxB;CAOA,IAAI,oBAAoB,uBAAuB;CAC/C,MAAM,8BAA8B,oBAAoB;EACtD;EACA,GAAG;EACH;CACF;;;;;;;;;;;;CAaA,IAAI,cAAc,mBAChB,OAAO,2BAA2B,eAAe;;;;CAMnD,MAAM,iBAAiB,wBAAwB;CAC/C,MAAM,uBAAuB,wBAAwB;CACrD,MAAM,cAAc,wBAAwB;CAE5C,IAAI,sBAEF,qBAAqB;CAGvB,IAAI,gBAEF,qBAAqB;CAGvB,MAAM,YAAY,gBAAgB;CAIlC,MAAM,WAAW,gBAAgB,GAAG,EAAE;;;;;;;;;;;;;;CAetC,IAAI,cAAc,mBAAmB;EACnC,MAAM,qBAAqB,CAAC;EAC5B,IAAI,aACF,mBAAmB,KAAK,GAAG,gBAAgB,MAAM,GAAG,iBAAiB,CAAC;EAExE,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;EAElC,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;CAgBA,IAAI,cAAc,aAAa,mBAAmB;EAChD,MAAM,qBAAqB,CAAC;EAC5B,IAAI,gBACF,mBAAmB,KAAK,SAAS;EAEnC,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,aACF,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,aAAa,mBAAmB,UAAU,CACrE;EAEF,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;;;;;;CAqBA,MAAM,oBAAoB;CAC1B,MAAM,mCAAmC,wBAAwB;CACjE,MAAM,8CAA8C,wBAAwB;CAC5E,MAAM,iBAAiB;CAEvB,MAAM,qBAAqB,CAAC;CAC5B,IAAI,6CACF,mBAAmB,KACjB,GAAG,gBAAgB,MACjB,cAAc,IAAI,mBAClB,cAAc,CAChB,CACF;MACK,IAAI,kCACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,mBAAmB,WAAW,CACvE;MACK,IAAI,mBACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAC/D;CAEF,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;CAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;CAElC,OAAO,2BAA2B,kBAAkB;AACtD;AAEA,IAAa,yBACX,WACA,eACA,eACuB;CACvB,IAAI,YAAY,YAAY;CAC5B,MAAM,cAAc,IAAI,IAAI,aAAa;CACzC,IAAI,WAAW;CACf,OAAO,YAAY,IAAI,QAAQ,GAC7B;CAEF,OAAO;AACT;AAEA,IAAa,6BACX,WACA,kBACuB;CACvB,IAAI,YAAY,GAAG;CACnB,MAAM,cAAc,IAAI,IAAI,aAAa;CACzC,IAAI,eAAe;CACnB,OAAO,YAAY,IAAI,YAAY,GACjC;CAEF,OAAO;AACT"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuProps = Omit<AriaComponents.SelectProps<object>, 'className' | 'style' | 'children'> & {
|
|
4
4
|
size?: 'sm' | 'md' | 'lg';
|
|
5
5
|
theme?: 'white' | 'grey';
|
|
6
6
|
state?: 'error';
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
7
9
|
};
|
|
8
|
-
export declare const SelectMenu: (({ size, theme, state, children, ...rest }: SelectMenuProps) => React.JSX.Element) & {
|
|
9
|
-
Trigger: ({ ref, placeholder, children, ...rest }:
|
|
10
|
+
export declare const SelectMenu: (({ size, theme, state, className, children, ...rest }: SelectMenuProps) => React.JSX.Element) & {
|
|
11
|
+
Trigger: ({ ref, placeholder, children, ...rest }: Omit<AriaComponents.ButtonProps & React.RefAttributes<HTMLButtonElement>, "aria-label" | "aria-labelledby" | "children"> & {
|
|
10
12
|
placeholder?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
11
14
|
}) => React.JSX.Element;
|
|
12
|
-
Content: ({ ref, children,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
Content: ({ ref, children, offset, ...rest }: Omit<AriaComponents.PopoverProps & React.RefAttributes<HTMLElement>, "children"> & {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
Item: ({ children, textValue, ...rest }: Omit<AriaComponents.ListBoxItemProps<object>, "children"> & {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
Group: <T>(props: AriaComponents.ListBoxSectionProps<T> & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
15
22
|
Label: {
|
|
16
|
-
({ className, ...rest }:
|
|
23
|
+
({ className, ...rest }: AriaComponents.HeaderProps & React.RefAttributes<HTMLElement>): React.JSX.Element;
|
|
17
24
|
displayName: string;
|
|
18
25
|
};
|
|
19
|
-
Separator: import("../..").StyledComponent<React.
|
|
26
|
+
Separator: import("../..").StyledComponent<(props: AriaComponents.SeparatorProps & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null, unknown>;
|
|
20
27
|
};
|
|
21
28
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cn } from "../../styled.js";
|
|
1
2
|
import { SelectMenuContext } from "./SelectMenu.context.js";
|
|
2
3
|
import { SelectMenuContent } from "./SelectMenuContent.js";
|
|
3
4
|
import { SelectMenuItem } from "./SelectMenuItem.js";
|
|
@@ -6,9 +7,9 @@ import { SelectMenuSeparator } from "./SelectMenuSeparator.js";
|
|
|
6
7
|
import { SelectMenuTrigger } from "./SelectMenuTrigger.js";
|
|
7
8
|
import * as React$1 from "react";
|
|
8
9
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import * as
|
|
10
|
+
import * as AriaComponents from "react-aria-components";
|
|
10
11
|
//#region src/components/select-menu/SelectMenu.tsx
|
|
11
|
-
var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest }) => {
|
|
12
|
+
var SelectMenuRoot = ({ size = "md", theme = "grey", state, className, children, ...rest }) => {
|
|
12
13
|
return /* @__PURE__ */ jsx(SelectMenuContext, {
|
|
13
14
|
value: React$1.useMemo(() => ({
|
|
14
15
|
size,
|
|
@@ -19,7 +20,8 @@ var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest })
|
|
|
19
20
|
theme,
|
|
20
21
|
state
|
|
21
22
|
]),
|
|
22
|
-
children: /* @__PURE__ */ jsx(
|
|
23
|
+
children: /* @__PURE__ */ jsx(AriaComponents.Select, {
|
|
24
|
+
className: cn("w-full", className),
|
|
23
25
|
...rest,
|
|
24
26
|
children
|
|
25
27
|
})
|
|
@@ -29,7 +31,7 @@ var SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {
|
|
|
29
31
|
Trigger: SelectMenuTrigger,
|
|
30
32
|
Content: SelectMenuContent,
|
|
31
33
|
Item: SelectMenuItem,
|
|
32
|
-
Group:
|
|
34
|
+
Group: AriaComponents.ListBoxSection,
|
|
33
35
|
Label: SelectMenuLabel,
|
|
34
36
|
Separator: SelectMenuSeparator
|
|
35
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as
|
|
1
|
+
{"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { cn } from '../../styled'\nimport { SelectMenuContext } from './SelectMenu.context'\nimport { SelectMenuContent } from './SelectMenuContent'\nimport { SelectMenuItem } from './SelectMenuItem'\nimport { SelectMenuLabel } from './SelectMenuLabel'\nimport { SelectMenuSeparator } from './SelectMenuSeparator'\nimport { SelectMenuTrigger } from './SelectMenuTrigger'\n\ntype SelectMenuProps = Omit<\n AriaComponents.SelectProps<object>,\n 'className' | 'style' | 'children'\n> & {\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n state?: 'error'\n className?: string\n children?: React.ReactNode\n}\n\nconst SelectMenuRoot = ({\n size = 'md',\n theme = 'grey',\n state,\n className,\n children,\n ...rest\n}: SelectMenuProps) => {\n const value = React.useMemo(\n () => ({ size, theme, state }),\n [size, theme, state]\n )\n return (\n <SelectMenuContext value={value}>\n {/* w-full so the trigger fills its container even in flex/inline layouts\n (react-aria wraps the trigger in an extra div). Consumers can override\n the width — or anything else — via className, e.g. w-auto / w-64. */}\n <AriaComponents.Select className={cn('w-full', className)} {...rest}>\n {children}\n </AriaComponents.Select>\n </SelectMenuContext>\n )\n}\n\nexport const SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {\n Trigger: SelectMenuTrigger,\n Content: SelectMenuContent,\n Item: SelectMenuItem,\n Group: AriaComponents.ListBoxSection,\n Label: SelectMenuLabel,\n Separator: SelectMenuSeparator\n})\n"],"mappings":";;;;;;;;;;;AAsBA,IAAM,kBAAkB,EACtB,OAAO,MACP,QAAQ,QACR,OACA,WACA,UACA,GAAG,WACkB;CAKrB,OACE,oBAAC,mBAAD;EAA0B,OALd,QAAM,eACX;GAAE;GAAM;GAAO;EAAM,IAC5B;GAAC;GAAM;GAAO;EAAK,CAGO;YAIxB,oBAAC,eAAe,QAAhB;GAAuB,WAAW,GAAG,UAAU,SAAS;GAAG,GAAI;GAC5D;EACoB,CAAA;CACN,CAAA;AAEvB;AAEA,IAAa,aAA6B,uBAAO,OAAO,gBAAgB;CACtE,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO,eAAe;CACtB,OAAO;CACP,WAAW;AACb,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuContentProps = Omit<React.ComponentPropsWithRef<typeof AriaComponents.Popover>, 'children'> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SelectMenuContent: ({ ref, children, offset, ...rest }: SelectMenuContentProps) => React.JSX.Element;
|
|
5
7
|
export {};
|
|
@@ -1,73 +1,32 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
|
-
import { Icon } from "../icon/Icon.js";
|
|
3
2
|
import "react";
|
|
4
|
-
import { jsx
|
|
5
|
-
import
|
|
6
|
-
import * as RadixSelect from "@radix-ui/react-select";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as AriaComponents from "react-aria-components";
|
|
7
5
|
//#region src/components/select-menu/SelectMenuContent.tsx
|
|
8
|
-
var Content = styled(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
popper: ["max-h-(--radix-select-content-available-height)", "min-w-(--radix-select-trigger-width)"],
|
|
27
|
-
"item-aligned": []
|
|
28
|
-
} }
|
|
29
|
-
});
|
|
30
|
-
var Viewport = styled(RadixSelect.Viewport, {
|
|
31
|
-
base: ["p-1", "w-full"],
|
|
32
|
-
variants: { position: {
|
|
33
|
-
popper: ["h-(--radix-select-content-available-height)"],
|
|
34
|
-
"item-aligned": []
|
|
35
|
-
} }
|
|
36
|
-
});
|
|
37
|
-
var ScrollUpButton = styled(RadixSelect.ScrollUpButton, { base: [
|
|
38
|
-
"flex",
|
|
39
|
-
"items-center",
|
|
40
|
-
"justify-center",
|
|
41
|
-
"h-6",
|
|
42
|
-
"cursor-default"
|
|
43
|
-
] });
|
|
44
|
-
var ScrollDownButton = styled(RadixSelect.ScrollDownButton, { base: [
|
|
45
|
-
"flex",
|
|
46
|
-
"items-center",
|
|
47
|
-
"justify-center",
|
|
48
|
-
"h-6",
|
|
49
|
-
"cursor-default"
|
|
50
|
-
] });
|
|
51
|
-
var SelectMenuContent = ({ ref, children, position = "popper", sideOffset = 4, ...rest }) => /* @__PURE__ */ jsx(RadixSelect.Portal, { children: /* @__PURE__ */ jsxs(Content, {
|
|
6
|
+
var Content = styled(AriaComponents.Popover, { base: [
|
|
7
|
+
"bg-white",
|
|
8
|
+
"rounded-md",
|
|
9
|
+
"shadow-lg",
|
|
10
|
+
"z-10",
|
|
11
|
+
"overflow-hidden",
|
|
12
|
+
"will-change-transform",
|
|
13
|
+
"min-w-[var(--trigger-width)]",
|
|
14
|
+
"max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]"
|
|
15
|
+
] }, { enablePolymorphism: false });
|
|
16
|
+
var Viewport = styled(AriaComponents.ListBox, { base: [
|
|
17
|
+
"max-h-[inherit]",
|
|
18
|
+
"w-full",
|
|
19
|
+
"overflow-auto",
|
|
20
|
+
"p-1",
|
|
21
|
+
"outline-none"
|
|
22
|
+
] }, { enablePolymorphism: false });
|
|
23
|
+
var SelectMenuContent = ({ ref, children, offset = 4, ...rest }) => /* @__PURE__ */ jsx(Content, {
|
|
52
24
|
ref,
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
offset,
|
|
26
|
+
containerPadding: 8,
|
|
55
27
|
...rest,
|
|
56
|
-
children:
|
|
57
|
-
|
|
58
|
-
is: ChevronUp,
|
|
59
|
-
className: "text-grey-700 size-4"
|
|
60
|
-
}) }),
|
|
61
|
-
/* @__PURE__ */ jsx(Viewport, {
|
|
62
|
-
position,
|
|
63
|
-
children
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ jsx(ScrollDownButton, { children: /* @__PURE__ */ jsx(Icon, {
|
|
66
|
-
is: ChevronDown,
|
|
67
|
-
className: "text-grey-700 size-4"
|
|
68
|
-
}) })
|
|
69
|
-
]
|
|
70
|
-
}) });
|
|
28
|
+
children: /* @__PURE__ */ jsx(Viewport, { children })
|
|
29
|
+
});
|
|
71
30
|
//#endregion
|
|
72
31
|
export { SelectMenuContent };
|
|
73
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenuContent.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuContent.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"SelectMenuContent.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuContent.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\n\nconst Content = styled(\n AriaComponents.Popover,\n {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'z-10',\n 'overflow-hidden',\n 'will-change-transform',\n // Floors at the trigger width; caps at min(viewport − 8px per edge, 400px)\n // on the --spacing() scale: --spacing(4)=16px (2×8px), --spacing(100)=400px.\n 'min-w-[var(--trigger-width)]',\n 'max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]'\n ]\n },\n { enablePolymorphism: false }\n)\n\nconst Viewport = styled(\n AriaComponents.ListBox,\n {\n base: ['max-h-[inherit]', 'w-full', 'overflow-auto', 'p-1', 'outline-none']\n },\n { enablePolymorphism: false }\n)\n\ntype SelectMenuContentProps = Omit<\n React.ComponentPropsWithRef<typeof AriaComponents.Popover>,\n 'children'\n> & {\n children?: React.ReactNode\n}\n\nexport const SelectMenuContent = ({\n ref,\n children,\n offset = 4,\n ...rest\n}: SelectMenuContentProps) => (\n // offset/containerPadding are react-aria positioner props in px (JS numbers,\n // not CSS), so they can't use the --spacing() scale: 4px gap from the trigger,\n // 8px minimum inset from every viewport edge (the 2×8px behind the max-width).\n <Content ref={ref} offset={offset} containerPadding={8} {...rest}>\n <Viewport>{children}</Viewport>\n </Content>\n)\n"],"mappings":";;;;;AAKA,IAAM,UAAU,OACd,eAAe,SACf,EACE,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;AACF,EACF,GACA,EAAE,oBAAoB,MAAM,CAC9B;AAEA,IAAM,WAAW,OACf,eAAe,SACf,EACE,MAAM;CAAC;CAAmB;CAAU;CAAiB;CAAO;AAAc,EAC5E,GACA,EAAE,oBAAoB,MAAM,CAC9B;AASA,IAAa,qBAAqB,EAChC,KACA,UACA,SAAS,GACT,GAAG,WAKH,oBAAC,SAAD;CAAc;CAAa;CAAQ,kBAAkB;CAAG,GAAI;WAC1D,oBAAC,UAAD,EAAW,SAAmB,CAAA;AACvB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuItemProps = Omit<AriaComponents.ListBoxItemProps, 'children'> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SelectMenuItem: ({ children, textValue, ...rest }: SelectMenuItemProps) => React.JSX.Element;
|
|
5
7
|
export {};
|
|
@@ -2,11 +2,11 @@ import { styled } from "../../styled.js";
|
|
|
2
2
|
import { Icon } from "../icon/Icon.js";
|
|
3
3
|
import { useSelectMenuContext } from "./SelectMenu.context.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Ok } from "@atom-learning/icons";
|
|
7
|
-
import * as
|
|
7
|
+
import * as AriaComponents from "react-aria-components";
|
|
8
8
|
//#region src/components/select-menu/SelectMenuItem.tsx
|
|
9
|
-
var Item = styled(
|
|
9
|
+
var Item = styled(AriaComponents.ListBoxItem, {
|
|
10
10
|
base: [
|
|
11
11
|
"relative",
|
|
12
12
|
"flex",
|
|
@@ -17,11 +17,11 @@ var Item = styled(RadixSelect.Item, {
|
|
|
17
17
|
"cursor-pointer",
|
|
18
18
|
"rounded-sm",
|
|
19
19
|
"outline-none",
|
|
20
|
-
"data-disabled:cursor-not-allowed",
|
|
21
|
-
"data-disabled:opacity-30",
|
|
22
|
-
"data-
|
|
23
|
-
"data-
|
|
24
|
-
"data-
|
|
20
|
+
"data-[disabled]:cursor-not-allowed",
|
|
21
|
+
"data-[disabled]:opacity-30",
|
|
22
|
+
"data-[hovered]:bg-grey-100",
|
|
23
|
+
"data-[focused]:bg-grey-100",
|
|
24
|
+
"data-[focus-visible]:outline-none"
|
|
25
25
|
],
|
|
26
26
|
variants: { size: {
|
|
27
27
|
sm: [
|
|
@@ -41,20 +41,20 @@ var Item = styled(RadixSelect.Item, {
|
|
|
41
41
|
"pr-6"
|
|
42
42
|
]
|
|
43
43
|
} }
|
|
44
|
-
});
|
|
45
|
-
var SelectMenuItem = ({
|
|
44
|
+
}, { enablePolymorphism: false });
|
|
45
|
+
var SelectMenuItem = ({ children, textValue, ...rest }) => {
|
|
46
46
|
const { size } = useSelectMenuContext();
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
ref,
|
|
47
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
49
48
|
size,
|
|
49
|
+
textValue: textValue ?? (typeof children === "string" ? children : void 0),
|
|
50
50
|
...rest,
|
|
51
|
-
children: [/* @__PURE__ */ jsx(
|
|
51
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
52
52
|
className: "absolute left-2 inline-flex items-center",
|
|
53
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
53
|
+
children: isSelected && /* @__PURE__ */ jsx(Icon, {
|
|
54
54
|
is: Ok,
|
|
55
55
|
className: size === "sm" ? "size-3" : "size-4"
|
|
56
56
|
})
|
|
57
|
-
}),
|
|
57
|
+
}), children] })
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenuItem.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuItem.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as
|
|
1
|
+
{"version":3,"file":"SelectMenuItem.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuItem.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useSelectMenuContext } from './SelectMenu.context'\n\nconst Item = styled(\n AriaComponents.ListBoxItem,\n {\n base: [\n 'relative',\n 'flex',\n 'items-center',\n 'text-grey-1000',\n 'font-body',\n 'font-normal',\n 'cursor-pointer',\n 'rounded-sm',\n 'outline-none',\n 'data-[disabled]:cursor-not-allowed',\n 'data-[disabled]:opacity-30',\n // react-aria's data-hovered (pointer only, ignores touch) — not `hover:`,\n // whose :hover sticks after a tap on touchscreens (this menu targets\n // webviews). data-focused covers keyboard navigation; together they\n // replicate the old Radix data-highlighted.\n 'data-[hovered]:bg-grey-100',\n 'data-[focused]:bg-grey-100',\n 'data-[focus-visible]:outline-none'\n ],\n variants: {\n size: {\n sm: ['py-1.5', 'pl-7', 'pr-4', 'text-sm'],\n md: ['py-2', 'pl-8', 'pr-6'],\n lg: ['py-2', 'pl-8', 'pr-6']\n }\n }\n },\n { enablePolymorphism: false }\n)\n\ntype SelectMenuItemProps = Omit<AriaComponents.ListBoxItemProps, 'children'> & {\n children?: React.ReactNode\n}\n\nexport const SelectMenuItem = ({\n children,\n textValue,\n ...rest\n}: SelectMenuItemProps) => {\n const { size } = useSelectMenuContext()\n const resolvedTextValue =\n textValue ?? (typeof children === 'string' ? children : undefined)\n\n return (\n <Item size={size} textValue={resolvedTextValue} {...rest}>\n {({ isSelected }) => (\n <>\n <span className=\"absolute left-2 inline-flex items-center\">\n {isSelected && (\n <Icon is={Ok} className={size === 'sm' ? 'size-3' : 'size-4'} />\n )}\n </span>\n {children}\n </>\n )}\n </Item>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,OAAO,OACX,eAAe,aACf;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAKA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI;GAAC;GAAU;GAAQ;GAAQ;EAAS;EACxC,IAAI;GAAC;GAAQ;GAAQ;EAAM;EAC3B,IAAI;GAAC;GAAQ;GAAQ;EAAM;CAC7B,EACF;AACF,GACA,EAAE,oBAAoB,MAAM,CAC9B;AAMA,IAAa,kBAAkB,EAC7B,UACA,WACA,GAAG,WACsB;CACzB,MAAM,EAAE,SAAS,qBAAqB;CAItC,OACE,oBAAC,MAAD;EAAY;EAAM,WAHlB,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;EAGR,GAAI;aAChD,EAAE,iBACF,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb,cACC,oBAAC,MAAD;IAAM,IAAI;IAAI,WAAW,SAAS,OAAO,WAAW;GAAW,CAAA;EAE7D,CAAA,GACL,QACD,EAAA,CAAA;CAEA,CAAA;AAEV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuLabelProps = React.ComponentProps<typeof AriaComponents.Header>;
|
|
4
4
|
export declare function SelectMenuLabel({ className, ...rest }: SelectMenuLabelProps): React.JSX.Element;
|
|
5
5
|
export declare namespace SelectMenuLabel {
|
|
6
6
|
var displayName: string;
|
|
@@ -2,10 +2,10 @@ import { cn } from "../../styled.js";
|
|
|
2
2
|
import { Text } from "../text/Text.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import * as
|
|
5
|
+
import * as AriaComponents from "react-aria-components";
|
|
6
6
|
//#region src/components/select-menu/SelectMenuLabel.tsx
|
|
7
7
|
var SelectMenuLabel = ({ className, ...rest }) => /* @__PURE__ */ jsx(Text, {
|
|
8
|
-
as:
|
|
8
|
+
as: AriaComponents.Header,
|
|
9
9
|
size: "sm",
|
|
10
10
|
className: cn("p-2", "mb-1", "text-text-subtle", className),
|
|
11
11
|
...rest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenuLabel.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuLabel.tsx"],"sourcesContent":["import * as
|
|
1
|
+
{"version":3,"file":"SelectMenuLabel.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuLabel.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { cn } from '../../styled'\nimport { Text } from '../text/Text'\n\ntype SelectMenuLabelProps = React.ComponentProps<typeof AriaComponents.Header>\n\nexport const SelectMenuLabel = ({\n className,\n ...rest\n}: SelectMenuLabelProps) => (\n <Text\n as={AriaComponents.Header}\n size=\"sm\"\n className={cn('p-2', 'mb-1', 'text-text-subtle', className)}\n {...rest}\n />\n)\n\nSelectMenuLabel.displayName = 'SelectMenuLabel'\n"],"mappings":";;;;;;AAQA,IAAa,mBAAmB,EAC9B,WACA,GAAG,WAEH,oBAAC,MAAD;CACE,IAAI,eAAe;CACnB,MAAK;CACL,WAAW,GAAG,OAAO,QAAQ,oBAAoB,SAAS;CAC1D,GAAI;AACL,CAAA;AAGH,gBAAgB,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export declare const SelectMenuSeparator: import("../..").StyledComponent<
|
|
1
|
+
import * as AriaComponents from 'react-aria-components';
|
|
2
|
+
export declare const SelectMenuSeparator: import("../..").StyledComponent<(props: AriaComponents.SeparatorProps & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null, unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as AriaComponents from "react-aria-components";
|
|
3
3
|
//#region src/components/select-menu/SelectMenuSeparator.tsx
|
|
4
|
-
var SelectMenuSeparator = styled(
|
|
4
|
+
var SelectMenuSeparator = styled(AriaComponents.Separator, { base: [
|
|
5
5
|
"h-px",
|
|
6
6
|
"bg-grey-200",
|
|
7
7
|
"my-2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenuSeparator.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuSeparator.tsx"],"sourcesContent":["import * as
|
|
1
|
+
{"version":3,"file":"SelectMenuSeparator.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuSeparator.tsx"],"sourcesContent":["import * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\n\nexport const SelectMenuSeparator = styled(\n AriaComponents.Separator,\n {\n base: ['h-px', 'bg-grey-200', 'my-2', 'mx-1']\n },\n { enablePolymorphism: false }\n)\n"],"mappings":";;;AAIA,IAAa,sBAAsB,OACjC,eAAe,WACf,EACE,MAAM;CAAC;CAAQ;CAAe;CAAQ;AAAM,EAC9C,GACA,EAAE,oBAAoB,MAAM,CAC9B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuTriggerProps = Omit<React.ComponentPropsWithRef<typeof AriaComponents.Button>, 'children' | 'aria-label' | 'aria-labelledby'> & {
|
|
4
4
|
placeholder?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
5
6
|
};
|
|
6
7
|
export declare const SelectMenuTrigger: ({ ref, placeholder, children, ...rest }: SelectMenuTriggerProps) => React.JSX.Element;
|
|
7
8
|
export {};
|