@cdx-ui/components 0.1.7 → 0.2.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/coverage.svg +1 -1
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.js +78 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.js.map +1 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.web.js +31 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.web.js.map +1 -0
- package/lib/commonjs/components/ColorArea/index.js +57 -0
- package/lib/commonjs/components/ColorArea/index.js.map +1 -0
- package/lib/commonjs/components/ColorArea/styles.js +12 -0
- package/lib/commonjs/components/ColorArea/styles.js.map +1 -0
- package/lib/commonjs/components/ColorField/index.js +138 -0
- package/lib/commonjs/components/ColorField/index.js.map +1 -0
- package/lib/commonjs/components/ColorField/styles.js +14 -0
- package/lib/commonjs/components/ColorField/styles.js.map +1 -0
- package/lib/commonjs/components/ColorPicker/index.js +88 -0
- package/lib/commonjs/components/ColorPicker/index.js.map +1 -0
- package/lib/commonjs/components/ColorPicker/styles.js +22 -0
- package/lib/commonjs/components/ColorPicker/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.js +68 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.web.js +41 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.web.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/index.js +123 -0
- package/lib/commonjs/components/ColorSlider/index.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/styles.js +50 -0
- package/lib/commonjs/components/ColorSlider/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSwatch/index.js +54 -0
- package/lib/commonjs/components/ColorSwatch/index.js.map +1 -0
- package/lib/commonjs/components/ColorSwatch/styles.js +25 -0
- package/lib/commonjs/components/ColorSwatch/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSwatchPicker/index.js +110 -0
- package/lib/commonjs/components/ColorSwatchPicker/index.js.map +1 -0
- package/lib/commonjs/components/ColorSwatchPicker/styles.js +17 -0
- package/lib/commonjs/components/ColorSwatchPicker/styles.js.map +1 -0
- package/lib/commonjs/components/Heading/styles.js +3 -0
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +27 -3
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Icon/styles.js +19 -0
- package/lib/commonjs/components/Icon/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +13 -4
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +39 -3
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Toast/hooks.js +0 -1
- package/lib/commonjs/components/Toast/hooks.js.map +1 -1
- package/lib/commonjs/components/Toast/index.js +9 -6
- package/lib/commonjs/components/Toast/index.js.map +1 -1
- package/lib/commonjs/components/Toast/styles.js +36 -19
- package/lib/commonjs/components/Toast/styles.js.map +1 -1
- package/lib/commonjs/components/ToggleButton/index.js +5 -4
- package/lib/commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib/commonjs/components/index.js +68 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/picker/surfaces.js +9 -2
- package/lib/commonjs/components/picker/surfaces.js.map +1 -1
- package/lib/commonjs/figma/Icon.figma.js +30 -3
- package/lib/commonjs/figma/Icon.figma.js.map +1 -1
- package/lib/commonjs/figma/Text.figma.js +15 -1
- package/lib/commonjs/figma/Text.figma.js.map +1 -1
- package/lib/commonjs/providers/toast/insets-container.js +15 -3
- package/lib/commonjs/providers/toast/insets-container.js.map +1 -1
- package/lib/commonjs/providers/toast/provider.js +1 -0
- package/lib/commonjs/providers/toast/provider.js.map +1 -1
- package/lib/commonjs/styles/constants.js +14 -1
- package/lib/commonjs/styles/constants.js.map +1 -1
- package/lib/module/components/ColorArea/ColorAreaPaint.js +74 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.js.map +1 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.web.js +27 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.web.js.map +1 -0
- package/lib/module/components/ColorArea/index.js +53 -0
- package/lib/module/components/ColorArea/index.js.map +1 -0
- package/lib/module/components/ColorArea/styles.js +8 -0
- package/lib/module/components/ColorArea/styles.js.map +1 -0
- package/lib/module/components/ColorField/index.js +134 -0
- package/lib/module/components/ColorField/index.js.map +1 -0
- package/lib/module/components/ColorField/styles.js +10 -0
- package/lib/module/components/ColorField/styles.js.map +1 -0
- package/lib/module/components/ColorPicker/index.js +79 -0
- package/lib/module/components/ColorPicker/index.js.map +1 -0
- package/lib/module/components/ColorPicker/styles.js +18 -0
- package/lib/module/components/ColorPicker/styles.js.map +1 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.js +64 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.js.map +1 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.web.js +37 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.web.js.map +1 -0
- package/lib/module/components/ColorSlider/index.js +119 -0
- package/lib/module/components/ColorSlider/index.js.map +1 -0
- package/lib/module/components/ColorSlider/styles.js +46 -0
- package/lib/module/components/ColorSlider/styles.js.map +1 -0
- package/lib/module/components/ColorSwatch/index.js +50 -0
- package/lib/module/components/ColorSwatch/index.js.map +1 -0
- package/lib/module/components/ColorSwatch/styles.js +21 -0
- package/lib/module/components/ColorSwatch/styles.js.map +1 -0
- package/lib/module/components/ColorSwatchPicker/index.js +106 -0
- package/lib/module/components/ColorSwatchPicker/index.js.map +1 -0
- package/lib/module/components/ColorSwatchPicker/styles.js +13 -0
- package/lib/module/components/ColorSwatchPicker/styles.js.map +1 -0
- package/lib/module/components/Heading/styles.js +3 -0
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +27 -3
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Icon/styles.js +16 -0
- package/lib/module/components/Icon/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +14 -5
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +38 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Toast/hooks.js +0 -1
- package/lib/module/components/Toast/hooks.js.map +1 -1
- package/lib/module/components/Toast/index.js +10 -7
- package/lib/module/components/Toast/index.js.map +1 -1
- package/lib/module/components/Toast/styles.js +35 -19
- package/lib/module/components/Toast/styles.js.map +1 -1
- package/lib/module/components/ToggleButton/index.js +3 -3
- package/lib/module/components/ToggleButton/index.js.map +1 -1
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/picker/surfaces.js +10 -3
- package/lib/module/components/picker/surfaces.js.map +1 -1
- package/lib/module/figma/Icon.figma.js +30 -3
- package/lib/module/figma/Icon.figma.js.map +1 -1
- package/lib/module/figma/Text.figma.js +15 -1
- package/lib/module/figma/Text.figma.js.map +1 -1
- package/lib/module/providers/toast/insets-container.js +15 -4
- package/lib/module/providers/toast/insets-container.js.map +1 -1
- package/lib/module/providers/toast/provider.js +2 -1
- package/lib/module/providers/toast/provider.js.map +1 -1
- package/lib/module/styles/constants.js +13 -0
- package/lib/module/styles/constants.js.map +1 -1
- package/lib/typescript/components/Alert/index.d.ts +1 -1
- package/lib/typescript/components/Alert/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/index.d.ts +1 -1
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Badge/styles.d.ts +3 -3
- package/lib/typescript/components/Breadcrumbs/styles.d.ts +1 -1
- package/lib/typescript/components/Button/index.d.ts +1 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +4 -4
- package/lib/typescript/components/Checkbox/index.d.ts +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +1 -1
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +3 -3
- package/lib/typescript/components/ColorArea/ColorAreaPaint.d.ts +5 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.web.d.ts +5 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.web.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/index.d.ts +20 -0
- package/lib/typescript/components/ColorArea/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/styles.d.ts +4 -0
- package/lib/typescript/components/ColorArea/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorField/index.d.ts +41 -0
- package/lib/typescript/components/ColorField/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorField/styles.d.ts +13 -0
- package/lib/typescript/components/ColorField/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorPicker/index.d.ts +28 -0
- package/lib/typescript/components/ColorPicker/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorPicker/styles.d.ts +9 -0
- package/lib/typescript/components/ColorPicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.d.ts +5 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.web.d.ts +5 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.web.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/index.d.ts +33 -0
- package/lib/typescript/components/ColorSlider/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/styles.d.ts +14 -0
- package/lib/typescript/components/ColorSlider/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatch/index.d.ts +19 -0
- package/lib/typescript/components/ColorSwatch/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatch/styles.d.ts +7 -0
- package/lib/typescript/components/ColorSwatch/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatchPicker/index.d.ts +37 -0
- package/lib/typescript/components/ColorSwatchPicker/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatchPicker/styles.d.ts +5 -0
- package/lib/typescript/components/ColorSwatchPicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/Divider/index.d.ts +1 -1
- package/lib/typescript/components/Divider/index.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts +14 -22
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/Icon/styles.d.ts +6 -0
- package/lib/typescript/components/Icon/styles.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/styles.d.ts +2 -2
- package/lib/typescript/components/Input/index.d.ts +1 -1
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +1 -1
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts +2 -2
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Slider/styles.d.ts +3 -3
- package/lib/typescript/components/Text/index.d.ts +40 -3
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts +9 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/hooks.d.ts +1 -1
- package/lib/typescript/components/Toast/hooks.d.ts.map +1 -1
- package/lib/typescript/components/Toast/index.d.ts.map +1 -1
- package/lib/typescript/components/Toast/styles.d.ts +4 -0
- package/lib/typescript/components/Toast/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/types.d.ts +1 -1
- package/lib/typescript/components/Toast/types.d.ts.map +1 -1
- package/lib/typescript/components/ToggleButton/index.d.ts +5 -3
- package/lib/typescript/components/ToggleButton/index.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/picker/surfaces.d.ts +5 -1
- package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -1
- package/lib/typescript/providers/toast/insets-container.d.ts +12 -0
- package/lib/typescript/providers/toast/insets-container.d.ts.map +1 -1
- package/lib/typescript/providers/toast/types.d.ts +5 -0
- package/lib/typescript/providers/toast/types.d.ts.map +1 -1
- package/lib/typescript/styles/constants.d.ts +10 -0
- package/lib/typescript/styles/constants.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Alert/index.tsx +1 -1
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Chip/index.tsx +1 -1
- package/src/components/ColorArea/ColorAreaPaint.tsx +51 -0
- package/src/components/ColorArea/ColorAreaPaint.web.tsx +31 -0
- package/src/components/ColorArea/index.tsx +71 -0
- package/src/components/ColorArea/styles.ts +18 -0
- package/src/components/ColorField/index.tsx +181 -0
- package/src/components/ColorField/styles.ts +20 -0
- package/src/components/ColorPicker/index.tsx +110 -0
- package/src/components/ColorPicker/styles.ts +33 -0
- package/src/components/ColorSlider/ColorSliderRailPaint.tsx +60 -0
- package/src/components/ColorSlider/ColorSliderRailPaint.web.tsx +33 -0
- package/src/components/ColorSlider/index.tsx +147 -0
- package/src/components/ColorSlider/styles.ts +72 -0
- package/src/components/ColorSwatch/index.tsx +56 -0
- package/src/components/ColorSwatch/styles.ts +24 -0
- package/src/components/ColorSwatchPicker/index.tsx +150 -0
- package/src/components/ColorSwatchPicker/styles.ts +32 -0
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Heading/styles.ts +3 -0
- package/src/components/Icon/index.tsx +46 -6
- package/src/components/Icon/styles.ts +15 -0
- package/src/components/Input/index.tsx +1 -1
- package/src/components/Link/index.tsx +1 -1
- package/src/components/Menu/index.tsx +2 -2
- package/src/components/Select/index.tsx +1 -1
- package/src/components/Text/index.tsx +32 -5
- package/src/components/Text/styles.ts +39 -1
- package/src/components/Toast/hooks.ts +0 -1
- package/src/components/Toast/index.tsx +14 -8
- package/src/components/Toast/styles.ts +47 -19
- package/src/components/Toast/types.ts +1 -1
- package/src/components/ToggleButton/index.tsx +9 -7
- package/src/components/index.ts +6 -0
- package/src/components/picker/surfaces.tsx +15 -2
- package/src/providers/toast/insets-container.tsx +23 -9
- package/src/providers/toast/provider.tsx +2 -2
- package/src/providers/toast/types.ts +5 -0
- package/src/styles/constants.ts +13 -0
package/coverage.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 91.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 91.8%"><title>coverage: 91.8%</title><filter id="blur"><feGaussianBlur stdDeviation="16"/></filter><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="108" height="20" rx="3"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="47" height="20" fill="#4b0"/><rect width="108" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="315" y="150" fill-opacity=".8" filter="url(#blur)" textLength="510">coverage</text><text x="315" y="150" fill-opacity=".3" textLength="510">coverage</text></g><text x="315" y="140" textLength="510">coverage</text></g><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="835" y="150" fill-opacity=".8" filter="url(#blur)" textLength="370">91.8%</text><text x="835" y="150" fill-opacity=".3" textLength="370">91.8%</text></g><text x="835" y="140" textLength="370">91.8%</text></g></g></svg>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorAreaPaint = ColorAreaPaint;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
10
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function ColorAreaPaint() {
|
|
14
|
+
const {
|
|
15
|
+
value,
|
|
16
|
+
isRTL
|
|
17
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
18
|
+
const horizontalGradientId = (0, _react.useId)();
|
|
19
|
+
const verticalGradientId = (0, _react.useId)();
|
|
20
|
+
const hue = value.withChannel('hsb', 'saturation', 100).withChannel('hsb', 'brightness', 100);
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
22
|
+
className: (0, _styles.colorAreaPaintVariants)(),
|
|
23
|
+
style: styles.paint,
|
|
24
|
+
accessible: false,
|
|
25
|
+
accessibilityElementsHidden: true,
|
|
26
|
+
importantForAccessibility: "no-hide-descendants",
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Svg, {
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Defs, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
|
|
32
|
+
id: horizontalGradientId,
|
|
33
|
+
x1: isRTL ? '100%' : '0%',
|
|
34
|
+
y1: "0%",
|
|
35
|
+
x2: isRTL ? '0%' : '100%',
|
|
36
|
+
y2: "0%",
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
38
|
+
offset: "0%",
|
|
39
|
+
stopColor: "#FFFFFF"
|
|
40
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
41
|
+
offset: "100%",
|
|
42
|
+
stopColor: hue.toString('hex')
|
|
43
|
+
})]
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
|
|
45
|
+
id: verticalGradientId,
|
|
46
|
+
x1: "0%",
|
|
47
|
+
y1: "0%",
|
|
48
|
+
x2: "0%",
|
|
49
|
+
y2: "100%",
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
51
|
+
offset: "0%",
|
|
52
|
+
stopColor: "#000000",
|
|
53
|
+
stopOpacity: 0
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
55
|
+
offset: "100%",
|
|
56
|
+
stopColor: "#000000",
|
|
57
|
+
stopOpacity: 1
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
61
|
+
width: "100%",
|
|
62
|
+
height: "100%",
|
|
63
|
+
fill: `url(#${horizontalGradientId})`
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: "100%",
|
|
67
|
+
fill: `url(#${verticalGradientId})`
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
ColorAreaPaint.displayName = 'ColorAreaPaint';
|
|
73
|
+
const styles = _reactNative.StyleSheet.create({
|
|
74
|
+
paint: {
|
|
75
|
+
pointerEvents: 'none'
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=ColorAreaPaint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_primitives","_styles","_jsxRuntime","ColorAreaPaint","value","isRTL","useColorAreaContext","horizontalGradientId","useId","verticalGradientId","hue","withChannel","jsx","View","className","colorAreaPaintVariants","style","styles","paint","accessible","accessibilityElementsHidden","importantForAccessibility","children","jsxs","Svg","width","height","Defs","LinearGradient","id","x1","y1","x2","y2","Stop","offset","stopColor","toString","stopOpacity","Rect","fill","displayName","StyleSheet","create","pointerEvents"],"sourceRoot":"../../../../src","sources":["components/ColorArea/ColorAreaPaint.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAE3C,SAASM,cAAcA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAG,IAAAC,+BAAmB,EAAC,CAAC;EAC9C,MAAMC,oBAAoB,GAAG,IAAAC,YAAK,EAAC,CAAC;EACpC,MAAMC,kBAAkB,GAAG,IAAAD,YAAK,EAAC,CAAC;EAClC,MAAME,GAAG,GAAGN,KAAK,CAACO,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CAACA,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC;EAE7F,oBACE,IAAAT,WAAA,CAAAU,GAAA,EAACd,YAAA,CAAAe,IAAI;IACHC,SAAS,EAAE,IAAAC,8BAAsB,EAAC,CAAE;IACpCC,KAAK,EAAEC,MAAM,CAACC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AACb,eAAA,CAAAmC,IAAI;YAACC,MAAM,EAAC,MAAM;YAACC,SAAS,EAAC,SAAS;YAACE,WAAW,EAAE;UAAE,CAAE,CAAC;QAAA,CAC5C,CAAC;MAAA,CACb,CAAC,eACP,IAAApC,WAAA,CAAAU,GAAA,EAACb,eAAA,CAAAwC,IAAI;QAACd,KAAK,EAAC,MAAM;QAACC,MAAM,EAAC,MAAM;QAACc,IAAI,EAAE,QAAQjC,oBAAoB;MAAI,CAAE,CAAC,eAC1E,IAAAL,WAAA,CAAAU,GAAA,EAACb,eAAA,CAAAwC,IAAI;QAACd,KAAK,EAAC,MAAM;QAACC,MAAM,EAAC,MAAM;QAACc,IAAI,EAAE,QAAQ/B,kBAAkB;MAAI,CAAE,CAAC;IAAA,CACrE;EAAC,CACF,CAAC;AAEX;AAEAN,cAAc,CAACsC,WAAW,GAAG,gBAAgB;AAE7C,MAAMxB,MAAM,GAAGyB,uBAAU,CAACC,MAAM,CAAC;EAC/BzB,KAAK,EAAE;IACL0B,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorAreaPaint = ColorAreaPaint;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _styles = require("./styles");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function ColorAreaPaint() {
|
|
12
|
+
const {
|
|
13
|
+
value,
|
|
14
|
+
isRTL
|
|
15
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
16
|
+
const hue = value.withChannel('hsb', 'saturation', 100).withChannel('hsb', 'brightness', 100).toString('hex');
|
|
17
|
+
const direction = isRTL ? 'to left' : 'to right';
|
|
18
|
+
const paintStyle = {
|
|
19
|
+
backgroundImage: ['linear-gradient(to bottom, transparent, #000000)', `linear-gradient(${direction}, #FFFFFF, ${hue})`].join(', '),
|
|
20
|
+
pointerEvents: 'none'
|
|
21
|
+
};
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
23
|
+
className: (0, _styles.colorAreaPaintVariants)(),
|
|
24
|
+
style: paintStyle,
|
|
25
|
+
accessible: false,
|
|
26
|
+
accessibilityElementsHidden: true,
|
|
27
|
+
importantForAccessibility: "no-hide-descendants"
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
ColorAreaPaint.displayName = 'ColorAreaPaint';
|
|
31
|
+
//# sourceMappingURL=ColorAreaPaint.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_primitives","_styles","_jsxRuntime","ColorAreaPaint","value","isRTL","useColorAreaContext","hue","withChannel","toString","direction","paintStyle","backgroundImage","join","pointerEvents","jsx","View","className","colorAreaPaintVariants","style","accessible","accessibilityElementsHidden","importantForAccessibility","displayName"],"sourceRoot":"../../../../src","sources":["components/ColorArea/ColorAreaPaint.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAkD,IAAAG,WAAA,GAAAH,OAAA;AAE3C,SAASI,cAAcA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAG,IAAAC,+BAAmB,EAAC,CAAC;EAC9C,MAAMC,GAAG,GAAGH,KAAK,CACdI,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CACrCA,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CACrCC,QAAQ,CAAC,KAAK,CAAC;EAClB,MAAMC,SAAS,GAAGL,KAAK,GAAG,SAAS,GAAG,UAAU;EAChD,MAAMM,UAAU,GAAG;IACjBC,eAAe,EAAE,CACf,kDAAkD,EAClD,mBAAmBF,SAAS,cAAcH,GAAG,GAAG,CACjD,CAACM,IAAI,CAAC,IAAI,CAAC;IACZC,aAAa,EAAE;EACjB,CAAyB;EAEzB,oBACE,IAAAZ,WAAA,CAAAa,GAAA,EAACjB,YAAA,CAAAkB,IAAI;IACHC,SAAS,EAAE,IAAAC,8BAAsB,EAAC,CAAE;IACpCC,KAAK,EAAER,UAAW;IAClBS,UAAU,EAAE,KAAM;IAClBC,2BAA2B;IAC3BC,yBAAyB,EAAC;EAAqB,CAChD,CAAC;AAEN;AAEAnB,cAAc,CAACoB,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorArea = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _ColorAreaPaint = require("./ColorAreaPaint");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const ColorAreaRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
14
|
+
asChild,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.ColorAreaRoot, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
asChild: asChild,
|
|
22
|
+
className: (0, _utils.cn)((0, _styles.colorAreaVariants)(), className),
|
|
23
|
+
style: style,
|
|
24
|
+
...props,
|
|
25
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
26
|
+
slot: 'color-area'
|
|
27
|
+
})),
|
|
28
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorAreaPaint.ColorAreaPaint, {}), children]
|
|
29
|
+
}));
|
|
30
|
+
ColorAreaRoot.displayName = 'ColorArea';
|
|
31
|
+
const ColorAreaThumb = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
value
|
|
39
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorAreaThumb, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
className: (0, _utils.cn)((0, _styles.colorAreaThumbVariants)(), className),
|
|
43
|
+
style: [{
|
|
44
|
+
backgroundColor: value.toString('hex')
|
|
45
|
+
}, style],
|
|
46
|
+
...props,
|
|
47
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
48
|
+
slot: 'color-area-thumb'
|
|
49
|
+
})),
|
|
50
|
+
children: children
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
ColorAreaThumb.displayName = 'ColorArea.Thumb';
|
|
54
|
+
const ColorArea = exports.ColorArea = Object.assign(ColorAreaRoot, {
|
|
55
|
+
Thumb: ColorAreaThumb
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_primitives","_utils","_ColorAreaPaint","_styles","_jsxRuntime","ColorAreaRoot","forwardRef","asChild","className","style","children","props","ref","jsxs","cn","colorAreaVariants","mergeDataAttributes","dataAttributes","slot","jsx","ColorAreaPaint","displayName","ColorAreaThumb","value","useColorAreaContext","colorAreaThumbVariants","backgroundColor","toString","ColorArea","exports","Object","assign","Thumb"],"sourceRoot":"../../../../src","sources":["components/ColorArea/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAA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AAE,CAAC;MAAEiB,eAAe,EAAEH,KAAK,CAACI,QAAQ,CAAC,KAAK;IAAE,CAAC,EAAElB,KAAK,CAAE;IAAA,GACvDE,KAAK;IAAA,GACL,IAAAK,+BAAmB,EAACL,KAAK,EAAE,IAAAM,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAmB,CAAC,CAAC,CAAC;IAAAR,QAAA,EAE3EA;EAAQ,CACc,CAAC;AAE9B,CACF,CAAC;AAEDY,cAAc,CAACD,WAAW,GAAG,iBAAiB;AAMvC,MAAMO,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,MAAM,CAACC,MAAM,CAAC1B,aAAa,EAAE;EACpD2B,KAAK,EAAEV;AACT,CAAC,CAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorAreaVariants = exports.colorAreaThumbVariants = exports.colorAreaPaintVariants = void 0;
|
|
7
|
+
var _utils = require("@cdx-ui/utils");
|
|
8
|
+
var _constants = require("../../styles/constants");
|
|
9
|
+
const colorAreaVariants = exports.colorAreaVariants = (0, _utils.cva)(['relative aspect-square w-full touch-none select-none', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _constants.DISABLED_CURSOR]);
|
|
10
|
+
const colorAreaPaintVariants = exports.colorAreaPaintVariants = (0, _utils.cva)(['absolute inset-0 overflow-hidden rounded-[var(--border-radius-default)]']);
|
|
11
|
+
const colorAreaThumbVariants = exports.colorAreaThumbVariants = (0, _utils.cva)(['z-2 size-5 rounded-[var(--border-radius-round)]', 'border-2 border-surface-primary shadow-md', 'transition-none']);
|
|
12
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","_constants","colorAreaVariants","exports","cva","DISABLED_CURSOR","colorAreaPaintVariants","colorAreaThumbVariants"],"sourceRoot":"../../../../src","sources":["components/ColorArea/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,UAAG,EAAC,CACnC,sDAAsD,EACtD,wDAAwD,EACxDC,0BAAe,CAChB,CAAC;AAEK,MAAMC,sBAAsB,GAAAH,OAAA,CAAAG,sBAAA,GAAG,IAAAF,UAAG,EAAC,CACxC,yEAAyE,CAC1E,CAAC;AAEK,MAAMG,sBAAsB,GAAAJ,OAAA,CAAAI,sBAAA,GAAG,IAAAH,UAAG,EAAC,CACxC,iDAAiD,EACjD,2CAA2C,EAC3C,iBAAiB,CAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorField = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _positionToDataIcon = require("../../utils/positionToDataIcon");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const SCOPE = 'COLOR_FIELD';
|
|
15
|
+
const useColorFieldStyleContext = () => (0, _utils.useParentContext)()[SCOPE] ?? {};
|
|
16
|
+
const ColorFieldRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
17
|
+
variant = 'outline',
|
|
18
|
+
size = 'default',
|
|
19
|
+
fullWidth,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
style,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const parent = (0, _utils.useParentContext)();
|
|
26
|
+
const context = (0, _react.useMemo)(() => ({
|
|
27
|
+
...parent,
|
|
28
|
+
[SCOPE]: {
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
fullWidth
|
|
32
|
+
}
|
|
33
|
+
}), [fullWidth, parent, size, variant]);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
35
|
+
value: context,
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorFieldRoot, {
|
|
37
|
+
ref: ref,
|
|
38
|
+
className: (0, _utils.cn)((0, _styles.colorFieldVariants)(), className),
|
|
39
|
+
style: style,
|
|
40
|
+
...props,
|
|
41
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
42
|
+
slot: 'color-field'
|
|
43
|
+
})),
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
ColorFieldRoot.displayName = 'ColorField';
|
|
49
|
+
const ColorFieldGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
50
|
+
asChild,
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
fullWidth,
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
style,
|
|
57
|
+
...props
|
|
58
|
+
}, ref) => {
|
|
59
|
+
const inherited = useColorFieldStyleContext();
|
|
60
|
+
const {
|
|
61
|
+
disabled,
|
|
62
|
+
invalid,
|
|
63
|
+
readOnly,
|
|
64
|
+
required
|
|
65
|
+
} = (0, _primitives.useColorFieldContext)();
|
|
66
|
+
const resolvedVariant = variant ?? inherited.variant ?? 'outline';
|
|
67
|
+
const resolvedSize = size ?? inherited.size ?? 'default';
|
|
68
|
+
const resolvedFullWidth = fullWidth ?? inherited.fullWidth ?? true;
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.InputRoot, {
|
|
70
|
+
ref: ref,
|
|
71
|
+
asChild: asChild,
|
|
72
|
+
isDisabled: disabled,
|
|
73
|
+
isInvalid: invalid,
|
|
74
|
+
isReadOnly: readOnly,
|
|
75
|
+
isRequired: required,
|
|
76
|
+
className: (0, _utils.cn)((0, _styles.colorFieldGroupVariants)({
|
|
77
|
+
variant: resolvedVariant,
|
|
78
|
+
size: resolvedSize
|
|
79
|
+
}), !resolvedFullWidth && 'w-auto self-start', className),
|
|
80
|
+
style: style,
|
|
81
|
+
...props,
|
|
82
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
83
|
+
slot: 'color-field-group'
|
|
84
|
+
})),
|
|
85
|
+
children: children
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
ColorFieldGroup.displayName = 'ColorField.Group';
|
|
89
|
+
const ColorFieldInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
90
|
+
className,
|
|
91
|
+
placeholderTextColorClassName,
|
|
92
|
+
style,
|
|
93
|
+
...props
|
|
94
|
+
}, ref) => {
|
|
95
|
+
const {
|
|
96
|
+
size
|
|
97
|
+
} = useColorFieldStyleContext();
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorFieldInput, {
|
|
99
|
+
ref: ref,
|
|
100
|
+
className: (0, _utils.cn)((0, _styles.colorFieldInputVariants)({
|
|
101
|
+
size: size ?? 'default'
|
|
102
|
+
}), className),
|
|
103
|
+
placeholderTextColorClassName: (0, _utils.cn)((0, _styles.colorFieldInputPlaceholderVariants)(), placeholderTextColorClassName),
|
|
104
|
+
style: style,
|
|
105
|
+
...props,
|
|
106
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
107
|
+
slot: 'color-field-input'
|
|
108
|
+
}))
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
ColorFieldInput.displayName = 'ColorField.Input';
|
|
112
|
+
const ColorFieldSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
113
|
+
asChild,
|
|
114
|
+
position,
|
|
115
|
+
className,
|
|
116
|
+
children,
|
|
117
|
+
style,
|
|
118
|
+
...props
|
|
119
|
+
}, ref) => {
|
|
120
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
121
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
122
|
+
ref: ref,
|
|
123
|
+
className: (0, _utils.cn)((0, _styles.colorFieldSlotVariants)(), className),
|
|
124
|
+
style: style,
|
|
125
|
+
...props,
|
|
126
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
127
|
+
slot: 'color-field-slot'
|
|
128
|
+
}), (0, _positionToDataIcon.positionToDataIcon)(position)),
|
|
129
|
+
children: children
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
ColorFieldSlot.displayName = 'ColorField.Slot';
|
|
133
|
+
const ColorField = exports.ColorField = Object.assign(ColorFieldRoot, {
|
|
134
|
+
Group: ColorFieldGroup,
|
|
135
|
+
Input: ColorFieldInput,
|
|
136
|
+
Slot: ColorFieldSlot
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_positionToDataIcon","_styles","_jsxRuntime","SCOPE","useColorFieldStyleContext","useParentContext","ColorFieldRoot","forwardRef","variant","size","fullWidth","className","children","style","props","ref","parent","context","useMemo","jsx","ParentContext","Provider","value","cn","colorFieldVariants","mergeDataAttributes","dataAttributes","slot","displayName","ColorFieldGroup","asChild","inherited","disabled","invalid","readOnly","required","useColorFieldContext","resolvedVariant","resolvedSize","resolvedFullWidth","InputRoot","isDisabled","isInvalid","isReadOnly","isRequired","colorFieldGroupVariants","ColorFieldInput","placeholderTextColorClassName","colorFieldInputVariants","colorFieldInputPlaceholderVariants","ColorFieldSlot","position","Comp","Slot","View","colorFieldSlotVariants","positionToDataIcon","ColorField","exports","Object","assign","Group","Input"],"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WAAA,CAAAiB,GAAA,EAACiC,IAAI;IACHrC,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAE,IAAAY,SAAE,EAAC,IAAAgC,8BAAsB,EAAC,CAAC,EAAE5C,SAAS,CAAE;IACnDE,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAA,GACL,IAAAW,+BAAmB,EACrBX,KAAK,EACL,IAAAY,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAmB,CAAC,CAAC,EAC5C,IAAA6B,sCAAkB,EAACL,QAAQ,CAC7B,CAAC;IAAAvC,QAAA,EAEAA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDsC,cAAc,CAACtB,WAAW,GAAG,iBAAiB;AAQvC,MAAM6B,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGE,MAAM,CAACC,MAAM,CAACtD,cAAc,EAAE;EACtDuD,KAAK,EAAEhC,eAAe;EACtBiC,KAAK,EAAEhB,eAAe;EACtBO,IAAI,EAAEH;AACR,CAAC,CAAgC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorFieldVariants = exports.colorFieldSlotVariants = exports.colorFieldInputVariants = exports.colorFieldInputPlaceholderVariants = exports.colorFieldGroupVariants = void 0;
|
|
7
|
+
var _utils = require("@cdx-ui/utils");
|
|
8
|
+
var _styles = require("../Input/styles");
|
|
9
|
+
const colorFieldVariants = exports.colorFieldVariants = (0, _utils.cva)('gap-1.5');
|
|
10
|
+
const colorFieldGroupVariants = exports.colorFieldGroupVariants = _styles.inputRootVariants;
|
|
11
|
+
const colorFieldInputVariants = exports.colorFieldInputVariants = _styles.inputFieldVariants;
|
|
12
|
+
const colorFieldInputPlaceholderVariants = exports.colorFieldInputPlaceholderVariants = _styles.inputFieldPlaceholderVariants;
|
|
13
|
+
const colorFieldSlotVariants = exports.colorFieldSlotVariants = _styles.inputSlotVariants;
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","_styles","colorFieldVariants","exports","cva","colorFieldGroupVariants","inputRootVariants","colorFieldInputVariants","inputFieldVariants","colorFieldInputPlaceholderVariants","inputFieldPlaceholderVariants","colorFieldSlotVariants","inputSlotVariants"],"sourceRoot":"../../../../src","sources":["components/ColorField/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,UAAG,EAAC,SAAS,CAAC;AAEzC,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAGC,yBAAiB;AAEjD,MAAMC,uBAAuB,GAAAJ,OAAA,CAAAI,uBAAA,GAAGC,0BAAkB;AAElD,MAAMC,kCAAkC,GAAAN,OAAA,CAAAM,kCAAA,GAAGC,qCAA6B;AAExE,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAGC,yBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorPicker = void 0;
|
|
7
|
+
Object.defineProperty(exports, "parseColor", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _primitives.parseColor;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
15
|
+
var _utils = require("@cdx-ui/utils");
|
|
16
|
+
var _surfaces = require("../picker/surfaces");
|
|
17
|
+
var _styles = require("./styles");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
const ColorPickerRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
20
|
+
asChild,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorPickerRoot, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
asChild: asChild,
|
|
28
|
+
className: (0, _utils.cn)((0, _styles.colorPickerVariants)(), className),
|
|
29
|
+
style: style,
|
|
30
|
+
...props,
|
|
31
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
32
|
+
slot: 'color-picker'
|
|
33
|
+
})),
|
|
34
|
+
children: children
|
|
35
|
+
}));
|
|
36
|
+
ColorPickerRoot.displayName = 'ColorPicker';
|
|
37
|
+
const ColorPickerTrigger = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
38
|
+
asChild,
|
|
39
|
+
className,
|
|
40
|
+
style,
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorPickerTrigger, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
asChild: asChild,
|
|
46
|
+
className: asChild ? className : (0, _utils.cn)((0, _styles.colorPickerTriggerVariants)(), className),
|
|
47
|
+
style: style,
|
|
48
|
+
...props,
|
|
49
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
50
|
+
slot: 'color-picker-trigger'
|
|
51
|
+
})),
|
|
52
|
+
children: children
|
|
53
|
+
}));
|
|
54
|
+
ColorPickerTrigger.displayName = 'ColorPicker.Trigger';
|
|
55
|
+
const registerPopoverSurface = type => {
|
|
56
|
+
void type;
|
|
57
|
+
};
|
|
58
|
+
function ColorPickerPopover({
|
|
59
|
+
className,
|
|
60
|
+
contentClassName,
|
|
61
|
+
children
|
|
62
|
+
}) {
|
|
63
|
+
const context = (0, _primitives.useColorPickerRootContext)();
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_surfaces.PickerPopoverSurface, {
|
|
65
|
+
open: context.open,
|
|
66
|
+
setOpen: context.setOpen,
|
|
67
|
+
registerSurface: registerPopoverSurface,
|
|
68
|
+
anchorRef: context.anchorRef,
|
|
69
|
+
triggerRef: context.triggerRef,
|
|
70
|
+
className: (0, _utils.cn)((0, _styles.colorPickerPopoverVariants)(), className),
|
|
71
|
+
contentClassName: (0, _utils.cn)((0, _styles.colorPickerPopoverContentVariants)(), contentClassName),
|
|
72
|
+
dataSlot: "color-picker-popover",
|
|
73
|
+
width: "content",
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorPickerRootProvider, {
|
|
75
|
+
value: context,
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorPickerProvider, {
|
|
77
|
+
value: context,
|
|
78
|
+
children: children
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
ColorPickerPopover.displayName = 'ColorPicker.Popover';
|
|
84
|
+
const ColorPicker = exports.ColorPicker = Object.assign(ColorPickerRoot, {
|
|
85
|
+
Trigger: ColorPickerTrigger,
|
|
86
|
+
Popover: ColorPickerPopover
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_primitives","_utils","_surfaces","_styles","_jsxRuntime","ColorPickerRoot","forwardRef","asChild","className","style","children","props","ref","jsx","cn","colorPickerVariants","mergeDataAttributes","dataAttributes","slot","displayName","ColorPickerTrigger","colorPickerTriggerVariants","registerPopoverSurface","type","ColorPickerPopover","contentClassName","context","useColorPickerRootContext","PickerPopoverSurface","open","setOpen","registerSurface","anchorRef","triggerRef","colorPickerPopoverVariants","colorPickerPopoverContentVariants","dataSlot","width","ColorPickerRootProvider","value","ColorPickerProvider","ColorPicker","exports","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;AAEAc,kBAAkB,CAACL,WAAW,GAAG,qBAAqB;AAO/C,MAAMsB,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,MAAM,CAACC,MAAM,CAACvC,eAAe,EAAE;EACxDwC,OAAO,EAAEzB,kBAAkB;EAC3B0B,OAAO,EAAEtB;AACX,CAAC,CAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorPickerVariants = exports.colorPickerTriggerVariants = exports.colorPickerPopoverVariants = exports.colorPickerPopoverContentVariants = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _utils = require("@cdx-ui/utils");
|
|
9
|
+
var _constants = require("../../styles/constants");
|
|
10
|
+
const colorPickerVariants = exports.colorPickerVariants = (0, _utils.cva)(['items-start gap-2']);
|
|
11
|
+
const colorPickerTriggerVariants = exports.colorPickerTriggerVariants = (0, _utils.cva)(['h-10 self-start flex-row items-center justify-center gap-2 px-3', 'rounded-[var(--border-radius-button)]', 'border border-stroke-action bg-transparent', _constants.TRANSITION_COLORS, 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _constants.DISABLED_CURSOR, 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', 'web:data-[focus-visible=true]:ring-2', 'web:data-[focus-visible=true]:ring-stroke-focus', 'web:data-[focus-visible=true]:ring-offset-2', _reactNative.Platform.select({
|
|
12
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
13
|
+
web: ['data-[hover=true]:bg-surface-action-tint-hover', 'data-[active=true]:data-[hover=true]:bg-surface-action-tint-active'].join(' ')
|
|
14
|
+
})]);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Padding lives on the scroll content, not the popover: the popover's `ScrollView` clips at its
|
|
18
|
+
* own bounds, and slider/area thumbs overhang their track ends by half a thumb plus shadow.
|
|
19
|
+
*/
|
|
20
|
+
const colorPickerPopoverVariants = exports.colorPickerPopoverVariants = (0, _utils.cva)(['w-80 p-0']);
|
|
21
|
+
const colorPickerPopoverContentVariants = exports.colorPickerPopoverContentVariants = (0, _utils.cva)(['gap-3 p-4']);
|
|
22
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_utils","_constants","colorPickerVariants","exports","cva","colorPickerTriggerVariants","TRANSITION_COLORS","DISABLED_CURSOR","Platform","select","default","web","join","colorPickerPopoverVariants","colorPickerPopoverContentVariants"],"sourceRoot":"../../../../src","sources":["components/ColorPicker/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,UAAG,EAAC,CAAC,mBAAmB,CAAC,CAAC;AAEtD,MAAMC,0BAA0B,GAAAF,OAAA,CAAAE,0BAAA,GAAG,IAAAD,UAAG,EAAC,CAC5C,iEAAiE,EACjE,uCAAuC,EACvC,4CAA4C,EAC5CE,4BAAiB,EACjB,wDAAwD,EACxDC,0BAAe,EACf,wEAAwE,EACxE,sCAAsC,EACtC,iDAAiD,EACjD,6CAA6C,EAC7CC,qBAAQ,CAACC,MAAM,CAAC;EACdC,OAAO,EAAE,kDAAkD;EAC3DC,GAAG,EAAE,CACH,gDAAgD,EAChD,oEAAoE,CACrE,CAACC,IAAI,CAAC,GAAG;AACZ,CAAC,CAAC,CACH,CAAC;;AAEF;AACA;AACA;AACA;AACO,MAAMC,0BAA0B,GAAAV,OAAA,CAAAU,0BAAA,GAAG,IAAAT,UAAG,EAAC,CAAC,UAAU,CAAC,CAAC;AAEpD,MAAMU,iCAAiC,GAAAX,OAAA,CAAAW,iCAAA,GAAG,IAAAV,UAAG,EAAC,CAAC,WAAW,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorSliderRailPaint = ColorSliderRailPaint;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
10
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function getStopOffset(index, count, railSize, endCap) {
|
|
14
|
+
const ratio = index / (count - 1);
|
|
15
|
+
if (railSize <= 0 || endCap <= 0) {
|
|
16
|
+
return `${String(ratio * 100)}%`;
|
|
17
|
+
}
|
|
18
|
+
return `${String((endCap + ratio * railSize) / (railSize + 2 * endCap) * 100)}%`;
|
|
19
|
+
}
|
|
20
|
+
function ColorSliderRailPaint() {
|
|
21
|
+
const {
|
|
22
|
+
gradientColors,
|
|
23
|
+
orientation,
|
|
24
|
+
layout,
|
|
25
|
+
thumbSize
|
|
26
|
+
} = (0, _primitives.useColorSliderContext)();
|
|
27
|
+
const gradientId = (0, _react.useId)();
|
|
28
|
+
const isVertical = orientation === 'vertical';
|
|
29
|
+
const railSize = (isVertical ? layout?.height : layout?.width) ?? 0;
|
|
30
|
+
const endCap = (isVertical ? thumbSize.height : thumbSize.width) / 2;
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
32
|
+
className: (0, _styles.colorSliderRailPaintVariants)({
|
|
33
|
+
orientation
|
|
34
|
+
}),
|
|
35
|
+
style: styles.paint,
|
|
36
|
+
accessible: false,
|
|
37
|
+
accessibilityElementsHidden: true,
|
|
38
|
+
importantForAccessibility: "no-hide-descendants",
|
|
39
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Svg, {
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: "100%",
|
|
42
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
|
|
43
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.LinearGradient, {
|
|
44
|
+
id: gradientId,
|
|
45
|
+
x1: "0%",
|
|
46
|
+
y1: orientation === 'vertical' ? '100%' : '0%',
|
|
47
|
+
x2: orientation === 'horizontal' ? '100%' : '0%',
|
|
48
|
+
y2: "0%",
|
|
49
|
+
children: gradientColors.map((color, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
50
|
+
offset: getStopOffset(index, gradientColors.length, railSize, endCap),
|
|
51
|
+
stopColor: color
|
|
52
|
+
}, `${color}-${String(index)}`))
|
|
53
|
+
})
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
55
|
+
width: "100%",
|
|
56
|
+
height: "100%",
|
|
57
|
+
fill: `url(#${gradientId})`
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
ColorSliderRailPaint.displayName = 'ColorSliderRailPaint';
|
|
63
|
+
const styles = _reactNative.StyleSheet.create({
|
|
64
|
+
paint: {
|
|
65
|
+
pointerEvents: 'none'
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=ColorSliderRailPaint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_primitives","_styles","_jsxRuntime","getStopOffset","index","count","railSize","endCap","ratio","String","ColorSliderRailPaint","gradientColors","orientation","layout","thumbSize","useColorSliderContext","gradientId","useId","isVertical","height","width","jsx","View","className","colorSliderRailPaintVariants","style","styles","paint","accessible","accessibilityElementsHidden","importantForAccessibility","children","jsxs","Svg","Defs","LinearGradient","id","x1","y1","x2","y2","map","color","Stop","offset","length","stopColor","Rect","fill","displayName","StyleSheet","create","pointerEvents"],"sourceRoot":"../../../../src","sources":["components/ColorSlider/ColorSliderRailPaint.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AAExD,SAASM,aAAaA,CAACC,KAAa,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,MAAc,EAAU;EAC7F,MAAMC,KAAK,GAAGJ,KAAK,IAAIC,KAAK,GAAG,CAAC,CAAC;EACjC,IAAIC,QAAQ,IAAI,CAAC,IAAIC,MAAM,IAAI,CAAC,EAAE;IAChC,OAAO,GAAGE,MAAM,CAACD,KAAK,GAAG,GAAG,CAAC,GAAG;EAClC;EACA,OAAO,GAAGC,MAAM,CAAE,CAACF,MAAM,GAAGC,KAAK,GAAGF,QAAQ,KAAKA,QAAQ,GAAG,CAAC,GAAGC,MAAM,CAAC,GAAI,GAAG,CAAC,GAAG;AACpF;AAEO,SAASG,oBAAoBA,CAAA,EAAG;EACrC,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iCAAqB,EAAC,CAAC;EAClF,MAAMC,UAAU,GAAG,IAAAC,YAAK,EAAC,CAAC;EAC1B,MAAMC,UAAU,GAAGN,WAAW,KAAK,UAAU;EAC7C,MAAMN,QAAQ,GAAG,CAACY,UAAU,GAAGL,MAAM,EAAEM,MAAM,GAAGN,MAAM,EAAEO,KAAK,KAAK,CAAC;EACnE,MAAMb,MAAM,GAAG,CAACW,UAAU,GAAGJ,SAAS,CAACK,MAAM,GAAGL,SAAS,CAACM,KAAK,IAAI,CAAC;EAEpE,oBACE,IAAAlB,WAAA,CAAAmB,GAAA,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CACF,CAAC;AAEX;AAEAN,oBAAoB,CAACuC,WAAW,GAAG,sBAAsB;AAEzD,MAAMvB,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/BxB,KAAK,EAAE;IACLyB,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorSliderRailPaint = ColorSliderRailPaint;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _styles = require("./styles");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function getGradientStops(colors, endCap) {
|
|
12
|
+
if (endCap <= 0 || colors.length < 2) {
|
|
13
|
+
return colors.join(', ');
|
|
14
|
+
}
|
|
15
|
+
const first = `${colors[0]} ${String(endCap)}px`;
|
|
16
|
+
const last = `${colors[colors.length - 1]} calc(100% - ${String(endCap)}px)`;
|
|
17
|
+
return [first, ...colors.slice(1, -1), last].join(', ');
|
|
18
|
+
}
|
|
19
|
+
function ColorSliderRailPaint() {
|
|
20
|
+
const {
|
|
21
|
+
gradientColors,
|
|
22
|
+
orientation,
|
|
23
|
+
thumbSize
|
|
24
|
+
} = (0, _primitives.useColorSliderContext)();
|
|
25
|
+
const direction = orientation === 'vertical' ? 'to top' : 'to right';
|
|
26
|
+
const endCap = (orientation === 'vertical' ? thumbSize.height : thumbSize.width) / 2;
|
|
27
|
+
const paintStyle = {
|
|
28
|
+
backgroundImage: `linear-gradient(${direction}, ${getGradientStops(gradientColors, endCap)})`
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
31
|
+
className: (0, _styles.colorSliderRailPaintVariants)({
|
|
32
|
+
orientation
|
|
33
|
+
}),
|
|
34
|
+
style: paintStyle,
|
|
35
|
+
accessible: false,
|
|
36
|
+
accessibilityElementsHidden: true,
|
|
37
|
+
importantForAccessibility: "no-hide-descendants"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
ColorSliderRailPaint.displayName = 'ColorSliderRailPaint';
|
|
41
|
+
//# sourceMappingURL=ColorSliderRailPaint.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_primitives","_styles","_jsxRuntime","getGradientStops","colors","endCap","length","join","first","String","last","slice","ColorSliderRailPaint","gradientColors","orientation","thumbSize","useColorSliderContext","direction","height","width","paintStyle","backgroundImage","jsx","View","className","colorSliderRailPaintVariants","style","accessible","accessibilityElementsHidden","importantForAccessibility","displayName"],"sourceRoot":"../../../../src","sources":["components/ColorSlider/ColorSliderRailPaint.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAwD,IAAAG,WAAA,GAAAH,OAAA;AAExD,SAASI,gBAAgBA,CAACC,MAAyB,EAAEC,MAAc,EAAU;EAC3E,IAAIA,MAAM,IAAI,CAAC,IAAID,MAAM,CAACE,MAAM,GAAG,CAAC,EAAE;IACpC,OAAOF,MAAM,CAACG,IAAI,CAAC,IAAI,CAAC;EAC1B;EACA,MAAMC,KAAK,GAAG,GAAGJ,MAAM,CAAC,CAAC,CAAC,IAAIK,MAAM,CAACJ,MAAM,CAAC,IAAI;EAChD,MAAMK,IAAI,GAAG,GAAGN,MAAM,CAACA,MAAM,CAACE,MAAM,GAAG,CAAC,CAAC,gBAAgBG,MAAM,CAACJ,MAAM,CAAC,KAAK;EAC5E,OAAO,CAACG,KAAK,EAAE,GAAGJ,MAAM,CAACO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAED,IAAI,CAAC,CAACH,IAAI,CAAC,IAAI,CAAC;AACzD;A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