@frontify/fondue-components 19.2.0 → 19.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components.js +10 -8
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +3 -3
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +3 -3
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +3 -3
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +2 -2
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +2 -2
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +1 -1
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +1 -1
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +1 -1
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +2 -2
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +2 -2
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +8 -8
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +2 -2
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +63 -62
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +77 -70
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +2 -2
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +3 -12
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +101 -10
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +93 -73
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +12 -55
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +55 -14
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +20 -7
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +7 -6
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +7 -32
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +32 -5
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +5 -12
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +10 -153
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +59 -22
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +17 -17
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +33 -32
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +112 -15
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +19 -30
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +32 -62
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +53 -121
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +129 -20
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +21 -45
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +45 -8
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +8 -13
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +13 -15
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +14 -4
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +5 -60
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +59 -17
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +18 -19
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +18 -4
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +3 -13
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +13 -3
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +3 -17
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +19 -35
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +35 -5
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +4 -12
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +12 -4
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +4 -24
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +24 -16
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +16 -150
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +151 -19
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +19 -77
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +77 -8
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +8 -35
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +34 -70
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +70 -10
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +36 -30
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +8 -10
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +12 -12
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +12 -20
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +21 -29
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +33 -55
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +55 -14
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +14 -25
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +24 -13
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +14 -6
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +21 -5
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +6 -4
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +6 -4
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +5 -2
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +4 -16
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +2 -40
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +43 -0
- package/dist/fondue-components85.js.map +1 -0
- package/dist/fondue-components86.js +20 -0
- package/dist/fondue-components86.js.map +1 -0
- package/dist/fondue-components9.js +37 -32
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +125 -50
- package/dist/style.css +1 -1
- package/package.json +60 -60
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1cjgh_2", _ = {
|
|
2
2
|
root: o,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"weight-default": "_weight-default_1cjgh_7",
|
|
4
|
+
"weight-strong": "_weight-strong_1cjgh_11",
|
|
5
|
+
"weight-x-strong": "_weight-x-strong_1cjgh_15",
|
|
6
|
+
"size-x-small": "_size-x-small_1cjgh_19",
|
|
7
|
+
"size-small": "_size-small_1cjgh_24",
|
|
8
|
+
"size-medium": "_size-medium_1cjgh_29",
|
|
9
|
+
"size-large": "_size-large_1cjgh_34",
|
|
10
|
+
"color-default": "_color-default_1cjgh_39",
|
|
11
|
+
"color-weak": "_color-weak_1cjgh_43",
|
|
12
|
+
"color-x-weak": "_color-x-weak_1cjgh_47",
|
|
13
|
+
"color-disabled": "_color-disabled_1cjgh_51",
|
|
14
|
+
"color-negative": "_color-negative_1cjgh_55",
|
|
15
|
+
"color-positive": "_color-positive_1cjgh_59",
|
|
16
|
+
"color-warning": "_color-warning_1cjgh_63",
|
|
17
|
+
"color-interactive": "_color-interactive_1cjgh_67",
|
|
18
|
+
"color-box-neutral": "_color-box-neutral_1cjgh_71",
|
|
19
|
+
"color-box-selected": "_color-box-selected_1cjgh_75",
|
|
20
|
+
"color-box-disabled": "_color-box-disabled_1cjgh_79",
|
|
21
|
+
"color-box-positive": "_color-box-positive_1cjgh_83",
|
|
22
|
+
"color-box-negative": "_color-box-negative_1cjgh_87",
|
|
23
|
+
"color-box-warning": "_color-box-warning_1cjgh_91"
|
|
8
24
|
};
|
|
9
25
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
c as iconSuccess,
|
|
13
|
-
t as input,
|
|
14
|
-
_ as loadingStatus,
|
|
15
|
-
o as root,
|
|
16
|
-
s as slot
|
|
26
|
+
_ as default,
|
|
27
|
+
o as root
|
|
17
28
|
};
|
|
18
29
|
//# sourceMappingURL=fondue-components77.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components77.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components77.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const o = "_root_kjbh5_5", t = "_input_kjbh5_59", s = "_slot_kjbh5_82", c = "_iconSuccess_kjbh5_132", n = "_iconError_kjbh5_141", _ = "_loadingStatus_kjbh5_155", r = {
|
|
2
|
+
root: o,
|
|
3
|
+
input: t,
|
|
4
|
+
slot: s,
|
|
5
|
+
iconSuccess: c,
|
|
6
|
+
iconError: n,
|
|
7
|
+
loadingStatus: _
|
|
4
8
|
};
|
|
5
9
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
r as default,
|
|
11
|
+
n as iconError,
|
|
12
|
+
c as iconSuccess,
|
|
13
|
+
t as input,
|
|
14
|
+
_ as loadingStatus,
|
|
15
|
+
o as root,
|
|
16
|
+
s as slot
|
|
9
17
|
};
|
|
10
18
|
//# sourceMappingURL=fondue-components78.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components78.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components78.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_18lbr_5", t = "_textarea_18lbr_73", s = "_slot_18lbr_123", r = "_decorator_18lbr_137", _ = "_tools_18lbr_150", l = "_toolsButton_18lbr_162", c = "_success_18lbr_194", n = "_error_18lbr_198", e = "_loadingStatus_18lbr_202", a = "_spin_18lbr_1", b = {
|
|
2
2
|
root: o,
|
|
3
|
-
|
|
3
|
+
textarea: t,
|
|
4
|
+
slot: s,
|
|
5
|
+
decorator: r,
|
|
6
|
+
tools: _,
|
|
7
|
+
toolsButton: l,
|
|
8
|
+
success: c,
|
|
9
|
+
error: n,
|
|
10
|
+
loadingStatus: e,
|
|
11
|
+
spin: a
|
|
4
12
|
};
|
|
5
13
|
export {
|
|
6
|
-
r as
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
r as decorator,
|
|
15
|
+
b as default,
|
|
16
|
+
n as error,
|
|
17
|
+
e as loadingStatus,
|
|
18
|
+
o as root,
|
|
19
|
+
s as slot,
|
|
20
|
+
a as spin,
|
|
21
|
+
c as success,
|
|
22
|
+
t as textarea,
|
|
23
|
+
_ as tools,
|
|
24
|
+
l as toolsButton
|
|
9
25
|
};
|
|
10
26
|
//# sourceMappingURL=fondue-components79.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components79.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components79.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as P } from "@radix-ui/react-slot";
|
|
3
3
|
import { forwardRef as F, useState as y, useMemo as N, Children as I } from "react";
|
|
4
|
-
import { ForwardedRefColorGradientInput as w } from "./fondue-
|
|
5
|
-
import { ForwardedRefColorPickerInput as h } from "./fondue-
|
|
6
|
-
import { ForwardedRefColorValueInput as G } from "./fondue-
|
|
7
|
-
import V from "./fondue-
|
|
8
|
-
import { DEFAULT_FORMAT as g, DEFAULT_COLOR as A, getColorWithName as s } from "./fondue-
|
|
4
|
+
import { ForwardedRefColorGradientInput as w } from "./fondue-components42.js";
|
|
5
|
+
import { ForwardedRefColorPickerInput as h } from "./fondue-components43.js";
|
|
6
|
+
import { ForwardedRefColorValueInput as G } from "./fondue-components44.js";
|
|
7
|
+
import V from "./fondue-components45.js";
|
|
8
|
+
import { DEFAULT_FORMAT as g, DEFAULT_COLOR as A, getColorWithName as s } from "./fondue-components46.js";
|
|
9
9
|
const p = ({
|
|
10
10
|
children: t,
|
|
11
11
|
currentColor: r = A,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components8.js","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { Children, forwardRef, useMemo, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefColorGradientInput } from './ColorGradientInput';\nimport { ForwardedRefColorPickerInput } from './ColorPickerInput';\nimport { ForwardedRefColorValueInput } from './ColorValueInput';\nimport styles from './styles/customColorPicker.module.scss';\nimport { type ColorFormat, type RgbaColor } from './types';\nimport { DEFAULT_COLOR, DEFAULT_FORMAT, getColorWithName } from './utils';\n\ntype ColorPickerProps = {\n /**\n * The children of the color picker component. This can contain multiple `ColorPicker.Values` or `ColorPicker.Gradient` components.\n */\n children?: ReactNode;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * Event handler called when the color changes\n */\n onColorChange?: (color: RgbaColor) => void;\n /**\n * The active color format in the color picker\n */\n currentFormat?: ColorFormat;\n /**\n * Event handler called when the color format changes\n */\n onFormatChange?: (format: ColorFormat) => void;\n /**\n * The default format to use for the color input when not controlled externally\n * @default \"HEX\"\n */\n defaultFormat?: ColorFormat;\n /**\n * The test id of the color picker\n */\n 'data-test-id'?: string;\n};\n\nexport const ColorPickerRoot = (\n {\n children,\n currentColor = DEFAULT_COLOR,\n onColorChange = () => {},\n currentFormat,\n onFormatChange = () => {},\n defaultFormat = DEFAULT_FORMAT,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const [managedFormat, setManagedFormat] = useState<ColorFormat>(defaultFormat);\n const activeFormat = useMemo(() => currentFormat ?? managedFormat, [currentFormat, managedFormat]);\n\n return (\n <div className={styles.root} data-picker-type=\"custom-color\" data-test-id={dataTestId} ref={forwardedRef}>\n {Children.map(children, (child) => (\n <ColorPickerSlot\n {...props}\n onColorChange={(color: RgbaColor) => {\n onColorChange(getColorWithName(color, activeFormat));\n }}\n currentColor={currentColor}\n currentFormat={activeFormat}\n setCurrentFormat={(currentFormat: ColorFormat) => {\n setManagedFormat(currentFormat);\n onFormatChange(currentFormat);\n onColorChange(getColorWithName(currentColor, currentFormat));\n }}\n >\n {child}\n </ColorPickerSlot>\n ))}\n </div>\n );\n};\nColorPickerRoot.displayName = 'ColorPicker';\n\ntype ColorPickerSlotProps = ColorPickerProps & {\n currentFormat?: ColorFormat;\n setCurrentFormat?: (format: ColorFormat) => void;\n};\nconst ColorPickerSlot = ({ children, ...props }: ColorPickerSlotProps) => <RadixSlot {...props}>{children}</RadixSlot>;\n\nexport const ForwardedRefColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(ColorPickerRoot);\n\nexport const ColorPicker = {\n Root: ForwardedRefColorPicker,\n Values: ForwardedRefColorValueInput,\n Gradient: ForwardedRefColorGradientInput,\n Input: ForwardedRefColorPickerInput,\n};\n\nColorPicker.Root.displayName = 'ColorPicker.Root';\nColorPicker.Values.displayName = 'ColorPicker.Values';\nColorPicker.Gradient.displayName = 'ColorPicker.Gradient';\nColorPicker.Input.displayName = 'ColorPicker.Input';\n"],"names":["ColorPickerRoot","children","currentColor","DEFAULT_COLOR","onColorChange","currentFormat","onFormatChange","defaultFormat","DEFAULT_FORMAT","dataTestId","props","forwardedRef","managedFormat","setManagedFormat","useState","activeFormat","useMemo","jsx","styles","Children","child","ColorPickerSlot","color","getColorWithName","RadixSlot","ForwardedRefColorPicker","forwardRef","ColorPicker","ForwardedRefColorValueInput","ForwardedRefColorGradientInput","ForwardedRefColorPickerInput"],"mappings":";;;;;;;;AA4CO,MAAMA,IAAkB,CAC3B;AAAA,EACI,UAAAC;AAAA,EACA,cAAAC,IAAeC;AAAA,EACf,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,eAAAC;AAAA,EACA,gBAAAC,IAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,eAAAC,IAAgBC;AAAA,EAChB,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAsBP,CAAa,GACvEQ,IAAeC,EAAQ,MAAMX,KAAiBO,GAAe,CAACP,GAAeO,CAAa,CAAC;AAEjG,
|
|
1
|
+
{"version":3,"file":"fondue-components8.js","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { Children, forwardRef, useMemo, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefColorGradientInput } from './ColorGradientInput';\nimport { ForwardedRefColorPickerInput } from './ColorPickerInput';\nimport { ForwardedRefColorValueInput } from './ColorValueInput';\nimport styles from './styles/customColorPicker.module.scss';\nimport { type ColorFormat, type RgbaColor } from './types';\nimport { DEFAULT_COLOR, DEFAULT_FORMAT, getColorWithName } from './utils';\n\ntype ColorPickerProps = {\n /**\n * The children of the color picker component. This can contain multiple `ColorPicker.Values` or `ColorPicker.Gradient` components.\n */\n children?: ReactNode;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * Event handler called when the color changes\n */\n onColorChange?: (color: RgbaColor) => void;\n /**\n * The active color format in the color picker\n */\n currentFormat?: ColorFormat;\n /**\n * Event handler called when the color format changes\n */\n onFormatChange?: (format: ColorFormat) => void;\n /**\n * The default format to use for the color input when not controlled externally\n * @default \"HEX\"\n */\n defaultFormat?: ColorFormat;\n /**\n * The test id of the color picker\n */\n 'data-test-id'?: string;\n};\n\nexport const ColorPickerRoot = (\n {\n children,\n currentColor = DEFAULT_COLOR,\n onColorChange = () => {},\n currentFormat,\n onFormatChange = () => {},\n defaultFormat = DEFAULT_FORMAT,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const [managedFormat, setManagedFormat] = useState<ColorFormat>(defaultFormat);\n const activeFormat = useMemo(() => currentFormat ?? managedFormat, [currentFormat, managedFormat]);\n\n return (\n <div className={styles.root} data-picker-type=\"custom-color\" data-test-id={dataTestId} ref={forwardedRef}>\n {Children.map(children, (child) => (\n <ColorPickerSlot\n {...props}\n onColorChange={(color: RgbaColor) => {\n onColorChange(getColorWithName(color, activeFormat));\n }}\n currentColor={currentColor}\n currentFormat={activeFormat}\n setCurrentFormat={(currentFormat: ColorFormat) => {\n setManagedFormat(currentFormat);\n onFormatChange(currentFormat);\n onColorChange(getColorWithName(currentColor, currentFormat));\n }}\n >\n {child}\n </ColorPickerSlot>\n ))}\n </div>\n );\n};\nColorPickerRoot.displayName = 'ColorPicker';\n\ntype ColorPickerSlotProps = ColorPickerProps & {\n currentFormat?: ColorFormat;\n setCurrentFormat?: (format: ColorFormat) => void;\n};\nconst ColorPickerSlot = ({ children, ...props }: ColorPickerSlotProps) => <RadixSlot {...props}>{children}</RadixSlot>;\n\nexport const ForwardedRefColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(ColorPickerRoot);\n\nexport const ColorPicker = {\n Root: ForwardedRefColorPicker,\n Values: ForwardedRefColorValueInput,\n Gradient: ForwardedRefColorGradientInput,\n Input: ForwardedRefColorPickerInput,\n};\n\nColorPicker.Root.displayName = 'ColorPicker.Root';\nColorPicker.Values.displayName = 'ColorPicker.Values';\nColorPicker.Gradient.displayName = 'ColorPicker.Gradient';\nColorPicker.Input.displayName = 'ColorPicker.Input';\n"],"names":["ColorPickerRoot","children","currentColor","DEFAULT_COLOR","onColorChange","currentFormat","onFormatChange","defaultFormat","DEFAULT_FORMAT","dataTestId","props","forwardedRef","managedFormat","setManagedFormat","useState","activeFormat","useMemo","jsx","styles","Children","child","ColorPickerSlot","color","getColorWithName","RadixSlot","ForwardedRefColorPicker","forwardRef","ColorPicker","ForwardedRefColorValueInput","ForwardedRefColorGradientInput","ForwardedRefColorPickerInput"],"mappings":";;;;;;;;AA4CO,MAAMA,IAAkB,CAC3B;AAAA,EACI,UAAAC;AAAA,EACA,cAAAC,IAAeC;AAAA,EACf,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,eAAAC;AAAA,EACA,gBAAAC,IAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,eAAAC,IAAgBC;AAAA,EAChB,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAsBP,CAAa,GACvEQ,IAAeC,EAAQ,MAAMX,KAAiBO,GAAe,CAACP,GAAeO,CAAa,CAAC;AAEjG,SACI,gBAAAK,EAAC,OAAA,EAAI,WAAWC,EAAO,MAAM,oBAAiB,gBAAe,gBAAcT,GAAY,KAAKE,GACvF,UAAAQ,EAAS,IAAIlB,GAAU,CAACmB,MACrB,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MACI,GAAGX;AAAA,MACJ,eAAe,CAACY,MAAqB;AACjC,QAAAlB,EAAcmB,EAAiBD,GAAOP,CAAY,CAAC;AAAA,MACvD;AAAA,MACA,cAAAb;AAAA,MACA,eAAea;AAAA,MACf,kBAAkB,CAACV,MAA+B;AAC9C,QAAAQ,EAAiBR,CAAa,GAC9BC,EAAeD,CAAa,GAC5BD,EAAcmB,EAAiBrB,GAAcG,CAAa,CAAC;AAAA,MAC/D;AAAA,MAEC,UAAAe;AAAA,IAAA;AAAA,EAAA,CAER,GACL;AAER;AACApB,EAAgB,cAAc;AAM9B,MAAMqB,IAAkB,CAAC,EAAE,UAAApB,GAAU,GAAGS,EAAA,MAAkC,gBAAAO,EAACO,GAAA,EAAW,GAAGd,GAAQ,UAAAT,GAAS,GAE7FwB,IAA0BC,EAA6C1B,CAAe,GAEtF2B,IAAc;AAAA,EACvB,MAAMF;AAAA,EACN,QAAQG;AAAA,EACR,UAAUC;AAAA,EACV,OAAOC;AACX;AAEAH,EAAY,KAAK,cAAc;AAC/BA,EAAY,OAAO,cAAc;AACjCA,EAAY,SAAS,cAAc;AACnCA,EAAY,MAAM,cAAc;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const t = "_dark_1mr83_1", r = "_light_1mr83_250", s = {
|
|
2
|
+
dark: t,
|
|
3
|
+
light: r
|
|
3
4
|
};
|
|
4
5
|
export {
|
|
5
|
-
t as
|
|
6
|
-
|
|
6
|
+
t as dark,
|
|
7
|
+
s as default,
|
|
8
|
+
r as light
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=fondue-components80.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components80.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components80.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
const r =
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const o = "_root_13m98_4", r = "_arrow_13m98_25", t = {
|
|
2
|
+
root: o,
|
|
3
|
+
arrow: r
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
r as
|
|
6
|
+
r as arrow,
|
|
7
|
+
t as default,
|
|
8
|
+
o as root
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=fondue-components81.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components81.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components81.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = "_root_lwb4s_1", t = {
|
|
2
|
+
root: o
|
|
3
|
+
};
|
|
2
4
|
export {
|
|
3
|
-
t as
|
|
5
|
+
t as default,
|
|
6
|
+
o as root
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=fondue-components82.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components82.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components82.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
button: c,
|
|
5
|
-
colorIndicator: r,
|
|
6
|
-
actions: _,
|
|
7
|
-
clear: a,
|
|
8
|
-
caret: n
|
|
1
|
+
const r = (e) => {
|
|
2
|
+
if (e)
|
|
3
|
+
return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
|
|
9
4
|
};
|
|
10
5
|
export {
|
|
11
|
-
|
|
12
|
-
c as button,
|
|
13
|
-
n as caret,
|
|
14
|
-
a as clear,
|
|
15
|
-
r as colorIndicator,
|
|
16
|
-
t as colorName,
|
|
17
|
-
s as default,
|
|
18
|
-
o as root
|
|
6
|
+
r as colorToCss
|
|
19
7
|
};
|
|
20
8
|
//# sourceMappingURL=fondue-components83.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components83.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components83.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
|
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { ForwardedRefSelectItem as E } from "./fondue-components64.js";
|
|
3
|
-
const g = ({
|
|
4
|
-
children: o,
|
|
5
|
-
value: r,
|
|
6
|
-
label: s
|
|
7
|
-
}) => o && typeof o == "string" ? {
|
|
8
|
-
value: r || o,
|
|
9
|
-
label: s || o
|
|
10
|
-
} : {
|
|
11
|
-
value: r || "",
|
|
12
|
-
label: s || r || "",
|
|
13
|
-
...o ? { children: o } : null
|
|
14
|
-
}, w = (o, r) => u(o) && o.type === r, y = (o, r, s, p = 0) => {
|
|
15
|
-
const n = [];
|
|
16
|
-
let t = 0;
|
|
17
|
-
return a.forEach(o, (e) => {
|
|
18
|
-
if (w(e, E) && u(e))
|
|
19
|
-
g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
|
|
20
|
-
else if (u(e) && (e != null && e.props.children)) {
|
|
21
|
-
const { parsedChildren: m, subElementCount: C } = y(
|
|
22
|
-
e.props.children,
|
|
23
|
-
r,
|
|
24
|
-
"",
|
|
25
|
-
p + t
|
|
26
|
-
);
|
|
27
|
-
e = f(e, {
|
|
28
|
-
children: m,
|
|
29
|
-
key: `group-${p + t}`
|
|
30
|
-
}), n.push(e), t += C;
|
|
31
|
-
} else
|
|
32
|
-
n.push(e);
|
|
33
|
-
}), {
|
|
34
|
-
parsedChildren: n,
|
|
35
|
-
subElementCount: t
|
|
36
|
-
};
|
|
37
|
-
};
|
|
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";
|
|
38
2
|
export {
|
|
39
|
-
|
|
40
|
-
w as isReactLeaf,
|
|
41
|
-
y as recursiveMap
|
|
3
|
+
t as FOCUS_OUTLINE
|
|
42
4
|
};
|
|
43
5
|
//# sourceMappingURL=fondue-components84.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components84.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components84.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;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Children as a, isValidElement as u, cloneElement as f } from "react";
|
|
2
|
+
import { ForwardedRefSelectItem as E } from "./fondue-components65.js";
|
|
3
|
+
const g = ({
|
|
4
|
+
children: o,
|
|
5
|
+
value: r,
|
|
6
|
+
label: s
|
|
7
|
+
}) => o && typeof o == "string" ? {
|
|
8
|
+
value: r || o,
|
|
9
|
+
label: s || o
|
|
10
|
+
} : {
|
|
11
|
+
value: r || "",
|
|
12
|
+
label: s || r || "",
|
|
13
|
+
...o ? { children: o } : null
|
|
14
|
+
}, w = (o, r) => u(o) && o.type === r, y = (o, r, s, p = 0) => {
|
|
15
|
+
const n = [];
|
|
16
|
+
let t = 0;
|
|
17
|
+
return a.forEach(o, (e) => {
|
|
18
|
+
if (w(e, E) && u(e))
|
|
19
|
+
g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
|
|
20
|
+
else if (u(e) && (e != null && e.props.children)) {
|
|
21
|
+
const { parsedChildren: m, subElementCount: C } = y(
|
|
22
|
+
e.props.children,
|
|
23
|
+
r,
|
|
24
|
+
"",
|
|
25
|
+
p + t
|
|
26
|
+
);
|
|
27
|
+
e = f(e, {
|
|
28
|
+
children: m,
|
|
29
|
+
key: `group-${p + t}`
|
|
30
|
+
}), n.push(e), t += C;
|
|
31
|
+
} else
|
|
32
|
+
n.push(e);
|
|
33
|
+
}), {
|
|
34
|
+
parsedChildren: n,
|
|
35
|
+
subElementCount: t
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
g as getSelectOptionValue,
|
|
40
|
+
w as isReactLeaf,
|
|
41
|
+
y as recursiveMap
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=fondue-components85.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components85.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, children?: ReactNode }} 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 children?: ReactNode;\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 ...(children ? { children } : null),\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,MAKQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAAA,IAIxB;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AAAA,EAChC,GAAID,IAAW,EAAE,UAAAA,MAAa;AAAA,GAmBzBG,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AAClB,SAAAC,EAAS,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;AAChF,YAAM,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GAC5BQ,KAAeI;AAAA,IACnB;AACI,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAEpC,CAAC,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const o = "_root_1761r_5", t = "_colorName_1761r_55", c = "_button_1761r_63", r = "_colorIndicator_1761r_76", _ = "_actions_1761r_95", a = "_clear_1761r_105", n = "_caret_1761r_118", s = {
|
|
2
|
+
root: o,
|
|
3
|
+
colorName: t,
|
|
4
|
+
button: c,
|
|
5
|
+
colorIndicator: r,
|
|
6
|
+
actions: _,
|
|
7
|
+
clear: a,
|
|
8
|
+
caret: n
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
_ as actions,
|
|
12
|
+
c as button,
|
|
13
|
+
n as caret,
|
|
14
|
+
a as clear,
|
|
15
|
+
r as colorIndicator,
|
|
16
|
+
t as colorName,
|
|
17
|
+
s as default,
|
|
18
|
+
o as root
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=fondue-components86.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components86.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,53 +1,58 @@
|
|
|
1
1
|
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as j } from "@frontify/fondue-icons";
|
|
3
3
|
import * as d from "@radix-ui/react-dialog";
|
|
4
|
-
import { createContext as q, forwardRef as l, useRef as B, useContext as z } from "react";
|
|
5
|
-
import { useSyncRefs as
|
|
6
|
-
import { addShowFocusRing as
|
|
7
|
-
import { useFondueTheme as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
4
|
+
import { createContext as q, forwardRef as l, useRef as B, useContext as z, useMemo as E } from "react";
|
|
5
|
+
import { useSyncRefs as L } from "./fondue-components47.js";
|
|
6
|
+
import { addShowFocusRing as $, addAutoFocusAttribute as k } from "./fondue-components48.js";
|
|
7
|
+
import { useFondueTheme as G, ThemeProvider as I } from "./fondue-components30.js";
|
|
8
|
+
import r from "./fondue-components49.js";
|
|
9
|
+
const m = q({ isModal: !1 });
|
|
10
|
+
m.displayName = "DialogContext";
|
|
11
|
+
const y = ({ children: t, ...e }) => {
|
|
12
|
+
const a = E(() => ({ isModal: e.modal ?? !1 }), [e.modal]);
|
|
13
|
+
return /* @__PURE__ */ o(m.Provider, { value: a, children: /* @__PURE__ */ o(d.Root, { ...e, children: t }) });
|
|
14
|
+
};
|
|
10
15
|
y.displayName = "Dialog.Root";
|
|
11
|
-
const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger", ...i },
|
|
16
|
+
const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger", ...i }, n) => /* @__PURE__ */ o(
|
|
12
17
|
d.Trigger,
|
|
13
18
|
{
|
|
14
|
-
onMouseDown:
|
|
19
|
+
onMouseDown: k,
|
|
15
20
|
"data-auto-focus-visible": "true",
|
|
16
21
|
"data-auto-focus-trigger": !0,
|
|
17
22
|
"data-test-id": a,
|
|
18
23
|
asChild: t,
|
|
19
|
-
ref:
|
|
24
|
+
ref: n,
|
|
20
25
|
...i,
|
|
21
26
|
children: e
|
|
22
27
|
}
|
|
23
28
|
);
|
|
24
29
|
D.displayName = "Dialog.Trigger";
|
|
25
|
-
const
|
|
26
|
-
const { isModal: a } = z(
|
|
27
|
-
return a ? /* @__PURE__ */ o(d.Overlay, { "data-visible": e, className:
|
|
30
|
+
const J = ({ children: t, showUnderlay: e }) => {
|
|
31
|
+
const { isModal: a } = z(m);
|
|
32
|
+
return a ? /* @__PURE__ */ o(d.Overlay, { "data-visible": e, className: r.underlay, children: t }) : /* @__PURE__ */ o("div", { className: r.underlay, "data-visible": e, children: t });
|
|
28
33
|
}, h = ({
|
|
29
34
|
maxWidth: t = "800px",
|
|
30
35
|
minWidth: e = "400px",
|
|
31
36
|
minHeight: a = "200px",
|
|
32
37
|
padding: i = "compact",
|
|
33
|
-
verticalAlign:
|
|
38
|
+
verticalAlign: n = "center",
|
|
34
39
|
"data-test-id": s = "fondue-dialog-content",
|
|
35
40
|
showUnderlay: c = !1,
|
|
36
41
|
rounded: T = !0,
|
|
37
42
|
children: w,
|
|
38
43
|
...S
|
|
39
44
|
}, M) => {
|
|
40
|
-
const A =
|
|
41
|
-
|
|
45
|
+
const A = G(), u = B(null);
|
|
46
|
+
L(u, M);
|
|
42
47
|
const H = (O) => {
|
|
43
|
-
var
|
|
48
|
+
var f;
|
|
44
49
|
O.preventDefault();
|
|
45
|
-
const g = (
|
|
50
|
+
const g = (f = u.current) == null ? void 0 : f.querySelector('[data-dialog-layout-component="body"]'), p = g == null ? void 0 : g.querySelector(
|
|
46
51
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
47
52
|
);
|
|
48
|
-
|
|
53
|
+
p instanceof HTMLElement && p.focus();
|
|
49
54
|
};
|
|
50
|
-
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(
|
|
55
|
+
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(I, { theme: A, children: /* @__PURE__ */ o(J, { showUnderlay: c, children: /* @__PURE__ */ o(
|
|
51
56
|
d.Content,
|
|
52
57
|
{
|
|
53
58
|
style: {
|
|
@@ -56,13 +61,13 @@ const I = ({ children: t, showUnderlay: e }) => {
|
|
|
56
61
|
"--dialog-min-height": a
|
|
57
62
|
},
|
|
58
63
|
ref: u,
|
|
59
|
-
className:
|
|
60
|
-
onFocus:
|
|
64
|
+
className: r.content,
|
|
65
|
+
onFocus: $,
|
|
61
66
|
onOpenAutoFocus: H,
|
|
62
67
|
"data-dialog-padding": i,
|
|
63
68
|
"data-dialog-rounded": T,
|
|
64
69
|
"data-test-id": s,
|
|
65
|
-
"data-dialog-vertical-align":
|
|
70
|
+
"data-dialog-vertical-align": n,
|
|
66
71
|
...S,
|
|
67
72
|
children: w
|
|
68
73
|
}
|
|
@@ -74,19 +79,19 @@ const C = ({
|
|
|
74
79
|
showBorder: e = !0,
|
|
75
80
|
showCloseButton: a = !0,
|
|
76
81
|
closeProps: i,
|
|
77
|
-
children:
|
|
82
|
+
children: n,
|
|
78
83
|
"data-test-id": s = "fondue-dialog-header"
|
|
79
84
|
}, c) => /* @__PURE__ */ P(
|
|
80
85
|
"div",
|
|
81
86
|
{
|
|
82
87
|
"data-test-id": s,
|
|
83
88
|
ref: c,
|
|
84
|
-
className:
|
|
89
|
+
className: r.header,
|
|
85
90
|
"data-dialog-header-padding": t,
|
|
86
91
|
"data-show-border": e,
|
|
87
92
|
"data-dialog-layout-component": "header",
|
|
88
93
|
children: [
|
|
89
|
-
/* @__PURE__ */ o("div", { children:
|
|
94
|
+
/* @__PURE__ */ o("div", { children: n }),
|
|
90
95
|
a && /* @__PURE__ */ o(
|
|
91
96
|
d.Close,
|
|
92
97
|
{
|
|
@@ -102,12 +107,12 @@ const C = ({
|
|
|
102
107
|
}
|
|
103
108
|
);
|
|
104
109
|
C.displayName = "Dialog.Header";
|
|
105
|
-
const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" },
|
|
110
|
+
const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, n) => /* @__PURE__ */ o(
|
|
106
111
|
"div",
|
|
107
112
|
{
|
|
108
113
|
"data-test-id": i,
|
|
109
|
-
ref:
|
|
110
|
-
className:
|
|
114
|
+
ref: n,
|
|
115
|
+
className: r.footer,
|
|
111
116
|
"data-dialog-footer-padding": t,
|
|
112
117
|
"data-show-border": e,
|
|
113
118
|
"data-dialog-layout-component": "footer",
|
|
@@ -120,14 +125,14 @@ const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }
|
|
|
120
125
|
{
|
|
121
126
|
"data-test-id": a,
|
|
122
127
|
ref: i,
|
|
123
|
-
className:
|
|
128
|
+
className: r.body,
|
|
124
129
|
"data-dialog-body-padding": t,
|
|
125
130
|
"data-dialog-layout-component": "body",
|
|
126
131
|
children: e
|
|
127
132
|
}
|
|
128
133
|
);
|
|
129
134
|
b.displayName = "Dialog.Body";
|
|
130
|
-
const v = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className:
|
|
135
|
+
const v = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className: r.sideContent, "data-dialog-layout-component": !0, children: t });
|
|
131
136
|
v.displayName = "Dialog.SideContent";
|
|
132
137
|
const x = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
|
|
133
138
|
x.displayName = "Dialog.Close";
|
|
@@ -135,7 +140,7 @@ const F = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild:
|
|
|
135
140
|
F.displayName = "Dialog.Title";
|
|
136
141
|
const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
|
|
137
142
|
R.displayName = "Dialog.Description";
|
|
138
|
-
const
|
|
143
|
+
const Z = {
|
|
139
144
|
Root: y,
|
|
140
145
|
Title: F,
|
|
141
146
|
Description: R,
|
|
@@ -148,7 +153,7 @@ const Y = {
|
|
|
148
153
|
SideContent: l(v)
|
|
149
154
|
};
|
|
150
155
|
export {
|
|
151
|
-
|
|
156
|
+
Z as Dialog,
|
|
152
157
|
b as DialogBody,
|
|
153
158
|
x as DialogClose,
|
|
154
159
|
h as DialogContent,
|