@frontify/fondue-components 9.0.0 → 10.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-components21.js +35 -24
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components34.js +6 -6
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +5 -5
- package/dist/fondue-components41.js +14 -14
- package/dist/fondue-components60.js +16 -16
- package/dist/fondue-components9.js +96 -82
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +37 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
|
-
import { IconArrowUp as B, IconArrowDown as
|
|
3
|
-
import { forwardRef as m, useRef as y, useMemo as
|
|
2
|
+
import { IconArrowUp as B, IconArrowDown as z, IconArrowBidirectional as A } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as m, useRef as y, useMemo as K } from "react";
|
|
4
4
|
import { useSyncRefs as p } from "./fondue-components58.js";
|
|
5
5
|
import { useTextTruncation as w } from "./fondue-components59.js";
|
|
6
6
|
import o from "./fondue-components60.js";
|
|
7
|
-
import { handleKeyDown as
|
|
7
|
+
import { handleKeyDown as h } from "./fondue-components61.js";
|
|
8
8
|
const N = m(
|
|
9
|
-
({ layout: e = "auto",
|
|
9
|
+
({ layout: e = "auto", fontSize: a = "medium", sticky: t, children: i, ...d }, l) => /* @__PURE__ */ n("div", { onKeyDown: h, role: "grid", tabIndex: -1, children: /* @__PURE__ */ n(
|
|
10
|
+
"table",
|
|
11
|
+
{
|
|
12
|
+
ref: l,
|
|
13
|
+
className: o.table,
|
|
14
|
+
"data-layout": e,
|
|
15
|
+
"data-font-size": a,
|
|
16
|
+
"data-sticky": t,
|
|
17
|
+
...d,
|
|
18
|
+
children: i
|
|
19
|
+
}
|
|
20
|
+
) })
|
|
10
21
|
);
|
|
11
22
|
N.displayName = "Table.Root";
|
|
12
23
|
const g = m(({ children: e }, a) => /* @__PURE__ */ n("caption", { ref: a, className: o.caption, children: e }));
|
|
13
24
|
g.displayName = "Table.Caption";
|
|
14
25
|
const R = m(
|
|
15
|
-
({ children: e, "aria-label": a, "aria-busy":
|
|
26
|
+
({ children: e, "aria-label": a, "aria-busy": t }, i) => /* @__PURE__ */ n("thead", { ref: i, className: o.header, "aria-label": a, "aria-busy": t, children: e })
|
|
16
27
|
);
|
|
17
28
|
R.displayName = "Table.Header";
|
|
18
29
|
const C = m(
|
|
19
30
|
({
|
|
20
31
|
noShrink: e = !1,
|
|
21
32
|
truncate: a = !1,
|
|
22
|
-
align:
|
|
33
|
+
align: t = "left",
|
|
23
34
|
scope: i = "col",
|
|
24
|
-
sortTranslations:
|
|
25
|
-
sortDirection:
|
|
35
|
+
sortTranslations: d,
|
|
36
|
+
sortDirection: l,
|
|
26
37
|
colSpan: c,
|
|
27
38
|
width: b,
|
|
28
39
|
onSortChange: s,
|
|
@@ -30,10 +41,10 @@ const C = m(
|
|
|
30
41
|
}, u) => {
|
|
31
42
|
const f = y(null);
|
|
32
43
|
p(f, u), w(f);
|
|
33
|
-
const I =
|
|
44
|
+
const I = K(() => typeof r == "string" ? l === "ascending" ? (d == null ? void 0 : d.sortDescending) ?? `Sort by ${r} descending` : (d == null ? void 0 : d.sortAscending) ?? `Sort by ${r} ascending` : l === "ascending" ? "Sort descending" : "Sort ascending", [r, l, d]), H = () => {
|
|
34
45
|
if (!s)
|
|
35
46
|
return;
|
|
36
|
-
s(
|
|
47
|
+
s(l === void 0 || l === "descending" ? "ascending" : "descending");
|
|
37
48
|
};
|
|
38
49
|
return /* @__PURE__ */ n(
|
|
39
50
|
"th",
|
|
@@ -43,21 +54,21 @@ const C = m(
|
|
|
43
54
|
className: o.headerCell,
|
|
44
55
|
scope: i,
|
|
45
56
|
colSpan: c,
|
|
46
|
-
"data-align":
|
|
57
|
+
"data-align": t,
|
|
47
58
|
"data-truncate": a,
|
|
48
59
|
"data-no-shrink": e,
|
|
49
60
|
"data-sortable": !!s,
|
|
50
|
-
"aria-sort": s ?
|
|
61
|
+
"aria-sort": s ? l || "none" : void 0,
|
|
51
62
|
children: s ? /* @__PURE__ */ n("div", { className: o.cellContent, children: /* @__PURE__ */ k(
|
|
52
63
|
"button",
|
|
53
64
|
{
|
|
54
65
|
className: o.sortButton,
|
|
55
66
|
"aria-label": I,
|
|
56
|
-
"data-active": !!
|
|
67
|
+
"data-active": !!l,
|
|
57
68
|
onClick: H,
|
|
58
69
|
children: [
|
|
59
70
|
typeof r == "string" && a ? /* @__PURE__ */ n("span", { className: o.buttonText, children: r }) : r,
|
|
60
|
-
|
|
71
|
+
l === "ascending" ? /* @__PURE__ */ n(B, { size: "12" }) : l === "descending" ? /* @__PURE__ */ n(z, { size: "12" }) : /* @__PURE__ */ n(A, { className: o.sortIndicator, size: "12" })
|
|
61
72
|
]
|
|
62
73
|
}
|
|
63
74
|
) }) : r
|
|
@@ -67,13 +78,13 @@ const C = m(
|
|
|
67
78
|
);
|
|
68
79
|
C.displayName = "Table.HeaderCell";
|
|
69
80
|
const v = m(
|
|
70
|
-
({ children: e, "aria-busy": a },
|
|
81
|
+
({ children: e, "aria-busy": a }, t) => /* @__PURE__ */ n("tbody", { ref: t, className: o.body, "aria-busy": a, children: e })
|
|
71
82
|
);
|
|
72
83
|
v.displayName = "Table.Body";
|
|
73
84
|
const T = m(
|
|
74
|
-
({ disabled: e = !1, selected: a = !1, onClick:
|
|
75
|
-
const b =
|
|
76
|
-
e ||
|
|
85
|
+
({ disabled: e = !1, selected: a = !1, onClick: t, children: i, "aria-label": d, "data-test-id": l }, c) => {
|
|
86
|
+
const b = t !== void 0 && !e, s = () => {
|
|
87
|
+
e || t && t(a);
|
|
77
88
|
}, r = (u) => {
|
|
78
89
|
b && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), s());
|
|
79
90
|
};
|
|
@@ -88,11 +99,11 @@ const T = m(
|
|
|
88
99
|
"data-interactive": b,
|
|
89
100
|
"data-selected": a,
|
|
90
101
|
"aria-disabled": e,
|
|
91
|
-
"aria-label":
|
|
102
|
+
"aria-label": d,
|
|
92
103
|
"aria-selected": a,
|
|
93
104
|
onClick: b ? s : void 0,
|
|
94
105
|
onKeyDown: b ? r : void 0,
|
|
95
|
-
"data-test-id":
|
|
106
|
+
"data-test-id": l,
|
|
96
107
|
children: i
|
|
97
108
|
}
|
|
98
109
|
);
|
|
@@ -100,17 +111,17 @@ const T = m(
|
|
|
100
111
|
);
|
|
101
112
|
T.displayName = "Table.Row";
|
|
102
113
|
const x = m(
|
|
103
|
-
({ colSpan: e, truncate: a, align:
|
|
114
|
+
({ colSpan: e, truncate: a, align: t = "left", children: i, "aria-label": d }, l) => {
|
|
104
115
|
const c = y(null);
|
|
105
|
-
return p(c,
|
|
116
|
+
return p(c, l), w(c), /* @__PURE__ */ n(
|
|
106
117
|
"td",
|
|
107
118
|
{
|
|
108
119
|
ref: c,
|
|
109
120
|
className: o.rowCell,
|
|
110
121
|
colSpan: e,
|
|
111
|
-
"data-align":
|
|
122
|
+
"data-align": t,
|
|
112
123
|
"data-truncate": a,
|
|
113
|
-
"aria-label":
|
|
124
|
+
"aria-label": d,
|
|
114
125
|
children: i
|
|
115
126
|
}
|
|
116
127
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components21.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowDown, IconArrowUp, IconArrowBidirectional } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useMemo,\n useRef,\n type ReactNode,\n type KeyboardEvent,\n type CSSProperties,\n type ReactElement,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', sticky, children, ...props }, ref) => {\n return (\n <div onKeyDown={handleKeyDown} role=\"grid\" tabIndex={-1}>\n <table ref={ref} className={styles.table} data-layout={layout} data-sticky={sticky} {...props}>\n {children}\n </table>\n </div>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {onSortChange ? (\n <div className={styles.cellContent}>\n <button\n className={styles.sortButton}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n >\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </button>\n </div>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype BaseTableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\ntype ClickableTableRowProps = BaseTableRowProps & {\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick: (selected: boolean) => void;\n onNavigate?: never;\n href?: never;\n};\n\ntype NavigableTableRowProps = BaseTableRowProps & {\n onClick?: never;\n /**\n * Handler called when the row is clicked or activated via keyboard for navigation\n * Must be provided together with href\n */\n onNavigate: (href: string) => void;\n /**\n * URL associated with this row for navigation\n * Must be provided together with onNavigate\n */\n href: string;\n};\n\ntype NonInteractiveTableRowProps = BaseTableRowProps & {\n onClick?: never;\n onNavigate?: never;\n href?: never;\n};\n\ntype TableRowProps = ClickableTableRowProps | NavigableTableRowProps | NonInteractiveTableRowProps;\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = () => {\n if (disabled) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={selected}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={selected}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","sticky","children","props","ref","jsx","handleKeyDown","styles","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","TableRowCell","Table"],"mappings":";;;;;;;AAiCO,MAAMA,IAAYC;AAAA,EACrB,CAAC,EAAE,QAAAC,IAAS,QAAQ,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAM,GAAGC,MAE1C,gBAAAC,EAAC,SAAI,WAAWC,GAAe,MAAK,QAAO,UAAU,IACjD,UAAC,gBAAAD,EAAA,SAAA,EAAM,KAAAD,GAAU,WAAWG,EAAO,OAAO,eAAaP,GAAQ,eAAaC,GAAS,GAAGE,GACnF,UAAAD,EAAA,CACL,EACJ,CAAA;AAGZ;AACAJ,EAAU,cAAc;AAEjB,MAAMU,IAAeT,EAA6D,CAAC,EAAE,UAAAG,EAAA,GAAYE,wBAE/F,WAAQ,EAAA,KAAAA,GAAU,WAAWG,EAAO,SAChC,UAAAL,GACL,CAEP;AACDM,EAAa,cAAc;AAQpB,MAAMC,IAAcV;AAAA,EACvB,CAAC,EAAE,UAAAG,GAAU,cAAcQ,GAAW,aAAaC,KAAYP,MAEvD,gBAAAC,EAAC,SAAM,EAAA,KAAAD,GAAU,WAAWG,EAAO,QAAQ,cAAYG,GAAW,aAAWC,GACxE,UAAAT,EACL,CAAA;AAGZ;AACAO,EAAY,cAAc;AAsDnB,MAAMG,IAAkBb;AAAA,EAC3B,CACI;AAAA,IACI,UAAAc,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,OAAAC,IAAQ;AAAA,IACR,kBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAnB;AAAA,KAEJE,MACC;AACK,UAAAkB,IAAUC,EAA6B,IAAI;AACjD,IAAAC,EAAkCF,GAASlB,CAAG,GAE9CqB,EAAkB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AU,GAAGN,MAAsB;AACvF,UAAAkB,IAAUC,EAA6B,IAAI;AACjD,WAAAC,EAAkCF,GAASlB,CAAG,GAE9CqB,EAAkBH,CAAO,GAGrB,gBAAAjB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKiB;AAAA,QACL,WAAWf,EAAO;AAAA,QAClB,SAAAY;AAAA,QACA,cAAYJ;AAAA,QACZ,iBAAeD;AAAA,QACf,cAAYJ;AAAA,QAEX,UAAAR;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGZ;AACAwC,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAM7C;AAAA,EACN,SAASU;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMqB;AAAA,EACN,KAAKC;AAAA,EACL,SAASQ;AACb;"}
|
|
1
|
+
{"version":3,"file":"fondue-components21.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowDown, IconArrowUp, IconArrowBidirectional } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useMemo,\n useRef,\n type ReactNode,\n type KeyboardEvent,\n type CSSProperties,\n type ReactElement,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Font size of the table content\n * @default 'small'\n */\n fontSize?: 'small' | 'medium';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', fontSize = 'medium', sticky, children, ...props }, ref) => {\n return (\n <div onKeyDown={handleKeyDown} role=\"grid\" tabIndex={-1}>\n <table\n ref={ref}\n className={styles.table}\n data-layout={layout}\n data-font-size={fontSize}\n data-sticky={sticky}\n {...props}\n >\n {children}\n </table>\n </div>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {onSortChange ? (\n <div className={styles.cellContent}>\n <button\n className={styles.sortButton}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n >\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </button>\n </div>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype BaseTableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\ntype ClickableTableRowProps = BaseTableRowProps & {\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick: (selected: boolean) => void;\n onNavigate?: never;\n href?: never;\n};\n\ntype NavigableTableRowProps = BaseTableRowProps & {\n onClick?: never;\n /**\n * Handler called when the row is clicked or activated via keyboard for navigation\n * Must be provided together with href\n */\n onNavigate: (href: string) => void;\n /**\n * URL associated with this row for navigation\n * Must be provided together with onNavigate\n */\n href: string;\n};\n\ntype NonInteractiveTableRowProps = BaseTableRowProps & {\n onClick?: never;\n onNavigate?: never;\n href?: never;\n};\n\ntype TableRowProps = ClickableTableRowProps | NavigableTableRowProps | NonInteractiveTableRowProps;\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = () => {\n if (disabled) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={selected}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={selected}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","fontSize","sticky","children","props","ref","handleKeyDown","jsx","styles","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","TableRowCell","Table"],"mappings":";;;;;;;AAsCO,MAAMA,IAAYC;AAAA,EACrB,CAAC,EAAE,QAAAC,IAAS,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AC;AAAA,MAAA;AAAA,QACG,KAAKgB;AAAA,QACL,WAAWf,EAAO;AAAA,QAClB,SAAAY;AAAA,QACA,cAAYJ;AAAA,QACZ,iBAAeD;AAAA,QACf,cAAYJ;AAAA,QAEX,UAAAR;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGZ;AACAwC,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAM9C;AAAA,EACN,SAASW;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMqB;AAAA,EACN,KAAKC;AAAA,EACL,SAASQ;AACb;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as N, useState as b, useEffect as R } from "react";
|
|
3
3
|
import { Select as c } from "./fondue-components18.js";
|
|
4
4
|
import { TextInput as r } from "./fondue-components23.js";
|
|
5
5
|
import a from "./fondue-components35.js";
|
|
@@ -12,11 +12,11 @@ const h = ({
|
|
|
12
12
|
setCurrentFormat: v = () => {
|
|
13
13
|
},
|
|
14
14
|
"data-test-id": f = "color-picker-value-input"
|
|
15
|
-
},
|
|
16
|
-
const [u, p] =
|
|
15
|
+
}, g) => {
|
|
16
|
+
const [u, p] = b(d(t));
|
|
17
17
|
return R(() => {
|
|
18
18
|
p(d(t));
|
|
19
|
-
}, [t]), /* @__PURE__ */ o("div", { className: a.inputs, "data-test-id": f, ref:
|
|
19
|
+
}, [t]), /* @__PURE__ */ o("div", { className: a.inputs, "data-test-id": f, ref: g, children: [
|
|
20
20
|
/* @__PURE__ */ e("div", { className: a.colorFormatInput, children: /* @__PURE__ */ o(
|
|
21
21
|
c,
|
|
22
22
|
{
|
|
@@ -107,7 +107,7 @@ const h = ({
|
|
|
107
107
|
{
|
|
108
108
|
"data-test-id": "color-picker-value-input-alpha",
|
|
109
109
|
className: a.valueInput,
|
|
110
|
-
value: t.alpha === void 0 ? 100 : Math.trunc(t.alpha * 100),
|
|
110
|
+
value: t.alpha === void 0 ? 100 : Math.trunc(t.alpha * 100).toString(),
|
|
111
111
|
type: "number",
|
|
112
112
|
onChange: (l) => {
|
|
113
113
|
i({
|
|
@@ -125,7 +125,7 @@ const h = ({
|
|
|
125
125
|
] });
|
|
126
126
|
};
|
|
127
127
|
h.displayName = "ColorPicker.Values";
|
|
128
|
-
const E =
|
|
128
|
+
const E = N(h);
|
|
129
129
|
export {
|
|
130
130
|
h as ColorValueInput,
|
|
131
131
|
E as ForwardedRefColorValueInput
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components34.js","sources":["../src/components/ColorPicker/ColorValueInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ForwardedRef, forwardRef, useEffect, useState } from 'react';\n\nimport { Select } from '../Select/Select';\nimport { TextInput } from '../TextInput/TextInput';\n\nimport styles from './styles/customColorPicker.module.scss';\nimport { type RgbaColor } from './types';\nimport {\n DEFAULT_COLOR,\n DEFAULT_FORMAT,\n getLimitedColorChannelValue,\n hexColorToRgba,\n isValidHexColor,\n rgbColorToHex,\n} from './utils';\n\ntype ColorFormat = 'HEX' | 'RGBA';\n\ntype ColorValueInputProps = {\n /**\n * @ignore\n * The active color in the color picker, passed down from the root component\n */\n currentColor?: RgbaColor;\n /**\n * @ignore\n * Event handler called when the color changes, passed down from the root component\n */\n onColorChange?: (color: RgbaColor) => void;\n /**\n * @ignore\n * The format to use for the color input, passed down from the root component\n */\n currentFormat?: ColorFormat;\n /**\n * @ignore\n * The format to use for the color input, passed down from the root component\n */\n setCurrentFormat?: (format: ColorFormat) => void;\n /**\n * The test id of the color picker value input\n */\n 'data-test-id'?: string;\n};\n\nexport const ColorValueInput = (\n {\n currentColor = DEFAULT_COLOR,\n onColorChange = () => {},\n currentFormat = DEFAULT_FORMAT,\n setCurrentFormat = () => {},\n 'data-test-id': dataTestId = 'color-picker-value-input',\n }: ColorValueInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const [hexColorValue, setHexColorValue] = useState<string>(rgbColorToHex(currentColor));\n\n useEffect(() => {\n setHexColorValue(rgbColorToHex(currentColor));\n }, [currentColor]);\n\n return (\n <div className={styles.inputs} data-test-id={dataTestId} ref={forwardedRef}>\n <div className={styles.colorFormatInput}>\n <Select\n data-test-id=\"color-picker-select-format\"\n aria-label=\"Select a color format\"\n onSelect={(selectedValue) => {\n setCurrentFormat(selectedValue as ColorFormat);\n }}\n value={currentFormat}\n >\n <Select.Item value=\"HEX\">HEX</Select.Item>\n <Select.Item value=\"RGBA\">RGBA</Select.Item>\n </Select>\n </div>\n {currentFormat === 'HEX' ? (\n <TextInput.Root\n data-test-id=\"color-picker-value-input-hex\"\n className={styles.valueInput}\n type=\"text\"\n value={hexColorValue}\n status={isValidHexColor(hexColorValue) ? 'neutral' : 'error'}\n onBlur={(event) => {\n if (isValidHexColor(event.target.value)) {\n onColorChange(hexColorToRgba(event.target.value));\n }\n }}\n onChange={(event) => {\n setHexColorValue(event.target.value);\n }}\n aria-label=\"Hex color value\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>#</span>\n </TextInput.Slot>\n </TextInput.Root>\n ) : (\n <div className={styles.colorChannelInputGroup}>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-red\"\n className={styles.valueInput}\n value={currentColor.red}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n red: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Red Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>R</span>\n </TextInput.Slot>\n </TextInput.Root>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-green\"\n className={styles.valueInput}\n value={currentColor.green}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n green: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Green Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>G</span>\n </TextInput.Slot>\n </TextInput.Root>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-blue\"\n className={styles.valueInput}\n value={currentColor.blue}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n blue: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Blue Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>B</span>\n </TextInput.Slot>\n </TextInput.Root>\n </div>\n )}\n <div className={styles.colorAlphaInput}>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-alpha\"\n className={styles.valueInput}\n value={currentColor.alpha === undefined ? 100 : Math.trunc(currentColor.alpha * 100)}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n alpha: getLimitedColorChannelValue(event.target.value, 0, 100) / 100,\n });\n }}\n aria-label=\"Color Opacity\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>A</span>\n </TextInput.Slot>\n <TextInput.Slot name=\"right\">\n <span className={styles.inputDecorator}>%</span>\n </TextInput.Slot>\n </TextInput.Root>\n </div>\n </div>\n );\n};\nColorValueInput.displayName = 'ColorPicker.Values';\n\nexport const ForwardedRefColorValueInput = forwardRef<HTMLDivElement, ColorValueInputProps>(ColorValueInput);\n"],"names":["ColorValueInput","currentColor","DEFAULT_COLOR","onColorChange","currentFormat","DEFAULT_FORMAT","setCurrentFormat","dataTestId","forwardedRef","hexColorValue","setHexColorValue","useState","rgbColorToHex","useEffect","jsxs","styles","jsx","Select","selectedValue","TextInput","isValidHexColor","event","hexColorToRgba","getLimitedColorChannelValue","ForwardedRefColorValueInput","forwardRef"],"mappings":";;;;;;AA+CO,MAAMA,IAAkB,CAC3B;AAAA,EACI,cAAAC,IAAeC;AAAA,EACf,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,eAAAC,IAAgBC;AAAA,EAChB,kBAAAC,IAAmB,MAAM;AAAA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tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ForwardedRef, forwardRef, useEffect, useState } from 'react';\n\nimport { Select } from '../Select/Select';\nimport { TextInput } from '../TextInput/TextInput';\n\nimport styles from './styles/customColorPicker.module.scss';\nimport { type RgbaColor } from './types';\nimport {\n DEFAULT_COLOR,\n DEFAULT_FORMAT,\n getLimitedColorChannelValue,\n hexColorToRgba,\n isValidHexColor,\n rgbColorToHex,\n} from './utils';\n\ntype ColorFormat = 'HEX' | 'RGBA';\n\ntype ColorValueInputProps = {\n /**\n * @ignore\n * The active color in the color picker, passed down from the root component\n */\n currentColor?: RgbaColor;\n /**\n * @ignore\n * Event handler called when the color changes, passed down from the root component\n */\n onColorChange?: (color: RgbaColor) => void;\n /**\n * @ignore\n * The format to use for the color input, passed down from the root component\n */\n currentFormat?: ColorFormat;\n /**\n * @ignore\n * The format to use for the color input, passed down from the root component\n */\n setCurrentFormat?: (format: ColorFormat) => void;\n /**\n * The test id of the color picker value input\n */\n 'data-test-id'?: string;\n};\n\nexport const ColorValueInput = (\n {\n currentColor = DEFAULT_COLOR,\n onColorChange = () => {},\n currentFormat = DEFAULT_FORMAT,\n setCurrentFormat = () => {},\n 'data-test-id': dataTestId = 'color-picker-value-input',\n }: ColorValueInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const [hexColorValue, setHexColorValue] = useState<string>(rgbColorToHex(currentColor));\n\n useEffect(() => {\n setHexColorValue(rgbColorToHex(currentColor));\n }, [currentColor]);\n\n return (\n <div className={styles.inputs} data-test-id={dataTestId} ref={forwardedRef}>\n <div className={styles.colorFormatInput}>\n <Select\n data-test-id=\"color-picker-select-format\"\n aria-label=\"Select a color format\"\n onSelect={(selectedValue) => {\n setCurrentFormat(selectedValue as ColorFormat);\n }}\n value={currentFormat}\n >\n <Select.Item value=\"HEX\">HEX</Select.Item>\n <Select.Item value=\"RGBA\">RGBA</Select.Item>\n </Select>\n </div>\n {currentFormat === 'HEX' ? (\n <TextInput.Root\n data-test-id=\"color-picker-value-input-hex\"\n className={styles.valueInput}\n type=\"text\"\n value={hexColorValue}\n status={isValidHexColor(hexColorValue) ? 'neutral' : 'error'}\n onBlur={(event) => {\n if (isValidHexColor(event.target.value)) {\n onColorChange(hexColorToRgba(event.target.value));\n }\n }}\n onChange={(event) => {\n setHexColorValue(event.target.value);\n }}\n aria-label=\"Hex color value\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>#</span>\n </TextInput.Slot>\n </TextInput.Root>\n ) : (\n <div className={styles.colorChannelInputGroup}>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-red\"\n className={styles.valueInput}\n value={currentColor.red}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n red: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Red Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>R</span>\n </TextInput.Slot>\n </TextInput.Root>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-green\"\n className={styles.valueInput}\n value={currentColor.green}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n green: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Green Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>G</span>\n </TextInput.Slot>\n </TextInput.Root>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-blue\"\n className={styles.valueInput}\n value={currentColor.blue}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n blue: getLimitedColorChannelValue(event.target.value),\n });\n }}\n aria-label=\"Blue Color Channel\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>B</span>\n </TextInput.Slot>\n </TextInput.Root>\n </div>\n )}\n <div className={styles.colorAlphaInput}>\n <TextInput.Root\n data-test-id=\"color-picker-value-input-alpha\"\n className={styles.valueInput}\n /* .toString() is a workaround for https://github.com/facebook/react/issues/9402 */\n value={currentColor.alpha === undefined ? 100 : Math.trunc(currentColor.alpha * 100).toString()}\n type=\"number\"\n onChange={(event) => {\n onColorChange({\n ...currentColor,\n alpha: getLimitedColorChannelValue(event.target.value, 0, 100) / 100,\n });\n }}\n aria-label=\"Color Opacity\"\n >\n <TextInput.Slot name=\"left\">\n <span className={styles.inputDecorator}>A</span>\n </TextInput.Slot>\n <TextInput.Slot name=\"right\">\n <span className={styles.inputDecorator}>%</span>\n </TextInput.Slot>\n </TextInput.Root>\n </div>\n </div>\n );\n};\nColorValueInput.displayName = 'ColorPicker.Values';\n\nexport const ForwardedRefColorValueInput = forwardRef<HTMLDivElement, ColorValueInputProps>(ColorValueInput);\n"],"names":["ColorValueInput","currentColor","DEFAULT_COLOR","onColorChange","currentFormat","DEFAULT_FORMAT","setCurrentFormat","dataTestId","forwardedRef","hexColorValue","setHexColorValue","useState","rgbColorToHex","useEffect","jsxs","styles","jsx","Select","selectedValue","TextInput","isValidHexColor","event","hexColorToRgba","getLimitedColorChannelValue","ForwardedRefColorValueInput","forwardRef"],"mappings":";;;;;;AA+CO,MAAMA,IAAkB,CAC3B;AAAA,EACI,cAAAC,IAAeC;AAAA,EACf,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,eAAAC,IAAgBC;AAAA,EAChB,kBAAAC,IAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAiBC,EAAcX,CAAY,CAAC;AAEtF,SAAAY,EAAU,MAAM;AACK,IAAAH,EAAAE,EAAcX,CAAY,CAAC;AAAA,EAAA,GAC7C,CAACA,CAAY,CAAC,GAGb,gBAAAa,EAAC,SAAI,WAAWC,EAAO,QAAQ,gBAAcR,GAAY,KAAKC,GAC1D,UAAA;AAAA,IAAC,gBAAAQ,EAAA,OAAA,EAAI,WAAWD,EAAO,kBACnB,UAAA,gBAAAD;AAAA,MAACG;AA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D;AAAA,MAACK,EAAU;AAAA,MAAV;AAAA,QACG,gBAAa;AAAA,QACb,WAAWJ,EAAO;AAAA,QAElB,OAAOd,EAAa,UAAU,SAAY,MAAM,KAAK,MAAMA,EAAa,QAAQ,GAAG,EAAE,SAAS;AAAA,QAC9F,MAAK;AAAA,QACL,UAAU,CAACoB,MAAU;AACH,UAAAlB,EAAA;AAAA,YACV,GAAGF;AAAA,YACH,OAAOsB,EAA4BF,EAAM,OAAO,OAAO,GAAG,GAAG,IAAI;AAAA,UAAA,CACpE;AAAA,QACL;AAAA,QACA,cAAW;AAAA,QAEX,UAAA;AAAA,UAAC,gBAAAL,EAAAG,EAAU,MAAV,EAAe,MAAK,QACjB,UAAC,gBAAAH,EAAA,QAAA,EAAK,WAAWD,EAAO,gBAAgB,UAAA,IAAC,CAAA,GAC7C;AAAA,UACC,gBAAAC,EAAAG,EAAU,MAAV,EAAe,MAAK,SACjB,UAAC,gBAAAH,EAAA,QAAA,EAAK,WAAWD,EAAO,gBAAgB,UAAA,IAAA,CAAC,EAC7C,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,EAER,CAAA;AAAA,EAAA,GACJ;AAER;AACAf,EAAgB,cAAc;AAEjB,MAAAwB,IAA8BC,EAAiDzB,CAAe;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_riubn_4", n = "_inputs_riubn_12", t = "_colorFormatInput_riubn_23", r = "_colorAlphaInput_riubn_24", u = "_colorChannelInputGroup_riubn_28", p = "_inputDecorator_riubn_39", _ = "_gradientInput_riubn_43", l = "_reactColorful_riubn_46", c = "_valueInput_riubn_50", a = {
|
|
2
2
|
root: o,
|
|
3
|
-
inputs:
|
|
4
|
-
colorFormatInput:
|
|
3
|
+
inputs: n,
|
|
4
|
+
colorFormatInput: t,
|
|
5
5
|
colorAlphaInput: r,
|
|
6
6
|
colorChannelInputGroup: u,
|
|
7
7
|
inputDecorator: p,
|
|
@@ -12,11 +12,11 @@ const o = "_root_v784d_5", t = "_inputs_v784d_12", n = "_colorFormatInput_v784d_
|
|
|
12
12
|
export {
|
|
13
13
|
r as colorAlphaInput,
|
|
14
14
|
u as colorChannelInputGroup,
|
|
15
|
-
|
|
15
|
+
t as colorFormatInput,
|
|
16
16
|
a as default,
|
|
17
17
|
_ as gradientInput,
|
|
18
18
|
p as inputDecorator,
|
|
19
|
-
|
|
19
|
+
n as inputs,
|
|
20
20
|
l as reactColorful,
|
|
21
21
|
o as root,
|
|
22
22
|
c as valueInput
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
content:
|
|
3
|
-
subContent:
|
|
4
|
-
item:
|
|
5
|
-
subTrigger:
|
|
6
|
-
subMenuIndicator:
|
|
1
|
+
const e = "_content_ee4rq_6", t = "_subContent_ee4rq_7", n = "_item_ee4rq_21", o = "_subTrigger_ee4rq_21", s = "_subMenuIndicator_ee4rq_119", _ = "_group_ee4rq_125", r = "_slot_ee4rq_132", u = {
|
|
2
|
+
content: e,
|
|
3
|
+
subContent: t,
|
|
4
|
+
item: n,
|
|
5
|
+
subTrigger: o,
|
|
6
|
+
subMenuIndicator: s,
|
|
7
7
|
group: _,
|
|
8
|
-
slot:
|
|
8
|
+
slot: r
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
e as content,
|
|
12
|
+
u as default,
|
|
13
13
|
_ as group,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
n as item,
|
|
15
|
+
r as slot,
|
|
16
|
+
t as subContent,
|
|
17
|
+
s as subMenuIndicator,
|
|
18
|
+
o as subTrigger
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components41.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_table_tkqa4_4", o = "_headerCell_tkqa4_18", _ = "_rowCell_tkqa4_19", a = "_caption_tkqa4_46", n = "_sortButton_tkqa4_71", e = "_buttonText_tkqa4_89", r = "_sortIndicator_tkqa4_98", s = "_body_tkqa4_102", l = "_row_tkqa4_19", c = {
|
|
2
2
|
table: t,
|
|
3
3
|
headerCell: o,
|
|
4
|
-
rowCell:
|
|
5
|
-
caption:
|
|
6
|
-
sortButton:
|
|
7
|
-
buttonText:
|
|
8
|
-
sortIndicator:
|
|
9
|
-
body:
|
|
10
|
-
row:
|
|
4
|
+
rowCell: _,
|
|
5
|
+
caption: a,
|
|
6
|
+
sortButton: n,
|
|
7
|
+
buttonText: e,
|
|
8
|
+
sortIndicator: r,
|
|
9
|
+
body: s,
|
|
10
|
+
row: l
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
s as body,
|
|
14
|
+
e as buttonText,
|
|
15
|
+
a as caption,
|
|
16
|
+
c as default,
|
|
17
17
|
o as headerCell,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
l as row,
|
|
19
|
+
_ as rowCell,
|
|
20
|
+
n as sortButton,
|
|
21
|
+
r as sortIndicator,
|
|
22
22
|
t as table
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=fondue-components60.js.map
|