@frontify/fondue-components 8.0.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components22.js +34 -32
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components28.js +2 -2
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components33.js +15 -15
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components38.js +14 -14
- package/dist/fondue-components4.js +20 -18
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components41.js +4 -4
- package/dist/fondue-components43.js +10 -10
- package/dist/fondue-components54.js +22 -22
- package/dist/fondue-components56.js +6 -6
- package/dist/fondue-components57.js +9 -9
- package/dist/fondue-components60.js +10 -10
- package/dist/fondue-components63.js +7 -7
- package/dist/fondue-components64.js +15 -15
- package/dist/fondue-components66.js +15 -2
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +2 -15
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components7.js +94 -81
- package/dist/fondue-components7.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { createContext as x, forwardRef as i, useCallback as
|
|
3
|
-
import { IconDotsHorizontal as
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, forwardRef as i, useCallback as A, createElement as N, useContext as b, useRef as D, useEffect as E } from "react";
|
|
3
|
+
import { IconDotsHorizontal as O } from "@frontify/fondue-icons";
|
|
4
4
|
import * as d from "@radix-ui/react-tabs";
|
|
5
|
-
import { useControllableState as
|
|
6
|
-
import { Button as
|
|
5
|
+
import { useControllableState as V } from "./fondue-components48.js";
|
|
6
|
+
import { Button as q } from "./fondue-components4.js";
|
|
7
7
|
import { Dropdown as l } from "./fondue-components9.js";
|
|
8
|
-
import { useTabTriggers as
|
|
8
|
+
import { useTabTriggers as B } from "./fondue-components62.js";
|
|
9
9
|
import r from "./fondue-components63.js";
|
|
10
|
-
const
|
|
10
|
+
const T = x({
|
|
11
11
|
value: "",
|
|
12
12
|
disabled: !1
|
|
13
13
|
}), w = x({
|
|
14
14
|
addTrigger: () => {
|
|
15
15
|
}
|
|
16
16
|
}), y = ({
|
|
17
|
-
|
|
17
|
+
padding: t = "compact",
|
|
18
18
|
activeTab: o,
|
|
19
19
|
defaultActiveTab: s,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
size: n = "medium",
|
|
21
|
+
onActiveTabChange: c,
|
|
22
|
+
children: m,
|
|
23
|
+
...p
|
|
24
|
+
}, k) => {
|
|
24
25
|
var R;
|
|
25
|
-
const [f, v] =
|
|
26
|
+
const [f, v] = V({
|
|
26
27
|
prop: o,
|
|
27
28
|
defaultProp: s,
|
|
28
|
-
onChange:
|
|
29
|
-
}), g =
|
|
29
|
+
onChange: c
|
|
30
|
+
}), g = A(
|
|
30
31
|
(e) => {
|
|
31
32
|
v(e);
|
|
32
33
|
},
|
|
33
34
|
[v]
|
|
34
|
-
), { triggerListRef:
|
|
35
|
+
), { triggerListRef: P, activeIndicatorRef: S, triggers: C, triggersOutOfView: h, addTrigger: j } = B({
|
|
35
36
|
activeTab: f
|
|
36
37
|
});
|
|
37
|
-
return /* @__PURE__ */ a(w.Provider, { value: { addTrigger:
|
|
38
|
+
return /* @__PURE__ */ a(w.Provider, { value: { addTrigger: j }, children: /* @__PURE__ */ u(
|
|
38
39
|
d.Root,
|
|
39
40
|
{
|
|
40
|
-
ref:
|
|
41
|
+
ref: k,
|
|
41
42
|
className: r.root,
|
|
42
43
|
onValueChange: g,
|
|
43
44
|
value: f ?? ((R = C[0]) == null ? void 0 : R.value),
|
|
44
|
-
|
|
45
|
+
"data-tabs-content-padding": t,
|
|
46
|
+
...p,
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ a(d.List, { ref:
|
|
48
|
+
/* @__PURE__ */ u("div", { className: r.triggerListWrapper, children: [
|
|
49
|
+
/* @__PURE__ */ a(d.List, { ref: P, "data-size": n, className: r.triggerList, children: C.map((e) => /* @__PURE__ */ N(
|
|
48
50
|
d.Trigger,
|
|
49
51
|
{
|
|
50
52
|
...e.props,
|
|
@@ -56,8 +58,8 @@ const b = x({
|
|
|
56
58
|
},
|
|
57
59
|
e.element
|
|
58
60
|
)) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
h.length > 0 && /* @__PURE__ */ a(l.Trigger, { "data-test-id": "overflow-items-dropdown-trigger", children: /* @__PURE__ */ a(
|
|
61
|
+
/* @__PURE__ */ u(l.Root, { children: [
|
|
62
|
+
h.length > 0 && /* @__PURE__ */ a(l.Trigger, { "data-test-id": "overflow-items-dropdown-trigger", children: /* @__PURE__ */ a(q, { emphasis: "default", aspect: "square", size: "small", children: /* @__PURE__ */ a(O, { size: 16 }) }) }),
|
|
61
63
|
/* @__PURE__ */ a(l.Content, { align: "end", "data-test-id": "overflow-items-dropdown-content", children: h.map((e) => /* @__PURE__ */ N(
|
|
62
64
|
l.Item,
|
|
63
65
|
{
|
|
@@ -73,24 +75,24 @@ const b = x({
|
|
|
73
75
|
"span",
|
|
74
76
|
{
|
|
75
77
|
"data-test-id": "active-tab-indicator",
|
|
76
|
-
ref:
|
|
78
|
+
ref: S,
|
|
77
79
|
className: r.activeIndicator
|
|
78
80
|
}
|
|
79
81
|
)
|
|
80
82
|
] }),
|
|
81
|
-
|
|
83
|
+
m
|
|
82
84
|
]
|
|
83
85
|
}
|
|
84
86
|
) });
|
|
85
87
|
};
|
|
86
88
|
y.displayName = "Tabs.Root";
|
|
87
|
-
const z = ({ children: t, value: o, disabled: s }) => /* @__PURE__ */ a(
|
|
89
|
+
const z = ({ children: t, value: o, disabled: s }) => /* @__PURE__ */ a(T.Provider, { value: { value: o, disabled: s }, children: t });
|
|
88
90
|
z.displayName = "Tabs.Tab";
|
|
89
91
|
const I = ({ children: t, ...o }, s) => {
|
|
90
|
-
const { value: n, disabled: c } = T
|
|
91
|
-
return
|
|
92
|
+
const { value: n, disabled: c } = b(T), { addTrigger: m } = b(w), p = D(null);
|
|
93
|
+
return E(() => {
|
|
92
94
|
m({
|
|
93
|
-
ref:
|
|
95
|
+
ref: p || s,
|
|
94
96
|
value: n ?? "",
|
|
95
97
|
disabled: c,
|
|
96
98
|
props: o,
|
|
@@ -100,18 +102,18 @@ const I = ({ children: t, ...o }, s) => {
|
|
|
100
102
|
};
|
|
101
103
|
I.displayName = "Tabs.Trigger";
|
|
102
104
|
const L = ({ children: t, ...o }, s) => {
|
|
103
|
-
const { value: n } = T
|
|
105
|
+
const { value: n } = b(T);
|
|
104
106
|
return /* @__PURE__ */ a(d.Content, { ref: s, ...o, className: r.content, value: n ?? "", children: t });
|
|
105
107
|
};
|
|
106
108
|
L.displayName = "Tabs.Content";
|
|
107
|
-
const
|
|
109
|
+
const U = {
|
|
108
110
|
Root: i(y),
|
|
109
111
|
Tab: i(z),
|
|
110
112
|
Trigger: i(I),
|
|
111
113
|
Content: i(L)
|
|
112
114
|
};
|
|
113
115
|
export {
|
|
114
|
-
|
|
116
|
+
U as Tabs,
|
|
115
117
|
L as TabsContent,
|
|
116
118
|
y as TabsRoot,
|
|
117
119
|
z as TabsTab,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Tabs/Tabs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDotsHorizontal } from '@frontify/fondue-icons';\nimport * as RadixTabs from '@radix-ui/react-tabs';\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport { Button } from '../Button/Button';\nimport { Dropdown } from '../Dropdown/Dropdown';\n\nimport { useTabTriggers } from './hooks/useTabTriggers';\nimport styles from './styles/tabs.module.scss';\nimport { type TabTrigger } from './types';\n\nexport type TabsRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default active tab\n * Used for uncontrolled components\n */\n defaultActiveTab?: string;\n /**\n * The controlled value of the active tab\n */\n activeTab?: string;\n /**\n * The height of the tabs\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /**\n * Event handler called when the active tab changes\n */\n onActiveTabChange?: (value: string) => void;\n};\n\nconst TabConfigContext = createContext<{\n value: string;\n disabled?: boolean;\n}>({\n value: '',\n disabled: false,\n});\n\nconst TabTriggerContext = createContext<{\n addTrigger: (trigger: TabTrigger) => void;\n}>({\n addTrigger: () => {},\n});\n\nexport const TabsRoot = (\n {\n children,\n activeTab: propsActiveTab,\n defaultActiveTab,\n onActiveTabChange,\n size = 'medium',\n ...props\n }: TabsRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [activeTab, setActiveTab] = useControllableState({\n prop: propsActiveTab,\n defaultProp: defaultActiveTab,\n onChange: onActiveTabChange,\n });\n\n const handleSetActiveTab = useCallback(\n (value: string) => {\n setActiveTab(value);\n },\n [setActiveTab],\n );\n\n const { triggerListRef, activeIndicatorRef, triggers, triggersOutOfView, addTrigger } = useTabTriggers({\n activeTab,\n });\n\n return (\n <TabTriggerContext.Provider value={{ addTrigger }}>\n <RadixTabs.Root\n ref={ref}\n className={styles.root}\n onValueChange={handleSetActiveTab}\n value={activeTab ?? triggers[0]?.value}\n {...props}\n >\n <div className={styles.triggerListWrapper}>\n <RadixTabs.List ref={triggerListRef} data-size={size} className={styles.triggerList}>\n {triggers.map((trigger) => (\n <RadixTabs.Trigger\n {...trigger.props}\n key={trigger.value}\n value={trigger.value}\n disabled={trigger.disabled}\n className={styles.trigger}\n ref={trigger.ref}\n >\n {trigger.element}\n </RadixTabs.Trigger>\n ))}\n </RadixTabs.List>\n <Dropdown.Root>\n {triggersOutOfView.length > 0 && (\n <Dropdown.Trigger data-test-id=\"overflow-items-dropdown-trigger\">\n <Button emphasis=\"default\" aspect=\"square\" size=\"small\">\n <IconDotsHorizontal size={16} />\n </Button>\n </Dropdown.Trigger>\n )}\n <Dropdown.Content align=\"end\" data-test-id=\"overflow-items-dropdown-content\">\n {triggersOutOfView.map((trigger) => (\n <Dropdown.Item\n {...trigger.props}\n disabled={trigger.disabled}\n onSelect={() => handleSetActiveTab(trigger.value)}\n key={trigger.value}\n >\n {trigger.element}\n </Dropdown.Item>\n ))}\n </Dropdown.Content>\n </Dropdown.Root>\n <span\n data-test-id=\"active-tab-indicator\"\n ref={activeIndicatorRef}\n className={styles.activeIndicator}\n />\n </div>\n {children}\n </RadixTabs.Root>\n </TabTriggerContext.Provider>\n );\n};\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsTabProps = {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n};\n\nexport const TabsTab = ({ children, value, disabled }: TabsTabProps) => (\n <TabConfigContext.Provider value={{ value, disabled }}>{children}</TabConfigContext.Provider>\n);\nTabsTab.displayName = 'Tabs.Tab';\n\ntype TabsTriggerProps = {\n children: ReactNode;\n};\n\nexport const TabsTrigger = ({ children, ...props }: TabsTriggerProps, ref: ForwardedRef<HTMLButtonElement>) => {\n const { value, disabled } = useContext(TabConfigContext);\n\n const { addTrigger } = useContext(TabTriggerContext);\n\n const localRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n addTrigger({\n ref: localRef || ref,\n value: value ?? '',\n disabled,\n props,\n element: children,\n });\n }, []);\n\n return null;\n};\nTabsTrigger.displayName = 'Tabs.Trigger';\n\ntype TabsContentProps = {\n children: ReactNode;\n};\n\nexport const TabsContent = ({ children, ...itemProps }: TabsContentProps, ref: ForwardedRef<HTMLDivElement>) => {\n const { value } = useContext(TabConfigContext);\n\n return (\n <RadixTabs.Content ref={ref} {...itemProps} className={styles.content} value={value ?? ''}>\n {children}\n </RadixTabs.Content>\n );\n};\nTabsContent.displayName = 'Tabs.Content';\n\nexport const Tabs = {\n Root: forwardRef<HTMLDivElement, TabsRootProps>(TabsRoot),\n Tab: forwardRef<HTMLDivElement, TabsTabProps>(TabsTab),\n Trigger: forwardRef<HTMLButtonElement, TabsTriggerProps>(TabsTrigger),\n Content: forwardRef<HTMLDivElement, TabsContentProps>(TabsContent),\n};\n"],"names":["TabConfigContext","createContext","TabTriggerContext","TabsRoot","children","propsActiveTab","defaultActiveTab","onActiveTabChange","size","props","ref","activeTab","setActiveTab","useControllableState","handleSetActiveTab","useCallback","value","triggerListRef","activeIndicatorRef","triggers","triggersOutOfView","addTrigger","useTabTriggers","jsxs","RadixTabs","styles","_a","jsx","trigger","createElement","Dropdown","Button","IconDotsHorizontal","TabsTab","disabled","TabsTrigger","useContext","localRef","useRef","useEffect","TabsContent","itemProps","Tabs","forwardRef"],"mappings":";;;;;;;;;AA+CA,MAAMA,IAAmBC,EAGtB;AAAA,EACC,OAAO;AAAA,EACP,UAAU;AACd,CAAC,GAEKC,IAAoBD,EAEvB;AAAA,EACC,YAAY,MAAM;AAAA,EAAA;AACtB,CAAC,GAEYE,IAAW,CACpB;AAAA,EACI,UAAAC;AAAA,EACA,WAAWC;AAAA,EACX,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACP,GACAC,MACC;;AACD,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAqB;AAAA,IACnD,MAAMR;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb,GAEKO,IAAqBC;AAAA,IACvB,CAACC,MAAkB;AACf,MAAAJ,EAAaI,CAAK;AAAA,IACtB;AAAA,IACA,CAACJ,CAAY;AAAA,EACjB,GAEM,EAAE,gBAAAK,GAAgB,oBAAAC,GAAoB,UAAAC,GAAU,mBAAAC,GAAmB,YAAAC,MAAeC,EAAe;AAAA,IACnG,WAAAX;AAAA,EAAA,CACH;AAED,2BACKT,EAAkB,UAAl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AEnB,MAAME,IAAO;AAAA,EAChB,MAAMC,EAA0CxC,CAAQ;AAAA,EACxD,KAAKwC,EAAyCV,CAAO;AAAA,EACrD,SAASU,EAAgDR,CAAW;AAAA,EACpE,SAASQ,EAA6CH,CAAW;AACrE;"}
|
|
1
|
+
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Tabs/Tabs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDotsHorizontal } from '@frontify/fondue-icons';\nimport * as RadixTabs from '@radix-ui/react-tabs';\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport { Button } from '../Button/Button';\nimport { Dropdown } from '../Dropdown/Dropdown';\n\nimport { useTabTriggers } from './hooks/useTabTriggers';\nimport styles from './styles/tabs.module.scss';\nimport { type TabTrigger } from './types';\n\nexport type TabsRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The default active tab\n * Used for uncontrolled components\n */\n defaultActiveTab?: string;\n /**\n * The controlled value of the active tab\n */\n activeTab?: string;\n /**\n * The height of the tabs\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /**\n * Event handler called when the active tab changes\n */\n onActiveTabChange?: (value: string) => void;\n};\n\nconst TabConfigContext = createContext<{\n value: string;\n disabled?: boolean;\n}>({\n value: '',\n disabled: false,\n});\n\nconst TabTriggerContext = createContext<{\n addTrigger: (trigger: TabTrigger) => void;\n}>({\n addTrigger: () => {},\n});\n\nexport const TabsRoot = (\n {\n padding = 'compact',\n activeTab: propsActiveTab,\n defaultActiveTab,\n size = 'medium',\n onActiveTabChange,\n children,\n ...props\n }: TabsRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [activeTab, setActiveTab] = useControllableState({\n prop: propsActiveTab,\n defaultProp: defaultActiveTab,\n onChange: onActiveTabChange,\n });\n\n const handleSetActiveTab = useCallback(\n (value: string) => {\n setActiveTab(value);\n },\n [setActiveTab],\n );\n\n const { triggerListRef, activeIndicatorRef, triggers, triggersOutOfView, addTrigger } = useTabTriggers({\n activeTab,\n });\n\n return (\n <TabTriggerContext.Provider value={{ addTrigger }}>\n <RadixTabs.Root\n ref={ref}\n className={styles.root}\n onValueChange={handleSetActiveTab}\n value={activeTab ?? triggers[0]?.value}\n data-tabs-content-padding={padding}\n {...props}\n >\n <div className={styles.triggerListWrapper}>\n <RadixTabs.List ref={triggerListRef} data-size={size} className={styles.triggerList}>\n {triggers.map((trigger) => (\n <RadixTabs.Trigger\n {...trigger.props}\n key={trigger.value}\n value={trigger.value}\n disabled={trigger.disabled}\n className={styles.trigger}\n ref={trigger.ref}\n >\n {trigger.element}\n </RadixTabs.Trigger>\n ))}\n </RadixTabs.List>\n <Dropdown.Root>\n {triggersOutOfView.length > 0 && (\n <Dropdown.Trigger data-test-id=\"overflow-items-dropdown-trigger\">\n <Button emphasis=\"default\" aspect=\"square\" size=\"small\">\n <IconDotsHorizontal size={16} />\n </Button>\n </Dropdown.Trigger>\n )}\n <Dropdown.Content align=\"end\" data-test-id=\"overflow-items-dropdown-content\">\n {triggersOutOfView.map((trigger) => (\n <Dropdown.Item\n {...trigger.props}\n disabled={trigger.disabled}\n onSelect={() => handleSetActiveTab(trigger.value)}\n key={trigger.value}\n >\n {trigger.element}\n </Dropdown.Item>\n ))}\n </Dropdown.Content>\n </Dropdown.Root>\n <span\n data-test-id=\"active-tab-indicator\"\n ref={activeIndicatorRef}\n className={styles.activeIndicator}\n />\n </div>\n {children}\n </RadixTabs.Root>\n </TabTriggerContext.Provider>\n );\n};\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsTabProps = {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n};\n\nexport const TabsTab = ({ children, value, disabled }: TabsTabProps) => (\n <TabConfigContext.Provider value={{ value, disabled }}>{children}</TabConfigContext.Provider>\n);\nTabsTab.displayName = 'Tabs.Tab';\n\ntype TabsTriggerProps = {\n children: ReactNode;\n};\n\nexport const TabsTrigger = ({ children, ...props }: TabsTriggerProps, ref: ForwardedRef<HTMLButtonElement>) => {\n const { value, disabled } = useContext(TabConfigContext);\n\n const { addTrigger } = useContext(TabTriggerContext);\n\n const localRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n addTrigger({\n ref: localRef || ref,\n value: value ?? '',\n disabled,\n props,\n element: children,\n });\n }, []);\n\n return null;\n};\nTabsTrigger.displayName = 'Tabs.Trigger';\n\ntype TabsContentProps = {\n children: ReactNode;\n};\n\nexport const TabsContent = ({ children, ...itemProps }: TabsContentProps, ref: ForwardedRef<HTMLDivElement>) => {\n const { value } = useContext(TabConfigContext);\n\n return (\n <RadixTabs.Content ref={ref} {...itemProps} className={styles.content} value={value ?? ''}>\n {children}\n </RadixTabs.Content>\n );\n};\nTabsContent.displayName = 'Tabs.Content';\n\nexport const Tabs = {\n Root: forwardRef<HTMLDivElement, TabsRootProps>(TabsRoot),\n Tab: forwardRef<HTMLDivElement, TabsTabProps>(TabsTab),\n Trigger: forwardRef<HTMLButtonElement, TabsTriggerProps>(TabsTrigger),\n Content: forwardRef<HTMLDivElement, TabsContentProps>(TabsContent),\n};\n"],"names":["TabConfigContext","createContext","TabTriggerContext","TabsRoot","padding","propsActiveTab","defaultActiveTab","size","onActiveTabChange","children","props","ref","activeTab","setActiveTab","useControllableState","handleSetActiveTab","useCallback","value","triggerListRef","activeIndicatorRef","triggers","triggersOutOfView","addTrigger","useTabTriggers","jsxs","RadixTabs","styles","_a","jsx","trigger","createElement","Dropdown","Button","IconDotsHorizontal","TabsTab","disabled","TabsTrigger","useContext","localRef","useRef","useEffect","TabsContent","itemProps","Tabs","forwardRef"],"mappings":";;;;;;;;;AAoDA,MAAMA,IAAmBC,EAGtB;AAAA,EACC,OAAO;AAAA,EACP,UAAU;AACd,CAA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G,QAAM,EAAE,OAAAM,GAAO,UAAAkB,MAAaE,EAAWrC,CAAgB,GAEjD,EAAE,YAAAsB,EAAA,IAAee,EAAWnC,CAAiB,GAE7CoC,IAAWC,EAA0B,IAAI;AAE/C,SAAAC,EAAU,MAAM;AACD,IAAAlB,EAAA;AAAA,MACP,KAAKgB,KAAY3B;AAAA,MACjB,OAAOM,KAAS;AAAA,MAChB,UAAAkB;AAAA,MACA,OAAAzB;AAAA,MACA,SAASD;AAAA,IAAA,CACZ;AAAA,EACL,GAAG,EAAE,GAEE;AACX;AACA2B,EAAY,cAAc;AAMnB,MAAMK,IAAc,CAAC,EAAE,UAAAhC,GAAU,GAAGiC,EAAA,GAA+B/B,MAAsC;AAC5G,QAAM,EAAE,OAAAM,EAAA,IAAUoB,EAAWrC,CAAgB;AAE7C,SACK,gBAAA4B,EAAAH,EAAU,SAAV,EAAkB,KAAAd,GAAW,GAAG+B,GAAW,WAAWhB,EAAO,SAAS,OAAOT,KAAS,IAClF,UAAAR,EACL,CAAA;AAER;AACAgC,EAAY,cAAc;AAEnB,MAAME,IAAO;AAAA,EAChB,MAAMC,EAA0CzC,CAAQ;AAAA,EACxD,KAAKyC,EAAyCV,CAAO;AAAA,EACrD,SAASU,EAAgDR,CAAW;AAAA,EACpE,SAASQ,EAA6CH,CAAW;AACrE;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components67.js";
|
|
2
2
|
import { sv as e } from "./fondue-components27.js";
|
|
3
3
|
const o = e({
|
|
4
|
-
base: `tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium ${t}`,
|
|
4
|
+
base: `tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium tw-box-border ${t}`,
|
|
5
5
|
variants: {
|
|
6
6
|
disabled: {
|
|
7
7
|
true: "tw-not-allowed tw-pointer-events-none tw-text-box-disabled-inverse tw-bg-box-disabled"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components28.js","sources":["../src/components/Button/styles/buttonStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_OUTLINE } from '#/utilities/focusStyle';\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const buttonStyles = sv({\n base:\n 'tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium ' +\n `${FOCUS_OUTLINE}`,\n variants: {\n disabled: {\n true: 'tw-not-allowed tw-pointer-events-none tw-text-box-disabled-inverse tw-bg-box-disabled',\n },\n rounding: {\n medium: 'tw-rounded',\n full: 'tw-rounded-full',\n },\n size: {\n small: 'tw-h-6 tw-text-body-small',\n medium: 'tw-h-9 tw-text-body-medium',\n large: 'tw-h-12 tw-text-body-large',\n },\n aspect: {\n square: 'tw-aspect-square tw-px-0',\n default: '',\n },\n hugWidth: {\n false: 'tw-w-full',\n },\n emphasis: {\n default: '',\n weak: '',\n strong: '',\n },\n variant: {\n default: '',\n positive: '',\n negative: '',\n danger: '',\n loud: '',\n },\n },\n compoundVariants: [\n {\n disabled: false,\n variant: 'default',\n emphasis: 'default',\n class:\n 'tw-bg-button-background ' +\n 'hover:tw-bg-button-background-hover ' +\n 'active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'default',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'default',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-background ' +\n 'hover:tw-bg-button-strong-background-hover ' +\n 'active:tw-bg-button-strong-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'default',\n class:\n 'tw-bg-button-positive-background ' +\n 'hover:tw-bg-button-positive-background-hover ' +\n 'active:tw-bg-button-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-positive-background-hover active:tw-bg-button-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-positive-background ' +\n 'hover:tw-bg-button-strong-positive-background-hover ' +\n 'active:tw-bg-button-strong-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'default',\n class:\n 'tw-bg-button-negative-background ' +\n 'hover:tw-bg-button-negative-background-hover ' +\n 'active:tw-bg-button-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-negative-background-hover active:tw-bg-button-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-negative-background ' +\n 'hover:tw-bg-button-strong-negative-background-hover ' +\n 'active:tw-bg-button-strong-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'default',\n class:\n 'tw-bg-button-background ' +\n 'hover:tw-bg-button-background-hover ' +\n 'active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'strong',\n class:\n 'tw-bg-button-danger-background ' +\n 'hover:tw-bg-button-danger-background-hover ' +\n 'active:tw-bg-button-danger-background-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'default',\n class: 'tw-bg-box-selected hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'weak',\n class: 'tw-border-transparent hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'strong',\n class:\n 'tw-bg-box-selected-strong ' +\n 'hover:tw-bg-box-selected-strong-hover ' +\n 'active:tw-bg-box-selected-strong-pressed ',\n },\n {\n aspect: 'default',\n size: 'small',\n class: 'tw-px-2',\n },\n {\n aspect: 'default',\n size: 'medium',\n class: 'tw-px-4',\n },\n {\n aspect: 'default',\n size: 'large',\n class: 'tw-px-6',\n },\n ],\n defaultVariants: {\n variant: 'default',\n emphasis: 'strong',\n size: 'medium',\n rounding: 'medium',\n hugWidth: true,\n aspect: 'default',\n disabled: false,\n },\n});\n"],"names":["buttonStyles","sv","FOCUS_OUTLINE"],"mappings":";;AAKO,MAAMA,IAAeC,EAAG;AAAA,EAC3B,MACI,
|
|
1
|
+
{"version":3,"file":"fondue-components28.js","sources":["../src/components/Button/styles/buttonStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_OUTLINE } from '#/utilities/focusStyle';\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const buttonStyles = sv({\n base:\n 'tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium tw-box-border ' +\n `${FOCUS_OUTLINE}`,\n variants: {\n disabled: {\n true: 'tw-not-allowed tw-pointer-events-none tw-text-box-disabled-inverse tw-bg-box-disabled',\n },\n rounding: {\n medium: 'tw-rounded',\n full: 'tw-rounded-full',\n },\n size: {\n small: 'tw-h-6 tw-text-body-small',\n medium: 'tw-h-9 tw-text-body-medium',\n large: 'tw-h-12 tw-text-body-large',\n },\n aspect: {\n square: 'tw-aspect-square tw-px-0',\n default: '',\n },\n hugWidth: {\n false: 'tw-w-full',\n },\n emphasis: {\n default: '',\n weak: '',\n strong: '',\n },\n variant: {\n default: '',\n positive: '',\n negative: '',\n danger: '',\n loud: '',\n },\n },\n compoundVariants: [\n {\n disabled: false,\n variant: 'default',\n emphasis: 'default',\n class:\n 'tw-bg-button-background ' +\n 'hover:tw-bg-button-background-hover ' +\n 'active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'default',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'default',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-background ' +\n 'hover:tw-bg-button-strong-background-hover ' +\n 'active:tw-bg-button-strong-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'default',\n class:\n 'tw-bg-button-positive-background ' +\n 'hover:tw-bg-button-positive-background-hover ' +\n 'active:tw-bg-button-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-positive-background-hover active:tw-bg-button-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'positive',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-positive-background ' +\n 'hover:tw-bg-button-strong-positive-background-hover ' +\n 'active:tw-bg-button-strong-positive-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'default',\n class:\n 'tw-bg-button-negative-background ' +\n 'hover:tw-bg-button-negative-background-hover ' +\n 'active:tw-bg-button-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-negative-background-hover active:tw-bg-button-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'negative',\n emphasis: 'strong',\n class:\n 'tw-bg-button-strong-negative-background ' +\n 'hover:tw-bg-button-strong-negative-background-hover ' +\n 'active:tw-bg-button-strong-negative-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'default',\n class:\n 'tw-bg-button-background ' +\n 'hover:tw-bg-button-background-hover ' +\n 'active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'weak',\n class: 'hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed',\n },\n {\n disabled: false,\n variant: 'danger',\n emphasis: 'strong',\n class:\n 'tw-bg-button-danger-background ' +\n 'hover:tw-bg-button-danger-background-hover ' +\n 'active:tw-bg-button-danger-background-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'default',\n class: 'tw-bg-box-selected hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'weak',\n class: 'tw-border-transparent hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed',\n },\n {\n disabled: false,\n variant: 'loud',\n emphasis: 'strong',\n class:\n 'tw-bg-box-selected-strong ' +\n 'hover:tw-bg-box-selected-strong-hover ' +\n 'active:tw-bg-box-selected-strong-pressed ',\n },\n {\n aspect: 'default',\n size: 'small',\n class: 'tw-px-2',\n },\n {\n aspect: 'default',\n size: 'medium',\n class: 'tw-px-4',\n },\n {\n aspect: 'default',\n size: 'large',\n class: 'tw-px-6',\n },\n ],\n defaultVariants: {\n variant: 'default',\n emphasis: 'strong',\n size: 'medium',\n rounding: 'medium',\n hugWidth: true,\n aspect: 'default',\n disabled: false,\n },\n});\n"],"names":["buttonStyles","sv","FOCUS_OUTLINE"],"mappings":";;AAKO,MAAMA,IAAeC,EAAG;AAAA,EAC3B,MACI,mJACGC,CAAa;AAAA,EACpB,UAAU;AAAA,IACN,UAAU;AAAA,MACN,MAAM;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACN,QAAQ;AAAA,MACR,MAAM;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACF,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACJ,QAAQ;AAAA,MACR,SAAS;AAAA,IACb;AAAA,IACA,UAAU;AAAA,MACN,OAAO;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACN,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA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S;AAAA,MACT,UAAU;AAAA,MACV,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,EAAA;AAElB,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components67.js";
|
|
2
2
|
import { sv as e } from "./fondue-components27.js";
|
|
3
3
|
const s = e({
|
|
4
4
|
base: `tw-peer tw-relative tw-inline-flex tw-bg-base tw-text-white tw-shrink-0 tw-rounded tw-border tw-border-line-x-strong group-hover:tw-border-line-xx-strong hover:tw-border-line-xx-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-base disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-box-disabled-strong ${t}`,
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as a, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { IconDroplet as h, IconTrashBin as N, IconCaretDown as f } from "@frontify/fondue-icons";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import e from "./fondue-
|
|
5
|
-
import { colorToCss as
|
|
3
|
+
import { forwardRef as b } from "react";
|
|
4
|
+
import e from "./fondue-components66.js";
|
|
5
|
+
import { colorToCss as I } from "./fondue-components36.js";
|
|
6
6
|
const o = ({
|
|
7
7
|
id: c,
|
|
8
|
-
currentColor:
|
|
8
|
+
currentColor: t,
|
|
9
9
|
isOpen: d,
|
|
10
|
-
onClear:
|
|
10
|
+
onClear: i,
|
|
11
11
|
onClick: l,
|
|
12
12
|
"data-test-id": r = "color-picker-input",
|
|
13
13
|
...n
|
|
14
|
-
}, m) => /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
(
|
|
14
|
+
}, m) => /* @__PURE__ */ s("div", { id: c, className: e.root, ...n, ref: m, "data-test-id": r, children: [
|
|
15
|
+
/* @__PURE__ */ s("button", { className: e.button, onClick: l, type: "button", "data-color-input-select": !0, children: [
|
|
16
|
+
(t == null ? void 0 : t.red) !== void 0 ? /* @__PURE__ */ a(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
className: e.colorIndicator,
|
|
21
|
-
style: { backgroundColor:
|
|
21
|
+
style: { backgroundColor: I(t) }
|
|
22
22
|
}
|
|
23
|
-
) : /* @__PURE__ */
|
|
23
|
+
) : /* @__PURE__ */ s(p, { children: [
|
|
24
24
|
/* @__PURE__ */ a(h, { size: 16 }),
|
|
25
25
|
/* @__PURE__ */ a("span", { children: "Select Color" })
|
|
26
26
|
] }),
|
|
27
|
-
/* @__PURE__ */ a("span", { className: e.colorName, children:
|
|
27
|
+
/* @__PURE__ */ a("span", { className: e.colorName, children: t == null ? void 0 : t.name })
|
|
28
28
|
] }),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
29
|
+
/* @__PURE__ */ s("div", { className: e.actions, children: [
|
|
30
|
+
i && /* @__PURE__ */ a("button", { type: "button", "aria-label": "Clear color", onClick: i, className: e.clear, children: /* @__PURE__ */ a(N, { size: 16 }) }),
|
|
31
31
|
/* @__PURE__ */ a("div", { className: e.caret, "data-state": d ? "open" : "closed", children: /* @__PURE__ */ a(f, { size: 16, className: e.caret }) })
|
|
32
32
|
] })
|
|
33
33
|
] });
|
|
34
34
|
o.displayName = "ColorPicker.Input";
|
|
35
|
-
const x =
|
|
35
|
+
const x = b(o);
|
|
36
36
|
export {
|
|
37
37
|
o as ColorPickerInput,
|
|
38
38
|
x as ForwardedRefColorPickerInput
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components33.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconDroplet, IconTrashBin } from '@frontify/fondue-icons';\nimport { type ForwardedRef, forwardRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype ColorPickerInputProps = {\n id?: string;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to dermine arrow state\n */\n isOpen?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * Event handler called when the color picker input is clicked\n */\n onClick?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n {\n id,\n currentColor,\n isOpen,\n onClear,\n onClick,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div id={id} className={styles.root} {...props} ref={forwardedRef} data-test-id={dataTestId}>\n <button className={styles.button} onClick={onClick} data-color-input-select>\n {currentColor?.red !== undefined ? (\n <div\n aria-hidden\n className={styles.colorIndicator}\n style={{ backgroundColor: colorToCss(currentColor) }}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span className={styles.colorName}>{currentColor?.name}</span>\n </button>\n <div className={styles.actions}>\n {onClear && (\n <button type=\"button\" aria-label=\"Clear color\" onClick={onClear} className={styles.clear}>\n <IconTrashBin size={16} />\n </button>\n )}\n <div className={styles.caret} data-state={isOpen ? 'open' : 'closed'}>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n </div>\n );\n};\nColorPickerInput.displayName = 'ColorPicker.Input';\n\nexport const ForwardedRefColorPickerInput = forwardRef<HTMLDivElement, ColorPickerInputProps>(ColorPickerInput);\n"],"names":["ColorPickerInput","id","currentColor","isOpen","onClear","onClick","dataTestId","props","forwardedRef","jsxs","styles","jsx","colorToCss","Fragment","IconDroplet","IconTrashBin","IconCaretDown","ForwardedRefColorPickerInput","forwardRef"],"mappings":";;;;;AAmCO,MAAMA,IAAmB,CAC5B;AAAA,EACI,IAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MAGI,gBAAAC,EAAC,OAAI,EAAA,IAAAR,GAAQ,WAAWS,EAAO,MAAO,GAAGH,GAAO,KAAKC,GAAc,gBAAcF,GAC7E,UAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components33.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconDroplet, IconTrashBin } from '@frontify/fondue-icons';\nimport { type ForwardedRef, forwardRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype ColorPickerInputProps = {\n id?: string;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to dermine arrow state\n */\n isOpen?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * Event handler called when the color picker input is clicked\n */\n onClick?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n {\n id,\n currentColor,\n isOpen,\n onClear,\n onClick,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div id={id} className={styles.root} {...props} ref={forwardedRef} data-test-id={dataTestId}>\n <button className={styles.button} onClick={onClick} type=\"button\" data-color-input-select>\n {currentColor?.red !== undefined ? (\n <div\n aria-hidden\n className={styles.colorIndicator}\n style={{ backgroundColor: colorToCss(currentColor) }}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span className={styles.colorName}>{currentColor?.name}</span>\n </button>\n <div className={styles.actions}>\n {onClear && (\n <button type=\"button\" aria-label=\"Clear color\" onClick={onClear} className={styles.clear}>\n <IconTrashBin size={16} />\n </button>\n )}\n <div className={styles.caret} data-state={isOpen ? 'open' : 'closed'}>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n </div>\n );\n};\nColorPickerInput.displayName = 'ColorPicker.Input';\n\nexport const ForwardedRefColorPickerInput = forwardRef<HTMLDivElement, ColorPickerInputProps>(ColorPickerInput);\n"],"names":["ColorPickerInput","id","currentColor","isOpen","onClear","onClick","dataTestId","props","forwardedRef","jsxs","styles","jsx","colorToCss","Fragment","IconDroplet","IconTrashBin","IconCaretDown","ForwardedRefColorPickerInput","forwardRef"],"mappings":";;;;;AAmCO,MAAMA,IAAmB,CAC5B;AAAA,EACI,IAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MAGI,gBAAAC,EAAC,OAAI,EAAA,IAAAR,GAAQ,WAAWS,EAAO,MAAO,GAAGH,GAAO,KAAKC,GAA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_lmry4_51", n = "_body_lmry4_52", _ = "_underlay_lmry4_176", r = "_sideContent_lmry4_189", d = {
|
|
2
|
+
content: t,
|
|
3
|
+
header: e,
|
|
4
|
+
footer: o,
|
|
5
|
+
body: n,
|
|
6
|
+
underlay: _,
|
|
7
|
+
sideContent: r
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
n as body,
|
|
11
|
+
t as content,
|
|
12
|
+
d as default,
|
|
13
|
+
o as footer,
|
|
14
|
+
e as header,
|
|
15
|
+
r as sideContent,
|
|
16
|
+
_ as underlay
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components38.js.map
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { buttonStyles as
|
|
5
|
-
import { iconStyles as
|
|
6
|
-
import { textStyles as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y } from "react";
|
|
3
|
+
import { cn as r } from "./fondue-components27.js";
|
|
4
|
+
import { buttonStyles as x } from "./fondue-components28.js";
|
|
5
|
+
import { iconStyles as S } from "./fondue-components29.js";
|
|
6
|
+
import { textStyles as k } from "./fondue-components30.js";
|
|
7
|
+
const B = y(
|
|
8
8
|
({
|
|
9
9
|
children: u,
|
|
10
10
|
type: d = "button",
|
|
11
11
|
variant: m,
|
|
12
12
|
size: e = "medium",
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
form: l,
|
|
14
|
+
"data-test-id": c = "fondue-button",
|
|
15
|
+
className: n = "",
|
|
15
16
|
onPress: o = () => {
|
|
16
17
|
},
|
|
17
18
|
...t
|
|
18
|
-
},
|
|
19
|
+
}, a) => /* @__PURE__ */ b(
|
|
19
20
|
"button",
|
|
20
21
|
{
|
|
21
|
-
ref:
|
|
22
|
+
ref: a,
|
|
22
23
|
type: d,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
form: l,
|
|
25
|
+
"data-test-id": c,
|
|
26
|
+
className: r(
|
|
27
|
+
x({ size: e, variant: m, ...t }),
|
|
28
|
+
k({ variant: m, ...t }),
|
|
26
29
|
S({ variant: m, ...t }),
|
|
27
|
-
|
|
28
|
-
c
|
|
30
|
+
n
|
|
29
31
|
),
|
|
30
32
|
...t,
|
|
31
33
|
onClick: (i) => {
|
|
@@ -36,8 +38,8 @@ const k = b(
|
|
|
36
38
|
}
|
|
37
39
|
)
|
|
38
40
|
);
|
|
39
|
-
|
|
41
|
+
B.displayName = "Button";
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
B as Button
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=fondue-components4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components4.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type MouseEvent, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { buttonStyles } from './styles/buttonStyles';\nimport { iconStyles } from './styles/iconStyles';\nimport { textStyles } from './styles/textStyles';\n\ntype ButtonRounding = 'medium' | 'full';\n\ntype ButtonStyle = 'default' | 'positive' | 'negative' | 'danger' | 'loud';\n\ntype ButtonSize = 'small' | 'medium' | 'large';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\ntype ButtonEmphasis = 'default' | 'weak' | 'strong';\n\ntype ButtonAspect = 'default' | 'square';\n\nexport type ButtonProps = {\n /**\n * @default \"button\"\n */\n type?: ButtonType;\n /**\n * @default null\n */\n title?: string;\n /**\n * @default \"default\"\n */\n variant?: ButtonStyle;\n /**\n * @default \"strong\"\n */\n emphasis?: ButtonEmphasis;\n /**\n * @default \"medium\"\n */\n size?: ButtonSize;\n /**\n * @default \"medium\"\n */\n rounding?: ButtonRounding;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * @default \"default\"\n */\n aspect?: ButtonAspect;\n /**\n * @default true\n */\n hugWidth?: boolean;\n children?: ReactNode;\n onPress?: (event?: MouseEvent<HTMLButtonElement>) => void;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Button = forwardRef<HTMLButtonElement | null, ButtonProps>(\n (\n {\n children,\n type = 'button',\n variant,\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-button',\n className = '',\n onPress = () => {},\n ...props\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement | null>,\n ) => {\n return (\n <button\n ref={ref}\n type={type}\n data-test-id={dataTestId}\n className={cn(\n buttonStyles({ size, variant, ...props }),\n textStyles({ variant, ...props }),\n iconStyles({ variant, ...props }),\n className,\n )}\n {...props}\n onClick={(event) => {\n // @ts-expect-error - Allows other components who use Button as a trigger to pass an action\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n props.onClick?.(event);\n onPress?.(event);\n }}\n >\n {children}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n"],"names":["Button","forwardRef","children","type","variant","size","dataTestId","className","onPress","props","ref","jsx","cn","buttonStyles","textStyles","iconStyles","event","_a"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"fondue-components4.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type MouseEvent, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { buttonStyles } from './styles/buttonStyles';\nimport { iconStyles } from './styles/iconStyles';\nimport { textStyles } from './styles/textStyles';\n\ntype ButtonRounding = 'medium' | 'full';\n\ntype ButtonStyle = 'default' | 'positive' | 'negative' | 'danger' | 'loud';\n\ntype ButtonSize = 'small' | 'medium' | 'large';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\ntype ButtonEmphasis = 'default' | 'weak' | 'strong';\n\ntype ButtonAspect = 'default' | 'square';\n\nexport type ButtonProps = {\n /**\n * @default \"button\"\n */\n type?: ButtonType;\n /**\n * @default null\n */\n title?: string;\n /**\n * @default \"default\"\n */\n variant?: ButtonStyle;\n /**\n * @default \"strong\"\n */\n emphasis?: ButtonEmphasis;\n /**\n * @default \"medium\"\n */\n size?: ButtonSize;\n /**\n * @default \"medium\"\n */\n rounding?: ButtonRounding;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * @default \"default\"\n */\n aspect?: ButtonAspect;\n /**\n * @default true\n */\n hugWidth?: boolean;\n children?: ReactNode;\n onPress?: (event?: MouseEvent<HTMLButtonElement>) => void;\n form?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Button = forwardRef<HTMLButtonElement | null, ButtonProps>(\n (\n {\n children,\n type = 'button',\n variant,\n size = 'medium',\n form,\n 'data-test-id': dataTestId = 'fondue-button',\n className = '',\n onPress = () => {},\n ...props\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement | null>,\n ) => {\n return (\n <button\n ref={ref}\n type={type}\n form={form}\n data-test-id={dataTestId}\n className={cn(\n buttonStyles({ size, variant, ...props }),\n textStyles({ variant, ...props }),\n iconStyles({ variant, ...props }),\n className,\n )}\n {...props}\n onClick={(event) => {\n // @ts-expect-error - Allows other components who use Button as a trigger to pass an action\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n props.onClick?.(event);\n onPress?.(event);\n }}\n >\n {children}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n"],"names":["Button","forwardRef","children","type","variant","size","form","dataTestId","className","onPress","props","ref","jsx","cn","buttonStyles","textStyles","iconStyles","event","_a"],"mappings":";;;;;;AAoEO,MAAMA,IAASC;AAAA,EAClB,CACI;AAAA,IACI,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,MAAAC;AAAA,IACA,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU,MAAM;AAAA,IAAC;AAAA,IACjB,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAD;AAAA,MACA,MAAAR;AAAA,MACA,MAAAG;AAAA,MACA,gBAAcC;AAAA,MACd,WAAWM;AAAA,QACPC,EAAa,EAAE,MAAAT,GAAM,SAAAD,GAAS,GAAGM,GAAO;AAAA,QACxCK,EAAW,EAAE,SAAAX,GAAS,GAAGM,GAAO;AAAA,QAChCM,EAAW,EAAE,SAAAZ,GAAS,GAAGM,GAAO;AAAA,QAChCF;AAAA,MACJ;AAAA,MACC,GAAGE;AAAA,MACJ,SAAS,CAACO,MAAU;;AAGhB,SAAAC,IAAAR,EAAM,YAAN,QAAAQ,EAAA,KAAAR,GAAgBO,IAChBR,KAAA,QAAAA,EAAUQ;AAAA,MACd;AAAA,MAEC,UAAAf;AAAA,IAAA;AAAA,EACL;AAGZ;AAEAF,EAAO,cAAc;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_content_1d0au_5", n = "_subContent_1d0au_6", o = "_item_1d0au_20", s = "_subTrigger_1d0au_20", u = "_subMenuIndicator_1d0au_102", _ = "_group_1d0au_108", e = "_slot_1d0au_115", c = {
|
|
2
2
|
content: t,
|
|
3
3
|
subContent: n,
|
|
4
4
|
item: o,
|
|
5
5
|
subTrigger: s,
|
|
6
|
-
subMenuIndicator:
|
|
6
|
+
subMenuIndicator: u,
|
|
7
7
|
group: _,
|
|
8
8
|
slot: e
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
11
|
t as content,
|
|
12
|
-
|
|
12
|
+
c as default,
|
|
13
13
|
_ as group,
|
|
14
14
|
o as item,
|
|
15
15
|
e as slot,
|
|
16
16
|
n as subContent,
|
|
17
|
-
|
|
17
|
+
u as subMenuIndicator,
|
|
18
18
|
s as subTrigger
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components41.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1ry6r_6", r = "_overlay_1ry6r_49", e = "_header_1ry6r_66", _ = "_body_1ry6r_86", t = "_footer_1ry6r_104", s = "_close_1ry6r_124", y = {
|
|
2
2
|
root: o,
|
|
3
|
-
overlay:
|
|
4
|
-
header:
|
|
5
|
-
body:
|
|
3
|
+
overlay: r,
|
|
4
|
+
header: e,
|
|
5
|
+
body: _,
|
|
6
6
|
footer: t,
|
|
7
|
-
close:
|
|
7
|
+
close: s
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
_ as body,
|
|
11
|
+
s as close,
|
|
12
|
+
y as default,
|
|
13
13
|
t as footer,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
e as header,
|
|
15
|
+
r as overlay,
|
|
16
16
|
o as root
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components43.js.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const c = "
|
|
1
|
+
const c = "_root_96frq_6", o = "_selectedValue_96frq_68", _ = "_input_96frq_80", r = "_slot_96frq_106", t = "_clear_96frq_158", e = "_icons_96frq_171", n = "_caret_96frq_177", s = "_iconSuccess_96frq_205", a = "_iconError_96frq_211", l = "_menu_96frq_217", u = "_portal_96frq_238", i = "_item_96frq_242", f = "_checkmarkIcon_96frq_267", q = "_itemValue_96frq_274", m = "_group_96frq_288", p = {
|
|
2
2
|
root: c,
|
|
3
3
|
selectedValue: o,
|
|
4
4
|
input: _,
|
|
5
|
-
slot:
|
|
6
|
-
clear:
|
|
7
|
-
icons:
|
|
8
|
-
caret:
|
|
9
|
-
iconSuccess:
|
|
5
|
+
slot: r,
|
|
6
|
+
clear: t,
|
|
7
|
+
icons: e,
|
|
8
|
+
caret: n,
|
|
9
|
+
iconSuccess: s,
|
|
10
10
|
iconError: a,
|
|
11
11
|
menu: l,
|
|
12
|
-
portal:
|
|
13
|
-
item:
|
|
14
|
-
checkmarkIcon:
|
|
15
|
-
itemValue:
|
|
16
|
-
group:
|
|
12
|
+
portal: u,
|
|
13
|
+
item: i,
|
|
14
|
+
checkmarkIcon: f,
|
|
15
|
+
itemValue: q,
|
|
16
|
+
group: m
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
n as caret,
|
|
20
|
+
f as checkmarkIcon,
|
|
21
|
+
t as clear,
|
|
22
|
+
p as default,
|
|
23
|
+
m as group,
|
|
24
24
|
a as iconError,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
s as iconSuccess,
|
|
26
|
+
e as icons,
|
|
27
27
|
_ as input,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
i as item,
|
|
29
|
+
q as itemValue,
|
|
30
30
|
l as menu,
|
|
31
|
-
|
|
31
|
+
u as portal,
|
|
32
32
|
c as root,
|
|
33
33
|
o as selectedValue,
|
|
34
|
-
|
|
34
|
+
r as slot
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=fondue-components54.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_root_fs3zj_5", o = "_thumb_fs3zj_17", s = "_track_fs3zj_21", _ = "_range_fs3zj_28", r = {
|
|
2
2
|
root: t,
|
|
3
3
|
thumb: o,
|
|
4
|
-
track:
|
|
5
|
-
range:
|
|
4
|
+
track: s,
|
|
5
|
+
range: _
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
r as default,
|
|
9
|
+
_ as range,
|
|
10
10
|
t as root,
|
|
11
11
|
o as thumb,
|
|
12
|
-
|
|
12
|
+
s as track
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=fondue-components56.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
small:
|
|
4
|
-
medium:
|
|
1
|
+
const m = "_root_hrjmg_5", t = "_small_hrjmg_33", _ = "_medium_hrjmg_37", o = "_large_hrjmg_41", r = "_thumb_hrjmg_55", s = {
|
|
2
|
+
root: m,
|
|
3
|
+
small: t,
|
|
4
|
+
medium: _,
|
|
5
5
|
large: o,
|
|
6
|
-
thumb:
|
|
6
|
+
thumb: r
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
s as default,
|
|
10
10
|
o as large,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
_ as medium,
|
|
12
|
+
m as root,
|
|
13
|
+
t as small,
|
|
14
|
+
r as thumb
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=fondue-components57.js.map
|