@dxos/react-list 0.5.9-main.1c1903d → 0.5.9-main.1ea2105

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/List.tsx", "../../../src/ListItem.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\n// TODO(thure): A lot of the accessible affordances for this kind of thing need to be implemented per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\nconst LIST_NAME = 'List';\n\ntype ListScopedProps<P> = P & { __listScope?: Scope };\n\ntype ListVariant = 'ordered' | 'unordered';\n\ntype ListItemSizes = 'one' | 'many';\n\ntype ListProps = ComponentPropsWithRef<typeof Primitive.ol> & {\n selectable?: boolean;\n variant?: ListVariant;\n itemSizes?: ListItemSizes;\n};\n\nconst [createListContext, createListScope] = createContextScope(LIST_NAME, []);\n\ntype ListContextValue = {\n selectable: Exclude<ListProps['selectable'], undefined>;\n variant: Exclude<ListProps['variant'], undefined>;\n itemSizes?: ListItemSizes;\n};\n\nconst [ListProvider, useListContext] = createListContext<ListContextValue>(LIST_NAME);\n\nconst List = forwardRef<HTMLOListElement, ListProps>((props: ListScopedProps<ListProps>, forwardedRef) => {\n const { __listScope, variant = 'ordered', selectable = false, itemSizes, children, ...rootProps } = props;\n const ListRoot = variant === 'ordered' ? Primitive.ol : Primitive.ul;\n return (\n <ListRoot {...(selectable && { role: 'listbox', 'aria-multiselectable': true })} {...rootProps} ref={forwardedRef}>\n <ListProvider\n {...{\n scope: __listScope,\n variant,\n selectable,\n itemSizes,\n }}\n >\n {children}\n </ListProvider>\n </ListRoot>\n );\n});\n\nList.displayName = LIST_NAME;\n\nexport { List, createListScope, useListContext, LIST_NAME };\n\nexport type { ListProps, ListVariant, ListScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { CheckboxProps } from '@radix-ui/react-checkbox';\nimport { type CollapsibleContentProps, type CollapsibleTriggerProps } from '@radix-ui/react-collapsible';\nimport * as Collapsible from '@radix-ui/react-collapsible';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentProps,\n type ComponentPropsWithRef,\n type Dispatch,\n forwardRef,\n type ForwardRefExoticComponent,\n type SetStateAction,\n} from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nimport { LIST_NAME, type ListScopedProps, useListContext } from './List';\n\nconst LIST_ITEM_NAME = 'ListItem';\n\ntype ListItemScopedProps<P> = P & { __listItemScope?: Scope };\n\ninterface ListItemData {\n id: string;\n labelId?: string;\n selected?: CheckboxProps['checked'];\n open?: boolean;\n}\n\ntype ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & ComponentPropsWithRef<\n typeof Primitive.li\n > & {\n defaultOpen?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n } & {\n onSelectedChange?: CheckboxProps['onCheckedChange'];\n defaultSelected?: CheckboxProps['defaultChecked'];\n };\n\ntype ListItemElement = React.ElementRef<typeof Primitive.li>;\n\nconst [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);\n\ntype ListItemContextValue = {\n headingId: string;\n open: boolean;\n selected: CheckboxProps['checked'];\n setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;\n};\n\nconst [ListItemProvider, useListItemContext] = createListItemContext<ListItemContextValue>(LIST_ITEM_NAME);\n\ntype ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {\n asChild?: boolean;\n};\n\nconst ListItemHeading = forwardRef<HTMLDivElement, ListItemHeadingProps>(\n ({ children, asChild, __listItemScope, ...props }, forwardedRef) => {\n const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);\n const Root = asChild ? Slot : Primitive.div;\n return (\n <Root {...props} id={headingId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;\n\nconst ListItemOpenTrigger = Collapsible.Trigger;\n\ntype ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;\n\nconst ListItemCollapsibleContent: ForwardRefExoticComponent<CollapsibleContentProps> = Collapsible.Content;\n\nconst ListItem = forwardRef<ListItemElement, ListItemProps>(\n (props: ListItemScopedProps<ListScopedProps<ListItemProps>>, forwardedRef) => {\n const id = useId('listItem', props.id);\n\n const {\n __listScope,\n __listItemScope,\n children,\n selected: propsSelected,\n defaultSelected,\n onSelectedChange,\n open: propsOpen,\n defaultOpen,\n onOpenChange,\n collapsible,\n labelId,\n ...listItemProps\n } = props;\n const { selectable } = useListContext(LIST_NAME, __listScope);\n\n const [selected = false, setSelected] = useControllableState({\n prop: propsSelected,\n defaultProp: defaultSelected,\n onChange: onSelectedChange,\n });\n\n const [open = false, setOpen] = useControllableState({\n prop: propsOpen,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const headingId = useId('listItem__heading', labelId);\n\n const listItem = (\n <Primitive.li\n {...listItemProps}\n id={id}\n ref={forwardedRef}\n aria-labelledby={headingId}\n {...(selectable && { role: 'option', 'aria-selected': !!selected })}\n {...(open && { 'aria-expanded': true })}\n >\n {children}\n </Primitive.li>\n );\n\n return (\n <ListItemProvider\n scope={__listItemScope}\n headingId={headingId}\n open={open}\n selected={selected}\n setSelected={setSelected}\n >\n {collapsible ? (\n <Collapsible.Root asChild open={open} onOpenChange={setOpen}>\n {listItem}\n </Collapsible.Root>\n ) : (\n listItem\n )}\n </ListItemProvider>\n );\n },\n);\n\nListItem.displayName = LIST_ITEM_NAME;\n\nexport {\n ListItem,\n ListItemHeading,\n ListItemCollapsibleContent,\n ListItemOpenTrigger,\n createListItemScope,\n useListItemContext,\n LIST_ITEM_NAME,\n};\n\nexport type {\n ListItemProps,\n ListItemHeadingProps,\n ListItemCollapsibleContentProps,\n ListItemOpenTriggerProps,\n ListItemScopedProps,\n};\n"],
5
- "mappings": ";AAIA,SAASA,0BAAsC;AAC/C,SAASC,iBAAiB;AAC1B,OAAOC,SAAqCC,kBAAkB;AAI9D,IAAMC,YAAY;AAclB,IAAM,CAACC,mBAAmBC,eAAAA,IAAmBC,mBAAmBH,WAAW,CAAA,CAAE;AAQ7E,IAAM,CAACI,cAAcC,cAAAA,IAAkBJ,kBAAoCD,SAAAA;AAE3E,IAAMM,OAAOC,2BAAwC,CAACC,OAAmCC,iBAAAA;AACvF,QAAM,EAAEC,aAAaC,UAAU,WAAWC,aAAa,OAAOC,WAAWC,UAAU,GAAGC,UAAAA,IAAcP;AACpG,QAAMQ,WAAWL,YAAY,YAAYM,UAAUC,KAAKD,UAAUE;AAClE,SACE,sBAAA,cAACH,UAAAA;IAAU,GAAIJ,cAAc;MAAEQ,MAAM;MAAW,wBAAwB;IAAK;IAAK,GAAGL;IAAWM,KAAKZ;KACnG,sBAAA,cAACL,cACK;IACFkB,OAAOZ;IACPC;IACAC;IACAC;EACF,GAECC,QAAAA,CAAAA;AAIT,CAAA;AAEAR,KAAKiB,cAAcvB;;;AC/CnB,YAAYwB,iBAAiB;AAC7B,SAASC,sBAAAA,2BAAsC;AAC/C,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,4BAA4B;AACrC,OAAOC,UAILC,cAAAA,mBAGK;AAEP,SAASC,aAAa;AAItB,IAAMC,iBAAiB;AAuBvB,IAAM,CAACC,uBAAuBC,mBAAAA,IAAuBC,oBAAmBH,gBAAgB,CAAA,CAAE;AAS1F,IAAM,CAACI,kBAAkBC,kBAAAA,IAAsBJ,sBAA4CD,cAAAA;AAM3F,IAAMM,kBAAkBC,gBAAAA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kBAAI;IAACL,SAAAA;IAAQuB;IAAYG,cAAcY;KACjDC,QAAAA,IAGHA,QAAAA;AAIR,CAAA;AAGFvB,SAAS4B,cAAcrD;",
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\n// TODO(thure): A lot of the accessible affordances for this kind of thing need to be implemented per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\nconst LIST_NAME = 'List';\n\ntype ListScopedProps<P> = P & { __listScope?: Scope };\n\ntype ListVariant = 'ordered' | 'unordered';\n\ntype ListItemSizes = 'one' | 'many';\n\ntype ListProps = ComponentPropsWithRef<typeof Primitive.ol> & {\n selectable?: boolean;\n variant?: ListVariant;\n itemSizes?: ListItemSizes;\n};\n\nconst [createListContext, createListScope] = createContextScope(LIST_NAME, []);\n\ntype ListContextValue = {\n selectable: Exclude<ListProps['selectable'], undefined>;\n variant: Exclude<ListProps['variant'], undefined>;\n itemSizes?: ListItemSizes;\n};\n\nconst [ListProvider, useListContext] = createListContext<ListContextValue>(LIST_NAME);\n\nconst List = forwardRef<HTMLOListElement, ListProps>((props: ListScopedProps<ListProps>, forwardedRef) => {\n const { __listScope, variant = 'ordered', selectable = false, itemSizes, children, ...rootProps } = props;\n const ListRoot = variant === 'ordered' ? Primitive.ol : Primitive.ul;\n return (\n <ListRoot {...(selectable && { role: 'listbox', 'aria-multiselectable': true })} {...rootProps} ref={forwardedRef}>\n <ListProvider\n {...{\n scope: __listScope,\n variant,\n selectable,\n itemSizes,\n }}\n >\n {children}\n </ListProvider>\n </ListRoot>\n );\n});\n\nList.displayName = LIST_NAME;\n\nexport { List, createListScope, useListContext, LIST_NAME };\n\nexport type { ListProps, ListVariant, ListScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { CheckboxProps } from '@radix-ui/react-checkbox';\nimport { type CollapsibleContentProps, type CollapsibleTriggerProps } from '@radix-ui/react-collapsible';\nimport * as Collapsible from '@radix-ui/react-collapsible';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentProps,\n type ComponentPropsWithRef,\n type Dispatch,\n type ElementRef,\n forwardRef,\n type ForwardRefExoticComponent,\n type SetStateAction,\n} from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nimport { LIST_NAME, type ListScopedProps, useListContext } from './List';\n\nconst LIST_ITEM_NAME = 'ListItem';\n\ntype ListItemScopedProps<P> = P & { __listItemScope?: Scope };\n\ninterface ListItemData {\n id: string;\n labelId?: string;\n selected?: CheckboxProps['checked'];\n open?: boolean;\n}\n\ntype ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & ComponentPropsWithRef<\n typeof Primitive.li\n > & {\n defaultOpen?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n } & {\n onSelectedChange?: CheckboxProps['onCheckedChange'];\n defaultSelected?: CheckboxProps['defaultChecked'];\n };\n\ntype ListItemElement = ElementRef<typeof Primitive.li>;\n\nconst [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);\n\ntype ListItemContextValue = {\n headingId: string;\n open: boolean;\n selected: CheckboxProps['checked'];\n setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;\n};\n\nconst [ListItemProvider, useListItemContext] = createListItemContext<ListItemContextValue>(LIST_ITEM_NAME);\n\ntype ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {\n asChild?: boolean;\n};\n\nconst ListItemHeading = forwardRef<HTMLDivElement, ListItemHeadingProps>(\n ({ children, asChild, __listItemScope, ...props }, forwardedRef) => {\n const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);\n const Root = asChild ? Slot : Primitive.div;\n return (\n <Root {...props} id={headingId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;\n\nconst ListItemOpenTrigger = Collapsible.Trigger;\n\ntype ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;\n\nconst ListItemCollapsibleContent: ForwardRefExoticComponent<CollapsibleContentProps> = Collapsible.Content;\n\nconst ListItem = forwardRef<ListItemElement, ListItemProps>(\n (props: ListItemScopedProps<ListScopedProps<ListItemProps>>, forwardedRef) => {\n const id = useId('listItem', props.id);\n\n const {\n __listScope,\n __listItemScope,\n children,\n selected: propsSelected,\n defaultSelected,\n onSelectedChange,\n open: propsOpen,\n defaultOpen,\n onOpenChange,\n collapsible,\n labelId,\n ...listItemProps\n } = props;\n const { selectable } = useListContext(LIST_NAME, __listScope);\n\n const [selected = false, setSelected] = useControllableState({\n prop: propsSelected,\n defaultProp: defaultSelected,\n onChange: onSelectedChange,\n });\n\n const [open = false, setOpen] = useControllableState({\n prop: propsOpen,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const headingId = useId('listItem__heading', labelId);\n\n const listItem = (\n <Primitive.li\n {...listItemProps}\n id={id}\n ref={forwardedRef}\n aria-labelledby={headingId}\n {...(selectable && { role: 'option', 'aria-selected': !!selected })}\n {...(open && { 'aria-expanded': true })}\n >\n {children}\n </Primitive.li>\n );\n\n return (\n <ListItemProvider\n scope={__listItemScope}\n headingId={headingId}\n open={open}\n selected={selected}\n setSelected={setSelected}\n >\n {collapsible ? (\n <Collapsible.Root asChild open={open} onOpenChange={setOpen}>\n {listItem}\n </Collapsible.Root>\n ) : (\n listItem\n )}\n </ListItemProvider>\n );\n },\n);\n\nListItem.displayName = LIST_ITEM_NAME;\n\nexport {\n ListItem,\n ListItemHeading,\n ListItemCollapsibleContent,\n ListItemOpenTrigger,\n createListItemScope,\n useListItemContext,\n LIST_ITEM_NAME,\n};\n\nexport type {\n ListItemProps,\n ListItemHeadingProps,\n ListItemCollapsibleContentProps,\n ListItemOpenTriggerProps,\n ListItemScopedProps,\n};\n"],
5
+ "mappings": ";AAIA,SAASA,0BAAsC;AAC/C,SAASC,iBAAiB;AAC1B,OAAOC,SAAqCC,kBAAkB;AAI9D,IAAMC,YAAY;AAclB,IAAM,CAACC,mBAAmBC,eAAAA,IAAmBC,mBAAmBH,WAAW,CAAA,CAAE;AAQ7E,IAAM,CAACI,cAAcC,cAAAA,IAAkBJ,kBAAoCD,SAAAA;AAE3E,IAAMM,OAAOC,2BAAwC,CAACC,OAAmCC,iBAAAA;AACvF,QAAM,EAAEC,aAAaC,UAAU,WAAWC,aAAa,OAAOC,WAAWC,UAAU,GAAGC,UAAAA,IAAcP;AACpG,QAAMQ,WAAWL,YAAY,YAAYM,UAAUC,KAAKD,UAAUE;AAClE,SACE,sBAAA,cAACH,UAAAA;IAAU,GAAIJ,cAAc;MAAEQ,MAAM;MAAW,wBAAwB;IAAK;IAAK,GAAGL;IAAWM,KAAKZ;KACnG,sBAAA,cAACL,cACK;IACFkB,OAAOZ;IACPC;IACAC;IACAC;EACF,GAECC,QAAAA,CAAAA;AAIT,CAAA;AAEAR,KAAKiB,cAAcvB;;;AC/CnB,YAAYwB,iBAAiB;AAC7B,SAASC,sBAAAA,2BAAsC;AAC/C,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,4BAA4B;AACrC,OAAOC,UAKLC,cAAAA,mBAGK;AAEP,SAASC,aAAa;AAItB,IAAMC,iBAAiB;AAuBvB,IAAM,CAACC,uBAAuBC,mBAAAA,IAAuBC,oBAAmBH,gBAAgB,CAAA,CAAE;AAS1F,IAAM,CAACI,kBAAkBC,kBAAAA,IAAsBJ,sBAA4CD,cAAAA;AAM3F,IAAMM,kBAAkBC,gBAAAA,YACtB,CAAC,EAAEC,UAAUC,SAASC,iBAAiB,GAAGC,MAAAA,GAASC,iBAAAA;AACjD,QAAM,EAAEC,UAA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AAS4B,cAAcrD;",
6
6
  "names": ["createContextScope", "Primitive", "React", "forwardRef", "LIST_NAME", "createListContext", "createListScope", "createContextScope", "ListProvider", "useListContext", "List", "forwardRef", "props", "forwardedRef", "__listScope", "variant", "selectable", "itemSizes", "children", "rootProps", "ListRoot", "Primitive", "ol", "ul", "role", "ref", "scope", "displayName", "Collapsible", "createContextScope", "Primitive", "Slot", "useControllableState", "React", "forwardRef", "useId", "LIST_ITEM_NAME", "createListItemContext", "createListItemScope", "createContextScope", "ListItemProvider", "useListItemContext", "ListItemHeading", "forwardRef", "children", "asChild", "__listItemScope", "props", "forwardedRef", "headingId", "Root", "Slot", "Primitive", "div", "React", "id", "ref", "ListItemOpenTrigger", "Trigger", "ListItemCollapsibleContent", "Content", "ListItem", "useId", "__listScope", "selected", "propsSelected", "defaultSelected", "onSelectedChange", "open", "propsOpen", "defaultOpen", "onOpenChange", "collapsible", "labelId", "listItemProps", "selectable", "useListContext", "LIST_NAME", "setSelected", "useControllableState", "prop", "defaultProp", "onChange", "setOpen", "listItem", "li", "aria-labelledby", "role", "scope", "displayName"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytes":5456,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytes":13027,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"packages/ui/primitives/react-list/src/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"},{"path":"packages/ui/primitives/react-list/src/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"}},"outputs":{"packages/ui/primitives/react-list/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10200},"packages/ui/primitives/react-list/dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["LIST_ITEM_NAME","LIST_NAME","List","ListItem","ListItemCollapsibleContent","ListItemHeading","ListItemOpenTrigger","createListItemScope","createListScope","useListContext","useListItemContext"],"entryPoint":"packages/ui/primitives/react-list/src/index.ts","inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytesInOutput":935},"packages/ui/primitives/react-list/src/index.ts":{"bytesInOutput":0},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytesInOutput":2530}},"bytes":3821}}}
1
+ {"inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytes":5456,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytes":13047,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"packages/ui/primitives/react-list/src/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"},{"path":"packages/ui/primitives/react-list/src/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"}},"outputs":{"packages/ui/primitives/react-list/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10214},"packages/ui/primitives/react-list/dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["LIST_ITEM_NAME","LIST_NAME","List","ListItem","ListItemCollapsibleContent","ListItemHeading","ListItemOpenTrigger","createListItemScope","createListScope","useListContext","useListItemContext"],"entryPoint":"packages/ui/primitives/react-list/src/index.ts","inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytesInOutput":935},"packages/ui/primitives/react-list/src/index.ts":{"bytesInOutput":0},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytesInOutput":2530}},"bytes":3821}}}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/List.tsx", "../../../src/ListItem.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\n// TODO(thure): A lot of the accessible affordances for this kind of thing need to be implemented per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\nconst LIST_NAME = 'List';\n\ntype ListScopedProps<P> = P & { __listScope?: Scope };\n\ntype ListVariant = 'ordered' | 'unordered';\n\ntype ListItemSizes = 'one' | 'many';\n\ntype ListProps = ComponentPropsWithRef<typeof Primitive.ol> & {\n selectable?: boolean;\n variant?: ListVariant;\n itemSizes?: ListItemSizes;\n};\n\nconst [createListContext, createListScope] = createContextScope(LIST_NAME, []);\n\ntype ListContextValue = {\n selectable: Exclude<ListProps['selectable'], undefined>;\n variant: Exclude<ListProps['variant'], undefined>;\n itemSizes?: ListItemSizes;\n};\n\nconst [ListProvider, useListContext] = createListContext<ListContextValue>(LIST_NAME);\n\nconst List = forwardRef<HTMLOListElement, ListProps>((props: ListScopedProps<ListProps>, forwardedRef) => {\n const { __listScope, variant = 'ordered', selectable = false, itemSizes, children, ...rootProps } = props;\n const ListRoot = variant === 'ordered' ? Primitive.ol : Primitive.ul;\n return (\n <ListRoot {...(selectable && { role: 'listbox', 'aria-multiselectable': true })} {...rootProps} ref={forwardedRef}>\n <ListProvider\n {...{\n scope: __listScope,\n variant,\n selectable,\n itemSizes,\n }}\n >\n {children}\n </ListProvider>\n </ListRoot>\n );\n});\n\nList.displayName = LIST_NAME;\n\nexport { List, createListScope, useListContext, LIST_NAME };\n\nexport type { ListProps, ListVariant, ListScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { CheckboxProps } from '@radix-ui/react-checkbox';\nimport { type CollapsibleContentProps, type CollapsibleTriggerProps } from '@radix-ui/react-collapsible';\nimport * as Collapsible from '@radix-ui/react-collapsible';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentProps,\n type ComponentPropsWithRef,\n type Dispatch,\n forwardRef,\n type ForwardRefExoticComponent,\n type SetStateAction,\n} from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nimport { LIST_NAME, type ListScopedProps, useListContext } from './List';\n\nconst LIST_ITEM_NAME = 'ListItem';\n\ntype ListItemScopedProps<P> = P & { __listItemScope?: Scope };\n\ninterface ListItemData {\n id: string;\n labelId?: string;\n selected?: CheckboxProps['checked'];\n open?: boolean;\n}\n\ntype ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & ComponentPropsWithRef<\n typeof Primitive.li\n > & {\n defaultOpen?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n } & {\n onSelectedChange?: CheckboxProps['onCheckedChange'];\n defaultSelected?: CheckboxProps['defaultChecked'];\n };\n\ntype ListItemElement = React.ElementRef<typeof Primitive.li>;\n\nconst [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);\n\ntype ListItemContextValue = {\n headingId: string;\n open: boolean;\n selected: CheckboxProps['checked'];\n setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;\n};\n\nconst [ListItemProvider, useListItemContext] = createListItemContext<ListItemContextValue>(LIST_ITEM_NAME);\n\ntype ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {\n asChild?: boolean;\n};\n\nconst ListItemHeading = forwardRef<HTMLDivElement, ListItemHeadingProps>(\n ({ children, asChild, __listItemScope, ...props }, forwardedRef) => {\n const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);\n const Root = asChild ? Slot : Primitive.div;\n return (\n <Root {...props} id={headingId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;\n\nconst ListItemOpenTrigger = Collapsible.Trigger;\n\ntype ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;\n\nconst ListItemCollapsibleContent: ForwardRefExoticComponent<CollapsibleContentProps> = Collapsible.Content;\n\nconst ListItem = forwardRef<ListItemElement, ListItemProps>(\n (props: ListItemScopedProps<ListScopedProps<ListItemProps>>, forwardedRef) => {\n const id = useId('listItem', props.id);\n\n const {\n __listScope,\n __listItemScope,\n children,\n selected: propsSelected,\n defaultSelected,\n onSelectedChange,\n open: propsOpen,\n defaultOpen,\n onOpenChange,\n collapsible,\n labelId,\n ...listItemProps\n } = props;\n const { selectable } = useListContext(LIST_NAME, __listScope);\n\n const [selected = false, setSelected] = useControllableState({\n prop: propsSelected,\n defaultProp: defaultSelected,\n onChange: onSelectedChange,\n });\n\n const [open = false, setOpen] = useControllableState({\n prop: propsOpen,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const headingId = useId('listItem__heading', labelId);\n\n const listItem = (\n <Primitive.li\n {...listItemProps}\n id={id}\n ref={forwardedRef}\n aria-labelledby={headingId}\n {...(selectable && { role: 'option', 'aria-selected': !!selected })}\n {...(open && { 'aria-expanded': true })}\n >\n {children}\n </Primitive.li>\n );\n\n return (\n <ListItemProvider\n scope={__listItemScope}\n headingId={headingId}\n open={open}\n selected={selected}\n setSelected={setSelected}\n >\n {collapsible ? (\n <Collapsible.Root asChild open={open} onOpenChange={setOpen}>\n {listItem}\n </Collapsible.Root>\n ) : (\n listItem\n )}\n </ListItemProvider>\n );\n },\n);\n\nListItem.displayName = LIST_ITEM_NAME;\n\nexport {\n ListItem,\n ListItemHeading,\n ListItemCollapsibleContent,\n ListItemOpenTrigger,\n createListItemScope,\n useListItemContext,\n LIST_ITEM_NAME,\n};\n\nexport type {\n ListItemProps,\n ListItemHeadingProps,\n ListItemCollapsibleContentProps,\n ListItemOpenTriggerProps,\n ListItemScopedProps,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;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scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\n// TODO(thure): A lot of the accessible affordances for this kind of thing need to be implemented per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\nconst LIST_NAME = 'List';\n\ntype ListScopedProps<P> = P & { __listScope?: Scope };\n\ntype ListVariant = 'ordered' | 'unordered';\n\ntype ListItemSizes = 'one' | 'many';\n\ntype ListProps = ComponentPropsWithRef<typeof Primitive.ol> & {\n selectable?: boolean;\n variant?: ListVariant;\n itemSizes?: ListItemSizes;\n};\n\nconst [createListContext, createListScope] = createContextScope(LIST_NAME, []);\n\ntype ListContextValue = {\n selectable: Exclude<ListProps['selectable'], undefined>;\n variant: Exclude<ListProps['variant'], undefined>;\n itemSizes?: ListItemSizes;\n};\n\nconst [ListProvider, useListContext] = createListContext<ListContextValue>(LIST_NAME);\n\nconst List = forwardRef<HTMLOListElement, ListProps>((props: ListScopedProps<ListProps>, forwardedRef) => {\n const { __listScope, variant = 'ordered', selectable = false, itemSizes, children, ...rootProps } = props;\n const ListRoot = variant === 'ordered' ? Primitive.ol : Primitive.ul;\n return (\n <ListRoot {...(selectable && { role: 'listbox', 'aria-multiselectable': true })} {...rootProps} ref={forwardedRef}>\n <ListProvider\n {...{\n scope: __listScope,\n variant,\n selectable,\n itemSizes,\n }}\n >\n {children}\n </ListProvider>\n </ListRoot>\n );\n});\n\nList.displayName = LIST_NAME;\n\nexport { List, createListScope, useListContext, LIST_NAME };\n\nexport type { ListProps, ListVariant, ListScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { CheckboxProps } from '@radix-ui/react-checkbox';\nimport { type CollapsibleContentProps, type CollapsibleTriggerProps } from '@radix-ui/react-collapsible';\nimport * as Collapsible from '@radix-ui/react-collapsible';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentProps,\n type ComponentPropsWithRef,\n type Dispatch,\n type ElementRef,\n forwardRef,\n type ForwardRefExoticComponent,\n type SetStateAction,\n} from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nimport { LIST_NAME, type ListScopedProps, useListContext } from './List';\n\nconst LIST_ITEM_NAME = 'ListItem';\n\ntype ListItemScopedProps<P> = P & { __listItemScope?: Scope };\n\ninterface ListItemData {\n id: string;\n labelId?: string;\n selected?: CheckboxProps['checked'];\n open?: boolean;\n}\n\ntype ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & ComponentPropsWithRef<\n typeof Primitive.li\n > & {\n defaultOpen?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n } & {\n onSelectedChange?: CheckboxProps['onCheckedChange'];\n defaultSelected?: CheckboxProps['defaultChecked'];\n };\n\ntype ListItemElement = ElementRef<typeof Primitive.li>;\n\nconst [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);\n\ntype ListItemContextValue = {\n headingId: string;\n open: boolean;\n selected: CheckboxProps['checked'];\n setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;\n};\n\nconst [ListItemProvider, useListItemContext] = createListItemContext<ListItemContextValue>(LIST_ITEM_NAME);\n\ntype ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {\n asChild?: boolean;\n};\n\nconst ListItemHeading = forwardRef<HTMLDivElement, ListItemHeadingProps>(\n ({ children, asChild, __listItemScope, ...props }, forwardedRef) => {\n const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);\n const Root = asChild ? Slot : Primitive.div;\n return (\n <Root {...props} id={headingId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;\n\nconst ListItemOpenTrigger = Collapsible.Trigger;\n\ntype ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;\n\nconst ListItemCollapsibleContent: ForwardRefExoticComponent<CollapsibleContentProps> = Collapsible.Content;\n\nconst ListItem = forwardRef<ListItemElement, ListItemProps>(\n (props: ListItemScopedProps<ListScopedProps<ListItemProps>>, forwardedRef) => {\n const id = useId('listItem', props.id);\n\n const {\n __listScope,\n __listItemScope,\n children,\n selected: propsSelected,\n defaultSelected,\n onSelectedChange,\n open: propsOpen,\n defaultOpen,\n onOpenChange,\n collapsible,\n labelId,\n ...listItemProps\n } = props;\n const { selectable } = useListContext(LIST_NAME, __listScope);\n\n const [selected = false, setSelected] = useControllableState({\n prop: propsSelected,\n defaultProp: defaultSelected,\n onChange: onSelectedChange,\n });\n\n const [open = false, setOpen] = useControllableState({\n prop: propsOpen,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const headingId = useId('listItem__heading', labelId);\n\n const listItem = (\n <Primitive.li\n {...listItemProps}\n id={id}\n ref={forwardedRef}\n aria-labelledby={headingId}\n {...(selectable && { role: 'option', 'aria-selected': !!selected })}\n {...(open && { 'aria-expanded': true })}\n >\n {children}\n </Primitive.li>\n );\n\n return (\n <ListItemProvider\n scope={__listItemScope}\n headingId={headingId}\n open={open}\n selected={selected}\n setSelected={setSelected}\n >\n {collapsible ? (\n <Collapsible.Root asChild open={open} onOpenChange={setOpen}>\n {listItem}\n </Collapsible.Root>\n ) : (\n listItem\n )}\n </ListItemProvider>\n );\n },\n);\n\nListItem.displayName = LIST_ITEM_NAME;\n\nexport {\n ListItem,\n ListItemHeading,\n ListItemCollapsibleContent,\n ListItemOpenTrigger,\n createListItemScope,\n useListItemContext,\n LIST_ITEM_NAME,\n};\n\nexport type {\n ListItemProps,\n ListItemHeadingProps,\n ListItemCollapsibleContentProps,\n ListItemOpenTriggerProps,\n ListItemScopedProps,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA+C;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,KAAKb;KAClCK,QAAAA;AAGP,CAAA;AAKF,IAAMwB,sBAAkCC,YAAAA;AAIxC,IAAMC,6BAA6FC,YAAAA;AAEnG,IAAMC,WAAWnC,kCAAAA,YACf,CAACC,OAA4DC,iBAAAA;AAC3D,QAAM4B,SAAKM,0BAAM,YAAYnC,MAAM6B,EAAE;AAErC,QAAM,EACJ3B,aACAsB,iBACAlB,UACA8B,UAAUC,eACVC,iBACAC,kBACAC,MAAMC,WACNC,aACAC,cACAC,aACAC,SACA,GAAGC,cAAAA,IACD9C;AACJ,QAAM,EAAEI,WAAU,IAAKP,eAAeL,WAAWU,WAAAA;AAEjD,QAAM,CAACkC,WAAW,OAAOW,WAAAA,QAAeC,0DAAqB;IAC3DC,MAAMZ;IACNa,aAAaZ;IACba,UAAUZ;EACZ,CAAA;AAEA,QAAM,CAACC,OAAO,OAAOY,OAAAA,QAAWJ,0DAAqB;IACnDC,MAAMR;IACNS,aAAaR;IACbS,UAAUR;EACZ,CAAA;AAEA,QAAMlB,gBAAYU,0BAAM,qBAAqBU,OAAAA;AAE7C,QAAMQ,WACJzC,8BAAAA,QAAA,cAACH,wBAAAA,UAAU6C,IAAE;IACV,GAAGR;IACJjB;IACAf,KAAKb;IACLsD,mBAAiB9B;IAChB,GAAIrB,cAAc;MAAES,MAAM;MAAU,iBAAiB,CAAC,CAACuB;IAAS;IAChE,GAAII,QAAQ;MAAE,iBAAiB;IAAK;KAEpClC,QAAAA;AAIL,SACEM,8BAAAA,QAAA,cAACQ,kBAAAA;IACCL,OAAOS;IACPC;IACAe;IACAJ;IACAW;KAECH,cACChC,8BAAAA,QAAA,cAAac,YAAAA,MAAI;IAACH,SAAAA;IAAQiB;IAAYG,cAAcS;KACjDC,QAAAA,IAGHA,QAAAA;AAIR,CAAA;AAGFnB,SAASlB,cAAcC;",
6
6
  "names": ["import_react_context", "import_react_primitive", "import_react", "LIST_NAME", "createListContext", "createListScope", "createContextScope", "ListProvider", "useListContext", "List", "forwardRef", "props", "forwardedRef", "__listScope", "variant", "selectable", "itemSizes", "children", "rootProps", "ListRoot", "Primitive", "ol", "ul", "React", "role", "ref", "scope", "displayName", "LIST_ITEM_NAME", "createListItemContext", "createListItemScope", "ListItemProvider", "useListItemContext", "ListItemHeading", "asChild", "__listItemScope", "headingId", "Root", "Slot", "div", "id", "ListItemOpenTrigger", "Trigger", "ListItemCollapsibleContent", "Content", "ListItem", "useId", "selected", "propsSelected", "defaultSelected", "onSelectedChange", "open", "propsOpen", "defaultOpen", "onOpenChange", "collapsible", "labelId", "listItemProps", "setSelected", "useControllableState", "prop", "defaultProp", "onChange", "setOpen", "listItem", "li", "aria-labelledby"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytes":5456,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytes":13027,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"packages/ui/primitives/react-list/src/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"},{"path":"packages/ui/primitives/react-list/src/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"}},"outputs":{"packages/ui/primitives/react-list/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10200},"packages/ui/primitives/react-list/dist/lib/node/index.cjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["LIST_ITEM_NAME","LIST_NAME","List","ListItem","ListItemCollapsibleContent","ListItemHeading","ListItemOpenTrigger","createListItemScope","createListScope","useListContext","useListItemContext"],"entryPoint":"packages/ui/primitives/react-list/src/index.ts","inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytesInOutput":935},"packages/ui/primitives/react-list/src/index.ts":{"bytesInOutput":0},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytesInOutput":2530}},"bytes":3821}}}
1
+ {"inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytes":5456,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytes":13047,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"packages/ui/primitives/react-list/src/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/primitives/react-list/src/List.tsx","kind":"import-statement","original":"./List"},{"path":"packages/ui/primitives/react-list/src/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"}},"outputs":{"packages/ui/primitives/react-list/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10214},"packages/ui/primitives/react-list/dist/lib/node/index.cjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["LIST_ITEM_NAME","LIST_NAME","List","ListItem","ListItemCollapsibleContent","ListItemHeading","ListItemOpenTrigger","createListItemScope","createListScope","useListContext","useListItemContext"],"entryPoint":"packages/ui/primitives/react-list/src/index.ts","inputs":{"packages/ui/primitives/react-list/src/List.tsx":{"bytesInOutput":935},"packages/ui/primitives/react-list/src/index.ts":{"bytesInOutput":0},"packages/ui/primitives/react-list/src/ListItem.tsx":{"bytesInOutput":2530}},"bytes":3821}}}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA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AAK,wBAAwB,GAAG,mBAAmB,CAAC,uBAAuB,CAAC,CAAC;AAE7E,QAAA,MAAM,mBAAmB,mGAAsB,CAAC;AAEhD,KAAK,+BAA+B,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;AAElF,QAAA,MAAM,0BAA0B,EAAE,yBAAyB,CAAC,uBAAuB,CAAuB,CAAC;AAE3G,QAAA,MAAM,QAAQ,wRAiEb,CAAC;AAIF,OAAO,EACL,QAAQ,EACR,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,GACf,CAAC;AAEF,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,+BAA+B,EAC/B,wBAAwB,EACxB,mBAAmB,GACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-list",
3
- "version": "0.5.9-main.1c1903d",
3
+ "version": "0.5.9-main.1ea2105",
4
4
  "description": "List primitive components for React.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -22,7 +22,7 @@
22
22
  "@radix-ui/react-slot": "^1.0.1",
23
23
  "@radix-ui/react-use-controllable-state": "^1.0.0",
24
24
  "lodash.omit": "^4.5.0",
25
- "@dxos/react-hooks": "0.5.9-main.1c1903d"
25
+ "@dxos/react-hooks": "0.5.9-main.1ea2105"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@radix-ui/react-checkbox": "^1.0.3",
package/src/ListItem.tsx CHANGED
@@ -13,6 +13,7 @@ import React, {
13
13
  type ComponentProps,
14
14
  type ComponentPropsWithRef,
15
15
  type Dispatch,
16
+ type ElementRef,
16
17
  forwardRef,
17
18
  type ForwardRefExoticComponent,
18
19
  type SetStateAction,
@@ -43,7 +44,7 @@ type ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & Comp
43
44
  defaultSelected?: CheckboxProps['defaultChecked'];
44
45
  };
45
46
 
46
- type ListItemElement = React.ElementRef<typeof Primitive.li>;
47
+ type ListItemElement = ElementRef<typeof Primitive.li>;
47
48
 
48
49
  const [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);
49
50