@frontify/fondue-components 12.0.0 → 13.0.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/fondue-components.js +38 -32
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +2 -2
- package/dist/fondue-components11.js +3 -3
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +47 -24
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +24 -39
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +37 -64
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +16 -31
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +66 -47
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +36 -132
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +42 -50
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +132 -29
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +51 -143
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +28 -118
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +148 -60
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +112 -49
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +33 -7
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +66 -32
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +7 -5
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +55 -11
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +32 -155
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +2 -2
- package/dist/fondue-components30.js +5 -118
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +10 -116
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +147 -13
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +116 -30
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +118 -37
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +20 -129
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +32 -21
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +37 -45
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +130 -13
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +20 -14
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +4 -4
- package/dist/fondue-components40.js +45 -60
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +13 -18
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +12 -14
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +60 -5
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +18 -15
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +18 -4
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +5 -35
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +13 -11
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +1 -1
- package/dist/fondue-components49.js +18 -24
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +35 -17
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +6 -141
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +13 -16
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +4 -72
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +25 -8
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +16 -32
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +140 -47
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +16 -11
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +72 -12
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +8 -8
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +5 -5
- package/dist/fondue-components60.js +32 -12
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +48 -20
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +11 -15
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +12 -52
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +7 -14
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +12 -17
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +20 -6
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +15 -7
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +53 -2
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +14 -14
- package/dist/fondue-components7.js +3 -3
- package/dist/fondue-components70.js +25 -38
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +21 -0
- package/dist/fondue-components71.js.map +1 -0
- package/dist/fondue-components72.js +10 -0
- package/dist/fondue-components72.js.map +1 -0
- package/dist/fondue-components73.js +10 -0
- package/dist/fondue-components73.js.map +1 -0
- package/dist/fondue-components74.js +5 -0
- package/dist/fondue-components74.js.map +1 -0
- package/dist/fondue-components75.js +18 -0
- package/dist/fondue-components75.js.map +1 -0
- package/dist/fondue-components76.js +42 -0
- package/dist/fondue-components76.js.map +1 -0
- package/dist/fondue-components8.js +2 -2
- package/dist/fondue-components9.js +85 -77
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +159 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n modal = false,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} modal={modal} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n align = 'start',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","modal","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","side","align","preventTriggerFocusOnClose","theme","useFondueTheme","ThemeProvider","styles","event","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;;AA+BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAL,GAAY,OAAAC,GAAc,cAAAC,GAA4B,gBAAcC,GACnF,UAAAJ,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMQ,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAR;AAAA,EACA,gBAAgBI,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAT,EACL,CAAA;AAGRO,EAAgB,cAAc;AAqBvB,MAAMI,IAAkB,CAC3B;AAAA,EACI,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAb;AAAA,EACA,4BAAAc;AAAA,EACA,gBAAgBV,IAAa;AACjC,GACAM,MACC;AACD,QAAMK,IAAQC,EAAe;AAC7B,2BACKV,EAAc,QAAd,EACG,UAAA,gBAAAD,EAACY,KAAc,OAAAF,GACX,UAAA,gBAAAV;AAAA,IAACC,EAAc;AAAA,IAAd;AAAA,MACG,OAAAO;AAAA,MACA,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,MAAAD;AAAA,MACA,WAAWM,EAAO;AAAA,MAClB,gBAAcd;AAAA,MACd,KAAAM;AAAA,MACA,kBAAkB,CAACS,MAA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7B,GAAGK;AACP,GACAC,MACC;AACD,QAAM,EAAE,SAAAa,GAAS,QAAAU,MAAWT,EAAqBxB,CAAQ,GAEnDkC,IAAUD,IAASE,IAAO;AAG5B,SAAA,gBAAA9B;AAAA,IAACC,EAAc;AAAA,IAAd;AAAA,MACG,UAAAyB;AAAA,MACA,WAAWb,EAAO;AAAA,MAClB,WAAAY;AAAA,MACA,gBAAc1B;AAAA,MACd,iBAAe4B;AAAA,MACf,KAAAtB;AAAA,MACA,UAAAmB;AAAA,MACA,SAAO;AAAA,MACN,GAAGpB;AAAA,MAEJ,UAAA,gBAAAJ,EAAC6B,KAAS,UAAQX,EAAA,CAAA;AAAA,IAAA;AAAA,EACtB;AAER;AACAK,EAAa,cAAc;AAId,MAAAQ,IAAe,CACxB,EAAE,UAAApC,GAAU,MAAAqC,GAAM,gBAAgBjC,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAWgC,GAAM,WAAWnB,EAAO,MAAM,gBAAcd,GAAY,KAAAM,GACnE,UAAAV,EACL,CAAA;AAGRoC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoDhC,CAAe,GACjGiC,IAA8BD,EAAiD5B,CAAe,GAC9F8B,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM/C;AAAA,EACN,SAASuC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
1
|
+
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n modal = false,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} modal={modal} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\ntype DropdownSpacing = 'compact' | 'comfortable' | 'spacious';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: DropdownSpacing;\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nconst SPACING_MAP: Record<DropdownSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n align = 'start',\n triggerOffset = 'compact',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={side}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; heading?: string; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, heading, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span aria-label={heading}>{heading}</span>\n </div>\n ) : null}\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","modal","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","SPACING_MAP","DropdownContent","side","align","triggerOffset","preventTriggerFocusOnClose","theme","useFondueTheme","ThemeProvider","styles","event","DropdownGroup","heading","jsxs","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;;AA+BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAL,GAAY,OAAAC,GAAc,cAAAC,GAA4B,gBAAcC,GACnF,UAAAJ,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMQ,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAR;AAAA,EACA,gBAAgBI,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAT,EACL,CAAA;AAGRO,EAAgB,cAAc;AA4B9B,MAAMI,IAA+C;AAAA,EACjD,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACd,GAEaC,IAAkB,CAC3B;AAAA,EACI,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,eAAAC,IAAgB;AAAA,EAChB,UAAAf;AAAA,EACA,4BAAAgB;AAAA,EACA,gBAAgBZ,IAAa;AACjC,GACAM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,CAAe,GACjGoC,IAA8BD,EAAiD9B,CAAe,GAC9FgC,IAA4BF,EAA+CpB,CAAa,GACxFuB,IAAiCH,EAAoDhB,CAAkB,GACvGoB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAMlD;AAAA,EACN,SAAS0C;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASnB;AAAA,EACT,YAAYoB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { FocusEvent as FocusEvent_2 } from 'react';
|
|
|
8
8
|
import { FormEvent } from 'react';
|
|
9
9
|
import { ForwardedRef } from 'react';
|
|
10
10
|
import { ForwardRefExoticComponent } from 'react';
|
|
11
|
+
import { HTMLAttributeAnchorTarget } from 'react';
|
|
11
12
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
12
13
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
13
14
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
@@ -63,6 +64,8 @@ children?: ReactNode;
|
|
|
63
64
|
'data-test-id'?: string;
|
|
64
65
|
} & CommonAriaProps & RefAttributes<HTMLDivElement>>;
|
|
65
66
|
|
|
67
|
+
declare type BoxColor = 'neutral' | 'selected' | 'disabled' | 'positive' | 'negative' | 'warning';
|
|
68
|
+
|
|
66
69
|
declare type Breakpoint = keyof typeof screens;
|
|
67
70
|
|
|
68
71
|
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -542,6 +545,11 @@ declare type DropdownContentProps = {
|
|
|
542
545
|
* @default "bottom"
|
|
543
546
|
*/
|
|
544
547
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
548
|
+
/**
|
|
549
|
+
* Defines the spacing between the dropdown and its trigger.
|
|
550
|
+
* @default 'compact'
|
|
551
|
+
*/
|
|
552
|
+
triggerOffset?: DropdownSpacing;
|
|
545
553
|
/**
|
|
546
554
|
* Prevents the focus from being set on the trigger when the dropdown is closed.
|
|
547
555
|
*/
|
|
@@ -550,6 +558,7 @@ declare type DropdownContentProps = {
|
|
|
550
558
|
|
|
551
559
|
declare type DropdownGroupProps = {
|
|
552
560
|
children: ReactNode;
|
|
561
|
+
heading?: string;
|
|
553
562
|
'data-test-id'?: string;
|
|
554
563
|
};
|
|
555
564
|
|
|
@@ -599,6 +608,8 @@ declare type DropdownSlotProps = {
|
|
|
599
608
|
'data-test-id'?: string;
|
|
600
609
|
};
|
|
601
610
|
|
|
611
|
+
declare type DropdownSpacing = 'compact' | 'comfortable' | 'spacious';
|
|
612
|
+
|
|
602
613
|
declare type DropdownSubContentProps = {
|
|
603
614
|
children: ReactNode;
|
|
604
615
|
'data-test-id'?: string;
|
|
@@ -827,6 +838,30 @@ children?: ReactNode;
|
|
|
827
838
|
'data-test-id'?: string;
|
|
828
839
|
} & CommonAriaProps & RefAttributes<HTMLDivElement>>;
|
|
829
840
|
|
|
841
|
+
export declare const Heading: (<TTag extends TagType = "span">(props: HeadingProps<TTag> & {
|
|
842
|
+
ref?: ForwardedRef<HeadingElementType<TTag>>;
|
|
843
|
+
}) => JSX.Element) & {
|
|
844
|
+
displayName: string;
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
declare type HeadingColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';
|
|
848
|
+
|
|
849
|
+
declare type HeadingElementType<TTag extends TagType> = TTag extends 'span' ? HTMLSpanElement : TTag extends 'p' ? HTMLParagraphElement : HTMLHeadingElement;
|
|
850
|
+
|
|
851
|
+
declare type HeadingProps<TTag extends TagType = 'span'> = CommonAriaProps & {
|
|
852
|
+
'data-test-id'?: string;
|
|
853
|
+
as?: TTag;
|
|
854
|
+
children?: ReactNode;
|
|
855
|
+
color?: HeadingColor;
|
|
856
|
+
size?: HeadingSize;
|
|
857
|
+
weight?: HeadingWeight;
|
|
858
|
+
className?: string;
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
declare type HeadingSize = 'medium' | 'large' | 'x-large' | 'xx-large';
|
|
862
|
+
|
|
863
|
+
declare type HeadingWeight = 'default' | 'strong';
|
|
864
|
+
|
|
830
865
|
declare type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
831
866
|
|
|
832
867
|
export declare const Label: ForwardRefExoticComponent<LabelProps & RefAttributes<HTMLLabelElement>>;
|
|
@@ -1004,6 +1039,22 @@ declare type LoadingBarProps = {
|
|
|
1004
1039
|
'aria-labelledby': string;
|
|
1005
1040
|
});
|
|
1006
1041
|
|
|
1042
|
+
export declare const LoadingCircle: ForwardRefExoticComponent<LoadingCircleProps & RefAttributes<HTMLDivElement>>;
|
|
1043
|
+
|
|
1044
|
+
declare type LoadingCircleProps = {
|
|
1045
|
+
/**
|
|
1046
|
+
* The variant of the loading circle.
|
|
1047
|
+
* @default 'progress'
|
|
1048
|
+
*/
|
|
1049
|
+
variant?: 'progress' | 'success' | 'danger';
|
|
1050
|
+
/**
|
|
1051
|
+
* The size of the loading circle
|
|
1052
|
+
* @default "medium"
|
|
1053
|
+
*/
|
|
1054
|
+
size?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';
|
|
1055
|
+
'data-test-id'?: string;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1007
1058
|
declare type NavigableTableRowProps = BaseTableRowProps & {
|
|
1008
1059
|
onClick?: never;
|
|
1009
1060
|
/**
|
|
@@ -1396,6 +1447,15 @@ declare type TableHeaderCellProps = {
|
|
|
1396
1447
|
* @default false
|
|
1397
1448
|
*/
|
|
1398
1449
|
noShrink?: boolean;
|
|
1450
|
+
/**
|
|
1451
|
+
* State of the cell, used for displaying loading state
|
|
1452
|
+
* @default 'idle'
|
|
1453
|
+
*/
|
|
1454
|
+
state?: 'idle' | 'loading';
|
|
1455
|
+
/**
|
|
1456
|
+
* The aria-label to be applied when state='loading'
|
|
1457
|
+
*/
|
|
1458
|
+
loadingStateAriaLabel?: string;
|
|
1399
1459
|
/**
|
|
1400
1460
|
* Handler called when the sort direction changes
|
|
1401
1461
|
* @param direction - The new sort direction
|
|
@@ -1498,6 +1558,62 @@ declare type TabsTriggerProps = {
|
|
|
1498
1558
|
children: ReactNode;
|
|
1499
1559
|
};
|
|
1500
1560
|
|
|
1561
|
+
declare type TagPropMap = {
|
|
1562
|
+
a: {
|
|
1563
|
+
href?: string;
|
|
1564
|
+
target: HTMLAttributeAnchorTarget;
|
|
1565
|
+
rel?: string;
|
|
1566
|
+
title?: string;
|
|
1567
|
+
};
|
|
1568
|
+
abbr: {
|
|
1569
|
+
title?: string;
|
|
1570
|
+
};
|
|
1571
|
+
address: object;
|
|
1572
|
+
em: object;
|
|
1573
|
+
label: {
|
|
1574
|
+
for?: string;
|
|
1575
|
+
};
|
|
1576
|
+
li: {
|
|
1577
|
+
value?: string;
|
|
1578
|
+
};
|
|
1579
|
+
p: object;
|
|
1580
|
+
span: object;
|
|
1581
|
+
strong: object;
|
|
1582
|
+
time: {
|
|
1583
|
+
dateTime?: string;
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
declare type TagProps<TTag extends TagType_2> = TagPropMap[TTag];
|
|
1588
|
+
|
|
1589
|
+
declare type TagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';
|
|
1590
|
+
|
|
1591
|
+
declare type TagType_2 = 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';
|
|
1592
|
+
|
|
1593
|
+
declare const Text_2: (<TTag extends TagType_2 = "span">(props: TextProps<TTag> & {
|
|
1594
|
+
ref?: ForwardedRef<TextElementType<TTag>>;
|
|
1595
|
+
}) => JSX.Element) & {
|
|
1596
|
+
displayName: string;
|
|
1597
|
+
};
|
|
1598
|
+
export { Text_2 as Text }
|
|
1599
|
+
|
|
1600
|
+
declare type TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';
|
|
1601
|
+
|
|
1602
|
+
declare type TextElementMap = {
|
|
1603
|
+
a: HTMLAnchorElement;
|
|
1604
|
+
abbr: HTMLElement;
|
|
1605
|
+
address: HTMLElement;
|
|
1606
|
+
em: HTMLElement;
|
|
1607
|
+
label: HTMLLabelElement;
|
|
1608
|
+
li: HTMLLIElement;
|
|
1609
|
+
p: HTMLParagraphElement;
|
|
1610
|
+
span: HTMLSpanElement;
|
|
1611
|
+
strong: HTMLElement;
|
|
1612
|
+
time: HTMLTimeElement;
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
declare type TextElementType<TTag extends TagType_2> = TextElementMap[TTag];
|
|
1616
|
+
|
|
1501
1617
|
declare const TextFieldRoot: {
|
|
1502
1618
|
({ children, className, status, "data-test-id": dataTestId, ...inputProps }: TextInputProps, ref: ForwardedRef<HTMLInputElement>): JSX_2.Element;
|
|
1503
1619
|
displayName: string;
|
|
@@ -1604,6 +1720,49 @@ declare type TextInputProps = {
|
|
|
1604
1720
|
'aria-describedby'?: string;
|
|
1605
1721
|
};
|
|
1606
1722
|
|
|
1723
|
+
declare type TextProps<TTag extends TagType_2 = 'span'> = CommonAriaProps & TagProps<TTag> & {
|
|
1724
|
+
/**
|
|
1725
|
+
* Id of the element
|
|
1726
|
+
*/
|
|
1727
|
+
id?: string;
|
|
1728
|
+
/**
|
|
1729
|
+
* Size of the text
|
|
1730
|
+
*
|
|
1731
|
+
* @default 'medium'
|
|
1732
|
+
*/
|
|
1733
|
+
size?: TextSize;
|
|
1734
|
+
/**
|
|
1735
|
+
* Weight of the font
|
|
1736
|
+
*
|
|
1737
|
+
* @default 'default'
|
|
1738
|
+
*/
|
|
1739
|
+
weight?: TextWeight;
|
|
1740
|
+
/**
|
|
1741
|
+
* The html element used to render
|
|
1742
|
+
*
|
|
1743
|
+
* @default 'span'
|
|
1744
|
+
*/
|
|
1745
|
+
as?: TTag;
|
|
1746
|
+
/**
|
|
1747
|
+
* Color of the text
|
|
1748
|
+
*
|
|
1749
|
+
* @default 'default'
|
|
1750
|
+
*/
|
|
1751
|
+
color?: TextColor;
|
|
1752
|
+
/**
|
|
1753
|
+
* The texts color when used within a box
|
|
1754
|
+
*
|
|
1755
|
+
* @description optional color prop that uses the inverse box color when accessibility contrast is needed
|
|
1756
|
+
**/
|
|
1757
|
+
boxColor?: BoxColor;
|
|
1758
|
+
className?: string;
|
|
1759
|
+
children?: ReactNode;
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
declare type TextSize = 'x-small' | 'small' | 'medium' | 'large';
|
|
1763
|
+
|
|
1764
|
+
declare type TextWeight = 'default' | 'strong' | 'x-strong';
|
|
1765
|
+
|
|
1607
1766
|
export declare const ThemeContext: Context<"dark" | "light">;
|
|
1608
1767
|
|
|
1609
1768
|
export declare const ThemeProvider: ({ children, theme }: ThemeProviderProps) => JSX_2.Element;
|