@frontify/fondue-components 16.0.0 → 16.0.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-components21.js +3 -3
- package/dist/fondue-components24.js +51 -51
- package/dist/fondue-components25.js +4 -4
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components29.js +19 -19
- package/dist/fondue-components3.js +49 -51
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +4 -8
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +5 -5
- package/dist/fondue-components38.js +15 -15
- package/dist/fondue-components39.js +31 -28
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components40.js +13 -13
- package/dist/fondue-components42.js +15 -15
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components54.js +4 -6
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components57.js +3 -3
- package/dist/fondue-components59.js +13 -13
- package/dist/fondue-components6.js +3 -3
- package/dist/fondue-components61.js +8 -8
- package/dist/fondue-components64.js +13 -13
- package/dist/fondue-components66.js +12 -12
- package/dist/fondue-components7.js +37 -34
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components73.js +6 -9
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components77.js +6 -6
- package/dist/fondue-components8.js +3 -3
- package/dist/index.d.ts +15 -7
- package/dist/style.css +1 -1
- package/package.json +54 -54
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Slot as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { ForwardedRefColorGradientInput as
|
|
5
|
-
import { ForwardedRefColorPickerInput as
|
|
6
|
-
import { ForwardedRefColorValueInput as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as P } from "@radix-ui/react-slot";
|
|
3
|
+
import { forwardRef as F, useState as y, useMemo as N, Children as I } from "react";
|
|
4
|
+
import { ForwardedRefColorGradientInput as w } from "./fondue-components38.js";
|
|
5
|
+
import { ForwardedRefColorPickerInput as h } from "./fondue-components39.js";
|
|
6
|
+
import { ForwardedRefColorValueInput as G } from "./fondue-components40.js";
|
|
7
|
+
import V from "./fondue-components41.js";
|
|
8
|
+
import { DEFAULT_FORMAT as g, DEFAULT_COLOR as A, getColorWithName as s } from "./fondue-components42.js";
|
|
9
|
+
const p = ({
|
|
10
10
|
children: t,
|
|
11
|
-
currentColor:
|
|
12
|
-
onColorChange:
|
|
11
|
+
currentColor: r = A,
|
|
12
|
+
onColorChange: i = () => {
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
currentFormat: l,
|
|
15
|
+
onFormatChange: c = () => {
|
|
16
|
+
},
|
|
17
|
+
defaultFormat: n = g,
|
|
18
|
+
"data-test-id": f = "color-picker-input",
|
|
19
|
+
...C
|
|
20
|
+
}, u) => {
|
|
21
|
+
const [d, k] = y(n), m = N(() => l ?? d, [l, d]);
|
|
22
|
+
return /* @__PURE__ */ a("div", { className: V.root, "data-picker-type": "custom-color", "data-test-id": f, ref: u, children: I.map(t, (R) => /* @__PURE__ */ a(
|
|
23
|
+
L,
|
|
21
24
|
{
|
|
22
|
-
...
|
|
23
|
-
onColorChange: (
|
|
24
|
-
|
|
25
|
+
...C,
|
|
26
|
+
onColorChange: (o) => {
|
|
27
|
+
i(s(o, m));
|
|
25
28
|
},
|
|
26
|
-
currentColor:
|
|
27
|
-
currentFormat:
|
|
28
|
-
setCurrentFormat: (
|
|
29
|
-
|
|
29
|
+
currentColor: r,
|
|
30
|
+
currentFormat: m,
|
|
31
|
+
setCurrentFormat: (o) => {
|
|
32
|
+
k(o), c(o), i(s(r, o));
|
|
30
33
|
},
|
|
31
|
-
children:
|
|
34
|
+
children: R
|
|
32
35
|
}
|
|
33
36
|
)) });
|
|
34
37
|
};
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
Root:
|
|
38
|
-
Values:
|
|
39
|
-
Gradient:
|
|
40
|
-
Input:
|
|
38
|
+
p.displayName = "ColorPicker";
|
|
39
|
+
const L = ({ children: t, ...r }) => /* @__PURE__ */ a(P, { ...r, children: t }), M = F(p), e = {
|
|
40
|
+
Root: M,
|
|
41
|
+
Values: G,
|
|
42
|
+
Gradient: w,
|
|
43
|
+
Input: h
|
|
41
44
|
};
|
|
42
45
|
e.Root.displayName = "ColorPicker.Root";
|
|
43
46
|
e.Values.displayName = "ColorPicker.Values";
|
|
@@ -45,7 +48,7 @@ e.Gradient.displayName = "ColorPicker.Gradient";
|
|
|
45
48
|
e.Input.displayName = "ColorPicker.Input";
|
|
46
49
|
export {
|
|
47
50
|
e as ColorPicker,
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
p as ColorPickerRoot,
|
|
52
|
+
M as ForwardedRefColorPicker
|
|
50
53
|
};
|
|
51
54
|
//# sourceMappingURL=fondue-components7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components7.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, 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 default format to use for the color input\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 defaultFormat = DEFAULT_FORMAT,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const [
|
|
1
|
+
{"version":3,"file":"fondue-components7.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,SACK,gBAAAK,EAAA,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;AACnB,QAAAlB,EAAAmB,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,GACdD,EAAAmB,EAAiBrB,GAAcG,CAAa,CAAC;AAAA,MAC/D;AAAA,MAEC,UAAAe;AAAA,IAAA;AAAA,EAER,CAAA,GACL;AAER;AACApB,EAAgB,cAAc;AAM9B,MAAMqB,IAAkB,CAAC,EAAE,UAAApB,GAAU,GAAGS,EAAM,MAA6B,gBAAAO,EAAAO,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,21 +1,18 @@
|
|
|
1
|
-
const o = "_root_kjbh5_5", t = "_input_kjbh5_59", s = "_slot_kjbh5_82",
|
|
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
2
|
root: o,
|
|
3
3
|
input: t,
|
|
4
4
|
slot: s,
|
|
5
|
-
iconSuccess:
|
|
5
|
+
iconSuccess: c,
|
|
6
6
|
iconError: n,
|
|
7
|
-
loadingStatus:
|
|
8
|
-
spin: i,
|
|
9
|
-
"tw-dark": "_tw-dark_kjbh5_187"
|
|
7
|
+
loadingStatus: _
|
|
10
8
|
};
|
|
11
9
|
export {
|
|
12
10
|
r as default,
|
|
13
11
|
n as iconError,
|
|
14
|
-
|
|
12
|
+
c as iconSuccess,
|
|
15
13
|
t as input,
|
|
16
|
-
|
|
14
|
+
_ as loadingStatus,
|
|
17
15
|
o as root,
|
|
18
|
-
s as slot
|
|
19
|
-
i as spin
|
|
16
|
+
s as slot
|
|
20
17
|
};
|
|
21
18
|
//# sourceMappingURL=fondue-components73.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components73.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components73.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_18mav_5", t = "_colorName_18mav_56", c = "_button_18mav_60", a = "_colorIndicator_18mav_73", _ = "_actions_18mav_92", r = "_clear_18mav_102", n = "_caret_18mav_115", s = {
|
|
2
2
|
root: o,
|
|
3
3
|
colorName: t,
|
|
4
4
|
button: c,
|
|
5
|
-
colorIndicator:
|
|
5
|
+
colorIndicator: a,
|
|
6
6
|
actions: _,
|
|
7
7
|
clear: r,
|
|
8
|
-
caret:
|
|
8
|
+
caret: n
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
11
|
_ as actions,
|
|
12
12
|
c as button,
|
|
13
|
-
|
|
13
|
+
n as caret,
|
|
14
14
|
r as clear,
|
|
15
|
-
|
|
15
|
+
a as colorIndicator,
|
|
16
16
|
t as colorName,
|
|
17
|
-
|
|
17
|
+
s as default,
|
|
18
18
|
o as root
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components77.js.map
|
|
@@ -3,7 +3,7 @@ import { IconCross as j } from "@frontify/fondue-icons";
|
|
|
3
3
|
import * as d from "@radix-ui/react-dialog";
|
|
4
4
|
import { createContext as q, forwardRef as l, useRef as B, useContext as z } from "react";
|
|
5
5
|
import { useSyncRefs as E } from "./fondue-components43.js";
|
|
6
|
-
import {
|
|
6
|
+
import { addShowFocusRing as L, addAutoFocusAttribute as $ } from "./fondue-components44.js";
|
|
7
7
|
import { useFondueTheme as k, ThemeProvider as G } from "./fondue-components28.js";
|
|
8
8
|
import n from "./fondue-components45.js";
|
|
9
9
|
const p = q({ isModal: !1 }), f = ({ children: t, ...o }) => /* @__PURE__ */ e(p.Provider, { value: { isModal: o.modal ?? !1 }, children: /* @__PURE__ */ e(d.Root, { ...o, children: t }) });
|
|
@@ -11,7 +11,7 @@ f.displayName = "Dialog.Root";
|
|
|
11
11
|
const y = ({ asChild: t = !0, children: o, "data-test-id": a = "fondue-dialog-trigger", ...i }, r) => /* @__PURE__ */ e(
|
|
12
12
|
d.Trigger,
|
|
13
13
|
{
|
|
14
|
-
onMouseDown:
|
|
14
|
+
onMouseDown: $,
|
|
15
15
|
"data-auto-focus-visible": "true",
|
|
16
16
|
"data-auto-focus-trigger": !0,
|
|
17
17
|
"data-test-id": a,
|
|
@@ -57,7 +57,7 @@ const I = ({ children: t, showUnderlay: o }) => {
|
|
|
57
57
|
},
|
|
58
58
|
ref: c,
|
|
59
59
|
className: n.content,
|
|
60
|
-
onFocus:
|
|
60
|
+
onFocus: L,
|
|
61
61
|
onOpenAutoFocus: H,
|
|
62
62
|
"data-dialog-padding": i,
|
|
63
63
|
"data-dialog-rounded": T,
|
package/dist/index.d.ts
CHANGED
|
@@ -24,11 +24,11 @@ export declare const Accordion: {
|
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
Item: {
|
|
27
|
-
({ "data-test-id": dataTestId, children, disabled,
|
|
27
|
+
({ "data-test-id": dataTestId, children, disabled, value, }: AccordionItemProps): JSX_2.Element;
|
|
28
28
|
displayName: string;
|
|
29
29
|
};
|
|
30
30
|
Header: {
|
|
31
|
-
({ children }: AccordionHeaderProps): JSX_2.Element;
|
|
31
|
+
({ onClick, children }: AccordionHeaderProps): JSX_2.Element;
|
|
32
32
|
displayName: string;
|
|
33
33
|
};
|
|
34
34
|
Trigger: {
|
|
@@ -63,6 +63,10 @@ declare type AccordionContentProps = {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
declare type AccordionHeaderProps = {
|
|
66
|
+
/**
|
|
67
|
+
* Click callback for this item.
|
|
68
|
+
*/
|
|
69
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
66
70
|
/**
|
|
67
71
|
* Children of the Accordion header. This should contain `Accordion.Trigger`
|
|
68
72
|
*/
|
|
@@ -81,10 +85,6 @@ declare type AccordionItemProps = {
|
|
|
81
85
|
* @default false
|
|
82
86
|
*/
|
|
83
87
|
disabled?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Click callback for this item.
|
|
86
|
-
*/
|
|
87
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
88
88
|
/**
|
|
89
89
|
* A string value for the accordion item. All items within an accordion should use a unique value.
|
|
90
90
|
*/
|
|
@@ -353,7 +353,15 @@ declare type ColorPickerProps = {
|
|
|
353
353
|
*/
|
|
354
354
|
onColorChange?: (color: RgbaColor) => void;
|
|
355
355
|
/**
|
|
356
|
-
* The
|
|
356
|
+
* The active color format in the color picker
|
|
357
|
+
*/
|
|
358
|
+
currentFormat?: ColorFormat;
|
|
359
|
+
/**
|
|
360
|
+
* Event handler called when the color format changes
|
|
361
|
+
*/
|
|
362
|
+
onFormatChange?: (format: ColorFormat) => void;
|
|
363
|
+
/**
|
|
364
|
+
* The default format to use for the color input when not controlled externally
|
|
357
365
|
* @default "HEX"
|
|
358
366
|
*/
|
|
359
367
|
defaultFormat?: ColorFormat;
|