@frontify/fondue-components 13.0.2 → 14.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.
Files changed (156) hide show
  1. package/dist/fondue-components.js +56 -54
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +124 -34
  4. package/dist/fondue-components10.js.map +1 -1
  5. package/dist/fondue-components11.js +36 -84
  6. package/dist/fondue-components11.js.map +1 -1
  7. package/dist/fondue-components12.js +89 -36
  8. package/dist/fondue-components12.js.map +1 -1
  9. package/dist/fondue-components13.js +30 -40
  10. package/dist/fondue-components13.js.map +1 -1
  11. package/dist/fondue-components14.js +47 -24
  12. package/dist/fondue-components14.js.map +1 -1
  13. package/dist/fondue-components15.js +28 -39
  14. package/dist/fondue-components15.js.map +1 -1
  15. package/dist/fondue-components16.js +34 -16
  16. package/dist/fondue-components16.js.map +1 -1
  17. package/dist/fondue-components17.js +21 -68
  18. package/dist/fondue-components17.js.map +1 -1
  19. package/dist/fondue-components18.js +68 -36
  20. package/dist/fondue-components18.js.map +1 -1
  21. package/dist/fondue-components19.js +34 -45
  22. package/dist/fondue-components19.js.map +1 -1
  23. package/dist/fondue-components20.js +53 -130
  24. package/dist/fondue-components20.js.map +1 -1
  25. package/dist/fondue-components21.js +133 -53
  26. package/dist/fondue-components21.js.map +1 -1
  27. package/dist/fondue-components22.js +54 -28
  28. package/dist/fondue-components22.js.map +1 -1
  29. package/dist/fondue-components23.js +28 -153
  30. package/dist/fondue-components23.js.map +1 -1
  31. package/dist/fondue-components24.js +151 -116
  32. package/dist/fondue-components24.js.map +1 -1
  33. package/dist/fondue-components25.js +117 -31
  34. package/dist/fondue-components25.js.map +1 -1
  35. package/dist/fondue-components26.js +32 -65
  36. package/dist/fondue-components26.js.map +1 -1
  37. package/dist/fondue-components27.js +66 -7
  38. package/dist/fondue-components27.js.map +1 -1
  39. package/dist/fondue-components28.js +10 -55
  40. package/dist/fondue-components28.js.map +1 -1
  41. package/dist/fondue-components29.js +56 -32
  42. package/dist/fondue-components29.js.map +1 -1
  43. package/dist/fondue-components3.js +89 -36
  44. package/dist/fondue-components3.js.map +1 -1
  45. package/dist/fondue-components30.js +18 -4
  46. package/dist/fondue-components30.js.map +1 -1
  47. package/dist/fondue-components31.js +32 -12
  48. package/dist/fondue-components31.js.map +1 -1
  49. package/dist/fondue-components32.js +5 -155
  50. package/dist/fondue-components32.js.map +1 -1
  51. package/dist/fondue-components33.js +10 -116
  52. package/dist/fondue-components33.js.map +1 -1
  53. package/dist/fondue-components34.js +59 -22
  54. package/dist/fondue-components34.js.map +1 -1
  55. package/dist/fondue-components35.js +112 -15
  56. package/dist/fondue-components35.js.map +1 -1
  57. package/dist/fondue-components36.js +116 -30
  58. package/dist/fondue-components36.js.map +1 -1
  59. package/dist/fondue-components37.js +21 -37
  60. package/dist/fondue-components37.js.map +1 -1
  61. package/dist/fondue-components38.js +31 -129
  62. package/dist/fondue-components38.js.map +1 -1
  63. package/dist/fondue-components39.js +37 -21
  64. package/dist/fondue-components39.js.map +1 -1
  65. package/dist/fondue-components4.js +32 -38
  66. package/dist/fondue-components4.js.map +1 -1
  67. package/dist/fondue-components40.js +130 -45
  68. package/dist/fondue-components40.js.map +1 -1
  69. package/dist/fondue-components41.js +20 -7
  70. package/dist/fondue-components41.js.map +1 -1
  71. package/dist/fondue-components42.js +45 -13
  72. package/dist/fondue-components42.js.map +1 -1
  73. package/dist/fondue-components43.js +7 -14
  74. package/dist/fondue-components43.js.map +1 -1
  75. package/dist/fondue-components44.js +13 -60
  76. package/dist/fondue-components44.js.map +1 -1
  77. package/dist/fondue-components45.js +15 -18
  78. package/dist/fondue-components45.js.map +1 -1
  79. package/dist/fondue-components46.js +60 -19
  80. package/dist/fondue-components46.js.map +1 -1
  81. package/dist/fondue-components47.js +18 -5
  82. package/dist/fondue-components47.js.map +1 -1
  83. package/dist/fondue-components48.js +18 -14
  84. package/dist/fondue-components48.js.map +1 -1
  85. package/dist/fondue-components49.js +1 -1
  86. package/dist/fondue-components5.js +42 -45
  87. package/dist/fondue-components5.js.map +1 -1
  88. package/dist/fondue-components50.js +12 -16
  89. package/dist/fondue-components50.js.map +1 -1
  90. package/dist/fondue-components51.js +5 -35
  91. package/dist/fondue-components51.js.map +1 -1
  92. package/dist/fondue-components52.js +18 -6
  93. package/dist/fondue-components52.js.map +1 -1
  94. package/dist/fondue-components53.js +35 -13
  95. package/dist/fondue-components53.js.map +1 -1
  96. package/dist/fondue-components54.js +6 -4
  97. package/dist/fondue-components54.js.map +1 -1
  98. package/dist/fondue-components55.js +12 -24
  99. package/dist/fondue-components55.js.map +1 -1
  100. package/dist/fondue-components56.js +4 -16
  101. package/dist/fondue-components56.js.map +1 -1
  102. package/dist/fondue-components57.js +23 -140
  103. package/dist/fondue-components57.js.map +1 -1
  104. package/dist/fondue-components58.js +17 -16
  105. package/dist/fondue-components58.js.map +1 -1
  106. package/dist/fondue-components59.js +142 -70
  107. package/dist/fondue-components59.js.map +1 -1
  108. package/dist/fondue-components6.js +46 -48
  109. package/dist/fondue-components6.js.map +1 -1
  110. package/dist/fondue-components60.js +16 -8
  111. package/dist/fondue-components60.js.map +1 -1
  112. package/dist/fondue-components61.js +72 -32
  113. package/dist/fondue-components61.js.map +1 -1
  114. package/dist/fondue-components62.js +8 -49
  115. package/dist/fondue-components62.js.map +1 -1
  116. package/dist/fondue-components63.js +32 -10
  117. package/dist/fondue-components63.js.map +1 -1
  118. package/dist/fondue-components64.js +48 -12
  119. package/dist/fondue-components64.js.map +1 -1
  120. package/dist/fondue-components65.js +10 -12
  121. package/dist/fondue-components65.js.map +1 -1
  122. package/dist/fondue-components66.js +11 -19
  123. package/dist/fondue-components66.js.map +1 -1
  124. package/dist/fondue-components67.js +13 -15
  125. package/dist/fondue-components67.js.map +1 -1
  126. package/dist/fondue-components68.js +20 -52
  127. package/dist/fondue-components68.js.map +1 -1
  128. package/dist/fondue-components69.js +15 -15
  129. package/dist/fondue-components69.js.map +1 -1
  130. package/dist/fondue-components7.js +43 -144
  131. package/dist/fondue-components7.js.map +1 -1
  132. package/dist/fondue-components70.js +52 -25
  133. package/dist/fondue-components70.js.map +1 -1
  134. package/dist/fondue-components71.js +14 -17
  135. package/dist/fondue-components71.js.map +1 -1
  136. package/dist/fondue-components72.js +24 -5
  137. package/dist/fondue-components72.js.map +1 -1
  138. package/dist/fondue-components73.js +16 -5
  139. package/dist/fondue-components73.js.map +1 -1
  140. package/dist/fondue-components74.js +7 -2
  141. package/dist/fondue-components74.js.map +1 -1
  142. package/dist/fondue-components75.js +4 -12
  143. package/dist/fondue-components75.js.map +1 -1
  144. package/dist/fondue-components76.js +2 -39
  145. package/dist/fondue-components76.js.map +1 -1
  146. package/dist/fondue-components77.js +18 -0
  147. package/dist/fondue-components77.js.map +1 -0
  148. package/dist/fondue-components78.js +42 -0
  149. package/dist/fondue-components78.js.map +1 -0
  150. package/dist/fondue-components8.js +146 -27
  151. package/dist/fondue-components8.js.map +1 -1
  152. package/dist/fondue-components9.js +28 -125
  153. package/dist/fondue-components9.js.map +1 -1
  154. package/dist/index.d.ts +183 -57
  155. package/dist/style.css +1 -1
  156. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components38.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 /* .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;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,cAAW;AAAA,QACX,UAAU,CAACC,MAAkB;AACzB,UAAAZ,EAAiBY,CAA4B;AAAA,QACjD;AAAA,QACA,OAAOd;AAAA,QAEP,UAAA;AAAA,UAAA,gBAAAY,EAACC,EAAO,MAAP,EAAY,OAAM,OAAM,UAAG,OAAA;AAAA,4BAC3BA,EAAO,MAAP,EAAY,OAAM,QAAO,UAAI,OAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEtC;AAAA,IACCb,MAAkB,QACf,gBAAAY;AAAA,MAACG,EAAU;AAAA,MAAV;AAAA,QACG,gBAAa;AAAA,QACb,WAAWJ,EAAO;AAAA,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,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
+ {"version":3,"file":"fondue-components38.js","sources":["../src/components/ColorPicker/ColorGradientInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ForwardedRef, forwardRef } from 'react';\nimport { RgbaColorPicker } from 'react-colorful';\n\nimport styles from './styles/customColorPicker.module.scss';\nimport { type RgbaColor } from './types';\nimport { DEFAULT_COLOR } from './utils';\n\ntype ColorGradientInputProps = {\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 * The test id of the color picker gradient input\n */\n 'data-test-id'?: string;\n};\n\nexport const ColorGradientInput = (\n {\n currentColor = DEFAULT_COLOR,\n onColorChange = () => {},\n 'data-test-id': dataTestId = 'color-picker-input',\n }: ColorGradientInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div className={styles.gradientInput} data-test-id={dataTestId} ref={forwardedRef}>\n <RgbaColorPicker\n className={styles.reactColorful}\n color={{\n r: currentColor.red,\n g: currentColor.green,\n b: currentColor.blue,\n a: currentColor.alpha === undefined ? 1 : currentColor.alpha,\n }}\n onChange={(color) =>\n onColorChange({\n red: color.r,\n green: color.g,\n blue: color.b,\n alpha: color.a,\n })\n }\n />\n </div>\n );\n};\nColorGradientInput.displayName = 'ColorPicker.Gradient';\n\nexport const ForwardedRefColorGradientInput = forwardRef<HTMLDivElement, ColorGradientInputProps>(ColorGradientInput);\n"],"names":["ColorGradientInput","currentColor","DEFAULT_COLOR","onColorChange","dataTestId","forwardedRef","jsx","styles","RgbaColorPicker","color","ForwardedRefColorGradientInput","forwardRef"],"mappings":";;;;;AA0BO,MAAMA,IAAqB,CAC9B;AAAA,EACI,cAAAC,IAAeC;AAAA,EACf,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,gBAAgBC,IAAa;AACjC,GACAC,MAGI,gBAAAC,EAAC,SAAI,WAAWC,EAAO,eAAe,gBAAcH,GAAY,KAAKC,GACjE,UAAA,gBAAAC;AAAA,EAACE;AAAA,EAAA;AAAA,IACG,WAAWD,EAAO;AAAA,IAClB,OAAO;AAAA,MACH,GAAGN,EAAa;AAAA,MAChB,GAAGA,EAAa;AAAA,MAChB,GAAGA,EAAa;AAAA,MAChB,GAAGA,EAAa,UAAU,SAAY,IAAIA,EAAa;AAAA,IAC3D;AAAA,IACA,UAAU,CAACQ,MACPN,EAAc;AAAA,MACV,KAAKM,EAAM;AAAA,MACX,OAAOA,EAAM;AAAA,MACb,MAAMA,EAAM;AAAA,MACZ,OAAOA,EAAM;AAAA,IAChB,CAAA;AAAA,EAAA;AAAA,GAGb;AAGRT,EAAmB,cAAc;AAEpB,MAAAU,IAAiCC,EAAoDX,CAAkB;"}
@@ -1,24 +1,40 @@
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
- root: o,
3
- inputs: n,
4
- colorFormatInput: t,
5
- colorAlphaInput: r,
6
- colorChannelInputGroup: u,
7
- inputDecorator: p,
8
- gradientInput: _,
9
- reactColorful: l,
10
- valueInput: c
11
- };
1
+ import { jsxs as s, jsx as e, Fragment as p } from "react/jsx-runtime";
2
+ import { IconDroplet as f, IconTrashBin as h, IconCaretDown as N } from "@frontify/fondue-icons";
3
+ import { forwardRef as b } from "react";
4
+ import a from "./fondue-components77.js";
5
+ import { colorToCss as I } from "./fondue-components42.js";
6
+ const o = ({
7
+ id: c,
8
+ currentColor: t,
9
+ isOpen: d,
10
+ onClear: i,
11
+ onClick: l,
12
+ "data-test-id": n = "color-picker-input",
13
+ ...r
14
+ }, m) => /* @__PURE__ */ s("div", { id: c, className: a.root, ...r, ref: m, "data-test-id": n, children: [
15
+ /* @__PURE__ */ s("button", { className: a.button, onClick: l, type: "button", "data-color-input-select": !0, children: [
16
+ (t == null ? void 0 : t.red) !== void 0 ? /* @__PURE__ */ e(
17
+ "div",
18
+ {
19
+ "aria-hidden": !0,
20
+ className: a.colorIndicator,
21
+ style: { backgroundColor: I(t) }
22
+ }
23
+ ) : /* @__PURE__ */ s(p, { children: [
24
+ /* @__PURE__ */ e(f, { size: 16 }),
25
+ /* @__PURE__ */ e("span", { children: "Select Color" })
26
+ ] }),
27
+ /* @__PURE__ */ e("span", { className: a.colorName, children: t == null ? void 0 : t.name })
28
+ ] }),
29
+ /* @__PURE__ */ s("div", { className: a.actions, children: [
30
+ i && /* @__PURE__ */ e("button", { type: "button", "aria-label": "Clear color", onClick: i, className: a.clear, children: /* @__PURE__ */ e(h, { size: 16 }) }),
31
+ /* @__PURE__ */ e("div", { className: a.caret, "data-state": d ? "open" : "closed", children: /* @__PURE__ */ e(N, { size: 16, className: a.caret }) })
32
+ ] })
33
+ ] });
34
+ o.displayName = "ColorPicker.Input";
35
+ const x = b(o);
12
36
  export {
13
- r as colorAlphaInput,
14
- u as colorChannelInputGroup,
15
- t as colorFormatInput,
16
- a as default,
17
- _ as gradientInput,
18
- p as inputDecorator,
19
- n as inputs,
20
- l as reactColorful,
21
- o as root,
22
- c as valueInput
37
+ o as ColorPickerInput,
38
+ x as ForwardedRefColorPickerInput
23
39
  };
24
40
  //# sourceMappingURL=fondue-components39.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components39.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components39.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,GAAc,gBAAcF,GAC7E,UAAA;AAAA,EAAC,gBAAAG,EAAA,UAAA,EAAO,WAAWC,EAAO,QAAQ,SAAAL,GAAkB,MAAK,UAAS,2BAAuB,IACpF,UAAA;AAAA,KAAAH,KAAA,gBAAAA,EAAc,SAAQ,SACnB,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,eAAW;AAAA,QACX,WAAWD,EAAO;AAAA,QAClB,OAAO,EAAE,iBAAiBE,EAAWV,CAAY,EAAE;AAAA,MAAA;AAAA,IAAA,IAInD,gBAAAO,EAAAI,GAAA,EAAA,UAAA;AAAA,MAAC,gBAAAF,EAAAG,GAAA,EAAY,MAAM,GAAI,CAAA;AAAA,MACvB,gBAAAH,EAAC,UAAK,UAAY,eAAA,CAAA;AAAA,IAAA,GACtB;AAAA,sBAGH,QAAK,EAAA,WAAWD,EAAO,WAAY,iCAAc,KAAK,CAAA;AAAA,EAAA,GAC3D;AAAA,EACC,gBAAAD,EAAA,OAAA,EAAI,WAAWC,EAAO,SAClB,UAAA;AAAA,IAAAN,KACI,gBAAAO,EAAA,UAAA,EAAO,MAAK,UAAS,cAAW,eAAc,SAASP,GAAS,WAAWM,EAAO,OAC/E,UAAA,gBAAAC,EAACI,GAAa,EAAA,MAAM,GAAI,CAAA,GAC5B;AAAA,sBAEH,OAAI,EAAA,WAAWL,EAAO,OAAO,cAAYP,IAAS,SAAS,UACxD,UAAA,gBAAAQ,EAACK,KAAc,MAAM,IAAI,WAAWN,EAAO,OAAO,EACtD,CAAA;AAAA,EAAA,EACJ,CAAA;AAAA,GACJ;AAGRV,EAAiB,cAAc;AAElB,MAAAiB,IAA+BC,EAAkDlB,CAAgB;"}
@@ -1,46 +1,40 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as y } from "react";
3
- import { cn as x } from "./fondue-components31.js";
4
- import { buttonStyles as S } from "./fondue-components32.js";
5
- import { iconStyles as k } from "./fondue-components33.js";
6
- import { textStyles as B } from "./fondue-components34.js";
7
- const C = y(
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { propsToCssVariables as x } from "./fondue-components31.js";
4
+ import y from "./fondue-components32.js";
5
+ const c = n(
8
6
  ({
9
- children: f,
10
- type: d = "button",
11
- variant: m,
12
- size: e = "medium",
13
- form: l,
14
- "data-test-id": c = "fondue-button",
15
- className: n = "",
16
- onPress: o = () => {
17
- },
18
- hugWidth: a = !0,
19
- ...t
20
- }, b) => /* @__PURE__ */ r(
21
- "button",
7
+ as: a = "div",
8
+ "data-test-id": r = "fondue-box",
9
+ children: e,
10
+ role: i,
11
+ "aria-label": d,
12
+ "aria-hidden": o,
13
+ "aria-describedby": s,
14
+ "aria-labelledby": p,
15
+ "aria-expanded": t,
16
+ "aria-haspopup": l,
17
+ ...b
18
+ }, m) => /* @__PURE__ */ f(
19
+ a,
22
20
  {
23
- ref: b,
24
- type: d,
25
- form: l,
26
- "data-test-id": c,
27
- className: x(
28
- S({ size: e, variant: m, hugWidth: a, ...t }),
29
- B({ variant: m, ...t }),
30
- k({ variant: m, ...t }),
31
- n
32
- ),
33
- ...t,
34
- onClick: (i) => {
35
- var u;
36
- (u = t.onClick) == null || u.call(t, i), o == null || o(i);
37
- },
38
- children: f
21
+ className: y.root,
22
+ "data-test-id": r,
23
+ style: x(b),
24
+ role: i,
25
+ "aria-label": d,
26
+ "aria-hidden": o,
27
+ "aria-describedby": s,
28
+ "aria-labelledby": p,
29
+ "aria-expanded": t,
30
+ "aria-haspopup": l,
31
+ ref: m,
32
+ children: e
39
33
  }
40
34
  )
41
35
  );
42
- C.displayName = "Button";
36
+ c.displayName = "Box";
43
37
  export {
44
- C as Button
38
+ c as Box
45
39
  };
46
40
  //# 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 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 hugWidth = true,\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, hugWidth, ...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","hugWidth","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,UAAAC,IAAW;AAAA,IACX,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAD;AAAA,MACA,MAAAT;AAAA,MACA,MAAAG;AAAA,MACA,gBAAcC;AAAA,MACd,WAAWO;AAAA,QACPC,EAAa,EAAE,MAAAV,GAAM,SAAAD,GAAS,UAAAM,GAAU,GAAGC,GAAO;AAAA,QAClDK,EAAW,EAAE,SAAAZ,GAAS,GAAGO,GAAO;AAAA,QAChCM,EAAW,EAAE,SAAAb,GAAS,GAAGO,GAAO;AAAA,QAChCH;AAAA,MACJ;AAAA,MACC,GAAGG;AAAA,MACJ,SAAS,CAACO,MAAU;;AAGhB,SAAAC,IAAAR,EAAM,YAAN,QAAAQ,EAAA,KAAAR,GAAgBO,IAChBT,KAAA,QAAAA,EAAUS;AAAA,MACd;AAAA,MAEC,UAAAhB;AAAA,IAAA;AAAA,EACL;AAGZ;AAEAF,EAAO,cAAc;"}
1
+ {"version":3,"file":"fondue-components4.js","sources":["../src/components/Box/Box.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/box.module.scss';\n\nexport type BoxProps = LayoutComponentProps & {\n /**\n * The element to render the Box component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-box',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props)}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nBox.displayName = 'Box';\n"],"names":["Box","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AA0BO,MAAMA,IAAMC;AAAA,EACf,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,CAAK;AAAA,MAChC,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EACL;AAGZ;AACAJ,EAAI,cAAc;"}
@@ -1,48 +1,133 @@
1
- const s = { red: 255, green: 255, blue: 255, alpha: 1, name: "" }, g = "HEX", $ = (e) => {
2
- if (e)
3
- return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha || 1})`;
4
- }, p = (e) => {
5
- const n = /^([\dA-Fa-f]{3}){1,2}$/;
6
- return e.length > 2 && n.test(e);
7
- }, u = (e) => {
8
- const n = /^([\dA-Fa-f]{3}){1,2}$/, r = e.match(n);
9
- if (!r)
10
- return {
11
- red: 0,
12
- green: 0,
13
- blue: 0,
14
- alpha: 0
15
- };
16
- const t = r[0];
17
- return t.length === 3 ? {
18
- red: parseInt(`${t[0]}${t[0]}`, 16),
19
- green: parseInt(`${t[1]}${t[1]}`, 16),
20
- blue: parseInt(`${t[2]}${t[2]}`, 16),
21
- alpha: 1
22
- } : {
23
- red: parseInt(t.slice(0, 2), 16),
24
- green: parseInt(t.slice(2, 4), 16),
25
- blue: parseInt(t.slice(4, 6), 16),
26
- alpha: 1
27
- };
28
- }, a = (e) => {
29
- const { red: n, green: r, blue: t } = e;
30
- return `${n.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}`;
31
- }, h = (e, n) => n === "HEX" ? {
32
- ...e,
33
- name: `#${a(e)}`
34
- } : {
35
- ...e,
36
- name: `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha || 1})`
37
- }, i = (e, n = 0, r = 255) => e.length === 0 || parseInt(e) < n ? n : parseInt(e) > r ? r : parseInt(e);
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as N, useState as b, useEffect as R } from "react";
3
+ import { Select as c } from "./fondue-components21.js";
4
+ import { TextInput as r } from "./fondue-components27.js";
5
+ import a from "./fondue-components41.js";
6
+ import { rgbColorToHex as d, isValidHexColor as m, hexColorToRgba as I, getLimitedColorChannelValue as o, DEFAULT_COLOR as x, DEFAULT_FORMAT as S } from "./fondue-components42.js";
7
+ const h = ({
8
+ currentColor: t = x,
9
+ onColorChange: i = () => {
10
+ },
11
+ currentFormat: s = S,
12
+ setCurrentFormat: v = () => {
13
+ },
14
+ "data-test-id": f = "color-picker-value-input"
15
+ }, g) => {
16
+ const [u, p] = b(d(t));
17
+ return R(() => {
18
+ p(d(t));
19
+ }, [t]), /* @__PURE__ */ n("div", { className: a.inputs, "data-test-id": f, ref: g, children: [
20
+ /* @__PURE__ */ e("div", { className: a.colorFormatInput, children: /* @__PURE__ */ n(
21
+ c,
22
+ {
23
+ "data-test-id": "color-picker-select-format",
24
+ "aria-label": "Select a color format",
25
+ onSelect: (l) => {
26
+ v(l);
27
+ },
28
+ value: s,
29
+ children: [
30
+ /* @__PURE__ */ e(c.Item, { value: "HEX", children: "HEX" }),
31
+ /* @__PURE__ */ e(c.Item, { value: "RGBA", children: "RGBA" })
32
+ ]
33
+ }
34
+ ) }),
35
+ s === "HEX" ? /* @__PURE__ */ e(
36
+ r.Root,
37
+ {
38
+ "data-test-id": "color-picker-value-input-hex",
39
+ className: a.valueInput,
40
+ type: "text",
41
+ value: u,
42
+ status: m(u) ? "neutral" : "error",
43
+ onBlur: (l) => {
44
+ m(l.target.value) && i(I(l.target.value));
45
+ },
46
+ onChange: (l) => {
47
+ p(l.target.value);
48
+ },
49
+ "aria-label": "Hex color value",
50
+ children: /* @__PURE__ */ e(r.Slot, { name: "left", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "#" }) })
51
+ }
52
+ ) : /* @__PURE__ */ n("div", { className: a.colorChannelInputGroup, children: [
53
+ /* @__PURE__ */ e(
54
+ r.Root,
55
+ {
56
+ "data-test-id": "color-picker-value-input-red",
57
+ className: a.valueInput,
58
+ value: t.red,
59
+ type: "number",
60
+ onChange: (l) => {
61
+ i({
62
+ ...t,
63
+ red: o(l.target.value)
64
+ });
65
+ },
66
+ "aria-label": "Red Color Channel",
67
+ children: /* @__PURE__ */ e(r.Slot, { name: "left", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "R" }) })
68
+ }
69
+ ),
70
+ /* @__PURE__ */ e(
71
+ r.Root,
72
+ {
73
+ "data-test-id": "color-picker-value-input-green",
74
+ className: a.valueInput,
75
+ value: t.green,
76
+ type: "number",
77
+ onChange: (l) => {
78
+ i({
79
+ ...t,
80
+ green: o(l.target.value)
81
+ });
82
+ },
83
+ "aria-label": "Green Color Channel",
84
+ children: /* @__PURE__ */ e(r.Slot, { name: "left", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "G" }) })
85
+ }
86
+ ),
87
+ /* @__PURE__ */ e(
88
+ r.Root,
89
+ {
90
+ "data-test-id": "color-picker-value-input-blue",
91
+ className: a.valueInput,
92
+ value: t.blue,
93
+ type: "number",
94
+ onChange: (l) => {
95
+ i({
96
+ ...t,
97
+ blue: o(l.target.value)
98
+ });
99
+ },
100
+ "aria-label": "Blue Color Channel",
101
+ children: /* @__PURE__ */ e(r.Slot, { name: "left", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "B" }) })
102
+ }
103
+ )
104
+ ] }),
105
+ /* @__PURE__ */ e("div", { className: a.colorAlphaInput, children: /* @__PURE__ */ n(
106
+ r.Root,
107
+ {
108
+ "data-test-id": "color-picker-value-input-alpha",
109
+ className: a.valueInput,
110
+ value: t.alpha === void 0 ? 100 : Math.trunc(t.alpha * 100).toString(),
111
+ type: "number",
112
+ onChange: (l) => {
113
+ i({
114
+ ...t,
115
+ alpha: o(l.target.value, 0, 100) / 100
116
+ });
117
+ },
118
+ "aria-label": "Color Opacity",
119
+ children: [
120
+ /* @__PURE__ */ e(r.Slot, { name: "left", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "A" }) }),
121
+ /* @__PURE__ */ e(r.Slot, { name: "right", children: /* @__PURE__ */ e("span", { className: a.inputDecorator, children: "%" }) })
122
+ ]
123
+ }
124
+ ) })
125
+ ] });
126
+ };
127
+ h.displayName = "ColorPicker.Values";
128
+ const E = N(h);
38
129
  export {
39
- s as DEFAULT_COLOR,
40
- g as DEFAULT_FORMAT,
41
- $ as colorToCss,
42
- h as getColorWithName,
43
- i as getLimitedColorChannelValue,
44
- u as hexColorToRgba,
45
- p as isValidHexColor,
46
- a as rgbColorToHex
130
+ h as ColorValueInput,
131
+ E as ForwardedRefColorValueInput
47
132
  };
48
133
  //# sourceMappingURL=fondue-components40.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components40.js","sources":["../src/components/ColorPicker/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorFormat, type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\nexport const DEFAULT_FORMAT = 'HEX';\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha || 1})`;\n};\n\n/**\n * Checks if a string is a valid hexadecimal color code. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} color - The color code to be checked.\n * @returns {boolean}\n * @example\n * isValidHexColor('FFF'); // true\n * @example\n * isValidHexColor('FF5733'); // true\n * @example\n * isValidHexColor('XYZ'); // false\n */\nexport const isValidHexColor = (color: string): boolean => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n return color.length > 2 && hexRegex.test(color);\n};\n\n/**\n * Converts a hexadecimal color code to an RGBA color object. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} hex - The hex code, either 3 or 6 characters long. Characters should be from the set [0-9A-Fa-f].\n * @returns {RgbaColor}\n * @example\n * hexColorToRgba('FFF'); // { red: 255, green: 255, blue: 255, alpha: 1 }\n * @example\n * hexColorToRgba('FF5733'); // { red: 255, green: 87, blue: 51, alpha: 1 }\n * @example\n * hexColorToRgba('XYZ'); // { red: 0, green: 0, blue: 0, alpha: 0 }\n */\nexport const hexColorToRgba = (hex: string): RgbaColor => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n const matches = hex.match(hexRegex);\n if (!matches) {\n return {\n red: 0,\n green: 0,\n blue: 0,\n alpha: 0,\n };\n }\n const hexColor = matches[0];\n if (hexColor.length === 3) {\n return {\n red: parseInt(`${hexColor[0]}${hexColor[0]}`, 16),\n green: parseInt(`${hexColor[1]}${hexColor[1]}`, 16),\n blue: parseInt(`${hexColor[2]}${hexColor[2]}`, 16),\n alpha: 1,\n };\n }\n return {\n red: parseInt(hexColor.slice(0, 2), 16),\n green: parseInt(hexColor.slice(2, 4), 16),\n blue: parseInt(hexColor.slice(4, 6), 16),\n alpha: 1,\n };\n};\n\n/**\n * Converts an RGBA color object to a hexadecimal color code. This function returns a\n * six-digit hex code without the '#' symbol.\n * @param {RgbaColor} rgb - The RGBA color object.\n * @returns {string}\n * @example\n * rgbColorToHex({ red: 255, green: 255, blue: 255, alpha: 1 }); // '#FFFFFF'\n * @example\n * rgbColorToHex({ red: 255, green: 87, blue: 51, alpha: 1 }); // '#FF5733'\n * @example\n * rgbColorToHex({ red: 0, green: 0, blue: 0, alpha: 0 }); // '#000000'\n */\nexport const rgbColorToHex = (rgb: Omit<RgbaColor, 'alpha'>): string => {\n const { red, green, blue } = rgb;\n return `${red.toString(16).padStart(2, '0')}${green.toString(16).padStart(2, '0')}${blue.toString(16).padStart(2, '0')}`;\n};\n\n/**\n * Returns a color object with a name property based on the provided color and format.\n * @param {RgbaColor} color - The RGBA color object.\n * @param {ColorFormat} currentFormat - The current format of the color.\n * @returns {RgbaColor}\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'HEX'); // { red: 255, green: 255, blue: 255, alpha: 1, name: '#FFFFFF' }\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'RGBA'); // { red: 255, green: 255, blue: 255, alpha: 1, name: 'rgba(255, 255, 255, 1)' }\n * @example\n * getColorWithName({ red: 255, green: 87, blue: 51, alpha: 1 }, 'RGBA'); // { red: 255, green: 87, blue: 51, alpha: 1, name: 'rgba(255, 87, 51, 1)' }\n */\nexport const getColorWithName = (color: RgbaColor, currentFormat: ColorFormat) => {\n if (currentFormat === 'HEX') {\n return {\n ...color,\n name: `#${rgbColorToHex(color)}`,\n };\n }\n return {\n ...color,\n name: `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha || 1})`,\n };\n};\n\n/**\n * Returns a number between a minimum and maximum value, inclusive.\n * @param {string} value - The value to be limited.\n * @param {number} [min=0] - The minimum value (inclusive).\n * @param {number} [max=255] - The maximum value (inclusive).\n * @returns {number}\n * @example\n * getLimitedColorChannelValue('255'); // 255\n * @example\n * getLimitedColorChannelValue('100'); // 100\n * @example\n * getLimitedColorChannelValue('0'); // 0\n * @example\n * getLimitedColorChannelValue('500'); // 255\n * @example\n * getLimitedColorChannelValue('500', 0, 100); // 100\n */\nexport const getLimitedColorChannelValue = (value: string, min: number = 0, max: number = 255): number => {\n if (value.length === 0 || parseInt(value) < min) {\n return min;\n } else if (parseInt(value) > max) {\n return max;\n }\n return parseInt(value);\n};\n"],"names":["DEFAULT_COLOR","DEFAULT_FORMAT","colorToCss","color","isValidHexColor","hexRegex","hexColorToRgba","hex","matches","hexColor","rgbColorToHex","rgb","red","green","blue","getColorWithName","currentFormat","getLimitedColorChannelValue","value","min","max"],"mappings":"AAIa,MAAAA,IAAgB,EAAE,KAAK,KAAK,OAAO,KAAK,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,GACtEC,IAAiB,OAajBC,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF,GAcaC,IAAkB,CAACD,MAA2B;AACvD,QAAME,IAAW;AACjB,SAAOF,EAAM,SAAS,KAAKE,EAAS,KAAKF,CAAK;AAClD,GAcaG,IAAiB,CAACC,MAA2B;AACtD,QAAMF,IAAW,0BACXG,IAAUD,EAAI,MAAMF,CAAQ;AAClC,MAAI,CAACG;AACM,WAAA;AAAA,MACH,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,I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,IAEJ,SAASF,CAAK;"}
1
+ {"version":3,"file":"fondue-components40.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 /* .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,IA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J,GACJ;AAAA,IAEH,gBAAAC,EAAA,OAAA,EAAI,WAAWD,EAAO,iBACnB,UAAA,gBAAAD;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,11 +1,24 @@
1
- import { useEffect as f } from "react";
2
- import { syncRefs as o } from "./fondue-components42.js";
3
- const m = (s, e) => {
4
- f(() => {
5
- o(s, e);
6
- }, [s]);
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
+ root: o,
3
+ inputs: n,
4
+ colorFormatInput: t,
5
+ colorAlphaInput: r,
6
+ colorChannelInputGroup: u,
7
+ inputDecorator: p,
8
+ gradientInput: _,
9
+ reactColorful: l,
10
+ valueInput: c
7
11
  };
8
12
  export {
9
- m as useSyncRefs
13
+ r as colorAlphaInput,
14
+ u as colorChannelInputGroup,
15
+ t as colorFormatInput,
16
+ a as default,
17
+ _ as gradientInput,
18
+ p as inputDecorator,
19
+ n as inputs,
20
+ l as reactColorful,
21
+ o as root,
22
+ c as valueInput
10
23
  };
11
24
  //# sourceMappingURL=fondue-components41.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components41.js","sources":["../src/hooks/useSyncRefs.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ForwardedRef, useEffect, type RefObject } from 'react';\n\nimport { syncRefs } from '#/utilities/domUtilities';\n\n/**\n * A custom React hook that synchronizes a local ref with a forwarded ref.\n * This is useful when you need to maintain both an internal reference to a DOM element\n * and allow external access through a forwarded ref.\n *\n * @template TElement - The type of the DOM element being referenced. Defaults to HTMLElement.\n * @param {RefObject<TElement>} localRef - The local ref object used internally by the component.\n * @param {ForwardedRef<TElement>} forwardedRef - The ref forwarded from a parent component.\n *\n * @example\n * ```tsx\n * const MyComponent = forwardRef<HTMLDivElement>((props, ref) => {\n * const localRef = useRef<HTMLDivElement>(null);\n * useSyncRefs(localRef, ref);\n *\n * return <div ref={localRef}>Content</div>;\n * });\n * ```\n */\nexport const useSyncRefs = <TElement = HTMLElement>(\n localRef: RefObject<TElement>,\n forwardedRef: ForwardedRef<TElement>,\n) => {\n useEffect(() => {\n syncRefs<TElement>(localRef, forwardedRef);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [localRef]);\n};\n"],"names":["useSyncRefs","localRef","forwardedRef","useEffect","syncRefs"],"mappings":";;AAyBa,MAAAA,IAAc,CACvBC,GACAC,MACC;AACD,EAAAC,EAAU,MAAM;AACZ,IAAAC,EAAmBH,GAAUC,CAAY;AAAA,EAAA,GAE1C,CAACD,CAAQ,CAAC;AACjB;"}
1
+ {"version":3,"file":"fondue-components41.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,16 +1,48 @@
1
- function s(u, t) {
2
- t && (typeof t == "function" ? t(u.current) : t && "current" in t && (t.current = u.current));
3
- }
4
- function i(u) {
5
- u.currentTarget.dataset.autoFocusVisible = "false";
6
- }
7
- function a(u) {
8
- const t = u.relatedTarget;
9
- t != null && t.dataset.autoFocusTrigger && (t.dataset.autoFocusVisible === "true" ? u.target.dataset.showFocusRing = "true" : u.target.dataset.showFocusRing = "false", t.dataset.autoFocusVisible = "true");
10
- }
1
+ const s = { red: 255, green: 255, blue: 255, alpha: 1, name: "" }, g = "HEX", $ = (e) => {
2
+ if (e)
3
+ return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha || 1})`;
4
+ }, p = (e) => {
5
+ const n = /^([\dA-Fa-f]{3}){1,2}$/;
6
+ return e.length > 2 && n.test(e);
7
+ }, u = (e) => {
8
+ const n = /^([\dA-Fa-f]{3}){1,2}$/, r = e.match(n);
9
+ if (!r)
10
+ return {
11
+ red: 0,
12
+ green: 0,
13
+ blue: 0,
14
+ alpha: 0
15
+ };
16
+ const t = r[0];
17
+ return t.length === 3 ? {
18
+ red: parseInt(`${t[0]}${t[0]}`, 16),
19
+ green: parseInt(`${t[1]}${t[1]}`, 16),
20
+ blue: parseInt(`${t[2]}${t[2]}`, 16),
21
+ alpha: 1
22
+ } : {
23
+ red: parseInt(t.slice(0, 2), 16),
24
+ green: parseInt(t.slice(2, 4), 16),
25
+ blue: parseInt(t.slice(4, 6), 16),
26
+ alpha: 1
27
+ };
28
+ }, a = (e) => {
29
+ const { red: n, green: r, blue: t } = e;
30
+ return `${n.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}`;
31
+ }, h = (e, n) => n === "HEX" ? {
32
+ ...e,
33
+ name: `#${a(e)}`
34
+ } : {
35
+ ...e,
36
+ name: `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha || 1})`
37
+ }, i = (e, n = 0, r = 255) => e.length === 0 || parseInt(e) < n ? n : parseInt(e) > r ? r : parseInt(e);
11
38
  export {
12
- i as addAutoFocusAttribute,
13
- a as addShowFocusRing,
14
- s as syncRefs
39
+ s as DEFAULT_COLOR,
40
+ g as DEFAULT_FORMAT,
41
+ $ as colorToCss,
42
+ h as getColorWithName,
43
+ i as getLimitedColorChannelValue,
44
+ u as hexColorToRgba,
45
+ p as isValidHexColor,
46
+ a as rgbColorToHex
15
47
  };
16
48
  //# sourceMappingURL=fondue-components42.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components42.js","sources":["../src/utilities/domUtilities.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type FocusEvent, type MouseEvent as ReactMouseEvent, type ForwardedRef, type RefObject } from 'react';\n\nexport const MAX_HEIGHT_MARGIN = 8;\n\n/**\n * Sets the maximum height for a dialog element based on its position on the viewport.\n * The function calculates the space below the dialog up to the bottom of the viewport window,\n * subtracting a default margin, and sets this value as the max-height style of the dialog.\n *\n * @param {HTMLElement} dialog - The dialog element whose maximum height is to be set.\n *\n * @example\n * // Suppose you have a dialog element with id 'my-dialog'.\n * const dialogElement = myDialogRef.current || document.getElementById('my-dialog');\n * // Setting its max height relative to its current position and the viewport's dimensions.\n * setMaxHeightToAvailableSpace(dialogElement);\n */\nexport function setMaxHeightToAvailableSpace(dialog: HTMLElement) {\n if (!window) {\n throw new Error('Window object not found, this method should be used in a browser environment');\n }\n\n dialog.style.maxHeight = '';\n\n const { top, bottom } = dialog.getBoundingClientRect();\n if (top - MAX_HEIGHT_MARGIN < 0) {\n // if the dialog is overflowing to the top\n dialog.style.maxHeight = `${bottom - MAX_HEIGHT_MARGIN}px`;\n } else if (bottom + MAX_HEIGHT_MARGIN > window.innerHeight) {\n // if the dialog is overflowing to the bottom\n dialog.style.maxHeight = `${window.innerHeight - top - MAX_HEIGHT_MARGIN}px`;\n }\n}\n\n/**\n * Checks if a specified HTML element is visible within the viewport.\n * Visibility is determined by several factors:\n * - The element must have non-zero dimensions.\n * - The element's computed style must not be `display: none`, `visibility: hidden`, or `opacity: 0`.\n * - The element must be within the bounds of the current viewport.\n *\n * @param {HTMLElement} element - The HTML element to check for visibility.\n * @returns {boolean} Returns true if the element is visible according to the criteria specified, otherwise returns false.\n */\nexport function isElementVisible(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const hasSize = rect.width > 0 && rect.height > 0;\n\n const style = window.getComputedStyle(element);\n const isVisibleStyle = style.display !== 'none' && style.visibility !== 'hidden' && parseFloat(style.opacity) !== 0;\n\n // Check if the element is within the viewport\n const isInViewport =\n rect.top < window.innerHeight && rect.left < window.innerWidth && rect.bottom > 0 && rect.right > 0;\n\n return hasSize && isVisibleStyle && isInViewport;\n}\n\n/**\n * Assigns a local DOM ref to a forwarded ref.\n *\n * @param {RefObject<HTMLDivElement>} localRef - The local React reference to an HTMLDivElement.\n * @param {ForwardedRef<HTMLDivElement>} forwardedRef - The ref forwarded from a parent component.\n */\nexport function syncRefs<TElement = HTMLElement>(localRef: RefObject<TElement>, forwardedRef: ForwardedRef<TElement>) {\n if (!forwardedRef) {\n return;\n }\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(localRef.current);\n } else if (forwardedRef && 'current' in forwardedRef) {\n forwardedRef.current = localRef.current;\n }\n}\n\n/**\n * Sets the 'autoFocusVisible' data attribute to 'false' on the current target of a mouse event.\n * This function is typically used to indicate that an element has been interacted with via mouse,\n * which should prevent the focus ring from being displayed when the element receives focus.\n *\n * @param mouseEvent - The mouse event object.\n */\nexport function addAutoFocusAttribute(mouseEvent: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n mouseEvent.currentTarget.dataset.autoFocusVisible = 'false';\n}\n\n/**\n * Manages the focus ring visibility based on the previous focus state and the current focus event.\n * This function sets the 'showFocusRing' data attribute on the target element and updates the\n * 'autoFocusVisible' data attribute on the previously focused element.\n *\n * ! This function should be used in conjunction with the 'addAutoFocusAttribute' function and the autoFocusVisible data autoFocusTrigger.\n *\n * @param event - The focus event object.\n */\nexport function addShowFocusRing(event: FocusEvent<HTMLDivElement, HTMLElement>) {\n const triggerElement = event.relatedTarget;\n\n if (!triggerElement?.dataset.autoFocusTrigger) {\n return;\n }\n\n if (triggerElement.dataset.autoFocusVisible === 'true') {\n event.target.dataset.showFocusRing = 'true';\n } else {\n event.target.dataset.showFocusRing = 'false';\n }\n\n triggerElement.dataset.autoFocusVisible = 'true';\n}\n"],"names":["syncRefs","localRef","forwardedRef","addAutoFocusAttribute","mouseEvent","addShowFocusRing","event","triggerElement"],"mappings":"AAkEgB,SAAAA,EAAiCC,GAA+BC,GAAsC;AAClH,EAAKA,MAID,OAAOA,KAAiB,aACxBA,EAAaD,EAAS,OAAO,IACtBC,KAAgB,aAAaA,MACpCA,EAAa,UAAUD,EAAS;AAExC;AASO,SAASE,EAAsBC,GAA4D;AACnF,EAAAA,EAAA,cAAc,QAAQ,mBAAmB;AACxD;AAWO,SAASC,EAAiBC,GAAgD;AAC7E,QAAMC,IAAiBD,EAAM;AAEzB,EAACC,KAAA,QAAAA,EAAgB,QAAQ,qBAIzBA,EAAe,QAAQ,qBAAqB,SACtCD,EAAA,OAAO,QAAQ,gBAAgB,SAE/BA,EAAA,OAAO,QAAQ,gBAAgB,SAGzCC,EAAe,QAAQ,mBAAmB;AAC9C;"}
1
+ {"version":3,"file":"fondue-components42.js","sources":["../src/components/ColorPicker/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorFormat, type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\nexport const DEFAULT_FORMAT = 'HEX';\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha || 1})`;\n};\n\n/**\n * Checks if a string is a valid hexadecimal color code. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} color - The color code to be checked.\n * @returns {boolean}\n * @example\n * isValidHexColor('FFF'); // true\n * @example\n * isValidHexColor('FF5733'); // true\n * @example\n * isValidHexColor('XYZ'); // false\n */\nexport const isValidHexColor = (color: string): boolean => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n return color.length > 2 && hexRegex.test(color);\n};\n\n/**\n * Converts a hexadecimal color code to an RGBA color object. This function accepts\n * both three-digit and six-digit hex codes without the '#' symbol.\n * @param {string} hex - The hex code, either 3 or 6 characters long. Characters should be from the set [0-9A-Fa-f].\n * @returns {RgbaColor}\n * @example\n * hexColorToRgba('FFF'); // { red: 255, green: 255, blue: 255, alpha: 1 }\n * @example\n * hexColorToRgba('FF5733'); // { red: 255, green: 87, blue: 51, alpha: 1 }\n * @example\n * hexColorToRgba('XYZ'); // { red: 0, green: 0, blue: 0, alpha: 0 }\n */\nexport const hexColorToRgba = (hex: string): RgbaColor => {\n const hexRegex = /^([\\dA-Fa-f]{3}){1,2}$/;\n const matches = hex.match(hexRegex);\n if (!matches) {\n return {\n red: 0,\n green: 0,\n blue: 0,\n alpha: 0,\n };\n }\n const hexColor = matches[0];\n if (hexColor.length === 3) {\n return {\n red: parseInt(`${hexColor[0]}${hexColor[0]}`, 16),\n green: parseInt(`${hexColor[1]}${hexColor[1]}`, 16),\n blue: parseInt(`${hexColor[2]}${hexColor[2]}`, 16),\n alpha: 1,\n };\n }\n return {\n red: parseInt(hexColor.slice(0, 2), 16),\n green: parseInt(hexColor.slice(2, 4), 16),\n blue: parseInt(hexColor.slice(4, 6), 16),\n alpha: 1,\n };\n};\n\n/**\n * Converts an RGBA color object to a hexadecimal color code. This function returns a\n * six-digit hex code without the '#' symbol.\n * @param {RgbaColor} rgb - The RGBA color object.\n * @returns {string}\n * @example\n * rgbColorToHex({ red: 255, green: 255, blue: 255, alpha: 1 }); // '#FFFFFF'\n * @example\n * rgbColorToHex({ red: 255, green: 87, blue: 51, alpha: 1 }); // '#FF5733'\n * @example\n * rgbColorToHex({ red: 0, green: 0, blue: 0, alpha: 0 }); // '#000000'\n */\nexport const rgbColorToHex = (rgb: Omit<RgbaColor, 'alpha'>): string => {\n const { red, green, blue } = rgb;\n return `${red.toString(16).padStart(2, '0')}${green.toString(16).padStart(2, '0')}${blue.toString(16).padStart(2, '0')}`;\n};\n\n/**\n * Returns a color object with a name property based on the provided color and format.\n * @param {RgbaColor} color - The RGBA color object.\n * @param {ColorFormat} currentFormat - The current format of the color.\n * @returns {RgbaColor}\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'HEX'); // { red: 255, green: 255, blue: 255, alpha: 1, name: '#FFFFFF' }\n * @example\n * getColorWithName({ red: 255, green: 255, blue: 255, alpha: 1 }, 'RGBA'); // { red: 255, green: 255, blue: 255, alpha: 1, name: 'rgba(255, 255, 255, 1)' }\n * @example\n * getColorWithName({ red: 255, green: 87, blue: 51, alpha: 1 }, 'RGBA'); // { red: 255, green: 87, blue: 51, alpha: 1, name: 'rgba(255, 87, 51, 1)' }\n */\nexport const getColorWithName = (color: RgbaColor, currentFormat: ColorFormat) => {\n if (currentFormat === 'HEX') {\n return {\n ...color,\n name: `#${rgbColorToHex(color)}`,\n };\n }\n return {\n ...color,\n name: `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha || 1})`,\n };\n};\n\n/**\n * Returns a number between a minimum and maximum value, inclusive.\n * @param {string} value - The value to be limited.\n * @param {number} [min=0] - The minimum value (inclusive).\n * @param {number} [max=255] - The maximum value (inclusive).\n * @returns {number}\n * @example\n * getLimitedColorChannelValue('255'); // 255\n * @example\n * getLimitedColorChannelValue('100'); // 100\n * @example\n * getLimitedColorChannelValue('0'); // 0\n * @example\n * getLimitedColorChannelValue('500'); // 255\n * @example\n * getLimitedColorChannelValue('500', 0, 100); // 100\n */\nexport const getLimitedColorChannelValue = (value: string, min: number = 0, max: number = 255): number => {\n if (value.length === 0 || parseInt(value) < min) {\n return min;\n } else if (parseInt(value) > max) {\n return max;\n }\n return parseInt(value);\n};\n"],"names":["DEFAULT_COLOR","DEFAULT_FORMAT","colorToCss","color","isValidHexColor","hexRegex","hexColorToRgba","hex","matches","hexColor","rgbColorToHex","rgb","red","green","blue","getColorWithName","currentFormat","getLimitedColorChannelValue","value","min","max"],"mappings":"AAIa,MAAAA,IAAgB,EAAE,KAAK,KAAK,OAAO,KAAK,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,GACtEC,IAAiB,OAajBC,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF,GAcaC,IAAkB,CAACD,MAA2B;AACvD,QAAME,IAAW;AACjB,SAAOF,EAAM,SAAS,KAAKE,EAAS,KAAKF,CAAK;AAClD,GAcaG,IAAiB,CAACC,MAA2B;AACtD,QAAMF,IAAW,0BACXG,IAAUD,EAAI,MAAMF,CAAQ;AAClC,MAAI,CAACG;AACM,WAAA;AAAA,MACH,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAEE,QAAAC,IAAWD,EAAQ,CAAC;AACtB,SAAAC,EAAS,WAAW,IACb;AAAA,IACH,KAAK,SAAS,GAAGA,EAAS,CAAC,CAAC,GAAGA,EAAS,CAAC,CAAC,IAAI,EAAE;AAAA,IAChD,OAAO,SAAS,GAA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