@frontify/fondue 10.0.0 → 11.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/components/ColorInputFlyout/ColorInputTitle.es.js +6 -6
- package/dist/components/ColorInputFlyout/ColorInputTitle.es.js.map +1 -1
- package/dist/components/ColorInputFlyout/ColorPickerFlyout.es.js +10 -10
- package/dist/components/ColorInputFlyout/ColorPickerFlyout.es.js.map +1 -1
- package/dist/components/ColorInputFlyout/ColorPickerTrigger.es.js +9 -8
- package/dist/components/ColorInputFlyout/ColorPickerTrigger.es.js.map +1 -1
- package/dist/components/ColorPicker/BrandColorPicker.es.js +15 -15
- package/dist/components/ColorPicker/BrandColorPicker.es.js.map +1 -1
- package/dist/components/ColorPicker/ColorPreview.es.js +7 -6
- package/dist/components/ColorPicker/ColorPreview.es.js.map +1 -1
- package/dist/components/ColorPicker/CustomColorPicker.es.js +61 -55
- package/dist/components/ColorPicker/CustomColorPicker.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconBasketball12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconBasketball12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconBell12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconBell12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconBookmark12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconBookmark12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconBookmark12Filled.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconBookmark12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconBuildings12.es.js +14 -6
- package/dist/foundation/Icon/Generated/IconBuildings12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCalendar12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconCalendar12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCalendarChecked12.es.js +10 -1
- package/dist/foundation/Icon/Generated/IconCalendarChecked12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCard12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconCard12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconChartPie12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconChartPie12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCheckMarkCircle12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconCheckMarkCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCheckMarkCircle12Filled.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconCheckMarkCircle12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCircle12.es.js +12 -3
- package/dist/foundation/Icon/Generated/IconCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconClock12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconClock12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconClockAlternative12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconClockAlternative12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCodeBox12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconCodeBox12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCodeFrame12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconCodeFrame12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCog12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconCog12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconColorFan12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconColorFan12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCross12.es.js +6 -15
- package/dist/foundation/Icon/Generated/IconCross12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCross16.es.js +6 -15
- package/dist/foundation/Icon/Generated/IconCross16.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCross20.es.js +6 -15
- package/dist/foundation/Icon/Generated/IconCross20.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCross24.es.js +6 -15
- package/dist/foundation/Icon/Generated/IconCross24.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCross32.es.js +1 -1
- package/dist/foundation/Icon/Generated/IconCross32.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCrossCircle12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconCrossCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconCrossCircle12Filled.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconCrossCircle12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDiagramTree12.es.js +17 -8
- package/dist/foundation/Icon/Generated/IconDiagramTree12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDividerBlank12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconDividerBlank12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDividerDashed12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDividerDashed12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDividerDotted12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconDividerDotted12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDividerSolid12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconDividerSolid12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDoAndDont20.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDoAndDont20.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocument12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDocument12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentArrowRight12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconDocumentArrowRight12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentBadge12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconDocumentBadge12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentCheck12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDocumentCheck12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentCode12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconDocumentCode12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentList12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconDocumentList12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentStack12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDocumentStack12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDocumentText12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDocumentText12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDroplet12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconDroplet12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconDrops12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconDrops12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconExclamationMark12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconExclamationMark12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconExclamationMarkCircle12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconExclamationMarkCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconExclamationMarkCircle12Filled.es.js +10 -1
- package/dist/foundation/Icon/Generated/IconExclamationMarkCircle12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconHeartCircle12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconHeartCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconImageStackPlus12.es.js +12 -3
- package/dist/foundation/Icon/Generated/IconImageStackPlus12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconIntercom12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconIntercom12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconJohanna12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconJohanna12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconLightning12Filled.es.js +18 -9
- package/dist/foundation/Icon/Generated/IconLightning12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconLockClosed12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconLockClosed12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconLollipop12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconLollipop12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconMagnifier12.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconMagnifier12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconMagnifierPlus12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconMagnifierPlus12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconMapPointer12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconMapPointer12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconMinusCircle12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconMinusCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconMoneyCircle12Filled.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconMoneyCircle12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconOrientationBoxes12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconOrientationBoxes12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconQuestionMark12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconQuestionMark12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconQuestionMarkCircle12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconQuestionMarkCircle12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconReport12.es.js +16 -7
- package/dist/foundation/Icon/Generated/IconReport12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRocket12.es.js +1 -1
- package/dist/foundation/Icon/Generated/IconRocket12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRocket16.es.js +7 -16
- package/dist/foundation/Icon/Generated/IconRocket16.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRocket20.es.js +7 -16
- package/dist/foundation/Icon/Generated/IconRocket20.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRocket24.es.js +8 -17
- package/dist/foundation/Icon/Generated/IconRocket24.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRocket32.es.js +1 -1
- package/dist/foundation/Icon/Generated/IconRocket32.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconRuler12.es.js +10 -1
- package/dist/foundation/Icon/Generated/IconRuler12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconSoundWave12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconSoundWave12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconSpeechBubbleDots12.es.js +12 -3
- package/dist/foundation/Icon/Generated/IconSpeechBubbleDots12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconSpeechBubbleQuote12.es.js +12 -3
- package/dist/foundation/Icon/Generated/IconSpeechBubbleQuote12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconStackVertical12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconStackVertical12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconStar12.es.js +12 -3
- package/dist/foundation/Icon/Generated/IconStar12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconStar12Filled.es.js +15 -6
- package/dist/foundation/Icon/Generated/IconStar12Filled.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconSuitcase12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconSuitcase12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconSuitcaseTag12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconSuitcaseTag12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconTextBrackets12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconTextBrackets12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconTextColumnBreak12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconTextColumnBreak12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconTrashBin12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconTrashBin12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconTypographyCase12.es.js +14 -5
- package/dist/foundation/Icon/Generated/IconTypographyCase12.es.js.map +1 -1
- package/dist/foundation/Icon/Generated/IconWorkflowShapes12.es.js +13 -4
- package/dist/foundation/Icon/Generated/IconWorkflowShapes12.es.js.map +1 -1
- package/dist/index.cjs.js +20 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +3288 -3286
- package/dist/index.umd.js +20 -20
- package/dist/index.umd.js.map +1 -1
- package/dist/types/colors.d.ts +7 -1
- package/dist/types/colors.es.js.map +1 -1
- package/dist/utilities/colors.d.ts +3 -1
- package/dist/utilities/colors.es.js +16 -8
- package/dist/utilities/colors.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toShortRgb as c, getColorDisplayValue as s } from "../../utilities/colors.es.js";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import
|
|
3
|
+
import p from "tinycolor2";
|
|
4
4
|
import { ColorFormat as n } from "../../types/colors.es.js";
|
|
5
|
-
const
|
|
6
|
-
const { name: l,
|
|
5
|
+
const b = ({ currentColor: t, format: o }) => {
|
|
6
|
+
const { name: l, alpha: e } = t, r = p(c(t)), m = s(t, o, !1);
|
|
7
7
|
return /* @__PURE__ */ a.createElement("div", {
|
|
8
8
|
className: "tw-text-black-100"
|
|
9
|
-
}, l || m,
|
|
9
|
+
}, l || m, o === n.Hex && e && e < 1 && /* @__PURE__ */ a.createElement("span", {
|
|
10
10
|
className: "tw-text-black-60"
|
|
11
11
|
}, ` ${Math.trunc(r.getAlpha() * 100)} %`));
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
b as ColorInputTitle
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=ColorInputTitle.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorInputTitle.es.js","sources":["../../../src/components/ColorInputFlyout/ColorInputTitle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { getColorDisplayValue } from '@utilities/colors';\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { Color, ColorFormat } from '../../types/colors';\n\ntype Props = {\n currentColor: Color;\n format: ColorFormat;\n};\n\nexport const ColorInputTitle: FC<Props> = ({ currentColor, format }) => {\n const { name,
|
|
1
|
+
{"version":3,"file":"ColorInputTitle.es.js","sources":["../../../src/components/ColorInputFlyout/ColorInputTitle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { getColorDisplayValue, toShortRgb } from '@utilities/colors';\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { Color, ColorFormat } from '../../types/colors';\n\ntype Props = {\n currentColor: Color;\n format: ColorFormat;\n};\n\nexport const ColorInputTitle: FC<Props> = ({ currentColor, format }) => {\n const { name, alpha } = currentColor;\n const parsedColor = tinycolor(toShortRgb(currentColor));\n const colorValue = getColorDisplayValue(currentColor, format, false);\n\n return (\n <div className=\"tw-text-black-100\">\n {name || colorValue}\n {format === ColorFormat.Hex && alpha && alpha < 1 && (\n <span className=\"tw-text-black-60\">{` ${Math.trunc(parsedColor.getAlpha() * 100)} %`}</span>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAYO,MAAM,IAA6B,CAAC,EAAE,iBAAc,gBAAa;AAC9D,QAAA,EAAE,SAAM,aAAU,GAClB,IAAc,EAAU,EAAW,CAAY,CAAC,GAChD,IAAa,EAAqB,GAAc,GAAQ,EAAK;AAEnE,SACK,kBAAA,cAAA,OAAA;AAAA,IAAI,WAAU;AAAA,EACV,GAAA,KAAQ,GACR,MAAW,EAAY,OAAO,KAAS,IAAQ,KAC3C,kBAAA,cAAA,QAAA;AAAA,IAAK,WAAU;AAAA,EAAoB,GAAA,IAAI,KAAK,MAAM,EAAY,SAAa,IAAA,GAAG,KAAM,CAE7F;AAER;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t, { useState as
|
|
1
|
+
import t, { useState as s } from "react";
|
|
2
2
|
import "@react-aria/focus";
|
|
3
3
|
import "@react-aria/interactions";
|
|
4
4
|
import "@react-aria/radio";
|
|
@@ -1655,13 +1655,13 @@ const mI = ({
|
|
|
1655
1655
|
onSelect: g,
|
|
1656
1656
|
currentColor: i,
|
|
1657
1657
|
palettes: u,
|
|
1658
|
-
disabled:
|
|
1659
|
-
clearable:
|
|
1658
|
+
disabled: d = !1,
|
|
1659
|
+
clearable: h = !1,
|
|
1660
1660
|
onClear: e,
|
|
1661
1661
|
onDelete: p
|
|
1662
1662
|
}) => {
|
|
1663
|
-
const [a, r] =
|
|
1664
|
-
|
|
1663
|
+
const [a, r] = s(!1), [f, F] = s(O.Hex), n = (l) => {
|
|
1664
|
+
l || m == null || m(), r(l);
|
|
1665
1665
|
}, E = () => {
|
|
1666
1666
|
r(!1), o == null || o();
|
|
1667
1667
|
};
|
|
@@ -1671,16 +1671,16 @@ const mI = ({
|
|
|
1671
1671
|
isOpen: a,
|
|
1672
1672
|
onCancel: () => n(!1),
|
|
1673
1673
|
fixedHeader: /* @__PURE__ */ t.createElement(v, {
|
|
1674
|
-
color: i || {
|
|
1674
|
+
color: i || { red: 255, green: 255, blue: 255 }
|
|
1675
1675
|
}),
|
|
1676
1676
|
onOpenChange: n,
|
|
1677
1677
|
trigger: /* @__PURE__ */ t.createElement(x, {
|
|
1678
1678
|
isOpen: a,
|
|
1679
1679
|
currentColor: i,
|
|
1680
1680
|
format: f,
|
|
1681
|
-
disabled:
|
|
1681
|
+
disabled: d,
|
|
1682
1682
|
id: c,
|
|
1683
|
-
clearable:
|
|
1683
|
+
clearable: h,
|
|
1684
1684
|
onClear: () => {
|
|
1685
1685
|
r(!1), e && e();
|
|
1686
1686
|
},
|
|
@@ -1690,10 +1690,10 @@ const mI = ({
|
|
|
1690
1690
|
})
|
|
1691
1691
|
}, /* @__PURE__ */ t.createElement(P, {
|
|
1692
1692
|
currentFormat: f,
|
|
1693
|
-
setFormat:
|
|
1693
|
+
setFormat: F,
|
|
1694
1694
|
palettes: u,
|
|
1695
1695
|
showPreview: !1,
|
|
1696
|
-
currentColor: i || {
|
|
1696
|
+
currentColor: i || { red: 255, green: 255, blue: 255 },
|
|
1697
1697
|
onSelect: g
|
|
1698
1698
|
}));
|
|
1699
1699
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerFlyout.es.js","sources":["../../../src/components/ColorInputFlyout/ColorPickerFlyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ColorPreview } from '@components/ColorPicker';\nimport { ColorPicker, ColorPickerProps } from '@components/ColorPicker/ColorPicker';\nimport { Flyout } from '@components/Flyout/Flyout';\nimport React, { FC, useState } from 'react';\nimport { Color, ColorFormat } from '../../types/colors';\nimport { ColorInputTrigger } from './ColorPickerTrigger';\n\nexport type ColorPickerFlyoutProps = Pick<ColorPickerProps, 'palettes' | 'onSelect'> & {\n id?: string;\n disabled?: boolean;\n onClick?: () => void;\n onClose?: () => void;\n currentColor: Color | null;\n clearable?: boolean;\n onClear?: () => void;\n onDelete?: () => void;\n};\n\nexport const ColorPickerFlyout: FC<ColorPickerFlyoutProps> = ({\n id,\n onClick,\n onClose,\n onSelect,\n currentColor,\n palettes,\n disabled = false,\n clearable = false,\n onClear,\n onDelete,\n}) => {\n const [open, setOpen] = useState(false);\n const [currentFormat, setCurrentFormat] = useState(ColorFormat.Hex);\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.();\n }\n setOpen(isOpen);\n };\n\n const handleClick = () => {\n setOpen(false);\n onClick?.();\n };\n\n return (\n <Flyout\n hug={false}\n onConfirm={handleClick}\n isOpen={open}\n onCancel={() => handleOpenChange(false)}\n fixedHeader={<ColorPreview color={currentColor || {
|
|
1
|
+
{"version":3,"file":"ColorPickerFlyout.es.js","sources":["../../../src/components/ColorInputFlyout/ColorPickerFlyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ColorPreview } from '@components/ColorPicker';\nimport { ColorPicker, ColorPickerProps } from '@components/ColorPicker/ColorPicker';\nimport { Flyout } from '@components/Flyout/Flyout';\nimport React, { FC, useState } from 'react';\nimport { Color, ColorFormat } from '../../types/colors';\nimport { ColorInputTrigger } from './ColorPickerTrigger';\n\nexport type ColorPickerFlyoutProps = Pick<ColorPickerProps, 'palettes' | 'onSelect'> & {\n id?: string;\n disabled?: boolean;\n onClick?: () => void;\n onClose?: () => void;\n currentColor: Color | null;\n clearable?: boolean;\n onClear?: () => void;\n onDelete?: () => void;\n};\n\nexport const ColorPickerFlyout: FC<ColorPickerFlyoutProps> = ({\n id,\n onClick,\n onClose,\n onSelect,\n currentColor,\n palettes,\n disabled = false,\n clearable = false,\n onClear,\n onDelete,\n}) => {\n const [open, setOpen] = useState(false);\n const [currentFormat, setCurrentFormat] = useState(ColorFormat.Hex);\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.();\n }\n setOpen(isOpen);\n };\n\n const handleClick = () => {\n setOpen(false);\n onClick?.();\n };\n\n return (\n <Flyout\n hug={false}\n onConfirm={handleClick}\n isOpen={open}\n onCancel={() => handleOpenChange(false)}\n fixedHeader={<ColorPreview color={currentColor || { red: 255, green: 255, blue: 255 }} />}\n onOpenChange={handleOpenChange}\n trigger={\n <ColorInputTrigger\n isOpen={open}\n currentColor={currentColor}\n format={currentFormat}\n disabled={disabled}\n id={id}\n clearable={clearable}\n onClear={() => {\n setOpen(false);\n onClear && onClear();\n }}\n onDelete={\n onDelete\n ? () => {\n setOpen(false);\n onDelete && onDelete();\n }\n : undefined\n }\n />\n }\n >\n <ColorPicker\n currentFormat={currentFormat}\n setFormat={setCurrentFormat}\n palettes={palettes}\n showPreview={false}\n currentColor={currentColor || { red: 255, green: 255, blue: 255 }}\n onSelect={onSelect}\n />\n </Flyout>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAA,GAGZ,IAAc,MAAM;AACtB,MAAQ,EAAK,GACH;AAAA,EAAA;AAGd,SACK,kBAAA,cAAA,GAAA;AAAA,IACG,KAAK;AAAA,IACL,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,UAAU,MAAM,EAAiB,EAAK;AAAA,IACtC,aAAc,kBAAA,cAAA,GAAA;AAAA,MAAa,OAAO,KAAgB,EAAE,KAAK,KAAK,OAAO,KAAK,MAAM,IAAI;AAAA,IAAA,CAAG;AAAA,IACvF,cAAc;AAAA,IACd,SACK,kBAAA,cAAA,GAAA;AAAA,MACG,QAAQ;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,MAAM;AACX,UAAQ,EAAK,GACb,KAAW,EAAQ;AAAA,MACvB;AAAA,MACA,UACI,IACM,MAAM;AACF,UAAQ,EAAK,GACb,KAAY,EAAS;AAAA,MAEzB,IAAA;AAAA,IAAA,CAEd;AAAA,EAAA,GAGH,kBAAA,cAAA,GAAA;AAAA,IACG;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,cAAc,KAAgB,EAAE,KAAK,KAAK,OAAO,KAAK,MAAM,IAAI;AAAA,IAChE;AAAA,EACJ,CAAA,CACJ;AAER;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { MenuItemContent as f } from "../MenuItem/MenuItemContent.es.js";
|
|
2
2
|
import { Trigger as g } from "../Trigger/Trigger.es.js";
|
|
3
3
|
import u from "../../foundation/Icon/Generated/IconDroplet.es.js";
|
|
4
|
-
import { IconSize as
|
|
5
|
-
import { useMemoizedId as
|
|
4
|
+
import { IconSize as b } from "../../foundation/Icon/IconSize.es.js";
|
|
5
|
+
import { useMemoizedId as x } from "../../hooks/useMemoizedId.es.js";
|
|
6
6
|
import { useFocusRing as d } from "@react-aria/focus";
|
|
7
|
+
import { toShortRgb as E } from "../../utilities/colors.es.js";
|
|
7
8
|
import { merge as r } from "../../utilities/merge.es.js";
|
|
8
9
|
import e from "react";
|
|
9
|
-
import
|
|
10
|
+
import h from "tinycolor2";
|
|
10
11
|
import { ColorInputTitle as y } from "./ColorInputTitle.es.js";
|
|
11
|
-
const
|
|
12
|
+
const D = ({
|
|
12
13
|
id: m,
|
|
13
14
|
currentColor: t,
|
|
14
15
|
format: i,
|
|
@@ -18,7 +19,7 @@ const j = ({
|
|
|
18
19
|
onClear: a,
|
|
19
20
|
onDelete: s
|
|
20
21
|
}) => {
|
|
21
|
-
const { isFocusVisible: w, focusProps: c } = d(), p = t ? E(t).toRgbString() : "";
|
|
22
|
+
const { isFocusVisible: w, focusProps: c } = d(), p = t ? h(E(t)).toRgbString() : "";
|
|
22
23
|
return /* @__PURE__ */ e.createElement(g, {
|
|
23
24
|
isOpen: n,
|
|
24
25
|
disabled: o,
|
|
@@ -29,7 +30,7 @@ const j = ({
|
|
|
29
30
|
}, /* @__PURE__ */ e.createElement("button", {
|
|
30
31
|
...c,
|
|
31
32
|
type: "button",
|
|
32
|
-
id:
|
|
33
|
+
id: x(m),
|
|
33
34
|
className: r([
|
|
34
35
|
"tw-overflow-hidden tw-flex-auto tw-h-full tw-rounded tw-text-left tw-outline-none tw-py-2 tw-pl-3 tw-min-h-[34px] tw-pr-7",
|
|
35
36
|
!t && "tw-text-black-60",
|
|
@@ -49,11 +50,11 @@ const j = ({
|
|
|
49
50
|
}) : /* @__PURE__ */ e.createElement("span", {
|
|
50
51
|
className: "tw-text-black-70"
|
|
51
52
|
}, /* @__PURE__ */ e.createElement(u, {
|
|
52
|
-
size:
|
|
53
|
+
size: b.Size12
|
|
53
54
|
}))
|
|
54
55
|
})));
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
D as ColorInputTrigger
|
|
58
59
|
};
|
|
59
60
|
//# sourceMappingURL=ColorPickerTrigger.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerTrigger.es.js","sources":["../../../src/components/ColorInputFlyout/ColorPickerTrigger.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MenuItemContent } from '@components/MenuItem/MenuItemContent';\nimport { Trigger } from '@components/Trigger/Trigger';\nimport IconDroplet from '@foundation/Icon/Generated/IconDroplet';\nimport { IconSize } from '@foundation/Icon/IconSize';\nimport { useMemoizedId } from '@hooks/useMemoizedId';\nimport { useFocusRing } from '@react-aria/focus';\nimport { merge } from '@utilities/merge';\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { ColorFormat } from '../../types/colors';\nimport { ColorInputTitle } from './ColorInputTitle';\nimport { ColorPickerFlyoutProps } from './ColorPickerFlyout';\n\ntype ColorInputTriggerProps = Pick<ColorPickerFlyoutProps, 'id' | 'currentColor' | 'disabled'> & {\n isOpen?: boolean;\n format: ColorFormat;\n clearable?: boolean;\n onClear?: () => void;\n onDelete?: () => void;\n};\n\nexport const ColorInputTrigger: FC<ColorInputTriggerProps> = ({\n id,\n currentColor,\n format,\n isOpen = false,\n disabled = false,\n clearable = false,\n onClear,\n onDelete,\n}) => {\n const { isFocusVisible, focusProps } = useFocusRing();\n const backgroundColor = currentColor ? tinycolor(currentColor).toRgbString() : '';\n\n return (\n <Trigger\n isOpen={isOpen}\n disabled={disabled}\n isFocusVisible={isFocusVisible}\n showClear={!!currentColor && clearable}\n onClear={onClear}\n onDelete={onDelete}\n >\n <button\n {...focusProps}\n type=\"button\"\n id={useMemoizedId(id)}\n className={merge([\n 'tw-overflow-hidden tw-flex-auto tw-h-full tw-rounded tw-text-left tw-outline-none tw-py-2 tw-pl-3 tw-min-h-[34px] tw-pr-7',\n !currentColor && 'tw-text-black-60',\n disabled && 'tw-text-black-40',\n ])}\n >\n <MenuItemContent\n title={\n currentColor ? <ColorInputTitle format={format} currentColor={currentColor} /> : 'Select color'\n }\n decorator={\n currentColor ? (\n <span\n className={merge([\n 'tw-h-4 tw-w-4 tw-rounded tw-flex tw-items-center tw-justify-center tw-ring-1 tw-ring-black-10 tw-ring-offset-1',\n disabled && 'tw-opacity-50',\n ])}\n style={{ backgroundColor }}\n />\n ) : (\n <span className=\"tw-text-black-70\">\n <IconDroplet size={IconSize.Size12} />\n </span>\n )\n }\n />\n </button>\n </Trigger>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPickerTrigger.es.js","sources":["../../../src/components/ColorInputFlyout/ColorPickerTrigger.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MenuItemContent } from '@components/MenuItem/MenuItemContent';\nimport { Trigger } from '@components/Trigger/Trigger';\nimport IconDroplet from '@foundation/Icon/Generated/IconDroplet';\nimport { IconSize } from '@foundation/Icon/IconSize';\nimport { useMemoizedId } from '@hooks/useMemoizedId';\nimport { useFocusRing } from '@react-aria/focus';\nimport { toShortRgb } from '@utilities/colors';\nimport { merge } from '@utilities/merge';\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { ColorFormat } from '../../types/colors';\nimport { ColorInputTitle } from './ColorInputTitle';\nimport { ColorPickerFlyoutProps } from './ColorPickerFlyout';\n\ntype ColorInputTriggerProps = Pick<ColorPickerFlyoutProps, 'id' | 'currentColor' | 'disabled'> & {\n isOpen?: boolean;\n format: ColorFormat;\n clearable?: boolean;\n onClear?: () => void;\n onDelete?: () => void;\n};\n\nexport const ColorInputTrigger: FC<ColorInputTriggerProps> = ({\n id,\n currentColor,\n format,\n isOpen = false,\n disabled = false,\n clearable = false,\n onClear,\n onDelete,\n}) => {\n const { isFocusVisible, focusProps } = useFocusRing();\n const backgroundColor = currentColor ? tinycolor(toShortRgb(currentColor)).toRgbString() : '';\n\n return (\n <Trigger\n isOpen={isOpen}\n disabled={disabled}\n isFocusVisible={isFocusVisible}\n showClear={!!currentColor && clearable}\n onClear={onClear}\n onDelete={onDelete}\n >\n <button\n {...focusProps}\n type=\"button\"\n id={useMemoizedId(id)}\n className={merge([\n 'tw-overflow-hidden tw-flex-auto tw-h-full tw-rounded tw-text-left tw-outline-none tw-py-2 tw-pl-3 tw-min-h-[34px] tw-pr-7',\n !currentColor && 'tw-text-black-60',\n disabled && 'tw-text-black-40',\n ])}\n >\n <MenuItemContent\n title={\n currentColor ? <ColorInputTitle format={format} currentColor={currentColor} /> : 'Select color'\n }\n decorator={\n currentColor ? (\n <span\n className={merge([\n 'tw-h-4 tw-w-4 tw-rounded tw-flex tw-items-center tw-justify-center tw-ring-1 tw-ring-black-10 tw-ring-offset-1',\n disabled && 'tw-opacity-50',\n ])}\n style={{ backgroundColor }}\n />\n ) : (\n <span className=\"tw-text-black-70\">\n <IconDroplet size={IconSize.Size12} />\n </span>\n )\n }\n />\n </button>\n </Trigger>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAwBO,MAAM,IAAgD,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAS;AAAA,EACT,cAAW;AAAA,EACX,eAAY;AAAA,EACZ;AAAA,EACA;AAAA,MACE;AACI,QAAA,EAAE,mBAAgB,kBAAe,EAAa,GAC9C,IAAkB,IAAe,EAAU,EAAW,CAAY,CAAC,EAAE,YAAgB,IAAA;AAE3F,SACK,kBAAA,cAAA,GAAA;AAAA,IACG;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,CAAC,CAAC,KAAgB;AAAA,IAC7B;AAAA,IACA;AAAA,EAAA,GAEC,kBAAA,cAAA,UAAA;AAAA,IACI,GAAG;AAAA,IACJ,MAAK;AAAA,IACL,IAAI,EAAc,CAAE;AAAA,IACpB,WAAW,EAAM;AAAA,MACb;AAAA,MACA,CAAC,KAAgB;AAAA,MACjB,KAAY;AAAA,IAAA,CACf;AAAA,EAAA,GAEA,kBAAA,cAAA,GAAA;AAAA,IACG,OACI,IAAgB,kBAAA,cAAA,GAAA;AAAA,MAAgB;AAAA,MAAgB;AAAA,IAA4B,CAAA,IAAK;AAAA,IAErF,WACI,IACK,kBAAA,cAAA,QAAA;AAAA,MACG,WAAW,EAAM;AAAA,QACb;AAAA,QACA,KAAY;AAAA,MAAA,CACf;AAAA,MACD,OAAO,EAAE,mBAAgB;AAAA,IAAA,CAC7B,IAEC,kBAAA,cAAA,QAAA;AAAA,MAAK,WAAU;AAAA,IAAA,GACX,kBAAA,cAAA,GAAA;AAAA,MAAY,MAAM,EAAS;AAAA,IAAA,CAAQ,CACxC;AAAA,EAGZ,CAAA,CACJ,CACJ;AAER;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slider as
|
|
2
|
-
import { TextInput as
|
|
1
|
+
import { Slider as h } from "../Slider/Slider.es.js";
|
|
2
|
+
import { TextInput as N } from "../TextInput/TextInput.es.js";
|
|
3
3
|
import "../../foundation/Icon/Generated/IconAdobeCreativeCloud.es.js";
|
|
4
4
|
import "../../foundation/Icon/Generated/IconAdobeCreativeCloud12.es.js";
|
|
5
5
|
import "../../foundation/Icon/Generated/IconAdobeCreativeCloud16.es.js";
|
|
@@ -347,7 +347,7 @@ import "../../foundation/Icon/Generated/IconChartPie16.es.js";
|
|
|
347
347
|
import "../../foundation/Icon/Generated/IconChartPie20.es.js";
|
|
348
348
|
import "../../foundation/Icon/Generated/IconChartPie24.es.js";
|
|
349
349
|
import "../../foundation/Icon/Generated/IconChartPie32.es.js";
|
|
350
|
-
import
|
|
350
|
+
import L from "../../foundation/Icon/Generated/IconCheckMark.es.js";
|
|
351
351
|
import "../../foundation/Icon/Generated/IconCheckMark12.es.js";
|
|
352
352
|
import "../../foundation/Icon/Generated/IconCheckMark16.es.js";
|
|
353
353
|
import "../../foundation/Icon/Generated/IconCheckMark20.es.js";
|
|
@@ -1625,16 +1625,16 @@ import "../../foundation/Icon/Generated/IconWorkflowShapes20.es.js";
|
|
|
1625
1625
|
import "../../foundation/Icon/Generated/IconWorkflowShapes24.es.js";
|
|
1626
1626
|
import "../../foundation/Icon/Generated/IconWorkflowShapes32.es.js";
|
|
1627
1627
|
import { IconSize as S } from "../../foundation/Icon/IconSize.es.js";
|
|
1628
|
-
import { isColorLight as C } from "../../utilities/colors.es.js";
|
|
1628
|
+
import { isColorLight as C, toShortRgb as y } from "../../utilities/colors.es.js";
|
|
1629
1629
|
import { merge as d } from "../../utilities/merge.es.js";
|
|
1630
|
-
import t, { useState as s, useEffect as
|
|
1630
|
+
import t, { useState as s, useEffect as R } from "react";
|
|
1631
1631
|
import z from "tinycolor2";
|
|
1632
|
-
const l = (m, o = "") => m == null ? void 0 : m.toLocaleLowerCase().includes(o.toLocaleLowerCase().trim()),
|
|
1632
|
+
const l = (m, o = "") => m == null ? void 0 : m.toLocaleLowerCase().includes(o.toLocaleLowerCase().trim()), JC = ({ palettes: m = [], currentColor: o, onSelect: x }) => {
|
|
1633
1633
|
const w = [
|
|
1634
1634
|
{ id: "Grid", icon: /* @__PURE__ */ t.createElement(k, null), ariaLabel: "Grid" },
|
|
1635
1635
|
{ id: "List", icon: /* @__PURE__ */ t.createElement(I, null), ariaLabel: "List" }
|
|
1636
|
-
], [n,
|
|
1637
|
-
|
|
1636
|
+
], [n, u] = s(w[0].id), [p, g] = s(""), [E, b] = s(m);
|
|
1637
|
+
R(() => {
|
|
1638
1638
|
const i = setTimeout(() => {
|
|
1639
1639
|
b(m.filter(({ title: e, colors: a }) => l(e, p) || a.some(({ name: r }) => l(r, p))).map(({ id: e, title: a, colors: r }) => ({
|
|
1640
1640
|
id: e,
|
|
@@ -1652,18 +1652,18 @@ const l = (m, o = "") => m == null ? void 0 : m.toLocaleLowerCase().includes(o.t
|
|
|
1652
1652
|
className: "tw-flex tw-gap-2"
|
|
1653
1653
|
}, /* @__PURE__ */ t.createElement("div", {
|
|
1654
1654
|
className: "tw-flex-1"
|
|
1655
|
-
}, /* @__PURE__ */ t.createElement(
|
|
1655
|
+
}, /* @__PURE__ */ t.createElement(N, {
|
|
1656
1656
|
value: p,
|
|
1657
1657
|
decorator: /* @__PURE__ */ t.createElement(v, null),
|
|
1658
1658
|
placeholder: "Search",
|
|
1659
|
-
onChange: (i) =>
|
|
1659
|
+
onChange: (i) => g(i),
|
|
1660
1660
|
clearable: !0
|
|
1661
1661
|
})), /* @__PURE__ */ t.createElement("div", {
|
|
1662
1662
|
className: "tw-w-[72px]"
|
|
1663
|
-
}, /* @__PURE__ */ t.createElement(
|
|
1663
|
+
}, /* @__PURE__ */ t.createElement(h, {
|
|
1664
1664
|
items: w,
|
|
1665
1665
|
activeItemId: n,
|
|
1666
|
-
onChange: (i) =>
|
|
1666
|
+
onChange: (i) => u(i)
|
|
1667
1667
|
}))), /* @__PURE__ */ t.createElement("ul", {
|
|
1668
1668
|
className: "tw-flex tw-flex-col tw-gap-4"
|
|
1669
1669
|
}, f.length > 0 ? f.map(({ id: i, title: e, colors: a }) => /* @__PURE__ */ t.createElement("li", {
|
|
@@ -1688,14 +1688,14 @@ const l = (m, o = "") => m == null ? void 0 : m.toLocaleLowerCase().includes(o.t
|
|
|
1688
1688
|
"tw-h-6 tw-w-6 tw-mr-2 tw-rounded tw-flex tw-items-center tw-justify-center tw-ring-1 tw-ring-black-10 tw-ring-offset-1",
|
|
1689
1689
|
C(r) ? "tw-text-black" : "tw-text-white"
|
|
1690
1690
|
]),
|
|
1691
|
-
style: { background: z(r).toRgbString() }
|
|
1692
|
-
}, r.
|
|
1691
|
+
style: { background: z(y(r)).toRgbString() }
|
|
1692
|
+
}, r.red === o.red && r.green === o.green && r.blue === o.blue && r.alpha === o.alpha && /* @__PURE__ */ t.createElement(L, {
|
|
1693
1693
|
size: S.Size20
|
|
1694
1694
|
})), n === "List" && /* @__PURE__ */ t.createElement("span", {
|
|
1695
1695
|
className: "tw-h-6 tw-grow tw-flex tw-items-center tw-text-sm tw-text-left"
|
|
1696
1696
|
}, r.name))))))) : "No colors found"));
|
|
1697
1697
|
};
|
|
1698
1698
|
export {
|
|
1699
|
-
|
|
1699
|
+
JC as BrandColorPicker
|
|
1700
1700
|
};
|
|
1701
1701
|
//# sourceMappingURL=BrandColorPicker.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrandColorPicker.es.js","sources":["../../../src/components/ColorPicker/BrandColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slider } from '@components/Slider/Slider';\nimport { TextInput } from '@components/TextInput/TextInput';\nimport { IconCheckMark, IconGridRegular, IconMagnifier, IconStackVertical } from '@foundation/Icon/Generated';\nimport { IconSize } from '@foundation/Icon/IconSize';\nimport { isColorLight } from '@utilities/colors';\nimport { merge } from '@utilities/merge';\nimport React, { FC, useEffect, useState } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { ColorPickerProps } from './ColorPicker';\n\nconst find = (haystack?: string, needle = '') =>\n haystack?.toLocaleLowerCase().includes(needle.toLocaleLowerCase().trim());\n\nenum BrandColorView {\n List = 'List',\n Grid = 'Grid',\n}\n\ntype Props = Omit<ColorPickerProps, 'currentFormat' | 'setFormat'>;\n\nexport const BrandColorPicker: FC<Props> = ({ palettes: defaultPalettes = [], currentColor, onSelect }) => {\n const views = [\n { id: BrandColorView.Grid, icon: <IconGridRegular />, ariaLabel: 'Grid' },\n { id: BrandColorView.List, icon: <IconStackVertical />, ariaLabel: 'List' },\n ];\n const [view, setView] = useState(views[0].id);\n const [query, setQuery] = useState('');\n const [palettes, setPalettes] = useState(defaultPalettes);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setPalettes(\n defaultPalettes\n .filter(({ title, colors }) => find(title, query) || colors.some(({ name }) => find(name, query)))\n .map(({ id, title, colors }) => ({\n id,\n title,\n colors: colors.some(({ name }) => find(name, query))\n ? colors.filter(({ name }) => find(name, query))\n : colors,\n })),\n );\n }, 200);\n\n return () => clearTimeout(timer);\n }, [query]);\n\n const palettesWithColors = palettes.filter((palette) => palette.colors.length > 0);\n\n return (\n <div className=\"tw-flex tw-flex-col tw-gap-4\" data-test-id=\"brand-color-picker\">\n <div className=\"tw-flex tw-gap-2\">\n <div className=\"tw-flex-1\">\n <TextInput\n value={query}\n decorator={<IconMagnifier />}\n placeholder=\"Search\"\n onChange={(value) => setQuery(value)}\n clearable\n />\n </div>\n <div className=\"tw-w-[72px]\">\n <Slider\n items={views}\n activeItemId={view}\n onChange={(colorView) => setView(colorView as BrandColorView)}\n />\n </div>\n </div>\n <ul className=\"tw-flex tw-flex-col tw-gap-4\">\n {palettesWithColors.length > 0\n ? palettesWithColors.map(({ id, title, colors }) => (\n <li key={id} className=\"tw-flex tw-flex-col tw-gap-2\">\n <p className=\"tw-text-black tw-text-xs tw-font-medium dark:tw-text-white\">{title}</p>\n <ul\n className={merge([\n 'tw-flex tw-gap-y-2 tw-flex-wrap',\n view === BrandColorView.List && 'tw-flex-col',\n ])}\n >\n {colors.map((color) => (\n <li key={color.name} data-test-id=\"brand-color\">\n <button\n className=\"tw-flex tw-w-full\"\n onClick={() => onSelect(color)}\n type=\"button\"\n >\n <span\n className={merge([\n 'tw-h-6 tw-w-6 tw-mr-2 tw-rounded tw-flex tw-items-center tw-justify-center tw-ring-1 tw-ring-black-10 tw-ring-offset-1',\n isColorLight(color) ? 'tw-text-black' : 'tw-text-white',\n ])}\n style={{ background: tinycolor(color).toRgbString() }}\n >\n {color.r === currentColor.r &&\n color.g === currentColor.g &&\n color.b === currentColor.b &&\n color.a === currentColor.a && (\n <IconCheckMark size={IconSize.Size20} />\n )}\n </span>\n {view === BrandColorView.List && (\n <span className=\"tw-h-6 tw-grow tw-flex tw-items-center tw-text-sm tw-text-left\">\n {color.name}\n </span>\n )}\n </button>\n </li>\n ))}\n </ul>\n </li>\n ))\n : 'No colors found'}\n </ul>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;AAAA,IAAG,KAAK,EAAM;AAAA,IAAM,gBAAa;AAAA,EAAA,GAC7B,kBAAA,cAAA,UAAA;AAAA,IACG,WAAU;AAAA,IACV,SAAS,MAAM,EAAS,CAAK;AAAA,IAC7B,MAAK;AAAA,EAAA,GAEJ,kBAAA,cAAA,QAAA;AAAA,IACG,WAAW,EAAM;AAAA,MACb;AAAA,MACA,EAAa,CAAK,IAAI,kBAAkB;AAAA,IAAA,CAC3C;AAAA,IACD,OAAO,EAAE,YAAY,EAAU,CAAK,EAAE,cAAc;AAAA,EAAA,GAEnD,EAAM,MAAM,EAAa,KACtB,EAAM,MAAM,EAAa,KACzB,EAAM,MAAM,EAAa,KACzB,EAAM,MAAM,EAAa,KACpB,kBAAA,cAAA,GAAA;AAAA,IAAc,MAAM,EAAS;AAAA,EAAA,CAAQ,CAElD,GACC,MAAS,UACL,kBAAA,cAAA,QAAA;AAAA,IAAK,WAAU;AAAA,EAAA,GACX,EAAM,IACX,CAER,CACJ,CACH,CACL,CACJ,CACH,IACD,iBACV,CACJ;AAER;"}
|
|
1
|
+
{"version":3,"file":"BrandColorPicker.es.js","sources":["../../../src/components/ColorPicker/BrandColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Slider } from '@components/Slider/Slider';\nimport { TextInput } from '@components/TextInput/TextInput';\nimport { IconCheckMark, IconGridRegular, IconMagnifier, IconStackVertical } from '@foundation/Icon/Generated';\nimport { IconSize } from '@foundation/Icon/IconSize';\nimport { isColorLight, toShortRgb } from '@utilities/colors';\nimport { merge } from '@utilities/merge';\nimport React, { FC, useEffect, useState } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { ColorPickerProps } from './ColorPicker';\n\nconst find = (haystack?: string, needle = '') =>\n haystack?.toLocaleLowerCase().includes(needle.toLocaleLowerCase().trim());\n\nenum BrandColorView {\n List = 'List',\n Grid = 'Grid',\n}\n\ntype Props = Omit<ColorPickerProps, 'currentFormat' | 'setFormat'>;\n\nexport const BrandColorPicker: FC<Props> = ({ palettes: defaultPalettes = [], currentColor, onSelect }) => {\n const views = [\n { id: BrandColorView.Grid, icon: <IconGridRegular />, ariaLabel: 'Grid' },\n { id: BrandColorView.List, icon: <IconStackVertical />, ariaLabel: 'List' },\n ];\n const [view, setView] = useState(views[0].id);\n const [query, setQuery] = useState('');\n const [palettes, setPalettes] = useState(defaultPalettes);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setPalettes(\n defaultPalettes\n .filter(({ title, colors }) => find(title, query) || colors.some(({ name }) => find(name, query)))\n .map(({ id, title, colors }) => ({\n id,\n title,\n colors: colors.some(({ name }) => find(name, query))\n ? colors.filter(({ name }) => find(name, query))\n : colors,\n })),\n );\n }, 200);\n\n return () => clearTimeout(timer);\n }, [query]);\n\n const palettesWithColors = palettes.filter((palette) => palette.colors.length > 0);\n\n return (\n <div className=\"tw-flex tw-flex-col tw-gap-4\" data-test-id=\"brand-color-picker\">\n <div className=\"tw-flex tw-gap-2\">\n <div className=\"tw-flex-1\">\n <TextInput\n value={query}\n decorator={<IconMagnifier />}\n placeholder=\"Search\"\n onChange={(value) => setQuery(value)}\n clearable\n />\n </div>\n <div className=\"tw-w-[72px]\">\n <Slider\n items={views}\n activeItemId={view}\n onChange={(colorView) => setView(colorView as BrandColorView)}\n />\n </div>\n </div>\n <ul className=\"tw-flex tw-flex-col tw-gap-4\">\n {palettesWithColors.length > 0\n ? palettesWithColors.map(({ id, title, colors }) => (\n <li key={id} className=\"tw-flex tw-flex-col tw-gap-2\">\n <p className=\"tw-text-black tw-text-xs tw-font-medium dark:tw-text-white\">{title}</p>\n <ul\n className={merge([\n 'tw-flex tw-gap-y-2 tw-flex-wrap',\n view === BrandColorView.List && 'tw-flex-col',\n ])}\n >\n {colors.map((color) => (\n <li key={color.name} data-test-id=\"brand-color\">\n <button\n className=\"tw-flex tw-w-full\"\n onClick={() => onSelect(color)}\n type=\"button\"\n >\n <span\n className={merge([\n 'tw-h-6 tw-w-6 tw-mr-2 tw-rounded tw-flex tw-items-center tw-justify-center tw-ring-1 tw-ring-black-10 tw-ring-offset-1',\n isColorLight(color) ? 'tw-text-black' : 'tw-text-white',\n ])}\n style={{ background: tinycolor(toShortRgb(color)).toRgbString() }}\n >\n {color.red === currentColor.red &&\n color.green === currentColor.green &&\n color.blue === currentColor.blue &&\n color.alpha === currentColor.alpha && (\n <IconCheckMark size={IconSize.Size20} />\n )}\n </span>\n {view === BrandColorView.List && (\n <span className=\"tw-h-6 tw-grow tw-flex tw-items-center tw-text-sm tw-text-left\">\n {color.name}\n </span>\n )}\n </button>\n </li>\n ))}\n </ul>\n </li>\n ))\n : 'No colors found'}\n </ul>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,kBAAA,cAAA,QAAA;AAAA,IAAK,WAAU;AAAA,EAAA,GACX,EAAM,IACX,CAER,CACJ,CACH,CACL,CACJ,CACH,IACD,iBACV,CACJ;AAER;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import r from "
|
|
2
|
-
import e from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { toShortRgb as r } from "../../utilities/colors.es.js";
|
|
2
|
+
import e from "react";
|
|
3
|
+
import c from "tinycolor2";
|
|
4
|
+
const w = ({ color: t }) => {
|
|
5
|
+
const o = c(r(t)).toRgbString();
|
|
6
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
6
7
|
className: "tw-sticky tw-box-content tw-shrink-0 tw-h-2 tw-top-0 tw-bg-white tw-z-20 dark:tw-bg-black-95",
|
|
7
8
|
style: { backgroundColor: o },
|
|
8
9
|
"data-test-id": "color-preview"
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
w as ColorPreview
|
|
13
14
|
};
|
|
14
15
|
//# sourceMappingURL=ColorPreview.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPreview.es.js","sources":["../../../src/components/ColorPicker/ColorPreview.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { Color } from '../../types/colors';\n\ntype ColorPreviewProps = {\n color: Color;\n};\n\nexport const ColorPreview: FC<ColorPreviewProps> = ({ color }) => {\n const parsedColor = tinycolor(color);\n const backgroundColor = parsedColor.toRgbString();\n\n return (\n <div\n className=\"tw-sticky tw-box-content tw-shrink-0 tw-h-2 tw-top-0 tw-bg-white tw-z-20 dark:tw-bg-black-95\"\n style={{ backgroundColor }}\n data-test-id=\"color-preview\"\n ></div>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPreview.es.js","sources":["../../../src/components/ColorPicker/ColorPreview.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { toShortRgb } from '@utilities/colors';\nimport React, { FC } from 'react';\nimport tinycolor from 'tinycolor2';\nimport { Color } from '../../types/colors';\n\ntype ColorPreviewProps = {\n color: Color;\n};\n\nexport const ColorPreview: FC<ColorPreviewProps> = ({ color }) => {\n const parsedColor = tinycolor(toShortRgb(color));\n const backgroundColor = parsedColor.toRgbString();\n\n return (\n <div\n className=\"tw-sticky tw-box-content tw-shrink-0 tw-h-2 tw-top-0 tw-bg-white tw-z-20 dark:tw-bg-black-95\"\n style={{ backgroundColor }}\n data-test-id=\"color-preview\"\n ></div>\n );\n};\n"],"names":[],"mappings":";;;AAWa,MAAA,IAAsC,CAAC,EAAE,eAAY;AAExD,QAAA,IAAkB,AADJ,EAAU,EAAW,CAAK,CAAC,EACX;AAEpC,SACK,kBAAA,cAAA,OAAA;AAAA,IACG,WAAU;AAAA,IACV,OAAO,EAAE,mBAAgB;AAAA,IACzB,gBAAa;AAAA,EAAA,CAChB;AAET;"}
|
|
@@ -1,98 +1,104 @@
|
|
|
1
|
-
import { Dropdown as
|
|
2
|
-
import { TextInputType as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { Dropdown as I } from "../Dropdown/Dropdown.es.js";
|
|
2
|
+
import { TextInputType as m } from "../TextInput/TextInput.es.js";
|
|
3
|
+
import { toShortRgb as k, toLongRgb as y } from "../../utilities/colors.es.js";
|
|
4
|
+
import t, { useState as f, useEffect as C } from "react";
|
|
5
|
+
import { RgbaColorPicker as H } from "react-colorful";
|
|
6
|
+
import v from "tinycolor2";
|
|
7
|
+
import { ColorFormat as h } from "../../types/colors.es.js";
|
|
8
|
+
import { ColorInput as r, DecoratorPosition as R } from "./ColorInput.es.js";
|
|
9
|
+
const E = (a) => v(k(a)).toHex(), j = ({
|
|
9
10
|
currentColor: a,
|
|
10
11
|
currentFormat: l,
|
|
11
12
|
setFormat: s,
|
|
12
13
|
onSelect: o
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
+
const b = [
|
|
15
16
|
{
|
|
16
17
|
id: "color-picker-format-dropdown-block",
|
|
17
|
-
menuItems: Object.values(
|
|
18
|
+
menuItems: Object.values(h).map((e) => ({ id: e, title: e.toLocaleUpperCase() }))
|
|
18
19
|
}
|
|
19
|
-
], {
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
], { red: i, green: c, blue: p, alpha: n = 1 } = a, [d, g] = f(E(a)), [N, w] = f(n), u = () => {
|
|
21
|
+
const e = v(d);
|
|
22
|
+
e.isValid() && o(y(e.toRgb()));
|
|
22
23
|
};
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
}, [a]), /* @__PURE__ */
|
|
24
|
+
return C(() => {
|
|
25
|
+
w(n), g(E(a));
|
|
26
|
+
}, [a]), /* @__PURE__ */ t.createElement("div", {
|
|
26
27
|
className: "tw-flex tw-flex-col tw-gap-4",
|
|
27
28
|
"data-test-id": "custom-color-picker",
|
|
28
29
|
id: "custom-color-picker"
|
|
29
|
-
}, /* @__PURE__ */
|
|
30
|
+
}, /* @__PURE__ */ t.createElement("div", {
|
|
30
31
|
className: "tw-flex tw-flex-col md:tw-flex-row tw-gap-2 tw-max-w-full"
|
|
31
|
-
}, /* @__PURE__ */
|
|
32
|
+
}, /* @__PURE__ */ t.createElement("div", {
|
|
32
33
|
className: "tw-min-w-[84px]"
|
|
33
|
-
}, /* @__PURE__ */
|
|
34
|
-
menuBlocks:
|
|
34
|
+
}, /* @__PURE__ */ t.createElement(I, {
|
|
35
|
+
menuBlocks: b,
|
|
35
36
|
activeItemId: l,
|
|
36
|
-
onChange: (
|
|
37
|
-
})), l ===
|
|
37
|
+
onChange: (e) => e && s && s(e)
|
|
38
|
+
})), l === h.Hex ? /* @__PURE__ */ t.createElement("div", {
|
|
38
39
|
className: "tw-flex-1"
|
|
39
|
-
}, /* @__PURE__ */
|
|
40
|
-
value:
|
|
40
|
+
}, /* @__PURE__ */ t.createElement(r, {
|
|
41
|
+
value: d,
|
|
41
42
|
decorator: "#",
|
|
42
43
|
size: 6,
|
|
43
|
-
onChange:
|
|
44
|
-
onEnterPressed:
|
|
45
|
-
onBlur:
|
|
46
|
-
})) : /* @__PURE__ */
|
|
44
|
+
onChange: g,
|
|
45
|
+
onEnterPressed: u,
|
|
46
|
+
onBlur: u
|
|
47
|
+
})) : /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
47
48
|
className: "tw-flex-1"
|
|
48
|
-
}, /* @__PURE__ */
|
|
49
|
+
}, /* @__PURE__ */ t.createElement(r, {
|
|
49
50
|
min: 0,
|
|
50
51
|
max: 255,
|
|
51
52
|
size: 3,
|
|
52
|
-
type:
|
|
53
|
-
value:
|
|
54
|
-
onChange: (
|
|
55
|
-
})), /* @__PURE__ */
|
|
53
|
+
type: m.Number,
|
|
54
|
+
value: i.toString(),
|
|
55
|
+
onChange: (e) => o({ ...a, red: parseInt(e) })
|
|
56
|
+
})), /* @__PURE__ */ t.createElement("div", {
|
|
56
57
|
className: "tw-flex-1"
|
|
57
|
-
}, /* @__PURE__ */
|
|
58
|
+
}, /* @__PURE__ */ t.createElement(r, {
|
|
58
59
|
min: 0,
|
|
59
60
|
max: 255,
|
|
60
61
|
size: 3,
|
|
61
|
-
type:
|
|
62
|
-
value:
|
|
63
|
-
onChange: (
|
|
64
|
-
})), /* @__PURE__ */
|
|
62
|
+
type: m.Number,
|
|
63
|
+
value: c.toString(),
|
|
64
|
+
onChange: (e) => o({ ...a, green: parseInt(e) })
|
|
65
|
+
})), /* @__PURE__ */ t.createElement("div", {
|
|
65
66
|
className: "tw-flex-1"
|
|
66
|
-
}, /* @__PURE__ */
|
|
67
|
+
}, /* @__PURE__ */ t.createElement(r, {
|
|
67
68
|
min: 0,
|
|
68
69
|
max: 255,
|
|
69
70
|
size: 3,
|
|
70
|
-
type:
|
|
71
|
-
value:
|
|
72
|
-
onChange: (
|
|
73
|
-
}))), /* @__PURE__ */
|
|
71
|
+
type: m.Number,
|
|
72
|
+
value: p.toString(),
|
|
73
|
+
onChange: (e) => o({ ...a, blue: parseInt(e) })
|
|
74
|
+
}))), /* @__PURE__ */ t.createElement(r, {
|
|
74
75
|
min: 0,
|
|
75
76
|
max: 100,
|
|
76
77
|
size: 3,
|
|
77
|
-
type:
|
|
78
|
-
value: Math.trunc(
|
|
78
|
+
type: m.Number,
|
|
79
|
+
value: Math.trunc(N * 100).toString(),
|
|
79
80
|
decorator: "%",
|
|
80
|
-
decoratorPosition:
|
|
81
|
-
onChange: (
|
|
82
|
-
const
|
|
83
|
-
|
|
81
|
+
decoratorPosition: R.Right,
|
|
82
|
+
onChange: (e) => {
|
|
83
|
+
const x = parseInt(e || "0", 10) / 100;
|
|
84
|
+
w(x), o({ ...a, alpha: x });
|
|
84
85
|
}
|
|
85
|
-
})), /* @__PURE__ */
|
|
86
|
+
})), /* @__PURE__ */ t.createElement("div", {
|
|
86
87
|
className: "tw-flex tw-gap-2 tw-w-full tw-h-[200px]"
|
|
87
|
-
}, /* @__PURE__ */
|
|
88
|
+
}, /* @__PURE__ */ t.createElement("div", {
|
|
88
89
|
className: "tw-relative tw-grow tw-rounded"
|
|
89
|
-
}, /* @__PURE__ */
|
|
90
|
-
color: {
|
|
91
|
-
onChange: o
|
|
90
|
+
}, /* @__PURE__ */ t.createElement(H, {
|
|
91
|
+
color: { r: i, g: c, b: p, a: n },
|
|
92
|
+
onChange: (e) => o({
|
|
93
|
+
red: e.r,
|
|
94
|
+
green: e.g,
|
|
95
|
+
blue: e.b,
|
|
96
|
+
alpha: e.a
|
|
97
|
+
}),
|
|
92
98
|
style: { width: "100%" }
|
|
93
99
|
}))));
|
|
94
100
|
};
|
|
95
101
|
export {
|
|
96
|
-
|
|
102
|
+
j as CustomColorPicker
|
|
97
103
|
};
|
|
98
104
|
//# sourceMappingURL=CustomColorPicker.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomColorPicker.es.js","sources":["../../../src/components/ColorPicker/CustomColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Dropdown } from '@components/Dropdown/Dropdown';\nimport { TextInputType } from '@components/TextInput/TextInput';\nimport React, { FC, useEffect, useState } from 'react';\nimport { RgbaColorPicker } from 'react-colorful';\nimport tinycolor from 'tinycolor2';\nimport { Color, ColorFormat } from '../../types/colors';\nimport { ColorInput, DecoratorPosition } from './ColorInput';\nimport { ColorPickerProps } from './ColorPicker';\n\nconst convertToHex = (color: Color) => tinycolor(color).toHex();\n\nexport const CustomColorPicker: FC<Omit<ColorPickerProps, 'palette'>> = ({\n currentColor,\n currentFormat,\n setFormat,\n onSelect,\n}) => {\n const formatMenuBlock = [\n {\n id: 'color-picker-format-dropdown-block',\n menuItems: Object.values(ColorFormat).map((id) => ({ id, title: id.toLocaleUpperCase() })),\n },\n ];\n const {
|
|
1
|
+
{"version":3,"file":"CustomColorPicker.es.js","sources":["../../../src/components/ColorPicker/CustomColorPicker.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Dropdown } from '@components/Dropdown/Dropdown';\nimport { TextInputType } from '@components/TextInput/TextInput';\nimport { toLongRgb, toShortRgb } from '@utilities/colors';\nimport React, { FC, useEffect, useState } from 'react';\nimport { RgbaColorPicker } from 'react-colorful';\nimport tinycolor from 'tinycolor2';\nimport { Color, ColorFormat } from '../../types/colors';\nimport { ColorInput, DecoratorPosition } from './ColorInput';\nimport { ColorPickerProps } from './ColorPicker';\n\nconst convertToHex = (color: Color) => tinycolor(toShortRgb(color)).toHex();\n\nexport const CustomColorPicker: FC<Omit<ColorPickerProps, 'palette'>> = ({\n currentColor,\n currentFormat,\n setFormat,\n onSelect,\n}) => {\n const formatMenuBlock = [\n {\n id: 'color-picker-format-dropdown-block',\n menuItems: Object.values(ColorFormat).map((id) => ({ id, title: id.toLocaleUpperCase() })),\n },\n ];\n const { red, green, blue, alpha = 1 } = currentColor;\n const [hexInput, setHexInput] = useState(convertToHex(currentColor));\n const [alphaValue, setAlphaValue] = useState(alpha);\n\n const handleHexChange = () => {\n const parsedHex = tinycolor(hexInput);\n if (parsedHex.isValid()) {\n onSelect(toLongRgb(parsedHex.toRgb()));\n }\n };\n\n useEffect(() => {\n setAlphaValue(alpha);\n setHexInput(convertToHex(currentColor));\n }, [currentColor]);\n\n return (\n <div className=\"tw-flex tw-flex-col tw-gap-4\" data-test-id=\"custom-color-picker\" id=\"custom-color-picker\">\n <div className=\"tw-flex tw-flex-col md:tw-flex-row tw-gap-2 tw-max-w-full\">\n <div className=\"tw-min-w-[84px]\">\n <Dropdown\n menuBlocks={formatMenuBlock}\n activeItemId={currentFormat}\n onChange={(id) => id && setFormat && setFormat(id as ColorFormat)}\n />\n </div>\n {currentFormat === ColorFormat.Hex ? (\n <div className=\"tw-flex-1\">\n <ColorInput\n value={hexInput}\n decorator=\"#\"\n size={6}\n onChange={setHexInput}\n onEnterPressed={handleHexChange}\n onBlur={handleHexChange}\n />\n </div>\n ) : (\n <>\n <div className=\"tw-flex-1\">\n <ColorInput\n min={0}\n max={255}\n size={3}\n type={TextInputType.Number}\n value={red.toString()}\n onChange={(value) => onSelect({ ...currentColor, red: parseInt(value) })}\n />\n </div>\n <div className=\"tw-flex-1\">\n <ColorInput\n min={0}\n max={255}\n size={3}\n type={TextInputType.Number}\n value={green.toString()}\n onChange={(value) => onSelect({ ...currentColor, green: parseInt(value) })}\n />\n </div>\n <div className=\"tw-flex-1\">\n <ColorInput\n min={0}\n max={255}\n size={3}\n type={TextInputType.Number}\n value={blue.toString()}\n onChange={(value) => onSelect({ ...currentColor, blue: parseInt(value) })}\n />\n </div>\n </>\n )}\n <ColorInput\n min={0}\n max={100}\n size={3}\n type={TextInputType.Number}\n value={Math.trunc(alphaValue * 100).toString()}\n decorator=\"%\"\n decoratorPosition={DecoratorPosition.Right}\n onChange={(value) => {\n const a = parseInt(value || '0', 10) / 100;\n setAlphaValue(a);\n onSelect({ ...currentColor, alpha: a });\n }}\n />\n </div>\n <div className=\"tw-flex tw-gap-2 tw-w-full tw-h-[200px]\">\n <div className=\"tw-relative tw-grow tw-rounded\">\n <RgbaColorPicker\n color={{ r: red, g: green, b: blue, a: alpha }}\n onChange={(color) =>\n onSelect({\n red: color.r,\n green: color.g,\n blue: color.b,\n alpha: color.a,\n })\n }\n style={{ width: '100%' }}\n />\n </div>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAM,IAAe,CAAC,MAAiB,EAAU,EAAW,CAAK,CAAC,EAAE,SAEvD,IAA2D,CAAC;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACE;AACF,QAAM,IAAkB;AAAA,IACpB;AAAA,MACI,IAAI;AAAA,MACJ,WAAW,OAAO,OAAO,CAAW,EAAE,IAAI,CAAC,MAAQ,GAAE,OAAI,OAAO,EAAG,kBAAA,EAAsB,EAAA;AAAA,IAC7F;AAAA,EAAA,GAEE,EAAE,QAAK,UAAO,SAAM,WAAQ,MAAM,GAClC,CAAC,GAAU,KAAe,EAAS,EAAa,CAAY,CAAC,GAC7D,CAAC,GAAY,KAAiB,EAAS,CAAK,GAE5C,IAAkB,MAAM;AACpB,UAAA,IAAY,EAAU,CAAQ;AAChC,IAAA,EAAU,aACV,EAAS,EAAU,EAAU,MAAM,CAAC,CAAC;AAAA,EACzC;AAGJ,WAAU,MAAM;AACZ,MAAc,CAAK,GACP,EAAA,EAAa,CAAY,CAAC;AAAA,EAAA,GACvC,CAAC,CAAY,CAAC,GAGZ,kBAAA,cAAA,OAAA;AAAA,IAAI,WAAU;AAAA,IAA+B,gBAAa;AAAA,IAAsB,IAAG;AAAA,EAAA,GAC/E,kBAAA,cAAA,OAAA;AAAA,IAAI,WAAU;AAAA,EAAA,GACV,kBAAA,cAAA,OAAA;AAAA,IAA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AS,CAAK,GAAG;AAAA,EAC5E,CAAA,CACJ,CACJ,GAEH,kBAAA,cAAA,GAAA;AAAA,IACG,KAAK;AAAA,IACL,KAAK;AAAA,IACL,MAAM;AAAA,IACN,MAAM,EAAc;AAAA,IACpB,OAAO,KAAK,MAAM,IAAa,GAAG,EAAE,SAAS;AAAA,IAC7C,WAAU;AAAA,IACV,mBAAmB,EAAkB;AAAA,IACrC,UAAU,CAAC,MAAU;AACjB,YAAM,IAAI,SAAS,KAAS,KAAK,EAAE,IAAI;AACvC,QAAc,CAAC,GACf,EAAS,EAAE,GAAG,GAAc,OAAO,EAAG,CAAA;AAAA,IAC1C;AAAA,EACJ,CAAA,CACJ,GACC,kBAAA,cAAA,OAAA;AAAA,IAAI,WAAU;AAAA,EAAA,GACV,kBAAA,cAAA,OAAA;AAAA,IAAI,WAAU;AAAA,EAAA,GACV,kBAAA,cAAA,GAAA;AAAA,IACG,OAAO,EAAE,GAAG,GAAK,GAAG,GAAO,GAAG,GAAM,GAAG,EAAM;AAAA,IAC7C,UAAU,CAAC,MACP,EAAS;AAAA,MACL,KAAK,EAAM;AAAA,MACX,OAAO,EAAM;AAAA,MACb,MAAM,EAAM;AAAA,MACZ,OAAO,EAAM;AAAA,IAAA,CAChB;AAAA,IAEL,OAAO,EAAE,OAAO,OAAO;AAAA,EAAA,CAC3B,CACJ,CACJ,CACJ;AAER;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e, { memo as l } from "react";
|
|
2
|
-
function
|
|
2
|
+
function n(t) {
|
|
3
3
|
const a = "tw-flex tw-items-center tw-justify-center tw-fill-current";
|
|
4
4
|
return /* @__PURE__ */ e.createElement("svg", {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8,15 +8,24 @@ function m(t) {
|
|
|
8
8
|
className: a,
|
|
9
9
|
name: "IconBasketball12",
|
|
10
10
|
...t
|
|
11
|
+
}, /* @__PURE__ */ e.createElement("g", {
|
|
12
|
+
fill: "none"
|
|
13
|
+
}, /* @__PURE__ */ e.createElement("g", {
|
|
14
|
+
clipPath: "url(#prefix__a)"
|
|
11
15
|
}, /* @__PURE__ */ e.createElement("path", {
|
|
12
16
|
fill: "currentColor",
|
|
13
17
|
fillRule: "evenodd",
|
|
14
18
|
d: "M8.922 10.058a4.973 4.973 0 0 1-2.422.917V6.5h1.019a6.471 6.471 0 0 0 1.403 3.558Zm-.4-3.558a5.47 5.47 0 0 0 1.15 2.894A4.981 4.981 0 0 0 10.975 6.5H8.522Zm2.453-1a4.981 4.981 0 0 0-1.303-2.894A5.47 5.47 0 0 0 8.522 5.5h2.453Zm-3.456 0a6.471 6.471 0 0 1 1.403-3.558A4.973 4.973 0 0 0 6.5 1.025V5.5h1.019ZM5.5 5.5V1.025a4.973 4.973 0 0 0-2.422.917A6.47 6.47 0 0 1 4.481 5.5H5.5Zm-2.022 0a5.47 5.47 0 0 0-1.15-2.894A4.981 4.981 0 0 0 1.025 5.5h2.453Zm-2.453 1a4.981 4.981 0 0 0 1.303 2.894A5.47 5.47 0 0 0 3.478 6.5H1.025Zm3.456 0H5.5v4.475a4.973 4.973 0 0 1-2.422-.917A6.472 6.472 0 0 0 4.481 6.5ZM6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Z",
|
|
15
19
|
clipRule: "evenodd"
|
|
16
|
-
}))
|
|
20
|
+
})), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", {
|
|
21
|
+
id: "prefix__a"
|
|
22
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
|
23
|
+
fill: "#fff",
|
|
24
|
+
d: "M0 0h12v12H0z"
|
|
25
|
+
})))));
|
|
17
26
|
}
|
|
18
|
-
const
|
|
27
|
+
const m = l(n);
|
|
19
28
|
export {
|
|
20
|
-
|
|
29
|
+
m as default
|
|
21
30
|
};
|
|
22
31
|
//# sourceMappingURL=IconBasketball12.es.js.map
|