@instructure/ui-color-picker 8.25.1-snapshot-20
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/CHANGELOG.md +17 -0
- package/README.md +46 -0
- package/es/ColorContrast/ColorContrastLocator.js +54 -0
- package/es/ColorContrast/index.js +174 -0
- package/es/ColorContrast/props.js +40 -0
- package/es/ColorContrast/styles.js +99 -0
- package/es/ColorContrast/theme.js +55 -0
- package/es/ColorIndicator/ColorIndicatorLocator.js +40 -0
- package/es/ColorIndicator/index.js +91 -0
- package/es/ColorIndicator/props.js +31 -0
- package/es/ColorIndicator/styles.js +70 -0
- package/es/ColorIndicator/theme.js +53 -0
- package/es/ColorMixer/ColorMixerLocator.js +27 -0
- package/es/ColorMixer/ColorPalette/index.js +258 -0
- package/es/ColorMixer/ColorPalette/props.js +37 -0
- package/es/ColorMixer/ColorPalette/styles.js +81 -0
- package/es/ColorMixer/ColorPalette/theme.js +48 -0
- package/es/ColorMixer/RGBAInput/index.js +148 -0
- package/es/ColorMixer/RGBAInput/props.js +39 -0
- package/es/ColorMixer/RGBAInput/styles.js +63 -0
- package/es/ColorMixer/RGBAInput/theme.js +43 -0
- package/es/ColorMixer/Slider/index.js +218 -0
- package/es/ColorMixer/Slider/props.js +38 -0
- package/es/ColorMixer/Slider/styles.js +95 -0
- package/es/ColorMixer/Slider/theme.js +53 -0
- package/es/ColorMixer/index.js +232 -0
- package/es/ColorMixer/props.js +40 -0
- package/es/ColorMixer/styles.js +49 -0
- package/es/ColorMixer/utils/shallowCompare.js +32 -0
- package/es/ColorPicker/ColorPickerLocator.js +137 -0
- package/es/ColorPicker/index.js +487 -0
- package/es/ColorPicker/props.js +47 -0
- package/es/ColorPicker/styles.js +119 -0
- package/es/ColorPicker/theme.js +76 -0
- package/es/ColorPreset/ColorPresetLocator.js +27 -0
- package/es/ColorPreset/index.js +268 -0
- package/es/ColorPreset/props.js +36 -0
- package/es/ColorPreset/styles.js +102 -0
- package/es/ColorPreset/theme.js +53 -0
- package/es/index.js +28 -0
- package/lib/ColorContrast/ColorContrastLocator.js +66 -0
- package/lib/ColorContrast/index.js +169 -0
- package/lib/ColorContrast/props.js +51 -0
- package/lib/ColorContrast/styles.js +107 -0
- package/lib/ColorContrast/theme.js +63 -0
- package/lib/ColorIndicator/ColorIndicatorLocator.js +51 -0
- package/lib/ColorIndicator/index.js +82 -0
- package/lib/ColorIndicator/props.js +42 -0
- package/lib/ColorIndicator/styles.js +78 -0
- package/lib/ColorIndicator/theme.js +63 -0
- package/lib/ColorMixer/ColorMixerLocator.js +37 -0
- package/lib/ColorMixer/ColorPalette/index.js +252 -0
- package/lib/ColorMixer/ColorPalette/props.js +48 -0
- package/lib/ColorMixer/ColorPalette/styles.js +90 -0
- package/lib/ColorMixer/ColorPalette/theme.js +57 -0
- package/lib/ColorMixer/RGBAInput/index.js +142 -0
- package/lib/ColorMixer/RGBAInput/props.js +50 -0
- package/lib/ColorMixer/RGBAInput/styles.js +71 -0
- package/lib/ColorMixer/RGBAInput/theme.js +51 -0
- package/lib/ColorMixer/Slider/index.js +211 -0
- package/lib/ColorMixer/Slider/props.js +49 -0
- package/lib/ColorMixer/Slider/styles.js +103 -0
- package/lib/ColorMixer/Slider/theme.js +62 -0
- package/lib/ColorMixer/index.js +226 -0
- package/lib/ColorMixer/props.js +51 -0
- package/lib/ColorMixer/styles.js +57 -0
- package/lib/ColorMixer/utils/shallowCompare.js +40 -0
- package/lib/ColorPicker/ColorPickerLocator.js +151 -0
- package/lib/ColorPicker/index.js +500 -0
- package/lib/ColorPicker/props.js +58 -0
- package/lib/ColorPicker/styles.js +127 -0
- package/lib/ColorPicker/theme.js +85 -0
- package/lib/ColorPreset/ColorPresetLocator.js +37 -0
- package/lib/ColorPreset/index.js +274 -0
- package/lib/ColorPreset/props.js +47 -0
- package/lib/ColorPreset/styles.js +110 -0
- package/lib/ColorPreset/theme.js +61 -0
- package/lib/index.js +45 -0
- package/lib/package.json +1 -0
- package/package.json +62 -0
- package/src/ColorContrast/ColorContrastLocator.ts +51 -0
- package/src/ColorContrast/README.md +111 -0
- package/src/ColorContrast/index.tsx +189 -0
- package/src/ColorContrast/props.ts +140 -0
- package/src/ColorContrast/styles.ts +102 -0
- package/src/ColorContrast/theme.ts +62 -0
- package/src/ColorIndicator/ColorIndicatorLocator.ts +41 -0
- package/src/ColorIndicator/README.md +76 -0
- package/src/ColorIndicator/index.tsx +89 -0
- package/src/ColorIndicator/props.ts +68 -0
- package/src/ColorIndicator/styles.ts +88 -0
- package/src/ColorIndicator/theme.ts +58 -0
- package/src/ColorMixer/ColorMixerLocator.ts +29 -0
- package/src/ColorMixer/ColorPalette/index.tsx +250 -0
- package/src/ColorMixer/ColorPalette/props.ts +87 -0
- package/src/ColorMixer/ColorPalette/styles.ts +94 -0
- package/src/ColorMixer/ColorPalette/theme.ts +52 -0
- package/src/ColorMixer/README.md +98 -0
- package/src/ColorMixer/RGBAInput/index.tsx +172 -0
- package/src/ColorMixer/RGBAInput/props.ts +93 -0
- package/src/ColorMixer/RGBAInput/styles.ts +69 -0
- package/src/ColorMixer/RGBAInput/theme.ts +48 -0
- package/src/ColorMixer/Slider/index.tsx +242 -0
- package/src/ColorMixer/Slider/props.ts +94 -0
- package/src/ColorMixer/Slider/styles.ts +114 -0
- package/src/ColorMixer/Slider/theme.ts +59 -0
- package/src/ColorMixer/index.tsx +221 -0
- package/src/ColorMixer/props.ts +169 -0
- package/src/ColorMixer/styles.ts +51 -0
- package/src/ColorMixer/utils/shallowCompare.ts +35 -0
- package/src/ColorPicker/ColorPickerLocator.ts +124 -0
- package/src/ColorPicker/README.md +420 -0
- package/src/ColorPicker/index.tsx +609 -0
- package/src/ColorPicker/props.ts +293 -0
- package/src/ColorPicker/styles.ts +131 -0
- package/src/ColorPicker/theme.ts +80 -0
- package/src/ColorPreset/ColorPresetLocator.ts +29 -0
- package/src/ColorPreset/README.md +121 -0
- package/src/ColorPreset/index.tsx +328 -0
- package/src/ColorPreset/props.ts +162 -0
- package/src/ColorPreset/styles.ts +107 -0
- package/src/ColorPreset/theme.ts +58 -0
- package/src/index.ts +34 -0
- package/tsconfig.build.json +36 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/types/ColorContrast/ColorContrastLocator.d.ts +592 -0
- package/types/ColorContrast/ColorContrastLocator.d.ts.map +1 -0
- package/types/ColorContrast/index.d.ts +61 -0
- package/types/ColorContrast/index.d.ts.map +1 -0
- package/types/ColorContrast/props.d.ts +62 -0
- package/types/ColorContrast/props.d.ts.map +1 -0
- package/types/ColorContrast/styles.d.ts +76 -0
- package/types/ColorContrast/styles.d.ts.map +1 -0
- package/types/ColorContrast/theme.d.ts +10 -0
- package/types/ColorContrast/theme.d.ts.map +1 -0
- package/types/ColorIndicator/ColorIndicatorLocator.d.ts +577 -0
- package/types/ColorIndicator/ColorIndicatorLocator.d.ts.map +1 -0
- package/types/ColorIndicator/index.d.ts +35 -0
- package/types/ColorIndicator/index.d.ts.map +1 -0
- package/types/ColorIndicator/props.d.ts +25 -0
- package/types/ColorIndicator/props.d.ts.map +1 -0
- package/types/ColorIndicator/styles.d.ts +15 -0
- package/types/ColorIndicator/styles.d.ts.map +1 -0
- package/types/ColorIndicator/theme.d.ts +11 -0
- package/types/ColorIndicator/theme.d.ts.map +1 -0
- package/types/ColorMixer/ColorMixerLocator.d.ts +566 -0
- package/types/ColorMixer/ColorMixerLocator.d.ts.map +1 -0
- package/types/ColorMixer/ColorPalette/index.d.ts +70 -0
- package/types/ColorMixer/ColorPalette/index.d.ts.map +1 -0
- package/types/ColorMixer/ColorPalette/props.d.ts +29 -0
- package/types/ColorMixer/ColorPalette/props.d.ts.map +1 -0
- package/types/ColorMixer/ColorPalette/styles.d.ts +15 -0
- package/types/ColorMixer/ColorPalette/styles.d.ts.map +1 -0
- package/types/ColorMixer/ColorPalette/theme.d.ts +10 -0
- package/types/ColorMixer/ColorPalette/theme.d.ts.map +1 -0
- package/types/ColorMixer/RGBAInput/index.d.ts +51 -0
- package/types/ColorMixer/RGBAInput/index.d.ts.map +1 -0
- package/types/ColorMixer/RGBAInput/props.d.ts +28 -0
- package/types/ColorMixer/RGBAInput/props.d.ts.map +1 -0
- package/types/ColorMixer/RGBAInput/styles.d.ts +15 -0
- package/types/ColorMixer/RGBAInput/styles.d.ts.map +1 -0
- package/types/ColorMixer/RGBAInput/theme.d.ts +10 -0
- package/types/ColorMixer/RGBAInput/theme.d.ts.map +1 -0
- package/types/ColorMixer/Slider/index.d.ts +64 -0
- package/types/ColorMixer/Slider/index.d.ts.map +1 -0
- package/types/ColorMixer/Slider/props.d.ts +26 -0
- package/types/ColorMixer/Slider/props.d.ts.map +1 -0
- package/types/ColorMixer/Slider/styles.d.ts +15 -0
- package/types/ColorMixer/Slider/styles.d.ts.map +1 -0
- package/types/ColorMixer/Slider/theme.d.ts +10 -0
- package/types/ColorMixer/Slider/theme.d.ts.map +1 -0
- package/types/ColorMixer/index.d.ts +59 -0
- package/types/ColorMixer/index.d.ts.map +1 -0
- package/types/ColorMixer/props.d.ts +91 -0
- package/types/ColorMixer/props.d.ts.map +1 -0
- package/types/ColorMixer/styles.d.ts +14 -0
- package/types/ColorMixer/styles.d.ts.map +1 -0
- package/types/ColorMixer/utils/shallowCompare.d.ts +3 -0
- package/types/ColorMixer/utils/shallowCompare.d.ts.map +1 -0
- package/types/ColorPicker/ColorPickerLocator.d.ts +4113 -0
- package/types/ColorPicker/ColorPickerLocator.d.ts.map +1 -0
- package/types/ColorPicker/index.d.ts +158 -0
- package/types/ColorPicker/index.d.ts.map +1 -0
- package/types/ColorPicker/props.d.ts +166 -0
- package/types/ColorPicker/props.d.ts.map +1 -0
- package/types/ColorPicker/styles.d.ts +17 -0
- package/types/ColorPicker/styles.d.ts.map +1 -0
- package/types/ColorPicker/theme.d.ts +10 -0
- package/types/ColorPicker/theme.d.ts.map +1 -0
- package/types/ColorPreset/ColorPresetLocator.d.ts +566 -0
- package/types/ColorPreset/ColorPresetLocator.d.ts.map +1 -0
- package/types/ColorPreset/index.d.ts +100 -0
- package/types/ColorPreset/index.d.ts.map +1 -0
- package/types/ColorPreset/props.d.ts +87 -0
- package/types/ColorPreset/props.d.ts.map +1 -0
- package/types/ColorPreset/styles.d.ts +77 -0
- package/types/ColorPreset/styles.d.ts.map +1 -0
- package/types/ColorPreset/theme.d.ts +10 -0
- package/types/ColorPreset/theme.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPresetLocator.d.ts","sourceRoot":"","sources":["../../src/ColorPreset/ColorPresetLocator.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sIAAgC,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component, SyntheticEvent } from 'react';
|
|
3
|
+
import { jsx } from '@instructure/emotion';
|
|
4
|
+
import type { DrilldownOnSelectArgs } from '@instructure/ui-drilldown';
|
|
5
|
+
import type { ColorPresetProps, ColorPresetState } from './props';
|
|
6
|
+
/**
|
|
7
|
+
---
|
|
8
|
+
category: components
|
|
9
|
+
---
|
|
10
|
+
@tsProps
|
|
11
|
+
**/
|
|
12
|
+
declare class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
|
|
13
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
14
|
+
colors: string[];
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
elementRef?: ((element: Element | null) => void) | undefined;
|
|
17
|
+
label?: string | undefined;
|
|
18
|
+
colorMixerSettings?: {
|
|
19
|
+
addNewPresetButtonScreenReaderLabel: string;
|
|
20
|
+
maxHeight: string;
|
|
21
|
+
onPresetChange: (colors: string[]) => void;
|
|
22
|
+
colorMixer: {
|
|
23
|
+
withAlpha: boolean;
|
|
24
|
+
rgbRedInputScreenReaderLabel: string;
|
|
25
|
+
rgbGreenInputScreenReaderLabel: string;
|
|
26
|
+
rgbBlueInputScreenReaderLabel: string;
|
|
27
|
+
rgbAlphaInputScreenReaderLabel: string;
|
|
28
|
+
colorSliderNavigationExplanationScreenReaderLabel: string;
|
|
29
|
+
alphaSliderNavigationExplanationScreenReaderLabel: string;
|
|
30
|
+
colorPaletteNavigationExplanationScreenReaderLabel: string;
|
|
31
|
+
};
|
|
32
|
+
colorContrast?: {
|
|
33
|
+
firstColor: string;
|
|
34
|
+
label: string;
|
|
35
|
+
successLabel: string;
|
|
36
|
+
failureLabel: string;
|
|
37
|
+
normalTextLabel: string;
|
|
38
|
+
largeTextLabel: string;
|
|
39
|
+
graphicsTextLabel: string;
|
|
40
|
+
firstColorLabel: string;
|
|
41
|
+
secondColorLabel: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
onSelect: (selected: string) => void;
|
|
45
|
+
popoverScreenReaderLabel?: string | undefined;
|
|
46
|
+
selected: string | null;
|
|
47
|
+
}>;
|
|
48
|
+
static allowedProps: readonly (keyof {
|
|
49
|
+
colors: string[];
|
|
50
|
+
disabled?: boolean | undefined;
|
|
51
|
+
elementRef?: ((element: Element | null) => void) | undefined;
|
|
52
|
+
label?: string | undefined;
|
|
53
|
+
colorMixerSettings?: {
|
|
54
|
+
addNewPresetButtonScreenReaderLabel: string;
|
|
55
|
+
maxHeight: string;
|
|
56
|
+
onPresetChange: (colors: string[]) => void;
|
|
57
|
+
colorMixer: {
|
|
58
|
+
withAlpha: boolean;
|
|
59
|
+
rgbRedInputScreenReaderLabel: string;
|
|
60
|
+
rgbGreenInputScreenReaderLabel: string;
|
|
61
|
+
rgbBlueInputScreenReaderLabel: string;
|
|
62
|
+
rgbAlphaInputScreenReaderLabel: string;
|
|
63
|
+
colorSliderNavigationExplanationScreenReaderLabel: string;
|
|
64
|
+
alphaSliderNavigationExplanationScreenReaderLabel: string;
|
|
65
|
+
colorPaletteNavigationExplanationScreenReaderLabel: string;
|
|
66
|
+
};
|
|
67
|
+
colorContrast?: {
|
|
68
|
+
firstColor: string;
|
|
69
|
+
label: string;
|
|
70
|
+
successLabel: string;
|
|
71
|
+
failureLabel: string;
|
|
72
|
+
normalTextLabel: string;
|
|
73
|
+
largeTextLabel: string;
|
|
74
|
+
graphicsTextLabel: string;
|
|
75
|
+
firstColorLabel: string;
|
|
76
|
+
secondColorLabel: string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
onSelect: (selected: string) => void;
|
|
80
|
+
popoverScreenReaderLabel?: string | undefined;
|
|
81
|
+
selected: string | null;
|
|
82
|
+
})[];
|
|
83
|
+
static readonly componentId = "ColorPreset";
|
|
84
|
+
static defaultProps: {
|
|
85
|
+
disabled: boolean;
|
|
86
|
+
};
|
|
87
|
+
constructor(props: ColorPresetProps);
|
|
88
|
+
ref: HTMLDivElement | null;
|
|
89
|
+
handleRef: (el: HTMLDivElement | null) => void;
|
|
90
|
+
componentDidMount(): void;
|
|
91
|
+
componentDidUpdate(): void;
|
|
92
|
+
onMenuItemSelected: (color: string) => (_e: SyntheticEvent<Element, Event>, args: DrilldownOnSelectArgs) => void;
|
|
93
|
+
renderAddNewPresetButton: () => jsx.JSX.Element;
|
|
94
|
+
renderColorIndicator: (color: string, selectOnClick?: boolean) => jsx.JSX.Element;
|
|
95
|
+
renderSettingsMenu: (color: string, index: number) => jsx.JSX.Element;
|
|
96
|
+
render(): jsx.JSX.Element;
|
|
97
|
+
}
|
|
98
|
+
export { ColorPreset };
|
|
99
|
+
export default ColorPreset;
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ColorPreset/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAWrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAUtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGjE;;;;;GAKG;AACH,cAEM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACrE,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;MAElB;gBAEW,KAAK,EAAE,gBAAgB;IASnC,GAAG,EAAE,cAAc,GAAG,IAAI,CAAO;IAEjC,SAAS,OAAQ,cAAc,GAAG,IAAI,UAQrC;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,kBAAkB,UACR,MAAM,UACT,eAAe,OAAO,EAAE,KAAK,CAAC,QAAQ,qBAAqB,UAS/D;IAEH,wBAAwB,wBA0HvB;IACD,oBAAoB,UAAW,MAAM,kBAAkB,OAAO,qBAiC7D;IACD,kBAAkB,UAAW,MAAM,SAAS,MAAM,qBAkBjD;IAED,MAAM;CAqCP;AAED,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
2
|
+
import type { OtherHTMLAttributes, PropValidators, ColorPresetTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { RGBAType } from '../ColorMixer/props';
|
|
4
|
+
declare type ContrastStrength = 'min' | 'mid' | 'max';
|
|
5
|
+
declare type MessageType = Array<{
|
|
6
|
+
type: 'success' | 'hint' | 'error' | 'screenreader-only';
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare type ColorPresetOwnProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Array of HEX strings which are the preset colors. Supports 8 character HEX (with alpha)
|
|
12
|
+
*/
|
|
13
|
+
colors: Array<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Makes the component uninteractable
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Provides a reference to the component's underlying html element.
|
|
20
|
+
*/
|
|
21
|
+
elementRef?: (element: Element | null) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Label text of the component
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* If set, a `plus` button will appear for the preset. Those components whose corresponding keys aren't provided (`colorMixer` or `colorContrast`)
|
|
28
|
+
* will not be rendered.
|
|
29
|
+
* The `onPresetChange` function gets called when a color gets added or removed from the preset list.
|
|
30
|
+
* It will be called with the new list of colors
|
|
31
|
+
*/
|
|
32
|
+
colorMixerSettings?: {
|
|
33
|
+
/**
|
|
34
|
+
* screenReaderLabel for the add new preset button
|
|
35
|
+
*/
|
|
36
|
+
addNewPresetButtonScreenReaderLabel: string;
|
|
37
|
+
maxHeight: string;
|
|
38
|
+
onPresetChange: (colors: ColorPresetOwnProps['colors']) => void;
|
|
39
|
+
colorMixer: {
|
|
40
|
+
withAlpha: boolean;
|
|
41
|
+
rgbRedInputScreenReaderLabel: string;
|
|
42
|
+
rgbGreenInputScreenReaderLabel: string;
|
|
43
|
+
rgbBlueInputScreenReaderLabel: string;
|
|
44
|
+
rgbAlphaInputScreenReaderLabel: string;
|
|
45
|
+
colorSliderNavigationExplanationScreenReaderLabel: string;
|
|
46
|
+
alphaSliderNavigationExplanationScreenReaderLabel: string;
|
|
47
|
+
colorPaletteNavigationExplanationScreenReaderLabel: string;
|
|
48
|
+
};
|
|
49
|
+
colorContrast?: {
|
|
50
|
+
firstColor: string;
|
|
51
|
+
label: string;
|
|
52
|
+
successLabel: string;
|
|
53
|
+
failureLabel: string;
|
|
54
|
+
normalTextLabel: string;
|
|
55
|
+
largeTextLabel: string;
|
|
56
|
+
graphicsTextLabel: string;
|
|
57
|
+
firstColorLabel: string;
|
|
58
|
+
secondColorLabel: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The function gets called when a color gets selected
|
|
63
|
+
*/
|
|
64
|
+
onSelect: (selected: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the ScreenReaderLabel for the popover
|
|
67
|
+
*/
|
|
68
|
+
popoverScreenReaderLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The currently selected HEX string
|
|
71
|
+
*/
|
|
72
|
+
selected: string | null;
|
|
73
|
+
};
|
|
74
|
+
declare type ColorPresetState = {
|
|
75
|
+
openEditor: boolean | string;
|
|
76
|
+
openAddNew: boolean;
|
|
77
|
+
newColor: RGBAType;
|
|
78
|
+
};
|
|
79
|
+
declare type PropKeys = keyof ColorPresetOwnProps;
|
|
80
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
81
|
+
declare type ColorPresetProps = ColorPresetOwnProps & WithStyleProps<ColorPresetTheme, ColorPresetStyle> & OtherHTMLAttributes<ColorPresetOwnProps>;
|
|
82
|
+
declare type ColorPresetStyle = ComponentStyle<'colorPreset' | 'addNewPresetButton' | 'selectedIndicator' | 'popoverContent' | 'popoverDivider' | 'popoverFooter' | 'label' | 'popoverContrastBlock'>;
|
|
83
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
84
|
+
declare const allowedProps: AllowedPropKeys;
|
|
85
|
+
export type { ColorPresetProps, ColorPresetStyle, ColorPresetState, ContrastStrength, MessageType };
|
|
86
|
+
export { propTypes, allowedProps };
|
|
87
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ColorPreset/props.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ColorPresetTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { ColorPresetProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
11
|
+
* @return {Object} The final style object, which will be used in the component
|
|
12
|
+
*/
|
|
13
|
+
declare const generateStyle: (componentTheme: ColorPresetTheme, props: ColorPresetProps) => {
|
|
14
|
+
colorPreset: {
|
|
15
|
+
label: string;
|
|
16
|
+
display: string;
|
|
17
|
+
flexWrap: string;
|
|
18
|
+
width: string;
|
|
19
|
+
};
|
|
20
|
+
addNewPresetButton: {
|
|
21
|
+
label: string;
|
|
22
|
+
width: string;
|
|
23
|
+
height: string;
|
|
24
|
+
margin: string | 0;
|
|
25
|
+
};
|
|
26
|
+
selectedIndicator: {
|
|
27
|
+
label: string;
|
|
28
|
+
width: string;
|
|
29
|
+
height: string;
|
|
30
|
+
borderStyle: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
borderWidth: string | 0;
|
|
33
|
+
borderRadius: string;
|
|
34
|
+
boxSizing: string;
|
|
35
|
+
position: string;
|
|
36
|
+
insetInlineStart: string;
|
|
37
|
+
bottom: string;
|
|
38
|
+
backgroundColor: string;
|
|
39
|
+
display: string;
|
|
40
|
+
alignItems: string;
|
|
41
|
+
justifyContent: string;
|
|
42
|
+
};
|
|
43
|
+
popoverContent: {
|
|
44
|
+
label: string;
|
|
45
|
+
padding: string | 0;
|
|
46
|
+
maxHeight: string;
|
|
47
|
+
overflow: string;
|
|
48
|
+
};
|
|
49
|
+
popoverDivider: {
|
|
50
|
+
label: string;
|
|
51
|
+
borderTop: string;
|
|
52
|
+
borderWidth: string | 0;
|
|
53
|
+
borderColor: string;
|
|
54
|
+
margin: string;
|
|
55
|
+
};
|
|
56
|
+
popoverContrastBlock: {
|
|
57
|
+
label: string;
|
|
58
|
+
borderTop: string;
|
|
59
|
+
borderWidth: string | 0;
|
|
60
|
+
borderColor: string;
|
|
61
|
+
margin: string;
|
|
62
|
+
};
|
|
63
|
+
popoverFooter: {
|
|
64
|
+
label: string;
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
display: string;
|
|
67
|
+
flexDirection: string;
|
|
68
|
+
padding: string | 0;
|
|
69
|
+
};
|
|
70
|
+
label: {
|
|
71
|
+
label: string;
|
|
72
|
+
width: string;
|
|
73
|
+
margin: string | 0;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export default generateStyle;
|
|
77
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ColorPreset/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,gBAAgB,SACzB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkExB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
|
+
import { ColorPresetTheme } from '@instructure/shared-types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
5
|
+
* @param {Object} theme The actual theme object.
|
|
6
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
7
|
+
*/
|
|
8
|
+
declare const generateComponentTheme: (theme: Theme) => ColorPresetTheme;
|
|
9
|
+
export default generateComponentTheme;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ColorPreset/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,gBAuB9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ColorPicker } from './ColorPicker';
|
|
2
|
+
export { ColorMixer } from './ColorMixer';
|
|
3
|
+
export { ColorPreset } from './ColorPreset';
|
|
4
|
+
export { ColorContrast } from './ColorContrast';
|
|
5
|
+
export { ColorIndicator } from './ColorIndicator';
|
|
6
|
+
export type { ColorPickerProps } from './ColorPicker/props';
|
|
7
|
+
export type { ColorMixerProps } from './ColorMixer/props';
|
|
8
|
+
export type { ColorPresetProps } from './ColorPreset/props';
|
|
9
|
+
export type { ColorContrastProps } from './ColorContrast/props';
|
|
10
|
+
export type { ColorIndicatorProps } from './ColorIndicator/props';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA"}
|