@frontify/fondue-components 3.3.2 → 3.3.4
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-components18.js +79 -63
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components22.js +9 -9
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components26.js +1 -1
- package/dist/fondue-components29.js +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components36.js +14 -14
- package/dist/fondue-components39.js +12 -12
- package/dist/fondue-components48.js +66 -58
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +13 -9
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components50.js +60 -41
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components52.js +22 -20
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components56.js +14 -14
- package/dist/fondue-components58.js +11 -2
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +2 -11
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components7.js +66 -63
- package/dist/fondue-components7.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components48.js","sources":["../src/components/Select/Combobox.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useCombobox } from 'downshift';\nimport { type FocusEvent, forwardRef, useMemo, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { SelectMenu } from './SelectMenu';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type ComboboxProps = {\n /**\n * Children of the Combobox component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the combobox component. This is used to control the combobox externally.\n */\n value?: string;\n /**\n * The default value of the combobox component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the combobox component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the combobox component.\n */\n disabled?: boolean;\n /**\n * The aria label of the combobox component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectCombobox = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select-combobox',\n }: ComboboxProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, filterText, clearButton, getItemByValue, setFilterText } =\n useSelectData(children);\n\n const {\n getInputProps,\n getToggleButtonProps,\n getMenuProps,\n getItemProps,\n reset,\n selectedItem,\n isOpen,\n highlightedIndex,\n inputValue,\n } = useCombobox({\n items,\n selectedItem: getItemByValue(value),\n defaultSelectedItem: getItemByValue(defaultValue),\n defaultHighlightedIndex: 0,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n onInputValueChange: ({ inputValue }) => {\n setFilterText(inputValue);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const wasClicked = useRef(false);\n\n const valueInvalid = useMemo(\n () => !items.find((item) => item.label.toLowerCase().includes(inputValue.toLowerCase())),\n [inputValue, items],\n );\n\n const onBlurHandler = (blurEvent: FocusEvent<HTMLInputElement, Element>) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n\n const selectedItemNullOrOutdated = selectedItem?.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase();\n\n if (selectedItemNullOrOutdated) {\n // if there is no selection or\n // the existing selected value is not the same as the input value (old),\n // reset the input\n reset();\n }\n\n if (getInputProps().onBlur) {\n getInputProps().onBlur?.(blurEvent);\n }\n };\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div ref={forwardedRef} className={styles.root} data-status={valueInvalid ? 'error' : status}>\n <input\n {...getInputProps({\n 'aria-label': ariaLabel,\n })}\n data-test-id={dataTestId}\n placeholder={placeholder}\n className={styles.input}\n disabled={disabled}\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={onBlurHandler}\n />\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n role=\"button\"\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <button\n {...getToggleButtonProps()}\n type=\"button\"\n aria-label=\"toggle menu\"\n disabled={disabled}\n onMouseDown={() => {\n wasClicked.current = true;\n }}\n >\n <IconCaretDown size={16} className={styles.caret} />\n </button>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {valueInvalid || status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n highlightedIndex={highlightedIndex}\n filterText={filterText}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectCombobox.displayName = 'Select.Combobox';\n\nexport const ForwardedRefCombobox = forwardRef<HTMLDivElement, ComboboxProps>(SelectCombobox);\n"],"names":["SelectCombobox","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","filterText","clearButton","getItemByValue","setFilterText","useSelectData","getInputProps","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","inputValue","useCombobox","item","wasClicked","useRef","valueInvalid","useMemo","onBlurHandler","blurEvent","_b","_a","jsxs","RadixPopover","jsx","styles","mouseEvent","focusEvent","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefCombobox","forwardRef"],"mappings":";;;;;;;;;AAoDO,MAAMA,IAAiB,CAC1B;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,YAAAC,GAAY,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,EAAA,IAC3EC,EAAcjB,CAAQ,GAEpB;AAAA,IACF,eAAAkB;AAAA,IACA,sBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,MACAC,EAAY;AAAA,IACZ,OAAAf;AAAA,IACA,cAAcG,EAAeb,CAAK;AAAA,IAClC,qBAAqBa,EAAeZ,CAAY;AAAA,IAChD,yBAAyB;AAAA,IACzB,sBAAsB,CAAC,EAAE,cAAAoB,QAAmB;AAC5B,MAAAtB,KAAAA,EAASsB,EAAa,KAAK;AAAA,IAC3C;AAAA,IACA,oBAAoB,CAAC,EAAE,YAAAG,QAAiB;AACpC,MAAAV,EAAcU,CAAU;AAAA,IAC5B;AAA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ACG,SAAS,CAACC,MAAU;AAChB,YAAAA,EAAM,gBAAgB,GAChBtB;UACV;AAAA,UACA,WAAWkB,EAAO;AAAA,UAClB,MAAK;AAAA,UAEJ,UAAA1B;AAAA,QAAA;AAAA,MACL;AAAA,MAEH,gBAAAuB,EAAA,OAAA,EAAI,WAAWG,EAAO,OACnB,UAAA;AAAA,QAAA,gBAAAD;AAAA,UAAC;AAAA,UAAA;AAAA,YACI,GAAGpB,EAAqB;AAAA,YACzB,MAAK;AAAA,YACL,cAAW;AAAA,YACX,UAAAb;AAAA,YACA,aAAa,MAAM;AACf,cAAAuB,EAAW,UAAU;AAAA,YACzB;AAAA,YAEA,4BAACgB,GAAc,EAAA,MAAM,IAAI,WAAWL,EAAO,OAAO;AAAA,UAAA;AAAA,QACtD;AAAA,QACCnC,MAAW,YACR,gBAAAkC;AAAA,UAACO;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWN,EAAO;AAAA,YAClB,gBAAc,GAAGhC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,QACHuB,KAAgB1B,MAAW,UACxB,gBAAAkC;AAAA,UAACQ;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWP,EAAO;AAAA,YAClB,gBAAc,GAAGhC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,MAAA,GACR;AAAA,IAAA,EAAA,CACJ,EACJ,CAAA;AAAA,IAEA,gBAAA+B;AAAA,MAACS;AAAA,MAAA;AAAA,QACG,kBAAAvB;AAAA,QACA,YAAAZ;AAAA,QACA,cAAAO;AAAA,QACA,cAAAC;AAAA,QAEC,UAAAV;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAZ,EAAe,cAAc;AAEhB,MAAAkD,KAAuBC,EAA0CnD,CAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components48.js","sources":["../src/components/Select/Combobox.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useCombobox } from 'downshift';\nimport { forwardRef, useMemo, useRef, useState, type FocusEvent, type ForwardedRef, type ReactNode } from 'react';\n\nimport { SelectMenu } from './SelectMenu';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type ComboboxProps = {\n /**\n * Children of the Combobox component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the combobox component. This is used to control the combobox externally.\n */\n value?: string;\n /**\n * The default value of the combobox component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the combobox component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the combobox component.\n */\n disabled?: boolean;\n /**\n * The aria label of the combobox component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectCombobox = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select-combobox',\n }: ComboboxProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, filterText, clearButton, getItemByValue, setFilterText } =\n useSelectData(children);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const {\n getInputProps,\n getToggleButtonProps,\n getMenuProps,\n getItemProps,\n reset,\n selectedItem,\n isOpen,\n highlightedIndex,\n inputValue,\n } = useCombobox({\n items,\n selectedItem: getItemByValue(value),\n defaultSelectedItem: getItemByValue(defaultValue),\n defaultHighlightedIndex: 0,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n onInputValueChange: ({ inputValue }) => {\n setFilterText(inputValue);\n },\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const wasClicked = useRef(false);\n\n const valueInvalid = useMemo(\n () => !items.find((item) => item.label.toLowerCase().includes(inputValue.toLowerCase())),\n [inputValue, items],\n );\n\n const onBlurHandler = (blurEvent: FocusEvent<HTMLInputElement, Element>) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n\n const selectedItemNullOrOutdated = selectedItem?.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase();\n\n if (selectedItemNullOrOutdated) {\n // if there is no selection or\n // the existing selected value is not the same as the input value (old),\n // reset the input\n reset();\n }\n\n if (getInputProps().onBlur) {\n getInputProps().onBlur?.(blurEvent);\n }\n };\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div ref={forwardedRef} className={styles.root} data-status={valueInvalid ? 'error' : status}>\n <input\n {...getInputProps({\n 'aria-label': ariaLabel,\n })}\n data-test-id={dataTestId}\n placeholder={placeholder}\n className={styles.input}\n disabled={disabled}\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={onBlurHandler}\n />\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n role=\"button\"\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <button\n {...getToggleButtonProps()}\n type=\"button\"\n aria-label=\"toggle menu\"\n disabled={disabled}\n onMouseDown={() => {\n wasClicked.current = true;\n }}\n >\n <IconCaretDown size={16} className={styles.caret} />\n </button>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {valueInvalid || status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n highlightedIndex={highlightedIndex}\n filterText={filterText}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectCombobox.displayName = 'Select.Combobox';\n\nexport const ForwardedRefCombobox = forwardRef<HTMLDivElement, ComboboxProps>(SelectCombobox);\n"],"names":["SelectCombobox","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","filterText","clearButton","getItemByValue","setFilterText","useSelectData","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getInputProps","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","inputValue","useCombobox","item","wasClicked","useRef","valueInvalid","useMemo","onBlurHandler","blurEvent","_b","_a","jsxs","RadixPopover","jsx","styles","mouseEvent","focusEvent","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefCombobox","forwardRef"],"mappings":";;;;;;;;;AAoDO,MAAMA,IAAiB,CAC1B;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GA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,QACtD;AAAA,QACCtC,MAAW,YACR,gBAAAqC;AAAA,UAACO;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWN,EAAO;AAAA,YAClB,gBAAc,GAAGnC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,QACH0B,KAAgB7B,MAAW,UACxB,gBAAAqC;AAAA,UAACQ;AAAA,UAAA;AAAA,YACG,MAAM;AAAA,YACN,WAAWP,EAAO;AAAA,YAClB,gBAAc,GAAGnC,CAAU;AAAA,UAAA;AAAA,QAAA,IAE/B;AAAA,MAAA,GACR;AAAA,IAAA,EAAA,CACJ,EACJ,CAAA;AAAA,IAEA,gBAAAkC;AAAA,MAACS;AAAA,MAAA;AAAA,QACG,kBAAAvB;AAAA,QACA,YAAAf;AAAA,QACA,cAAAU;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAR;AAAA,QAEC,UAAAP;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAZ,EAAe,cAAc;AAEhB,MAAAqD,KAAuBC,EAA0CtD,CAAc;"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheckMark as l } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
3
4
|
import c from "./fondue-components52.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const d = ({ "data-test-id": t = "fondue-select-item", ...e }, r) => /* @__PURE__ */ i("li", { "data-test-id": t, ref: r, ...e, children: [
|
|
6
|
+
e.children,
|
|
7
|
+
/* @__PURE__ */ o(l, { className: c.checkmarkIcon })
|
|
8
|
+
] });
|
|
9
|
+
d.displayName = "Select.Item";
|
|
10
|
+
const I = a(d), m = ({ children: t, groupId: e, "data-test-id": r = "fondue-select-item-group" }, s) => /* @__PURE__ */ o("div", { "data-test-id": r, className: c.group, ref: s, children: t }, e);
|
|
7
11
|
m.displayName = "Select.Group";
|
|
8
|
-
const
|
|
12
|
+
const S = a(m);
|
|
9
13
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
I as ForwardedRefSelectItem,
|
|
15
|
+
S as ForwardedRefSelectItemGroup,
|
|
16
|
+
d as SelectItem,
|
|
13
17
|
m as SelectItemGroup
|
|
14
18
|
};
|
|
15
19
|
//# sourceMappingURL=fondue-components49.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components49.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n {props.children}\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","
|
|
1
|
+
{"version":3,"file":"fondue-components49.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n {props.children}\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","IconCheckMark","styles","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCa,MAAAA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9DC,wBAGK,MAAG,EAAA,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GAChD,UAAA;AAAA,EAAMA,EAAA;AAAA,EACN,gBAAAE,EAAAC,GAAA,EAAc,WAAWC,EAAO,cAAe,CAAA;AACpD,EAAA,CAAA;AAGRN,EAAW,cAAc;AAEZ,MAAAO,IAAyBC,EAA2CR,CAAU,GAiB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,gBAAgBV,IAAa,2BAA2B,GAC7EE,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcH,GAAY,WAAWK,EAAO,OAAO,KAAKH,GACxD,UAAAO,EAAA,GAD2EC,CAEhF;AAGRF,EAAgB,cAAc;AAEjB,MAAAG,IAA8BJ,EAAiDC,CAAe;"}
|
|
@@ -1,46 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { usePreventDropdownOverflow as
|
|
6
|
-
import
|
|
7
|
-
import { recursiveMap as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "@radix-ui/react-popover";
|
|
3
|
+
import { Slot as S } from "@radix-ui/react-slot";
|
|
4
|
+
import { useRef as g, isValidElement as C } from "react";
|
|
5
|
+
import { usePreventDropdownOverflow as M } from "./fondue-components38.js";
|
|
6
|
+
import n from "./fondue-components52.js";
|
|
7
|
+
import { recursiveMap as N, getSelectOptionValue as P } from "./fondue-components60.js";
|
|
8
|
+
const V = ({
|
|
9
|
+
highlightedIndex: p,
|
|
10
|
+
getMenuProps: u,
|
|
11
|
+
getItemProps: m,
|
|
12
|
+
children: f,
|
|
13
|
+
filterText: c,
|
|
14
|
+
selectedItem: r,
|
|
15
|
+
hasInteractedSinceOpening: d
|
|
16
|
+
}) => {
|
|
17
|
+
const s = g(null), { setMaxHeight: v } = M(s), h = (e) => {
|
|
18
|
+
e.preventDefault(), v();
|
|
11
19
|
};
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
return /* @__PURE__ */ t(l.Portal, { children: /* @__PURE__ */ t(l.Content, { onOpenAutoFocus: h, className: n.portal, children: /* @__PURE__ */ t(
|
|
21
|
+
"ul",
|
|
22
|
+
{
|
|
23
|
+
className: n.menu,
|
|
24
|
+
...u(),
|
|
25
|
+
ref: s,
|
|
26
|
+
"data-has-interacted": d ? "true" : "false",
|
|
27
|
+
"data-test-id": "fondue-select-menu",
|
|
28
|
+
children: N(
|
|
29
|
+
f,
|
|
30
|
+
(e, i) => {
|
|
31
|
+
if (((o) => (
|
|
32
|
+
// @ts-expect-error - We are explicitly checking for ref
|
|
33
|
+
C(o) && o.ref !== void 0
|
|
34
|
+
))(e)) {
|
|
35
|
+
const o = P(e.props), a = m({
|
|
36
|
+
item: o,
|
|
37
|
+
index: i,
|
|
38
|
+
...e.ref ? { ref: e.ref } : {}
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ t(
|
|
41
|
+
S,
|
|
42
|
+
{
|
|
43
|
+
className: n.item,
|
|
44
|
+
"data-highlighted": p === i,
|
|
45
|
+
"data-selected": (r == null ? void 0 : r.value) === o.value,
|
|
46
|
+
onTouchStart: (O) => {
|
|
47
|
+
a.onClick && a.onClick(O);
|
|
48
|
+
},
|
|
49
|
+
...a,
|
|
50
|
+
children: e
|
|
51
|
+
},
|
|
52
|
+
e.props.value
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
c
|
|
57
|
+
).parsedChildren
|
|
58
|
+
}
|
|
59
|
+
) }) });
|
|
41
60
|
};
|
|
42
|
-
|
|
61
|
+
V.displayName = "Select.Menu";
|
|
43
62
|
export {
|
|
44
|
-
|
|
63
|
+
V as SelectMenu
|
|
45
64
|
};
|
|
46
65
|
//# sourceMappingURL=fondue-components50.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components50.js","sources":["../src/components/Select/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, useRef, type ForwardedRef, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n};\n\nexport const SelectMenu = ({
|
|
1
|
+
{"version":3,"file":"fondue-components50.js","sources":["../src/components/Select/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, useRef, type ForwardedRef, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n /**\n * @internal\n * The type of the menu.\n */\n selectedItem?: {\n value: string;\n } | null;\n /**\n * @internal\n * A boolean to indicate if highlighted item was changed since opening the menu.\n * This is used to determine the style of the selected/highlighted item.\n */\n hasInteractedSinceOpening?: boolean;\n};\n\nexport const SelectMenu = ({\n highlightedIndex,\n getMenuProps,\n getItemProps,\n children,\n filterText,\n selectedItem,\n hasInteractedSinceOpening,\n}: SelectMenuProps) => {\n const ref = useRef<HTMLUListElement | null>(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(ref);\n\n const handleOnOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n setMaxHeight();\n };\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content onOpenAutoFocus={handleOnOpenAutoFocus} className={styles.portal}>\n <ul\n className={styles.menu}\n {...getMenuProps()}\n ref={ref}\n data-has-interacted={hasInteractedSinceOpening ? 'true' : 'false'}\n data-test-id=\"fondue-select-menu\"\n >\n {\n recursiveMap(\n children,\n (child, index) => {\n const isValid = <TProps,>(\n child: ReactNode,\n ): child is ReactElement<TProps> & { ref: ForwardedRef<HTMLElement> } =>\n // @ts-expect-error - We are explicitly checking for ref\n isValidElement<TProps>(child) && child.ref !== undefined;\n\n if (isValid<SelectItemProps>(child)) {\n const optionData = getSelectOptionValue(child.props);\n const itemProps = getItemProps({\n item: optionData,\n index,\n ...(child.ref ? { ref: child.ref } : {}),\n });\n\n return (\n <RadixSlot\n className={styles.item}\n data-highlighted={highlightedIndex === index}\n data-selected={selectedItem?.value === optionData.value}\n key={child.props.value}\n // Workaround for the issue where the onClick event is not fired on touch devices because of portal usage\n onTouchStart={(event) => {\n if (itemProps.onClick) {\n itemProps.onClick(event as unknown as MouseEvent<HTMLElement>);\n }\n }}\n {...itemProps}\n >\n {child}\n </RadixSlot>\n );\n }\n },\n filterText,\n ).parsedChildren\n }\n </ul>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nSelectMenu.displayName = 'Select.Menu';\n"],"names":["SelectMenu","highlightedIndex","getMenuProps","getItemProps","children","filterText","selectedItem","hasInteractedSinceOpening","ref","useRef","setMaxHeight","usePreventDropdownOverflow","handleOnOpenAutoFocus","event","jsx","RadixPopover","styles","recursiveMap","child","index","isValidElement","optionData","getSelectOptionValue","itemProps","RadixSlot"],"mappings":";;;;;;;AAsDO,MAAMA,IAAa,CAAC;AAAA,EACvB,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,2BAAAC;AACJ,MAAuB;AACb,QAAAC,IAAMC,EAAgC,IAAI,GAE1C,EAAE,cAAAC,EAAA,IAAiBC,EAA2BH,CAAG,GAEjDI,IAAwB,CAACC,MAAiB;AAC5C,IAAAA,EAAM,eAAe,GACRH;EAAA;AAGjB,SACK,gBAAAI,EAAAC,EAAa,QAAb,EACG,UAAC,gBAAAD,EAAAC,EAAa,SAAb,EAAqB,iBAAiBH,GAAuB,WAAWI,EAAO,QAC5E,UAAA,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWE,EAAO;AAAA,MACjB,GAAGd,EAAa;AAAA,MACjB,KAAAM;AAAA,MACA,uBAAqBD,IAA4B,SAAS;AAAA,MAC1D,gBAAa;AAAA,MAGT,UAAAU;AAAA,QACIb;AAAA,QACA,CAACc,GAAOC,MAAU;AAOV,eANY,CACZD;AAAAA;AAAAA,YAGAE,EAAuBF,CAAK,KAAKA,EAAM,QAAQ;AAAA,aAEtBA,CAAK,GAAG;AAC3B,kBAAAG,IAAaC,EAAqBJ,EAAM,KAAK,GAC7CK,IAAYpB,EAAa;AAAA,cAC3B,MAAMkB;AAAA,cACN,OAAAF;AAAA,cACA,GAAID,EAAM,MAAM,EAAE,KAAKA,EAAM,IAAA,IAAQ,CAAC;AAAA,YAAA,CACzC;AAGG,mBAAA,gBAAAJ;AAAA,cAACU;AAAAA,cAAA;AAAA,gBACG,WAAWR,EAAO;AAAA,gBAClB,oBAAkBf,MAAqBkB;AAAA,gBACvC,kBAAeb,KAAA,gBAAAA,EAAc,WAAUe,EAAW;AAAA,gBAGlD,cAAc,CAACR,MAAU;AACrB,kBAAIU,EAAU,WACVA,EAAU,QAAQV,CAA2C;AAAA,gBAErE;AAAA,gBACC,GAAGU;AAAA,gBAEH,UAAAL;AAAA,cAAA;AAAA,cATIA,EAAM,MAAM;AAAA,YAAA;AAAA,UAY7B;AAAA,QACJ;AAAA,QACAb;AAAA,MAAA,EACF;AAAA,IAAA;AAAA,EAAA,EAGd,CAAA,EACJ,CAAA;AAER;AACAL,EAAW,cAAc;"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
1
|
+
const n = "_root_1nim9_5", o = "_input_1nim9_59", c = "_slot_1nim9_78", _ = "_clear_1nim9_127", t = "_icons_1nim9_140", s = "_caret_1nim9_146", i = "_iconSuccess_1nim9_168", r = "_iconError_1nim9_174", m = "_menu_1nim9_180", e = "_portal_1nim9_194", a = "_item_1nim9_198", u = "_checkmarkIcon_1nim9_217", l = "_group_1nim9_231", p = {
|
|
2
|
+
root: n,
|
|
3
3
|
input: o,
|
|
4
|
-
slot:
|
|
4
|
+
slot: c,
|
|
5
5
|
clear: _,
|
|
6
|
-
icons:
|
|
6
|
+
icons: t,
|
|
7
7
|
caret: s,
|
|
8
|
-
iconSuccess:
|
|
9
|
-
iconError:
|
|
10
|
-
menu:
|
|
11
|
-
portal:
|
|
12
|
-
item:
|
|
13
|
-
|
|
8
|
+
iconSuccess: i,
|
|
9
|
+
iconError: r,
|
|
10
|
+
menu: m,
|
|
11
|
+
portal: e,
|
|
12
|
+
item: a,
|
|
13
|
+
checkmarkIcon: u,
|
|
14
|
+
group: l
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
17
|
s as caret,
|
|
18
|
+
u as checkmarkIcon,
|
|
17
19
|
_ as clear,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
p as default,
|
|
21
|
+
l as group,
|
|
22
|
+
r as iconError,
|
|
23
|
+
i as iconSuccess,
|
|
24
|
+
t as icons,
|
|
23
25
|
o as input,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
a as item,
|
|
27
|
+
m as menu,
|
|
28
|
+
e as portal,
|
|
29
|
+
n as root,
|
|
30
|
+
c as slot
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=fondue-components52.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components52.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components52.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
input:
|
|
4
|
-
slot:
|
|
1
|
+
const o = "_root_2iy13_5", t = "_input_2iy13_52", s = "_slot_2iy13_71", _ = "_iconSuccess_2iy13_121", i = "_iconError_2iy13_129", n = "_loadingStatus_2iy13_137", c = "_spin_2iy13_1", r = {
|
|
2
|
+
root: o,
|
|
3
|
+
input: t,
|
|
4
|
+
slot: s,
|
|
5
5
|
iconSuccess: _,
|
|
6
|
-
iconError:
|
|
7
|
-
loadingStatus:
|
|
8
|
-
spin:
|
|
9
|
-
"tw-dark": "_tw-
|
|
6
|
+
iconError: i,
|
|
7
|
+
loadingStatus: n,
|
|
8
|
+
spin: c,
|
|
9
|
+
"tw-dark": "_tw-dark_2iy13_169"
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
r as default,
|
|
13
|
-
|
|
13
|
+
i as iconError,
|
|
14
14
|
_ as iconSuccess,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
t as input,
|
|
16
|
+
n as loadingStatus,
|
|
17
|
+
o as root,
|
|
18
|
+
s as slot,
|
|
19
|
+
c as spin
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=fondue-components56.js.map
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const o = "_root_6hy5w_5", c = "_colorName_6hy5w_53", t = "_colorIndicator_6hy5w_57", r = "_caret_6hy5w_63", _ = {
|
|
2
|
+
root: o,
|
|
3
|
+
colorName: c,
|
|
4
|
+
colorIndicator: t,
|
|
5
|
+
caret: r
|
|
6
|
+
};
|
|
2
7
|
export {
|
|
3
|
-
|
|
8
|
+
r as caret,
|
|
9
|
+
t as colorIndicator,
|
|
10
|
+
c as colorName,
|
|
11
|
+
_ as default,
|
|
12
|
+
o as root
|
|
4
13
|
};
|
|
5
14
|
//# sourceMappingURL=fondue-components58.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components58.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components58.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
root: o,
|
|
3
|
-
colorName: c,
|
|
4
|
-
colorIndicator: t,
|
|
5
|
-
caret: r
|
|
6
|
-
};
|
|
1
|
+
const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
|
|
7
2
|
export {
|
|
8
|
-
|
|
9
|
-
t as colorIndicator,
|
|
10
|
-
c as colorName,
|
|
11
|
-
_ as default,
|
|
12
|
-
o as root
|
|
3
|
+
t as FOCUS_OUTLINE
|
|
13
4
|
};
|
|
14
5
|
//# sourceMappingURL=fondue-components59.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components59.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components59.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
|
|
@@ -1,95 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as w } from "@frontify/fondue-icons";
|
|
3
3
|
import * as i from "@radix-ui/react-dialog";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { addAutoFocusAttribute as
|
|
6
|
-
import
|
|
7
|
-
const s = ({ children: t, ...
|
|
8
|
-
|
|
9
|
-
const
|
|
4
|
+
import { createContext as M, forwardRef as l, useContext as S } from "react";
|
|
5
|
+
import { addAutoFocusAttribute as B, addShowFocusRing as H } from "./fondue-components35.js";
|
|
6
|
+
import d from "./fondue-components36.js";
|
|
7
|
+
const s = M({ isModal: !1 }), n = ({ children: t, ...a }) => /* @__PURE__ */ o(s.Provider, { value: { isModal: a.modal ?? !1 }, children: /* @__PURE__ */ o(i.Root, { ...a, children: t }) });
|
|
8
|
+
n.displayName = "Dialog.Root";
|
|
9
|
+
const g = ({ children: t, "data-test-id": a = "fondue-dialog-trigger" }, e) => /* @__PURE__ */ o(
|
|
10
10
|
i.Trigger,
|
|
11
11
|
{
|
|
12
|
-
onMouseDown:
|
|
12
|
+
onMouseDown: B,
|
|
13
13
|
"data-auto-focus-visible": "true",
|
|
14
14
|
"data-auto-focus-trigger": !0,
|
|
15
|
-
"data-test-id":
|
|
15
|
+
"data-test-id": a,
|
|
16
16
|
asChild: !0,
|
|
17
17
|
ref: e,
|
|
18
18
|
children: t
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
g.displayName = "Dialog.Trigger";
|
|
22
|
+
const j = ({ children: t, showUnderlay: a }) => {
|
|
23
|
+
const { isModal: e } = S(s);
|
|
24
|
+
return e ? /* @__PURE__ */ o(i.Overlay, { "data-visible": a, className: d.underlay, children: t }) : /* @__PURE__ */ o("div", { className: d.underlay, "data-visible": a, children: t });
|
|
25
|
+
}, c = ({
|
|
23
26
|
maxWidth: t = "800px",
|
|
24
|
-
minWidth:
|
|
27
|
+
minWidth: a = "400px",
|
|
25
28
|
minHeight: e = "200px",
|
|
26
|
-
padding:
|
|
29
|
+
padding: r = "compact",
|
|
27
30
|
verticalAlign: N = "center",
|
|
28
|
-
"data-test-id":
|
|
31
|
+
"data-test-id": v = "fondue-dialog-content",
|
|
29
32
|
showUnderlay: h = !1,
|
|
30
|
-
children:
|
|
31
|
-
rounded:
|
|
33
|
+
children: x,
|
|
34
|
+
rounded: b = !0,
|
|
32
35
|
...R
|
|
33
|
-
}, T) => /* @__PURE__ */
|
|
36
|
+
}, T) => /* @__PURE__ */ o(i.Portal, { children: /* @__PURE__ */ o(j, { showUnderlay: h, children: /* @__PURE__ */ o(
|
|
34
37
|
i.Content,
|
|
35
38
|
{
|
|
36
39
|
style: {
|
|
37
40
|
"--dialog-max-width": t,
|
|
38
|
-
"--dialog-min-width":
|
|
41
|
+
"--dialog-min-width": a,
|
|
39
42
|
"--dialog-min-height": e
|
|
40
43
|
},
|
|
41
44
|
ref: T,
|
|
42
|
-
className:
|
|
43
|
-
onFocus:
|
|
44
|
-
"data-dialog-rounded":
|
|
45
|
-
"data-dialog-spacing":
|
|
46
|
-
"data-test-id":
|
|
45
|
+
className: d.content,
|
|
46
|
+
onFocus: H,
|
|
47
|
+
"data-dialog-rounded": b,
|
|
48
|
+
"data-dialog-spacing": r,
|
|
49
|
+
"data-test-id": v,
|
|
47
50
|
"data-dialog-vertical-align": N,
|
|
48
51
|
...R,
|
|
49
|
-
children:
|
|
52
|
+
children: x
|
|
50
53
|
}
|
|
51
54
|
) }) });
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
55
|
+
c.displayName = "Dialog.Content";
|
|
56
|
+
const u = ({ children: t, showCloseButton: a = !0, "data-test-id": e = "fondue-dialog-header" }, r) => /* @__PURE__ */ F("div", { "data-test-id": e, ref: r, className: d.header, "data-dialog-layout-component": !0, children: [
|
|
57
|
+
/* @__PURE__ */ o("div", { children: t }),
|
|
58
|
+
a && /* @__PURE__ */ o(i.Close, { role: "button", "data-test-id": `${e}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ o(w, { size: 20 }) })
|
|
56
59
|
] });
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
Root:
|
|
72
|
-
Title:
|
|
73
|
-
Description:
|
|
74
|
-
Close:
|
|
75
|
-
Trigger:
|
|
76
|
-
Content:
|
|
77
|
-
Header:
|
|
78
|
-
Footer:
|
|
79
|
-
Body:
|
|
80
|
-
SideContent:
|
|
60
|
+
u.displayName = "Dialog.Header";
|
|
61
|
+
const m = ({ children: t, "data-test-id": a = "fondue-dialog-footer" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: d.footer, "data-dialog-layout-component": !0, children: t });
|
|
62
|
+
m.displayName = "Dialog.Footer";
|
|
63
|
+
const p = ({ children: t, "data-test-id": a = "fondue-dialog-body" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: d.body, "data-dialog-layout-component": !0, children: t });
|
|
64
|
+
p.displayName = "Dialog.Body";
|
|
65
|
+
const D = ({ children: t, "data-test-id": a = "fondue-dialog-side-content" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: d.sideContent, "data-dialog-layout-component": !0, children: t });
|
|
66
|
+
D.displayName = "Dialog.SideContent";
|
|
67
|
+
const y = ({ children: t }) => /* @__PURE__ */ o(i.Close, { asChild: !0, children: t });
|
|
68
|
+
y.displayName = "Dialog.Close";
|
|
69
|
+
const f = ({ children: t, asChild: a }) => /* @__PURE__ */ o(i.Title, { asChild: a, children: t });
|
|
70
|
+
f.displayName = "Dialog.Title";
|
|
71
|
+
const C = ({ children: t, asChild: a }) => /* @__PURE__ */ o(i.Description, { asChild: a, children: t });
|
|
72
|
+
C.displayName = "Dialog.Description";
|
|
73
|
+
const k = {
|
|
74
|
+
Root: n,
|
|
75
|
+
Title: f,
|
|
76
|
+
Description: C,
|
|
77
|
+
Close: y,
|
|
78
|
+
Trigger: l(g),
|
|
79
|
+
Content: l(c),
|
|
80
|
+
Header: l(u),
|
|
81
|
+
Footer: l(m),
|
|
82
|
+
Body: l(p),
|
|
83
|
+
SideContent: l(D)
|
|
81
84
|
};
|
|
82
85
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
k as Dialog,
|
|
87
|
+
p as DialogBody,
|
|
88
|
+
y as DialogClose,
|
|
89
|
+
c as DialogContent,
|
|
90
|
+
C as DialogDescription,
|
|
91
|
+
m as DialogFooter,
|
|
92
|
+
u as DialogHeader,
|
|
93
|
+
n as DialogRoot,
|
|
94
|
+
D as DialogSideContent,
|
|
95
|
+
f as DialogTitle,
|
|
96
|
+
g as DialogTrigger
|
|
94
97
|
};
|
|
95
98
|
//# sourceMappingURL=fondue-components7.js.map
|