@ssa-ui-kit/core 2.18.3 → 2.19.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/ColorPicker/ColorPicker.d.ts +2 -17
- package/dist/components/ColorPicker/ColorPickerContext.d.ts +4 -0
- package/dist/components/ColorPicker/components/ColorPickerTrigger.d.ts +1 -0
- package/dist/components/ColorPicker/components/TabColorPalette.d.ts +1 -0
- package/dist/components/ColorPicker/components/TabColorPicker.d.ts +1 -0
- package/dist/components/ColorPicker/components/TabContent.d.ts +1 -0
- package/dist/components/ColorPicker/components/index.d.ts +3 -0
- package/dist/components/ColorPicker/constants.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts +37 -0
- package/dist/components/ColorPicker/utils.d.ts +3 -0
- package/dist/components/TabBar/TabBar.d.ts +1 -1
- package/dist/components/TabBar/types.d.ts +1 -0
- package/dist/index.js +287 -50
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,18 +1,3 @@
|
|
|
1
|
+
import { ColorPickerProps } from './types';
|
|
1
2
|
import '@rc-component/color-picker/assets/index.css';
|
|
2
|
-
declare const
|
|
3
|
-
readonly hex: "HEX";
|
|
4
|
-
readonly rgb: "RGB";
|
|
5
|
-
readonly hsl: "HSL";
|
|
6
|
-
};
|
|
7
|
-
type ColorFormat = keyof typeof COLOR_FORMAT;
|
|
8
|
-
export interface ColorPickerProps {
|
|
9
|
-
defaultColor?: string;
|
|
10
|
-
color?: string;
|
|
11
|
-
disabledAlpha?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
format?: ColorFormat;
|
|
14
|
-
defaultFormat?: ColorFormat;
|
|
15
|
-
onChange?: (color: string) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const ColorPicker: ({ color: providedColor, defaultColor, disabledAlpha, disabled, format: providedFormat, defaultFormat, onChange, }: ColorPickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
3
|
+
export declare const ColorPicker: ({ color: providedColor, format: providedFormat, colorsPalette, ...rest }: ColorPickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ColorPickerProviderOutputProps, ColorPickerProviderInputProps } from './types';
|
|
2
|
+
export declare const ColorPickerContext: import("react").Context<ColorPickerProviderOutputProps>;
|
|
3
|
+
export declare const ColorPickerProvider: ({ children, providedColor, providedFormat, defaultColor, defaultFormat, classnames, disabledAlpha, disabled, label, colorsPalette, onChange, }: React.PropsWithChildren<ColorPickerProviderInputProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const useColorPickerContext: () => ColorPickerProviderOutputProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ColorPickerTrigger: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TabColorPalette: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TabColorPicker: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TabContent: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Color } from '@rc-component/color-picker';
|
|
2
|
+
import { SmallTabProps, TabProps } from '../TabBar/types';
|
|
3
|
+
import { COLOR_FORMAT } from './constants';
|
|
4
|
+
export type ColorFormat = keyof typeof COLOR_FORMAT;
|
|
5
|
+
export interface ColorPickerProps {
|
|
6
|
+
defaultColor?: string;
|
|
7
|
+
defaultFormat?: ColorFormat;
|
|
8
|
+
disabledAlpha?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
color?: string;
|
|
11
|
+
format?: ColorFormat;
|
|
12
|
+
label?: string;
|
|
13
|
+
colorsPalette?: string[];
|
|
14
|
+
classnames?: {
|
|
15
|
+
trigger?: string;
|
|
16
|
+
content?: string;
|
|
17
|
+
button?: string;
|
|
18
|
+
colorPicker?: string;
|
|
19
|
+
colorDropdown?: string;
|
|
20
|
+
output?: string;
|
|
21
|
+
};
|
|
22
|
+
onChange?: (color: string) => void;
|
|
23
|
+
}
|
|
24
|
+
export type ColorPickerProviderInputProps = Omit<ColorPickerProps, 'color' | 'format'> & {
|
|
25
|
+
providedColor: ColorPickerProps['color'];
|
|
26
|
+
providedFormat: ColorPickerProps['format'];
|
|
27
|
+
};
|
|
28
|
+
export type ColorPickerProviderOutputProps = Omit<ColorPickerProps, 'color'> & {
|
|
29
|
+
rawColor?: string | Color;
|
|
30
|
+
format: ColorFormat;
|
|
31
|
+
copy: (valueToCopy: string) => void;
|
|
32
|
+
setRawColor: (color: string | Color) => void;
|
|
33
|
+
setFormat: (format: ColorFormat) => void;
|
|
34
|
+
};
|
|
35
|
+
export type ColorPickerTabProps = Pick<TabProps, 'tabId' | 'isActive' | 'ariaControls' | 'onClick'> & Pick<SmallTabProps, 'text'> & {
|
|
36
|
+
isActive?: boolean;
|
|
37
|
+
};
|
|
@@ -6,5 +6,5 @@ import { TabBarProps } from './types';
|
|
|
6
6
|
* component to decide where to render the contents of the
|
|
7
7
|
* selected tab.
|
|
8
8
|
* */
|
|
9
|
-
declare const TabBar: ({ children }: TabBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const TabBar: ({ children, className }: TabBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default TabBar;
|
package/dist/index.js
CHANGED
|
@@ -7435,7 +7435,8 @@ const TabBarBase = /*#__PURE__*/base_default()("div", true ? {
|
|
|
7435
7435
|
* selected tab.
|
|
7436
7436
|
* */
|
|
7437
7437
|
const TabBar = ({
|
|
7438
|
-
children
|
|
7438
|
+
children,
|
|
7439
|
+
className
|
|
7439
7440
|
}) => {
|
|
7440
7441
|
const {
|
|
7441
7442
|
activeTab,
|
|
@@ -7444,6 +7445,7 @@ const TabBar = ({
|
|
|
7444
7445
|
const activeTabId = activeTab?.tabId;
|
|
7445
7446
|
return (0,jsx_runtime_namespaceObject.jsx)(TabBarBase, {
|
|
7446
7447
|
role: "tablist",
|
|
7448
|
+
className: className,
|
|
7447
7449
|
children: external_react_namespaceObject.Children.map(children, child => {
|
|
7448
7450
|
// istanbul ignore else
|
|
7449
7451
|
if (/*#__PURE__*/(0,external_react_namespaceObject.isValidElement)(child)) {
|
|
@@ -11758,11 +11760,131 @@ const CollapsibleNavBarCustomIconSVG = ({
|
|
|
11758
11760
|
|
|
11759
11761
|
|
|
11760
11762
|
|
|
11761
|
-
;// external "@emotion/css"
|
|
11762
|
-
const css_namespaceObject = require("@emotion/css");
|
|
11763
11763
|
;// external "@rc-component/color-picker"
|
|
11764
11764
|
const color_picker_namespaceObject = require("@rc-component/color-picker");
|
|
11765
11765
|
var color_picker_default = /*#__PURE__*/__webpack_require__.n(color_picker_namespaceObject);
|
|
11766
|
+
;// ./src/components/ColorPicker/utils.ts
|
|
11767
|
+
const colorFormatter = {
|
|
11768
|
+
hex: color => color.toHexString(),
|
|
11769
|
+
rgb: color => color.toRgbString(),
|
|
11770
|
+
hsl: color => color.toHslString()
|
|
11771
|
+
};
|
|
11772
|
+
;// ./src/components/ColorPicker/ColorPickerContext.tsx
|
|
11773
|
+
|
|
11774
|
+
|
|
11775
|
+
|
|
11776
|
+
|
|
11777
|
+
|
|
11778
|
+
const ColorPickerContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)({
|
|
11779
|
+
format: 'hex',
|
|
11780
|
+
rawColor: undefined,
|
|
11781
|
+
copy() {
|
|
11782
|
+
// no-op
|
|
11783
|
+
},
|
|
11784
|
+
setFormat() {
|
|
11785
|
+
// no-op
|
|
11786
|
+
},
|
|
11787
|
+
setRawColor() {
|
|
11788
|
+
// no-op
|
|
11789
|
+
}
|
|
11790
|
+
});
|
|
11791
|
+
const ColorPickerProvider = ({
|
|
11792
|
+
children,
|
|
11793
|
+
providedColor,
|
|
11794
|
+
providedFormat,
|
|
11795
|
+
defaultColor,
|
|
11796
|
+
defaultFormat,
|
|
11797
|
+
classnames,
|
|
11798
|
+
disabledAlpha,
|
|
11799
|
+
disabled,
|
|
11800
|
+
label,
|
|
11801
|
+
colorsPalette,
|
|
11802
|
+
onChange
|
|
11803
|
+
}) => {
|
|
11804
|
+
const {
|
|
11805
|
+
copy
|
|
11806
|
+
} = (0,hooks_namespaceObject.useClipboard)();
|
|
11807
|
+
const [format, setFormat] = (0,hooks_namespaceObject.useUncontrolled)({
|
|
11808
|
+
value: providedFormat,
|
|
11809
|
+
defaultValue: defaultFormat,
|
|
11810
|
+
finalValue: 'hex'
|
|
11811
|
+
});
|
|
11812
|
+
const [rawColor, setRawColor] = (0,hooks_namespaceObject.useUncontrolled)({
|
|
11813
|
+
value: providedColor,
|
|
11814
|
+
defaultValue: defaultColor,
|
|
11815
|
+
onChange: color => {
|
|
11816
|
+
if (color) {
|
|
11817
|
+
onChange?.(colorFormatter[format](new color_picker_namespaceObject.Color(color)));
|
|
11818
|
+
}
|
|
11819
|
+
}
|
|
11820
|
+
});
|
|
11821
|
+
return (0,jsx_runtime_namespaceObject.jsx)(ColorPickerContext.Provider, {
|
|
11822
|
+
value: {
|
|
11823
|
+
defaultColor,
|
|
11824
|
+
defaultFormat,
|
|
11825
|
+
format,
|
|
11826
|
+
rawColor,
|
|
11827
|
+
classnames,
|
|
11828
|
+
disabledAlpha,
|
|
11829
|
+
disabled,
|
|
11830
|
+
label,
|
|
11831
|
+
colorsPalette,
|
|
11832
|
+
copy,
|
|
11833
|
+
setFormat,
|
|
11834
|
+
setRawColor,
|
|
11835
|
+
onChange
|
|
11836
|
+
},
|
|
11837
|
+
children: children
|
|
11838
|
+
});
|
|
11839
|
+
};
|
|
11840
|
+
const useColorPickerContext = () => {
|
|
11841
|
+
const context = (0,external_react_namespaceObject.useContext)(ColorPickerContext);
|
|
11842
|
+
if (!context) {
|
|
11843
|
+
throw new Error('useColorPickerContext must be used within a ColorPickerProvider');
|
|
11844
|
+
}
|
|
11845
|
+
return context;
|
|
11846
|
+
};
|
|
11847
|
+
;// ./src/components/ColorPicker/components/TabColorPalette.tsx
|
|
11848
|
+
|
|
11849
|
+
|
|
11850
|
+
function TabColorPalette_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11851
|
+
|
|
11852
|
+
|
|
11853
|
+
|
|
11854
|
+
const TabColorPaletteItem = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
|
|
11855
|
+
target: "et6h5v0"
|
|
11856
|
+
} : 0)("width:28px;height:28px;border-radius:4px;cursor:pointer;border:1px solid ", ({
|
|
11857
|
+
theme
|
|
11858
|
+
}) => theme.colors.greySelectedMenuItem, ";" + ( true ? "" : 0));
|
|
11859
|
+
var TabColorPalette_ref = true ? {
|
|
11860
|
+
name: "dzb9g1",
|
|
11861
|
+
styles: "gap:16px;width:248px;height:240px;align-items:flex-start;align-content:flex-start;flex-wrap:wrap"
|
|
11862
|
+
} : 0;
|
|
11863
|
+
const TabColorPalette = () => {
|
|
11864
|
+
const {
|
|
11865
|
+
setRawColor,
|
|
11866
|
+
colorsPalette
|
|
11867
|
+
} = useColorPickerContext();
|
|
11868
|
+
const handleColorSelect = event => {
|
|
11869
|
+
const target = event.currentTarget;
|
|
11870
|
+
const selectedColor = target.getAttribute('data-color');
|
|
11871
|
+
if (selectedColor) {
|
|
11872
|
+
setRawColor(selectedColor);
|
|
11873
|
+
}
|
|
11874
|
+
};
|
|
11875
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
|
|
11876
|
+
css: TabColorPalette_ref,
|
|
11877
|
+
children: colorsPalette?.map(color => (0,jsx_runtime_namespaceObject.jsx)(TabColorPaletteItem, {
|
|
11878
|
+
"data-color": color,
|
|
11879
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
11880
|
+
backgroundColor: color
|
|
11881
|
+
}, true ? "" : 0, true ? "" : 0),
|
|
11882
|
+
onClick: handleColorSelect
|
|
11883
|
+
}, color))
|
|
11884
|
+
});
|
|
11885
|
+
};
|
|
11886
|
+
;// external "@emotion/css"
|
|
11887
|
+
const css_namespaceObject = require("@emotion/css");
|
|
11766
11888
|
;// ./src/components/ColorPicker/components/BaseInput.tsx
|
|
11767
11889
|
|
|
11768
11890
|
function BaseInput_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
@@ -11959,11 +12081,16 @@ const CopyButton = /*#__PURE__*/base_default()(Button_Button, true ? {
|
|
|
11959
12081
|
}) => theme.colors.grey, ";&:hover,&:focus{background:none;box-shadow:none;&::before{display:none;}}&:hover{svg path{fill:", ({
|
|
11960
12082
|
theme
|
|
11961
12083
|
}) => theme.colors.greyDarker, ";}}" + ( true ? "" : 0));
|
|
11962
|
-
;//
|
|
11963
|
-
const
|
|
11964
|
-
|
|
11965
|
-
|
|
12084
|
+
;// ./src/components/ColorPicker/constants.ts
|
|
12085
|
+
const COLOR_FORMAT = {
|
|
12086
|
+
hex: 'HEX',
|
|
12087
|
+
rgb: 'RGB',
|
|
12088
|
+
hsl: 'HSL'
|
|
12089
|
+
};
|
|
12090
|
+
const COLORS_PALETTE = ['#F463EA', '#BE49EC', '#9260FC', '#5B8DEC', '#4CBFFD', '#62E1F7', '#2CBB97', '#5FC855', '#99E176', '#CEEC83', '#F9F789', '#FDE47D', '#FDC67D', '#FFA069', '#FF7379'];
|
|
12091
|
+
;// ./src/components/ColorPicker/components/TabColorPicker.tsx
|
|
11966
12092
|
|
|
12093
|
+
function TabColorPicker_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11967
12094
|
|
|
11968
12095
|
|
|
11969
12096
|
|
|
@@ -11973,51 +12100,29 @@ function ColorPicker_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried t
|
|
|
11973
12100
|
|
|
11974
12101
|
|
|
11975
12102
|
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
}
|
|
11981
|
-
const colorFormatter = {
|
|
11982
|
-
hex: color => color.toHexString(),
|
|
11983
|
-
rgb: color => color.toRgbString(),
|
|
11984
|
-
hsl: color => color.toHslString()
|
|
11985
|
-
};
|
|
11986
|
-
var ColorPicker_ref = true ? {
|
|
11987
|
-
name: "16s5rj8",
|
|
11988
|
-
styles: "width:280px"
|
|
12103
|
+
|
|
12104
|
+
|
|
12105
|
+
var TabColorPicker_ref = true ? {
|
|
12106
|
+
name: "qsz8ux",
|
|
12107
|
+
styles: "width:248px;box-shadow:none;padding:0;& .rc-color-picker-slider-container{padding-left:4px;}"
|
|
11989
12108
|
} : 0;
|
|
11990
|
-
var
|
|
12109
|
+
var TabColorPicker_ref2 = true ? {
|
|
11991
12110
|
name: "71zmeu",
|
|
11992
12111
|
styles: "justify-content:space-between;gap:5px"
|
|
11993
12112
|
} : 0;
|
|
11994
|
-
const
|
|
11995
|
-
color: providedColor,
|
|
11996
|
-
defaultColor,
|
|
11997
|
-
disabledAlpha,
|
|
11998
|
-
disabled,
|
|
11999
|
-
format: providedFormat,
|
|
12000
|
-
defaultFormat,
|
|
12001
|
-
onChange
|
|
12002
|
-
}) => {
|
|
12113
|
+
const TabColorPicker = () => {
|
|
12003
12114
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
12004
|
-
const [format, setFormat] = (0,hooks_namespaceObject.useUncontrolled)({
|
|
12005
|
-
value: providedFormat,
|
|
12006
|
-
defaultValue: defaultFormat,
|
|
12007
|
-
finalValue: 'hex'
|
|
12008
|
-
});
|
|
12009
|
-
const [rawColor, setRawColor] = (0,hooks_namespaceObject.useUncontrolled)({
|
|
12010
|
-
value: providedColor,
|
|
12011
|
-
defaultValue: defaultColor,
|
|
12012
|
-
onChange: color => {
|
|
12013
|
-
if (color) {
|
|
12014
|
-
onChange?.(colorFormatter[format](new color_picker_namespaceObject.Color(color)));
|
|
12015
|
-
}
|
|
12016
|
-
}
|
|
12017
|
-
});
|
|
12018
12115
|
const {
|
|
12019
|
-
|
|
12020
|
-
|
|
12116
|
+
rawColor,
|
|
12117
|
+
disabled,
|
|
12118
|
+
disabledAlpha,
|
|
12119
|
+
classnames,
|
|
12120
|
+
format,
|
|
12121
|
+
copy,
|
|
12122
|
+
onChange,
|
|
12123
|
+
setFormat,
|
|
12124
|
+
setRawColor
|
|
12125
|
+
} = useColorPickerContext();
|
|
12021
12126
|
const parsedColor = rawColor ? new color_picker_namespaceObject.Color(rawColor) : undefined;
|
|
12022
12127
|
const handleFormatSelect = format => {
|
|
12023
12128
|
onChange?.(colorFormatter[format](new color_picker_namespaceObject.Color(rawColor)));
|
|
@@ -12042,16 +12147,17 @@ const ColorPicker = ({
|
|
|
12042
12147
|
onChange: setRawColor,
|
|
12043
12148
|
disabledAlpha: disabledAlpha,
|
|
12044
12149
|
disabled: disabled,
|
|
12045
|
-
css:
|
|
12150
|
+
css: TabColorPicker_ref,
|
|
12151
|
+
className: classnames?.colorPicker,
|
|
12046
12152
|
panelRender: panel => (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
12047
12153
|
children: [panel, (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
12048
12154
|
alignItems: "center",
|
|
12049
|
-
css:
|
|
12155
|
+
css: TabColorPicker_ref2,
|
|
12050
12156
|
children: [(0,jsx_runtime_namespaceObject.jsx)(ColorDropdown, {
|
|
12051
|
-
className: /*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
12157
|
+
className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
12052
12158
|
name: "2746za",
|
|
12053
12159
|
styles: "height:28px"
|
|
12054
|
-
} : 0),
|
|
12160
|
+
} : 0), classnames?.colorDropdown].join(' '),
|
|
12055
12161
|
selectedItem: {
|
|
12056
12162
|
value: COLOR_FORMAT[format],
|
|
12057
12163
|
id: format
|
|
@@ -12069,6 +12175,7 @@ const ColorPicker = ({
|
|
|
12069
12175
|
overflow: 'hidden',
|
|
12070
12176
|
alignSelf: 'stretch'
|
|
12071
12177
|
}, true ? "" : 0, true ? "" : 0),
|
|
12178
|
+
className: classnames?.output,
|
|
12072
12179
|
children: Input[format]()
|
|
12073
12180
|
}), (0,jsx_runtime_namespaceObject.jsx)(CopyButton, {
|
|
12074
12181
|
variant: "tertiary",
|
|
@@ -12084,6 +12191,136 @@ const ColorPicker = ({
|
|
|
12084
12191
|
})
|
|
12085
12192
|
});
|
|
12086
12193
|
};
|
|
12194
|
+
;// ./src/components/ColorPicker/components/TabContent.tsx
|
|
12195
|
+
|
|
12196
|
+
|
|
12197
|
+
|
|
12198
|
+
|
|
12199
|
+
const TabContent = () => {
|
|
12200
|
+
const {
|
|
12201
|
+
activeTab
|
|
12202
|
+
} = useTabBarContext();
|
|
12203
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
12204
|
+
children: [activeTab?.tabId === 'color-picker' && (0,jsx_runtime_namespaceObject.jsx)(TabColorPicker, {}), activeTab?.tabId === 'color-palette' && (0,jsx_runtime_namespaceObject.jsx)(TabColorPalette, {})]
|
|
12205
|
+
});
|
|
12206
|
+
};
|
|
12207
|
+
;// ./src/components/ColorPicker/components/ColorPickerTrigger.tsx
|
|
12208
|
+
function ColorPickerTrigger_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
12209
|
+
|
|
12210
|
+
|
|
12211
|
+
|
|
12212
|
+
|
|
12213
|
+
|
|
12214
|
+
|
|
12215
|
+
|
|
12216
|
+
var ColorPickerTrigger_ref = true ? {
|
|
12217
|
+
name: "1ue162o",
|
|
12218
|
+
styles: "padding:0;height:20px;min-width:20px;font-size:16px;font-weight:500;gap:8px"
|
|
12219
|
+
} : 0;
|
|
12220
|
+
const ColorPickerTrigger = () => {
|
|
12221
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
12222
|
+
const {
|
|
12223
|
+
classnames,
|
|
12224
|
+
rawColor,
|
|
12225
|
+
label
|
|
12226
|
+
} = useColorPickerContext();
|
|
12227
|
+
return (0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
|
|
12228
|
+
asChild: true,
|
|
12229
|
+
className: classnames?.trigger,
|
|
12230
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
|
|
12231
|
+
variant: "tertiary",
|
|
12232
|
+
className: classnames?.button,
|
|
12233
|
+
"data-testid": "color-picker-trigger",
|
|
12234
|
+
css: ColorPickerTrigger_ref,
|
|
12235
|
+
startIcon: (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
|
|
12236
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
12237
|
+
width: 20,
|
|
12238
|
+
height: 20,
|
|
12239
|
+
background: rawColor && new color_picker_namespaceObject.Color(rawColor).toRgbString(),
|
|
12240
|
+
borderRadius: 4,
|
|
12241
|
+
border: `1px solid ${theme.colors.greySelectedMenuItem}`,
|
|
12242
|
+
'&:hover': {
|
|
12243
|
+
border: `1px solid ${theme.colors.grey}`
|
|
12244
|
+
},
|
|
12245
|
+
'&:active': {
|
|
12246
|
+
border: `1px solid ${theme.colors.greyBackground}`
|
|
12247
|
+
}
|
|
12248
|
+
}, true ? "" : 0, true ? "" : 0)
|
|
12249
|
+
}),
|
|
12250
|
+
children: label
|
|
12251
|
+
})
|
|
12252
|
+
});
|
|
12253
|
+
};
|
|
12254
|
+
;// external "@rc-component/color-picker/assets/index.css"
|
|
12255
|
+
const index_css_namespaceObject = require("@rc-component/color-picker/assets/index.css");
|
|
12256
|
+
;// ./src/components/ColorPicker/ColorPicker.tsx
|
|
12257
|
+
function ColorPicker_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
12258
|
+
|
|
12259
|
+
|
|
12260
|
+
|
|
12261
|
+
|
|
12262
|
+
|
|
12263
|
+
|
|
12264
|
+
|
|
12265
|
+
|
|
12266
|
+
|
|
12267
|
+
var ColorPicker_ref = true ? {
|
|
12268
|
+
name: "dl37cv",
|
|
12269
|
+
styles: "gap:16px;padding:16px;border-radius:8px;box-shadow:0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05)"
|
|
12270
|
+
} : 0;
|
|
12271
|
+
var ColorPicker_ref2 = true ? {
|
|
12272
|
+
name: "xyzkeb",
|
|
12273
|
+
styles: "align-self:flex-start"
|
|
12274
|
+
} : 0;
|
|
12275
|
+
const ColorPicker = ({
|
|
12276
|
+
color: providedColor,
|
|
12277
|
+
format: providedFormat,
|
|
12278
|
+
colorsPalette = COLORS_PALETTE,
|
|
12279
|
+
...rest
|
|
12280
|
+
}) => {
|
|
12281
|
+
const tabsConfig = {
|
|
12282
|
+
colorPalette: {
|
|
12283
|
+
tabId: 'color-palette',
|
|
12284
|
+
ariaControls: 'color-palette-panel',
|
|
12285
|
+
text: 'General',
|
|
12286
|
+
renderContent: TabColorPalette
|
|
12287
|
+
},
|
|
12288
|
+
colorPicker: {
|
|
12289
|
+
tabId: 'color-picker',
|
|
12290
|
+
ariaControls: 'color-picker-panel',
|
|
12291
|
+
text: 'Custom',
|
|
12292
|
+
renderContent: TabColorPicker
|
|
12293
|
+
}
|
|
12294
|
+
};
|
|
12295
|
+
return (0,jsx_runtime_namespaceObject.jsx)(TabBarContextProvider, {
|
|
12296
|
+
initialTab: {
|
|
12297
|
+
tabId: tabsConfig.colorPalette.tabId,
|
|
12298
|
+
renderContent: tabsConfig.colorPalette.renderContent
|
|
12299
|
+
},
|
|
12300
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(ColorPickerProvider, {
|
|
12301
|
+
providedColor: providedColor,
|
|
12302
|
+
providedFormat: providedFormat,
|
|
12303
|
+
colorsPalette: colorsPalette,
|
|
12304
|
+
...rest,
|
|
12305
|
+
children: (0,jsx_runtime_namespaceObject.jsxs)(Popover, {
|
|
12306
|
+
interactionsEnabled: 'click',
|
|
12307
|
+
placement: 'top-start',
|
|
12308
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(ColorPickerTrigger, {}), (0,jsx_runtime_namespaceObject.jsxs)(PopoverContent, {
|
|
12309
|
+
css: ColorPicker_ref,
|
|
12310
|
+
className: rest.classnames?.content,
|
|
12311
|
+
children: [(0,jsx_runtime_namespaceObject.jsxs)(TabBar_TabBar, {
|
|
12312
|
+
css: ColorPicker_ref2,
|
|
12313
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(Tab_Tab, {
|
|
12314
|
+
...tabsConfig.colorPalette
|
|
12315
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(Tab_Tab, {
|
|
12316
|
+
...tabsConfig.colorPicker
|
|
12317
|
+
})]
|
|
12318
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(TabContent, {})]
|
|
12319
|
+
})]
|
|
12320
|
+
})
|
|
12321
|
+
})
|
|
12322
|
+
});
|
|
12323
|
+
};
|
|
12087
12324
|
;// ./src/components/ColorPicker/index.ts
|
|
12088
12325
|
|
|
12089
12326
|
;// ./src/components/DatePicker/constants.ts
|