@frontify/fondue-components 10.0.1 → 12.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.
Files changed (129) hide show
  1. package/dist/fondue-components.js +31 -27
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +2 -2
  4. package/dist/fondue-components10.js.map +1 -1
  5. package/dist/fondue-components11.js +52 -48
  6. package/dist/fondue-components11.js.map +1 -1
  7. package/dist/fondue-components12.js +11 -10
  8. package/dist/fondue-components12.js.map +1 -1
  9. package/dist/fondue-components13.js +1 -1
  10. package/dist/fondue-components14.js +1 -1
  11. package/dist/fondue-components15.js +1 -1
  12. package/dist/fondue-components16.js +11 -10
  13. package/dist/fondue-components16.js.map +1 -1
  14. package/dist/fondue-components17.js +2 -2
  15. package/dist/fondue-components18.js +62 -60
  16. package/dist/fondue-components18.js.map +1 -1
  17. package/dist/fondue-components19.js +1 -1
  18. package/dist/fondue-components20.js +2 -2
  19. package/dist/fondue-components21.js +60 -60
  20. package/dist/fondue-components22.js +3 -3
  21. package/dist/fondue-components23.js +2 -2
  22. package/dist/fondue-components24.js +36 -32
  23. package/dist/fondue-components24.js.map +1 -1
  24. package/dist/fondue-components25.js +7 -32
  25. package/dist/fondue-components25.js.map +1 -1
  26. package/dist/fondue-components26.js +32 -5
  27. package/dist/fondue-components26.js.map +1 -1
  28. package/dist/fondue-components27.js +5 -12
  29. package/dist/fondue-components27.js.map +1 -1
  30. package/dist/fondue-components28.js +10 -153
  31. package/dist/fondue-components28.js.map +1 -1
  32. package/dist/fondue-components29.js +59 -22
  33. package/dist/fondue-components29.js.map +1 -1
  34. package/dist/fondue-components3.js +11 -10
  35. package/dist/fondue-components3.js.map +1 -1
  36. package/dist/fondue-components30.js +17 -17
  37. package/dist/fondue-components30.js.map +1 -1
  38. package/dist/fondue-components31.js +112 -15
  39. package/dist/fondue-components31.js.map +1 -1
  40. package/dist/fondue-components32.js +19 -30
  41. package/dist/fondue-components32.js.map +1 -1
  42. package/dist/fondue-components33.js +32 -37
  43. package/dist/fondue-components33.js.map +1 -1
  44. package/dist/fondue-components34.js +34 -127
  45. package/dist/fondue-components34.js.map +1 -1
  46. package/dist/fondue-components35.js +129 -20
  47. package/dist/fondue-components35.js.map +1 -1
  48. package/dist/fondue-components36.js +21 -45
  49. package/dist/fondue-components36.js.map +1 -1
  50. package/dist/fondue-components37.js +45 -13
  51. package/dist/fondue-components37.js.map +1 -1
  52. package/dist/fondue-components38.js +13 -15
  53. package/dist/fondue-components38.js.map +1 -1
  54. package/dist/fondue-components39.js +15 -60
  55. package/dist/fondue-components39.js.map +1 -1
  56. package/dist/fondue-components4.js +18 -17
  57. package/dist/fondue-components4.js.map +1 -1
  58. package/dist/fondue-components40.js +59 -17
  59. package/dist/fondue-components40.js.map +1 -1
  60. package/dist/fondue-components41.js +18 -17
  61. package/dist/fondue-components41.js.map +1 -1
  62. package/dist/fondue-components42.js +16 -4
  63. package/dist/fondue-components42.js.map +1 -1
  64. package/dist/fondue-components43.js +3 -13
  65. package/dist/fondue-components43.js.map +1 -1
  66. package/dist/fondue-components44.js +13 -3
  67. package/dist/fondue-components44.js.map +1 -1
  68. package/dist/fondue-components45.js +5 -35
  69. package/dist/fondue-components45.js.map +1 -1
  70. package/dist/fondue-components46.js +35 -13
  71. package/dist/fondue-components46.js.map +1 -1
  72. package/dist/fondue-components47.js +12 -4
  73. package/dist/fondue-components47.js.map +1 -1
  74. package/dist/fondue-components48.js +4 -24
  75. package/dist/fondue-components48.js.map +1 -1
  76. package/dist/fondue-components49.js +24 -16
  77. package/dist/fondue-components49.js.map +1 -1
  78. package/dist/fondue-components5.js +2 -2
  79. package/dist/fondue-components50.js +16 -139
  80. package/dist/fondue-components50.js.map +1 -1
  81. package/dist/fondue-components51.js +142 -16
  82. package/dist/fondue-components51.js.map +1 -1
  83. package/dist/fondue-components52.js +16 -70
  84. package/dist/fondue-components52.js.map +1 -1
  85. package/dist/fondue-components53.js +73 -8
  86. package/dist/fondue-components53.js.map +1 -1
  87. package/dist/fondue-components54.js +8 -33
  88. package/dist/fondue-components54.js.map +1 -1
  89. package/dist/fondue-components55.js +32 -48
  90. package/dist/fondue-components55.js.map +1 -1
  91. package/dist/fondue-components56.js +48 -10
  92. package/dist/fondue-components56.js.map +1 -1
  93. package/dist/fondue-components57.js +10 -12
  94. package/dist/fondue-components57.js.map +1 -1
  95. package/dist/fondue-components58.js +12 -7
  96. package/dist/fondue-components58.js.map +1 -1
  97. package/dist/fondue-components59.js +7 -12
  98. package/dist/fondue-components59.js.map +1 -1
  99. package/dist/fondue-components6.js +5 -5
  100. package/dist/fondue-components60.js +12 -20
  101. package/dist/fondue-components60.js.map +1 -1
  102. package/dist/fondue-components61.js +21 -15
  103. package/dist/fondue-components61.js.map +1 -1
  104. package/dist/fondue-components62.js +14 -52
  105. package/dist/fondue-components62.js.map +1 -1
  106. package/dist/fondue-components63.js +52 -14
  107. package/dist/fondue-components63.js.map +1 -1
  108. package/dist/fondue-components64.js +14 -17
  109. package/dist/fondue-components64.js.map +1 -1
  110. package/dist/fondue-components65.js +16 -5
  111. package/dist/fondue-components65.js.map +1 -1
  112. package/dist/fondue-components66.js +7 -2
  113. package/dist/fondue-components66.js.map +1 -1
  114. package/dist/fondue-components67.js +6 -14
  115. package/dist/fondue-components67.js.map +1 -1
  116. package/dist/fondue-components68.js +2 -39
  117. package/dist/fondue-components68.js.map +1 -1
  118. package/dist/fondue-components69.js +18 -0
  119. package/dist/fondue-components69.js.map +1 -0
  120. package/dist/fondue-components7.js +74 -70
  121. package/dist/fondue-components7.js.map +1 -1
  122. package/dist/fondue-components70.js +42 -0
  123. package/dist/fondue-components70.js.map +1 -0
  124. package/dist/fondue-components8.js +2 -2
  125. package/dist/fondue-components9.js +80 -75
  126. package/dist/fondue-components9.js.map +1 -1
  127. package/dist/index.d.ts +45 -11
  128. package/dist/style.css +1 -1
  129. package/package.json +55 -56
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components7.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { createContext, forwardRef, useContext, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport styles from './styles/dialog.module.scss';\n\nexport type DialogRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a minimum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = {\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 type DialogHeaderProps = {\n /**\n * Define the padding for the dialog header\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the bottom of the header\n * @default true\n */\n showBorder?: boolean;\n /**\n * Show a close button in the header\n * @default true\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = {\n /**\n * Define the padding for the dialog footer\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the top of the footer\n * @default true\n */\n showBorder?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogBodyProps = {\n /**\n * Define the padding for the dialog body\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\ntype DialogContextType = {\n isModal: boolean;\n};\n\nconst DialogContext = createContext<DialogContextType>({ isModal: false });\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return (\n <DialogContext.Provider value={{ isModal: props.modal ?? false }}>\n <RadixDialog.Root {...props}>{children}</RadixDialog.Root>\n </DialogContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dialog-trigger', ...props }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogUnderlay = ({ children, showUnderlay }: { children: ReactNode; showUnderlay: boolean }) => {\n const { isModal } = useContext(DialogContext);\n if (isModal) {\n return (\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay}>\n {children}\n </RadixDialog.Overlay>\n );\n }\n return (\n <div className={styles.underlay} data-visible={showUnderlay}>\n {children}\n </div>\n );\n};\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n rounded = true,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDialog.Portal>\n <DialogUnderlay showUnderlay={showUnderlay}>\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={ref}\n className={styles.content}\n onFocus={addShowFocusRing}\n data-dialog-padding={padding}\n data-dialog-rounded={rounded}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </DialogUnderlay>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n {\n padding,\n showBorder = true,\n showCloseButton = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dialog-header',\n }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.header}\n data-dialog-header-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component\n >\n <div>{children}</div>\n {showCloseButton && (\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n )}\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { padding, showBorder = true, children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.footer}\n data-dialog-footer-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component\n >\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { padding, children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.body}\n data-dialog-body-padding={padding}\n data-dialog-layout-component\n >\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.sideContent} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogContext","createContext","DialogRoot","children","props","RadixDialog","DialogTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","DialogUnderlay","showUnderlay","isModal","useContext","styles","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","rounded","addShowFocusRing","DialogHeader","showBorder","showCloseButton","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;AAmIA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO,GAE5DC,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAEjCJ,EAAc,UAAd,EAAuB,OAAO,EAAE,SAASI,EAAM,SAAS,GAAM,GAC3D,4BAACC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA,GAC3C;AAGRD,EAAW,cAAc;AAElB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AAE5B,MAAMM,IAAiB,CAAC,EAAE,UAAAT,GAAU,cAAAU,QAAmE;AACnG,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAWf,CAAa;AAC5C,SAAIc,IAEI,gBAAAJ,EAACL,EAAY,SAAZ,EAAoB,gBAAcQ,GAAc,WAAWG,EAAO,UAC9D,UAAAb,GACL,sBAIH,OAAI,EAAA,WAAWa,EAAO,UAAU,gBAAcH,GAC1C,UAAAV,GACL;AAER,GAEac,IAAgB,CACzB;AAAA,EACI,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,eAAAC,IA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;AAAA,EACN,OAAOgC;AAAA,EACP,aAAaC;AAAA,EACb,OAAOF;AAAA,EACP,SAASI,EAAkD/B,CAAa;AAAA,EACxE,SAAS+B,EAA+CpB,CAAa;AAAA,EACrE,QAAQoB,EAA8CZ,CAAY;AAAA,EAClE,QAAQY,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
1
+ {"version":3,"file":"fondue-components7.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { createContext, forwardRef, useContext, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/dialog.module.scss';\n\nexport type DialogRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a minimum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = {\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 type DialogHeaderProps = {\n /**\n * Define the padding for the dialog header\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the bottom of the header\n * @default true\n */\n showBorder?: boolean;\n /**\n * Show a close button in the header\n * @default true\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = {\n /**\n * Define the padding for the dialog footer\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the top of the footer\n * @default true\n */\n showBorder?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogBodyProps = {\n /**\n * Define the padding for the dialog body\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\ntype DialogContextType = {\n isModal: boolean;\n};\n\nconst DialogContext = createContext<DialogContextType>({ isModal: false });\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return (\n <DialogContext.Provider value={{ isModal: props.modal ?? false }}>\n <RadixDialog.Root {...props}>{children}</RadixDialog.Root>\n </DialogContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dialog-trigger', ...props }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogUnderlay = ({ children, showUnderlay }: { children: ReactNode; showUnderlay: boolean }) => {\n const { isModal } = useContext(DialogContext);\n if (isModal) {\n return (\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay}>\n {children}\n </RadixDialog.Overlay>\n );\n }\n return (\n <div className={styles.underlay} data-visible={showUnderlay}>\n {children}\n </div>\n );\n};\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n rounded = true,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixDialog.Portal>\n <ThemeProvider theme={theme}>\n <DialogUnderlay showUnderlay={showUnderlay}>\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={ref}\n className={styles.content}\n onFocus={addShowFocusRing}\n data-dialog-padding={padding}\n data-dialog-rounded={rounded}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </DialogUnderlay>\n </ThemeProvider>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n {\n padding,\n showBorder = true,\n showCloseButton = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dialog-header',\n }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.header}\n data-dialog-header-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component\n >\n <div>{children}</div>\n {showCloseButton && (\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n )}\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { padding, showBorder = true, children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.footer}\n data-dialog-footer-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component\n >\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { padding, children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.body}\n data-dialog-body-padding={padding}\n data-dialog-layout-component\n >\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.sideContent} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogContext","createContext","DialogRoot","children","props","RadixDialog","DialogTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","DialogUnderlay","showUnderlay","isModal","useContext","styles","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","rounded","theme","useFondueTheme","ThemeProvider","addShowFocusRing","DialogHeader","showBorder","showCloseButton","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;;AAqIA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO,GAE5DC,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAEjCJ,EAAc,UAAd,EAAuB,OAAO,EAAE,SAASI,EAAM,SAAS,GAAM,GAC3D,4BAACC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA,GAC3C;AAGRD,EAAW,cAAc;AAElB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;A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,WAAWO,EAAO,aAAa,gCAA4B,IAC/F,UAAAb,EACL,CAAA;AAGRgC,EAAkB,cAAc;AAEzB,MAAMC,IAAc,CAAC,EAAE,UAAAjC,0BAClBE,EAAY,OAAZ,EAAkB,SAAO,IAAE,UAAAF,GAAS;AAEhDiC,EAAY,cAAc;AAEnB,MAAMC,IAAc,CAAC,EAAE,UAAAlC,GAAU,SAAAI,QAC5B,gBAAAG,EAAAL,EAAY,OAAZ,EAAkB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAE1DkC,EAAY,cAAc;AAEnB,MAAMC,IAAoB,CAAC,EAAE,UAAAnC,GAAU,SAAAI,QAClC,gBAAAG,EAAAL,EAAY,aAAZ,EAAwB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAEhEmC,EAAkB,cAAc;AAEzB,MAAMC,IAAS;AAAA,EAClB,MAAMrC;AAAA,EACN,OAAOmC;AAAA,EACP,aAAaC;AAAA,EACb,OAAOF;AAAA,EACP,SAASI,EAAkDlC,CAAa;AAAA,EACxE,SAASkC,EAA+CvB,CAAa;AAAA,EACrE,QAAQuB,EAA8CZ,CAAY;AAAA,EAClE,QAAQY,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
@@ -0,0 +1,42 @@
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components52.js";
3
+ const g = ({
4
+ children: r,
5
+ value: o,
6
+ label: s
7
+ }) => r && typeof r == "string" ? {
8
+ value: o || r,
9
+ label: s || r
10
+ } : {
11
+ value: o || "",
12
+ label: s || o || ""
13
+ }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
+ const n = [];
15
+ let t = 0;
16
+ return a.forEach(r, (e) => {
17
+ if (w(e, E) && u(e))
18
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
+ else if (u(e) && (e != null && e.props.children)) {
20
+ const { parsedChildren: m, subElementCount: C } = y(
21
+ e.props.children,
22
+ o,
23
+ "",
24
+ p + t
25
+ );
26
+ e = f(e, {
27
+ children: m,
28
+ key: `group-${p + t}`
29
+ }), n.push(e), t += C;
30
+ } else
31
+ n.push(e);
32
+ }), {
33
+ parsedChildren: n,
34
+ subElementCount: t
35
+ };
36
+ };
37
+ export {
38
+ g as getSelectOptionValue,
39
+ w as isReactLeaf,
40
+ y as recursiveMap
41
+ };
42
+ //# sourceMappingURL=fondue-components70.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fondue-components70.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAC3B,IAGG;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AACpC,GAkBSE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAC;AACxC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAChB;AACA,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EACrB;AACJ;"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import * as m from "@radix-ui/react-separator";
3
3
  import { forwardRef as s } from "react";
4
- import { cn as f } from "./fondue-components27.js";
5
- import { dividerStyles as p } from "./fondue-components39.js";
4
+ import { cn as f } from "./fondue-components28.js";
5
+ import { dividerStyles as p } from "./fondue-components40.js";
6
6
  const n = s(
7
7
  ({
8
8
  "data-test-id": r = "fondue-divider",
@@ -1,114 +1,119 @@
1
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as y } from "react/jsx-runtime";
2
2
  import { IconCaretRight as F } from "@frontify/fondue-icons";
3
3
  import * as n from "@radix-ui/react-dropdown-menu";
4
4
  import { Slot as I } from "@radix-ui/react-slot";
5
- import { forwardRef as s } from "react";
6
- import { useProcessedChildren as w } from "./fondue-components40.js";
7
- import a from "./fondue-components41.js";
8
- const c = ({
5
+ import { forwardRef as i } from "react";
6
+ import { useFondueTheme as G, ThemeProvider as P } from "./fondue-components25.js";
7
+ import { useProcessedChildren as c } from "./fondue-components41.js";
8
+ import s from "./fondue-components42.js";
9
+ const w = ({
9
10
  children: o,
10
11
  open: t,
11
- onOpenChange: r,
12
- "data-test-id": d = "fondue-dropdown"
13
- }) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: r, "data-test-id": d, children: o });
14
- c.displayName = "Dropdown.Root";
15
- const m = ({
12
+ modal: e = !1,
13
+ onOpenChange: d,
14
+ "data-test-id": a = "fondue-dropdown"
15
+ }) => /* @__PURE__ */ r(n.Root, { open: t, modal: e, onOpenChange: d, "data-test-id": a, children: o });
16
+ w.displayName = "Dropdown.Root";
17
+ const l = ({
16
18
  asChild: o = !0,
17
19
  children: t,
18
- "data-test-id": r = "fondue-dropdown-trigger",
20
+ "data-test-id": e = "fondue-dropdown-trigger",
19
21
  ...d
20
- }, i) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": r, ref: i, ...d, children: t });
21
- m.displayName = "Dropdown.Trigger";
22
- const l = ({
22
+ }, a) => /* @__PURE__ */ r(n.Trigger, { asChild: o, "data-test-id": e, ref: a, ...d, children: t });
23
+ l.displayName = "Dropdown.Trigger";
24
+ const f = ({
23
25
  side: o = "bottom",
24
26
  align: t = "start",
25
- children: r,
27
+ children: e,
26
28
  preventTriggerFocusOnClose: d,
27
- "data-test-id": i = "fondue-dropdown-content"
28
- }, p) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
29
- n.Content,
30
- {
31
- align: t,
32
- collisionPadding: 8,
33
- sideOffset: 8,
34
- side: o,
35
- className: a.content,
36
- "data-test-id": i,
37
- ref: p,
38
- onCloseAutoFocus: (u) => {
39
- d && u.preventDefault();
40
- },
41
- children: r
42
- }
43
- ) });
44
- l.displayName = "Dropdown.Content";
45
- const g = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ e(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
29
+ "data-test-id": a = "fondue-dropdown-content"
30
+ }, p) => {
31
+ const u = G();
32
+ return /* @__PURE__ */ r(n.Portal, { children: /* @__PURE__ */ r(P, { theme: u, children: /* @__PURE__ */ r(
33
+ n.Content,
34
+ {
35
+ align: t,
36
+ collisionPadding: 8,
37
+ sideOffset: 8,
38
+ side: o,
39
+ className: s.content,
40
+ "data-test-id": a,
41
+ ref: p,
42
+ onCloseAutoFocus: (m) => {
43
+ d && m.preventDefault();
44
+ },
45
+ children: e
46
+ }
47
+ ) }) });
48
+ };
49
+ f.displayName = "Dropdown.Content";
50
+ const g = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, e) => /* @__PURE__ */ r(n.Group, { className: s.group, "data-test-id": t, ref: e, children: o });
46
51
  g.displayName = "Dropdown.Group";
47
- const f = ({
52
+ const D = ({
48
53
  children: o,
49
54
  "data-test-id": t = "fondue-dropdown-submenu"
50
- }) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
51
- f.displayName = "Dropdown.SubMenu";
52
- const D = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
53
- const { content: d } = w(o);
54
- return /* @__PURE__ */ h(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
55
+ }) => /* @__PURE__ */ r(n.Sub, { "data-test-id": t, children: o });
56
+ D.displayName = "Dropdown.SubMenu";
57
+ const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, e) => {
58
+ const { content: d } = c(o);
59
+ return /* @__PURE__ */ y(n.SubTrigger, { className: s.subTrigger, "data-test-id": t, ref: e, children: [
55
60
  d,
56
- /* @__PURE__ */ e(F, { className: a.subMenuIndicator, size: 16 })
61
+ /* @__PURE__ */ r(F, { className: s.subMenuIndicator, size: 16 })
57
62
  ] });
58
63
  };
59
- D.displayName = "Dropdown.SubTrigger";
60
- const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subcontent" }, r) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(n.SubContent, { className: a.subContent, "data-test-id": t, ref: r, children: o }) });
61
- b.displayName = "Dropdown.SubContent";
62
- const S = ({
64
+ b.displayName = "Dropdown.SubTrigger";
65
+ const S = ({ children: o, "data-test-id": t = "fondue-dropdown-subcontent" }, e) => /* @__PURE__ */ r(n.Portal, { children: /* @__PURE__ */ r(n.SubContent, { className: s.subContent, "data-test-id": t, ref: e, children: o }) });
66
+ S.displayName = "Dropdown.SubContent";
67
+ const N = ({
63
68
  children: o,
64
69
  disabled: t,
65
- textValue: r,
70
+ textValue: e,
66
71
  onSelect: d,
67
- emphasis: i = "default",
72
+ emphasis: a = "default",
68
73
  "data-test-id": p = "fondue-dropdown-subtrigger",
69
74
  ...u
70
- }, C) => {
71
- const { content: R, isLink: T } = w(o), y = T ? I : "div";
72
- return /* @__PURE__ */ e(
75
+ }, m) => {
76
+ const { content: R, isLink: h } = c(o), T = h ? I : "div";
77
+ return /* @__PURE__ */ r(
73
78
  n.Item,
74
79
  {
75
80
  onSelect: d,
76
- className: a.item,
77
- textValue: r,
81
+ className: s.item,
82
+ textValue: e,
78
83
  "data-test-id": p,
79
- "data-emphasis": i,
80
- ref: C,
84
+ "data-emphasis": a,
85
+ ref: m,
81
86
  disabled: t,
82
87
  asChild: !0,
83
88
  ...u,
84
- children: /* @__PURE__ */ e(y, { children: R })
89
+ children: /* @__PURE__ */ r(T, { children: R })
85
90
  }
86
91
  );
87
92
  };
88
- S.displayName = "Dropdown.Item";
89
- const N = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ e("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: d, children: o });
90
- N.displayName = "Dropdown.Slot";
91
- const G = s(m), x = s(l), M = s(g), P = s(D), v = s(b), j = s(S), k = s(N), B = {
92
- Root: c,
93
- Trigger: G,
93
+ N.displayName = "Dropdown.Item";
94
+ const C = ({ children: o, name: t, "data-test-id": e = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ r("div", { "data-name": t, className: s.slot, "data-test-id": e, ref: d, children: o });
95
+ C.displayName = "Dropdown.Slot";
96
+ const v = i(l), x = i(f), M = i(g), j = i(b), k = i(S), z = i(N), A = i(C), J = {
97
+ Root: w,
98
+ Trigger: v,
94
99
  Content: x,
95
100
  Group: M,
96
- SubMenu: f,
97
- SubTrigger: P,
98
- SubContent: v,
99
- Item: j,
100
- Slot: k
101
+ SubMenu: D,
102
+ SubTrigger: j,
103
+ SubContent: k,
104
+ Item: z,
105
+ Slot: A
101
106
  };
102
107
  export {
103
- B as Dropdown,
104
- l as DropdownContent,
108
+ J as Dropdown,
109
+ f as DropdownContent,
105
110
  g as DropdownGroup,
106
- S as DropdownItem,
107
- c as DropdownRoot,
108
- N as DropdownSlot,
109
- b as DropdownSubContent,
110
- f as DropdownSubMenu,
111
- D as DropdownSubTrigger,
112
- m as DropdownTrigger
111
+ N as DropdownItem,
112
+ w as DropdownRoot,
113
+ C as DropdownSlot,
114
+ S as DropdownSubContent,
115
+ D as DropdownSubMenu,
116
+ b as DropdownSubTrigger,
117
+ l as DropdownTrigger
113
118
  };
114
119
  //# sourceMappingURL=fondue-components9.js.map
@@ -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 { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\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 onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} 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 return (\n <RadixDropdown.Portal>\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 </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","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","side","align","preventTriggerFocusOnClose","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":";;;;;;;AAwBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAR,EACL,CAAA;AAGRM,EAAgB,cAAc;AAqBvB,MAAMI,IAAkB,CAC3B;AAAA,EACI,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAZ;AAAA,EACA,4BAAAa;AAAA,EACA,gBAAgBV,IAAa;AACjC,GACAM,MAGI,gBAAAL,EAACC,EAAc,QAAd,EACG,UAAA,gBAAAD;AAAA,EAACC,EAAc;AAAA,EAAd;AAAA,IACG,OAAAO;AAAA,IACA,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,MA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own/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,MAAU;AACzB,QAAIL,KACAK,EAAM,eAAe;AAA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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;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { AriaAttributes } from 'react';
2
2
  import { ChangeEvent } from 'react';
3
+ import { CommonAriaAttrs } from '../../utilities/types';
4
+ import { Context } from 'react';
3
5
  import { CSSProperties } from 'react';
6
+ import { default as default_2 } from '@frontify/fondue-tokens/theme-tokens';
4
7
  import { FocusEvent as FocusEvent_2 } from 'react';
5
8
  import { FormEvent } from 'react';
6
9
  import { ForwardedRef } from 'react';
@@ -21,6 +24,8 @@ declare type AtLeastOneAttr<T> = Partial<T> & {
21
24
  [K in keyof T]-?: Required<Pick<T, K>>;
22
25
  }[keyof T];
23
26
 
27
+ declare type AvailableTheme = keyof typeof default_2;
28
+
24
29
  declare type BaseTableRowProps = {
25
30
  /**
26
31
  * Whether the row is in a selected state
@@ -248,11 +253,11 @@ declare type ComboboxProps = {
248
253
  /**
249
254
  * Callback function that is called when an item is selected.
250
255
  */
251
- onSelect?: (selectedValue: string) => void;
256
+ onSelect?: (selectedValue: string | null) => void;
252
257
  /**
253
258
  * The active value in the combobox component. This is used to control the combobox externally.
254
259
  */
255
- value?: string;
260
+ value?: string | null;
256
261
  /**
257
262
  * The default value of the combobox component. Used for uncontrolled usages.
258
263
  */
@@ -274,7 +279,11 @@ declare type ComboboxProps = {
274
279
  * The alignment of the menu.
275
280
  * @default "start"
276
281
  */
277
- alignMenu?: 'start' | 'center' | 'end';
282
+ alignMenu?: 'start' | 'center' | 'end' /**
283
+ * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport.
284
+ * @default "bottom"
285
+ */;
286
+ side?: 'left' | 'right' | 'bottom' | 'top';
278
287
  /**
279
288
  * The aria label of the combobox component.
280
289
  */
@@ -285,7 +294,7 @@ declare type ComboboxProps = {
285
294
  'data-test-id'?: string;
286
295
  };
287
296
 
288
- declare type CommonAriaAttrs = Pick<AriaAttributes, 'aria-describedby'> & AtLeastOneAriaLabelAttr;
297
+ declare type CommonAriaAttrs_2 = Pick<AriaAttributes, 'aria-describedby'> & AtLeastOneAriaLabelAttr;
289
298
 
290
299
  declare type CommonAriaProps = {
291
300
  /**
@@ -504,7 +513,7 @@ declare type DividerStyle = 'noline' | 'dashed' | 'solid';
504
513
 
505
514
  export declare const Dropdown: {
506
515
  Root: {
507
- ({ children, open, onOpenChange, "data-test-id": dataTestId, }: DropdownRootProps): JSX_2.Element;
516
+ ({ children, open, modal, onOpenChange, "data-test-id": dataTestId, }: DropdownRootProps): JSX_2.Element;
508
517
  displayName: string;
509
518
  };
510
519
  Trigger: ForwardRefExoticComponent<DropdownTriggerProps & RefAttributes<HTMLButtonElement>>;
@@ -568,6 +577,11 @@ declare type DropdownItemProps = {
568
577
 
569
578
  declare type DropdownRootProps = {
570
579
  children?: ReactNode;
580
+ /**
581
+ * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
582
+ * @default false
583
+ */
584
+ modal?: boolean;
571
585
  /**
572
586
  * Controls the open state of the dropdown.
573
587
  */
@@ -1124,11 +1138,11 @@ declare type SelectComponentProps = {
1124
1138
  /**
1125
1139
  * Callback function that is called when an item is selected.
1126
1140
  */
1127
- onSelect?: (selectedValue?: string) => void;
1141
+ onSelect?: (selectedValue: string | null) => void;
1128
1142
  /**
1129
1143
  * The active value in the select component. This is used to control the select externally.
1130
1144
  */
1131
- value?: string;
1145
+ value?: string | null;
1132
1146
  /**
1133
1147
  * The default value of the select component. Used for uncontrolled usages.
1134
1148
  */
@@ -1151,6 +1165,11 @@ declare type SelectComponentProps = {
1151
1165
  * @default "start"
1152
1166
  */
1153
1167
  alignMenu?: 'start' | 'center' | 'end';
1168
+ /**
1169
+ * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport.
1170
+ * @default "bottom"
1171
+ */
1172
+ side?: 'left' | 'right' | 'bottom' | 'top';
1154
1173
  /**
1155
1174
  * The aria label of the select component.
1156
1175
  */
@@ -1162,7 +1181,7 @@ declare type SelectComponentProps = {
1162
1181
  };
1163
1182
 
1164
1183
  declare const SelectInput: {
1165
- ({ children, onSelect, value, defaultValue, placeholder, status, disabled, alignMenu, "aria-label": ariaLabel, "data-test-id": dataTestId, }: SelectComponentProps, forwardedRef: ForwardedRef<HTMLDivElement>): JSX_2.Element;
1184
+ ({ children, onSelect, value, defaultValue, placeholder, status, disabled, alignMenu, side, "aria-label": ariaLabel, "data-test-id": dataTestId, }: SelectComponentProps, forwardedRef: ForwardedRef<HTMLDivElement>): JSX_2.Element;
1166
1185
  displayName: string;
1167
1186
  };
1168
1187
 
@@ -1265,7 +1284,7 @@ declare type SliderProps = {
1265
1284
  onChange?: (value: number[]) => void;
1266
1285
  onCommit?: (value: number[]) => void;
1267
1286
  'data-test-id'?: string;
1268
- } & CommonAriaAttrs;
1287
+ } & CommonAriaAttrs_2;
1269
1288
 
1270
1289
  declare type SortDirection = 'ascending' | 'descending' | undefined;
1271
1290
 
@@ -1317,7 +1336,7 @@ declare type SwitchProps = {
1317
1336
  */
1318
1337
  onFocus?: (event: FormEvent<HTMLButtonElement>) => void;
1319
1338
  'data-test-id'?: string;
1320
- } & CommonAriaAttrs;
1339
+ } & CommonAriaAttrs_2;
1321
1340
 
1322
1341
  export declare const Table: {
1323
1342
  Root: ForwardRefExoticComponent<TableRootProps & RefAttributes<HTMLTableElement>>;
@@ -1407,7 +1426,7 @@ declare type TableRootProps = {
1407
1426
  */
1408
1427
  sticky?: 'head' | 'col' | 'both';
1409
1428
  children: ReactNode;
1410
- } & CommonAriaAttrs;
1429
+ } & CommonAriaAttrs_2;
1411
1430
 
1412
1431
  declare type TableRowCellProps = {
1413
1432
  /**
@@ -1585,6 +1604,19 @@ declare type TextInputProps = {
1585
1604
  'aria-describedby'?: string;
1586
1605
  };
1587
1606
 
1607
+ export declare const ThemeContext: Context<"dark" | "light">;
1608
+
1609
+ export declare const ThemeProvider: ({ children, theme }: ThemeProviderProps) => JSX_2.Element;
1610
+
1611
+ declare type ThemeProviderProps = {
1612
+ children: ReactNode;
1613
+ /**
1614
+ * The theme to apply
1615
+ * @default "light"
1616
+ * */
1617
+ theme: AvailableTheme;
1618
+ };
1619
+
1588
1620
  export declare const Tooltip: {
1589
1621
  Root: {
1590
1622
  ({ children, enterDelay, open, onOpenChange, ...props }: TooltipRootProps): JSX_2.Element;
@@ -1636,6 +1668,8 @@ declare type TooltipTriggerProps = {
1636
1668
  'data-test-id'?: string;
1637
1669
  };
1638
1670
 
1671
+ export declare const useFondueTheme: () => "dark" | "light";
1672
+
1639
1673
  export { }
1640
1674
 
1641
1675