@cdx-ui/primitives 0.1.7 → 0.2.1
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/lib/commonjs/calendar/CalendarRoot.js +3 -1
- package/lib/commonjs/calendar/CalendarRoot.js.map +1 -1
- package/lib/commonjs/calendar/context.js.map +1 -1
- package/lib/commonjs/color/Color.js +69 -0
- package/lib/commonjs/color/Color.js.map +1 -0
- package/lib/commonjs/color/index.js +13 -0
- package/lib/commonjs/color/index.js.map +1 -0
- package/lib/commonjs/color/types.js +2 -0
- package/lib/commonjs/color/types.js.map +1 -0
- package/lib/commonjs/color-area/ColorAreaAccessibility.js +100 -0
- package/lib/commonjs/color-area/ColorAreaAccessibility.js.map +1 -0
- package/lib/commonjs/color-area/ColorAreaAccessibility.web.js +58 -0
- package/lib/commonjs/color-area/ColorAreaAccessibility.web.js.map +1 -0
- package/lib/commonjs/color-area/ColorAreaRoot.js +240 -0
- package/lib/commonjs/color-area/ColorAreaRoot.js.map +1 -0
- package/lib/commonjs/color-area/ColorAreaThumb.js +71 -0
- package/lib/commonjs/color-area/ColorAreaThumb.js.map +1 -0
- package/lib/commonjs/color-area/context.js +11 -0
- package/lib/commonjs/color-area/context.js.map +1 -0
- package/lib/commonjs/color-area/index.js +27 -0
- package/lib/commonjs/color-area/index.js.map +1 -0
- package/lib/commonjs/color-area/types.js +6 -0
- package/lib/commonjs/color-area/types.js.map +1 -0
- package/lib/commonjs/color-area/utils.js +51 -0
- package/lib/commonjs/color-area/utils.js.map +1 -0
- package/lib/commonjs/color-field/ColorFieldInput.js +67 -0
- package/lib/commonjs/color-field/ColorFieldInput.js.map +1 -0
- package/lib/commonjs/color-field/ColorFieldRoot.js +104 -0
- package/lib/commonjs/color-field/ColorFieldRoot.js.map +1 -0
- package/lib/commonjs/color-field/context.js +11 -0
- package/lib/commonjs/color-field/context.js.map +1 -0
- package/lib/commonjs/color-field/index.js +27 -0
- package/lib/commonjs/color-field/index.js.map +1 -0
- package/lib/commonjs/color-field/types.js +6 -0
- package/lib/commonjs/color-field/types.js.map +1 -0
- package/lib/commonjs/color-field/utils.js +60 -0
- package/lib/commonjs/color-field/utils.js.map +1 -0
- package/lib/commonjs/color-picker/ColorPickerRoot.js +69 -0
- package/lib/commonjs/color-picker/ColorPickerRoot.js.map +1 -0
- package/lib/commonjs/color-picker/ColorPickerTrigger.js +98 -0
- package/lib/commonjs/color-picker/ColorPickerTrigger.js.map +1 -0
- package/lib/commonjs/color-picker/context.js +32 -0
- package/lib/commonjs/color-picker/context.js.map +1 -0
- package/lib/commonjs/color-picker/index.js +51 -0
- package/lib/commonjs/color-picker/index.js.map +1 -0
- package/lib/commonjs/color-picker/types.js +6 -0
- package/lib/commonjs/color-picker/types.js.map +1 -0
- package/lib/commonjs/color-slider/ColorSliderRail.js +119 -0
- package/lib/commonjs/color-slider/ColorSliderRail.js.map +1 -0
- package/lib/commonjs/color-slider/ColorSliderRoot.js +153 -0
- package/lib/commonjs/color-slider/ColorSliderRoot.js.map +1 -0
- package/lib/commonjs/color-slider/ColorSliderThumb.js +265 -0
- package/lib/commonjs/color-slider/ColorSliderThumb.js.map +1 -0
- package/lib/commonjs/color-slider/context.js +11 -0
- package/lib/commonjs/color-slider/context.js.map +1 -0
- package/lib/commonjs/color-slider/index.js +34 -0
- package/lib/commonjs/color-slider/index.js.map +1 -0
- package/lib/commonjs/color-slider/types.js +6 -0
- package/lib/commonjs/color-slider/types.js.map +1 -0
- package/lib/commonjs/color-slider/utils.js +75 -0
- package/lib/commonjs/color-slider/utils.js.map +1 -0
- package/lib/commonjs/color-swatch-picker/ColorSwatchPickerItem.js +46 -0
- package/lib/commonjs/color-swatch-picker/ColorSwatchPickerItem.js.map +1 -0
- package/lib/commonjs/color-swatch-picker/ColorSwatchPickerRoot.js +71 -0
- package/lib/commonjs/color-swatch-picker/ColorSwatchPickerRoot.js.map +1 -0
- package/lib/commonjs/color-swatch-picker/context.js +22 -0
- package/lib/commonjs/color-swatch-picker/context.js.map +1 -0
- package/lib/commonjs/color-swatch-picker/index.js +33 -0
- package/lib/commonjs/color-swatch-picker/index.js.map +1 -0
- package/lib/commonjs/color-swatch-picker/types.js +6 -0
- package/lib/commonjs/color-swatch-picker/types.js.map +1 -0
- package/lib/commonjs/date-field/DateFieldRoot.js +5 -1
- package/lib/commonjs/date-field/DateFieldRoot.js.map +1 -1
- package/lib/commonjs/date-field/DateFieldSegment.js +7 -1
- package/lib/commonjs/date-field/DateFieldSegment.js.map +1 -1
- package/lib/commonjs/date-field/context.js.map +1 -1
- package/lib/commonjs/date-picker/DatePickerRoot.js +59 -13
- package/lib/commonjs/date-picker/DatePickerRoot.js.map +1 -1
- package/lib/commonjs/date-picker/context.js.map +1 -1
- package/lib/commonjs/index.js +80 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/react-native-web.d.js +2 -0
- package/lib/commonjs/react-native-web.d.js.map +1 -0
- package/lib/commonjs/slider/useSliderPointer.js +2 -0
- package/lib/commonjs/slider/useSliderPointer.js.map +1 -1
- package/lib/commonjs/utils/createPortal.web.js +10 -1
- package/lib/commonjs/utils/createPortal.web.js.map +1 -1
- package/lib/commonjs/utils/textAncestor.js +25 -0
- package/lib/commonjs/utils/textAncestor.js.map +1 -0
- package/lib/commonjs/utils/textAncestor.web.js +27 -0
- package/lib/commonjs/utils/textAncestor.web.js.map +1 -0
- package/lib/module/calendar/CalendarRoot.js +3 -1
- package/lib/module/calendar/CalendarRoot.js.map +1 -1
- package/lib/module/calendar/context.js.map +1 -1
- package/lib/module/color/Color.js +65 -0
- package/lib/module/color/Color.js.map +1 -0
- package/lib/module/color/index.js +4 -0
- package/lib/module/color/index.js.map +1 -0
- package/lib/module/color/types.js +2 -0
- package/lib/module/color/types.js.map +1 -0
- package/lib/module/color-area/ColorAreaAccessibility.js +96 -0
- package/lib/module/color-area/ColorAreaAccessibility.js.map +1 -0
- package/lib/module/color-area/ColorAreaAccessibility.web.js +54 -0
- package/lib/module/color-area/ColorAreaAccessibility.web.js.map +1 -0
- package/lib/module/color-area/ColorAreaRoot.js +236 -0
- package/lib/module/color-area/ColorAreaRoot.js.map +1 -0
- package/lib/module/color-area/ColorAreaThumb.js +67 -0
- package/lib/module/color-area/ColorAreaThumb.js.map +1 -0
- package/lib/module/color-area/context.js +5 -0
- package/lib/module/color-area/context.js.map +1 -0
- package/lib/module/color-area/index.js +6 -0
- package/lib/module/color-area/index.js.map +1 -0
- package/lib/module/color-area/types.js +4 -0
- package/lib/module/color-area/types.js.map +1 -0
- package/lib/module/color-area/utils.js +45 -0
- package/lib/module/color-area/utils.js.map +1 -0
- package/lib/module/color-field/ColorFieldInput.js +63 -0
- package/lib/module/color-field/ColorFieldInput.js.map +1 -0
- package/lib/module/color-field/ColorFieldRoot.js +100 -0
- package/lib/module/color-field/ColorFieldRoot.js.map +1 -0
- package/lib/module/color-field/context.js +5 -0
- package/lib/module/color-field/context.js.map +1 -0
- package/lib/module/color-field/index.js +6 -0
- package/lib/module/color-field/index.js.map +1 -0
- package/lib/module/color-field/types.js +4 -0
- package/lib/module/color-field/types.js.map +1 -0
- package/lib/module/color-field/utils.js +55 -0
- package/lib/module/color-field/utils.js.map +1 -0
- package/lib/module/color-picker/ColorPickerRoot.js +65 -0
- package/lib/module/color-picker/ColorPickerRoot.js.map +1 -0
- package/lib/module/color-picker/ColorPickerTrigger.js +94 -0
- package/lib/module/color-picker/ColorPickerTrigger.js.map +1 -0
- package/lib/module/color-picker/context.js +25 -0
- package/lib/module/color-picker/context.js.map +1 -0
- package/lib/module/color-picker/index.js +6 -0
- package/lib/module/color-picker/index.js.map +1 -0
- package/lib/module/color-picker/types.js +4 -0
- package/lib/module/color-picker/types.js.map +1 -0
- package/lib/module/color-slider/ColorSliderRail.js +115 -0
- package/lib/module/color-slider/ColorSliderRail.js.map +1 -0
- package/lib/module/color-slider/ColorSliderRoot.js +149 -0
- package/lib/module/color-slider/ColorSliderRoot.js.map +1 -0
- package/lib/module/color-slider/ColorSliderThumb.js +261 -0
- package/lib/module/color-slider/ColorSliderThumb.js.map +1 -0
- package/lib/module/color-slider/context.js +5 -0
- package/lib/module/color-slider/context.js.map +1 -0
- package/lib/module/color-slider/index.js +7 -0
- package/lib/module/color-slider/index.js.map +1 -0
- package/lib/module/color-slider/types.js +4 -0
- package/lib/module/color-slider/types.js.map +1 -0
- package/lib/module/color-slider/utils.js +66 -0
- package/lib/module/color-slider/utils.js.map +1 -0
- package/lib/module/color-swatch-picker/ColorSwatchPickerItem.js +42 -0
- package/lib/module/color-swatch-picker/ColorSwatchPickerItem.js.map +1 -0
- package/lib/module/color-swatch-picker/ColorSwatchPickerRoot.js +67 -0
- package/lib/module/color-swatch-picker/ColorSwatchPickerRoot.js.map +1 -0
- package/lib/module/color-swatch-picker/context.js +15 -0
- package/lib/module/color-swatch-picker/context.js.map +1 -0
- package/lib/module/color-swatch-picker/index.js +6 -0
- package/lib/module/color-swatch-picker/index.js.map +1 -0
- package/lib/module/color-swatch-picker/types.js +4 -0
- package/lib/module/color-swatch-picker/types.js.map +1 -0
- package/lib/module/date-field/DateFieldRoot.js +6 -2
- package/lib/module/date-field/DateFieldRoot.js.map +1 -1
- package/lib/module/date-field/DateFieldSegment.js +7 -1
- package/lib/module/date-field/DateFieldSegment.js.map +1 -1
- package/lib/module/date-field/context.js.map +1 -1
- package/lib/module/date-picker/DatePickerRoot.js +62 -16
- package/lib/module/date-picker/DatePickerRoot.js.map +1 -1
- package/lib/module/date-picker/context.js.map +1 -1
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/react-native-web.d.js +2 -0
- package/lib/module/react-native-web.d.js.map +1 -0
- package/lib/module/slider/useSliderPointer.js +2 -0
- package/lib/module/slider/useSliderPointer.js.map +1 -1
- package/lib/module/utils/createPortal.web.js +9 -1
- package/lib/module/utils/createPortal.web.js.map +1 -1
- package/lib/module/utils/textAncestor.js +20 -0
- package/lib/module/utils/textAncestor.js.map +1 -0
- package/lib/module/utils/textAncestor.web.js +22 -0
- package/lib/module/utils/textAncestor.web.js.map +1 -0
- package/lib/typescript/calendar/CalendarRoot.d.ts.map +1 -1
- package/lib/typescript/calendar/context.d.ts +1 -0
- package/lib/typescript/calendar/context.d.ts.map +1 -1
- package/lib/typescript/calendar/types.d.ts +7 -0
- package/lib/typescript/calendar/types.d.ts.map +1 -1
- package/lib/typescript/color/Color.d.ts +3 -0
- package/lib/typescript/color/Color.d.ts.map +1 -0
- package/lib/typescript/color/index.d.ts +3 -0
- package/lib/typescript/color/index.d.ts.map +1 -0
- package/lib/typescript/color/types.d.ts +13 -0
- package/lib/typescript/color/types.d.ts.map +1 -0
- package/lib/typescript/color-area/ColorAreaAccessibility.d.ts +8 -0
- package/lib/typescript/color-area/ColorAreaAccessibility.d.ts.map +1 -0
- package/lib/typescript/color-area/ColorAreaAccessibility.web.d.ts +8 -0
- package/lib/typescript/color-area/ColorAreaAccessibility.web.d.ts.map +1 -0
- package/lib/typescript/color-area/ColorAreaRoot.d.ts +7 -0
- package/lib/typescript/color-area/ColorAreaRoot.d.ts.map +1 -0
- package/lib/typescript/color-area/ColorAreaThumb.d.ts +6 -0
- package/lib/typescript/color-area/ColorAreaThumb.d.ts.map +1 -0
- package/lib/typescript/color-area/context.d.ts +6 -0
- package/lib/typescript/color-area/context.d.ts.map +1 -0
- package/lib/typescript/color-area/index.d.ts +5 -0
- package/lib/typescript/color-area/index.d.ts.map +1 -0
- package/lib/typescript/color-area/types.d.ts +65 -0
- package/lib/typescript/color-area/types.d.ts.map +1 -0
- package/lib/typescript/color-area/utils.d.ts +5 -0
- package/lib/typescript/color-area/utils.d.ts.map +1 -0
- package/lib/typescript/color-field/ColorFieldInput.d.ts +5 -0
- package/lib/typescript/color-field/ColorFieldInput.d.ts.map +1 -0
- package/lib/typescript/color-field/ColorFieldRoot.d.ts +7 -0
- package/lib/typescript/color-field/ColorFieldRoot.d.ts.map +1 -0
- package/lib/typescript/color-field/context.d.ts +6 -0
- package/lib/typescript/color-field/context.d.ts.map +1 -0
- package/lib/typescript/color-field/index.d.ts +7 -0
- package/lib/typescript/color-field/index.d.ts.map +1 -0
- package/lib/typescript/color-field/types.d.ts +39 -0
- package/lib/typescript/color-field/types.d.ts.map +1 -0
- package/lib/typescript/color-field/utils.d.ts +5 -0
- package/lib/typescript/color-field/utils.d.ts.map +1 -0
- package/lib/typescript/color-picker/ColorPickerRoot.d.ts +7 -0
- package/lib/typescript/color-picker/ColorPickerRoot.d.ts.map +1 -0
- package/lib/typescript/color-picker/ColorPickerTrigger.d.ts +4 -0
- package/lib/typescript/color-picker/ColorPickerTrigger.d.ts.map +1 -0
- package/lib/typescript/color-picker/context.d.ts +19 -0
- package/lib/typescript/color-picker/context.d.ts.map +1 -0
- package/lib/typescript/color-picker/index.d.ts +5 -0
- package/lib/typescript/color-picker/index.d.ts.map +1 -0
- package/lib/typescript/color-picker/types.d.ts +24 -0
- package/lib/typescript/color-picker/types.d.ts.map +1 -0
- package/lib/typescript/color-slider/ColorSliderRail.d.ts +6 -0
- package/lib/typescript/color-slider/ColorSliderRail.d.ts.map +1 -0
- package/lib/typescript/color-slider/ColorSliderRoot.d.ts +7 -0
- package/lib/typescript/color-slider/ColorSliderRoot.d.ts.map +1 -0
- package/lib/typescript/color-slider/ColorSliderThumb.d.ts +6 -0
- package/lib/typescript/color-slider/ColorSliderThumb.d.ts.map +1 -0
- package/lib/typescript/color-slider/context.d.ts +6 -0
- package/lib/typescript/color-slider/context.d.ts.map +1 -0
- package/lib/typescript/color-slider/index.d.ts +6 -0
- package/lib/typescript/color-slider/index.d.ts.map +1 -0
- package/lib/typescript/color-slider/types.d.ts +82 -0
- package/lib/typescript/color-slider/types.d.ts.map +1 -0
- package/lib/typescript/color-slider/utils.d.ts +12 -0
- package/lib/typescript/color-slider/utils.d.ts.map +1 -0
- package/lib/typescript/color-swatch-picker/ColorSwatchPickerItem.d.ts +6 -0
- package/lib/typescript/color-swatch-picker/ColorSwatchPickerItem.d.ts.map +1 -0
- package/lib/typescript/color-swatch-picker/ColorSwatchPickerRoot.d.ts +7 -0
- package/lib/typescript/color-swatch-picker/ColorSwatchPickerRoot.d.ts.map +1 -0
- package/lib/typescript/color-swatch-picker/context.d.ts +8 -0
- package/lib/typescript/color-swatch-picker/context.d.ts.map +1 -0
- package/lib/typescript/color-swatch-picker/index.d.ts +5 -0
- package/lib/typescript/color-swatch-picker/index.d.ts.map +1 -0
- package/lib/typescript/color-swatch-picker/types.d.ts +26 -0
- package/lib/typescript/color-swatch-picker/types.d.ts.map +1 -0
- package/lib/typescript/date-field/DateFieldRoot.d.ts.map +1 -1
- package/lib/typescript/date-field/DateFieldSegment.d.ts.map +1 -1
- package/lib/typescript/date-field/context.d.ts +2 -0
- package/lib/typescript/date-field/context.d.ts.map +1 -1
- package/lib/typescript/date-picker/DatePickerRoot.d.ts +29 -3
- package/lib/typescript/date-picker/DatePickerRoot.d.ts.map +1 -1
- package/lib/typescript/date-picker/context.d.ts +1 -0
- package/lib/typescript/date-picker/context.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +7 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/slider/useSliderPointer.d.ts.map +1 -1
- package/lib/typescript/utils/createPortal.web.d.ts +6 -2
- package/lib/typescript/utils/createPortal.web.d.ts.map +1 -1
- package/lib/typescript/utils/textAncestor.d.ts +13 -0
- package/lib/typescript/utils/textAncestor.d.ts.map +1 -0
- package/lib/typescript/utils/textAncestor.web.d.ts +15 -0
- package/lib/typescript/utils/textAncestor.web.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/calendar/CalendarRoot.tsx +3 -0
- package/src/calendar/context.tsx +1 -0
- package/src/calendar/types.ts +7 -0
- package/src/color/Color.ts +95 -0
- package/src/color/index.ts +2 -0
- package/src/color/types.ts +19 -0
- package/src/color-area/ColorAreaAccessibility.tsx +94 -0
- package/src/color-area/ColorAreaAccessibility.web.tsx +52 -0
- package/src/color-area/ColorAreaRoot.tsx +326 -0
- package/src/color-area/ColorAreaThumb.tsx +56 -0
- package/src/color-area/context.tsx +5 -0
- package/src/color-area/index.ts +10 -0
- package/src/color-area/types.ts +69 -0
- package/src/color-area/utils.ts +51 -0
- package/src/color-field/ColorFieldInput.tsx +66 -0
- package/src/color-field/ColorFieldRoot.tsx +132 -0
- package/src/color-field/context.tsx +5 -0
- package/src/color-field/index.ts +11 -0
- package/src/color-field/types.ts +46 -0
- package/src/color-field/utils.ts +75 -0
- package/src/color-picker/ColorPickerRoot.tsx +91 -0
- package/src/color-picker/ColorPickerTrigger.tsx +96 -0
- package/src/color-picker/context.tsx +47 -0
- package/src/color-picker/index.ts +12 -0
- package/src/color-picker/types.ts +25 -0
- package/src/color-slider/ColorSliderRail.tsx +130 -0
- package/src/color-slider/ColorSliderRoot.tsx +222 -0
- package/src/color-slider/ColorSliderThumb.tsx +294 -0
- package/src/color-slider/context.tsx +5 -0
- package/src/color-slider/index.ts +16 -0
- package/src/color-slider/types.ts +94 -0
- package/src/color-slider/utils.ts +79 -0
- package/src/color-swatch-picker/ColorSwatchPickerItem.tsx +54 -0
- package/src/color-swatch-picker/ColorSwatchPickerRoot.tsx +94 -0
- package/src/color-swatch-picker/context.tsx +22 -0
- package/src/color-swatch-picker/index.ts +4 -0
- package/src/color-swatch-picker/types.ts +29 -0
- package/src/date-field/DateFieldRoot.tsx +4 -1
- package/src/date-field/DateFieldSegment.tsx +19 -3
- package/src/date-field/context.tsx +2 -0
- package/src/date-picker/DatePickerRoot.tsx +127 -18
- package/src/date-picker/context.tsx +1 -0
- package/src/index.ts +7 -0
- package/src/react-native-web.d.ts +6 -0
- package/src/slider/useSliderPointer.ts +3 -0
- package/src/utils/createPortal.web.ts +9 -3
- package/src/utils/textAncestor.ts +19 -0
- package/src/utils/textAncestor.web.ts +19 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
import type { Color } from '../color';
|
|
4
|
+
export type ColorSliderOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
export type ColorSliderConfiguration = {
|
|
6
|
+
readonly colorSpace: 'rgb';
|
|
7
|
+
readonly channel: 'red' | 'green' | 'blue';
|
|
8
|
+
} | {
|
|
9
|
+
readonly colorSpace: 'hsl';
|
|
10
|
+
readonly channel: 'hue' | 'saturation' | 'lightness';
|
|
11
|
+
} | {
|
|
12
|
+
readonly colorSpace: 'hsb';
|
|
13
|
+
readonly channel: 'hue' | 'saturation' | 'brightness';
|
|
14
|
+
};
|
|
15
|
+
export interface ColorSliderCommonProps extends Omit<ViewProps, 'children'> {
|
|
16
|
+
/** Current controlled color. */
|
|
17
|
+
readonly value?: Color;
|
|
18
|
+
/** Initial color for uncontrolled usage. */
|
|
19
|
+
readonly defaultValue?: Color;
|
|
20
|
+
/** Called while the selected channel changes. */
|
|
21
|
+
readonly onValueChange?: (value: Color) => void;
|
|
22
|
+
/** Called when a pointer, keyboard, or screen reader interaction completes. */
|
|
23
|
+
readonly onValueChangeComplete?: (value: Color) => void;
|
|
24
|
+
/** Slider axis. @default `'horizontal'` */
|
|
25
|
+
readonly orientation?: ColorSliderOrientation;
|
|
26
|
+
/** Channel increment. Defaults to the channel's natural increment. */
|
|
27
|
+
readonly step?: number;
|
|
28
|
+
/** Shift-arrow and page-key increment. @default `10` */
|
|
29
|
+
readonly pageStep?: number;
|
|
30
|
+
/** Disables pointer, keyboard, and screen reader interaction. @default `false` */
|
|
31
|
+
readonly isDisabled?: boolean;
|
|
32
|
+
readonly children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export type IColorSliderProps = ColorSliderCommonProps & ColorSliderConfiguration;
|
|
35
|
+
export interface IColorSliderRailProps extends ViewProps {
|
|
36
|
+
readonly asChild?: boolean;
|
|
37
|
+
readonly children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export interface IColorSliderThumbProps extends PressableProps {
|
|
40
|
+
readonly asChild?: boolean;
|
|
41
|
+
readonly children?: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
export interface ColorSliderSize {
|
|
44
|
+
readonly width: number;
|
|
45
|
+
readonly height: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ColorSliderLayout extends ColorSliderSize {
|
|
48
|
+
readonly x: number;
|
|
49
|
+
readonly y: number;
|
|
50
|
+
}
|
|
51
|
+
export type ColorSliderContextValue = ColorSliderConfiguration & {
|
|
52
|
+
readonly value: Color;
|
|
53
|
+
readonly channelValue: number;
|
|
54
|
+
readonly valueLabel: string;
|
|
55
|
+
readonly min: number;
|
|
56
|
+
readonly max: number;
|
|
57
|
+
readonly step: number;
|
|
58
|
+
readonly pageStep: number;
|
|
59
|
+
readonly percent: number;
|
|
60
|
+
readonly orientation: ColorSliderOrientation;
|
|
61
|
+
readonly isDisabled: boolean;
|
|
62
|
+
readonly isDragging: boolean;
|
|
63
|
+
readonly accessibilityLabel?: string;
|
|
64
|
+
readonly layout: ColorSliderLayout | null;
|
|
65
|
+
readonly thumbSize: ColorSliderSize;
|
|
66
|
+
readonly gradientColors: readonly string[];
|
|
67
|
+
readonly setLayout: (layout: ColorSliderLayout) => void;
|
|
68
|
+
readonly setThumbSize: (size: ColorSliderSize) => void;
|
|
69
|
+
readonly setIsDragging: (dragging: boolean) => void;
|
|
70
|
+
readonly setChannelValue: (value: number, complete?: boolean) => void;
|
|
71
|
+
readonly setValueFromRatio: (ratio: number, complete?: boolean) => void;
|
|
72
|
+
};
|
|
73
|
+
export interface ColorSliderKeyboardEvent {
|
|
74
|
+
readonly nativeEvent?: {
|
|
75
|
+
readonly key?: string;
|
|
76
|
+
readonly shiftKey?: boolean;
|
|
77
|
+
};
|
|
78
|
+
readonly key?: string;
|
|
79
|
+
readonly shiftKey?: boolean;
|
|
80
|
+
preventDefault?: () => void;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/color-slider/types.ts"],"names":[],"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,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACzE,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Color } from '../color';
|
|
2
|
+
import type { ColorSliderConfiguration } from './types';
|
|
3
|
+
export declare function clampColorSliderValue(value: number, min: number, max: number): number;
|
|
4
|
+
export declare function getColorSliderRange({ colorSpace, channel }: ColorSliderConfiguration): {
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function getColorSliderChannelValue(color: Color, configuration: ColorSliderConfiguration): number;
|
|
9
|
+
export declare function withColorSliderChannel(color: Color, configuration: ColorSliderConfiguration, value: number): Color;
|
|
10
|
+
export declare function formatColorSliderValue(value: number, configuration: ColorSliderConfiguration): string;
|
|
11
|
+
export declare function getColorSliderGradientColors(color: Color, configuration: ColorSliderConfiguration): readonly string[];
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/color-slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAIxD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,wBAAwB,GAAG;IACtF,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAQA;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,wBAAwB,GACtC,MAAM,CAQR;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,wBAAwB,EACvC,KAAK,EAAE,MAAM,GACZ,KAAK,CAQP;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,wBAAwB,GACtC,MAAM,CASR;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,wBAAwB,GACtC,SAAS,MAAM,EAAE,CAYnB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IColorSwatchPickerItemProps } from './types';
|
|
2
|
+
export interface ColorSwatchPickerItemProps extends IColorSwatchPickerItemProps {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const ColorSwatchPickerItem: import("react").ForwardRefExoticComponent<ColorSwatchPickerItemProps & import("react").RefAttributes<import("react-native").View>>;
|
|
6
|
+
//# sourceMappingURL=ColorSwatchPickerItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorSwatchPickerItem.d.ts","sourceRoot":"","sources":["../../../src/color-swatch-picker/ColorSwatchPickerItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,oIAyCjC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { IColorSwatchPickerProps } from './types';
|
|
3
|
+
export interface ColorSwatchPickerRootProps extends IColorSwatchPickerProps {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ColorSwatchPickerRoot: import("react").ForwardRefExoticComponent<ColorSwatchPickerRootProps & import("react").RefAttributes<View>>;
|
|
7
|
+
//# sourceMappingURL=ColorSwatchPickerRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorSwatchPickerRoot.d.ts","sourceRoot":"","sources":["../../../src/color-swatch-picker/ColorSwatchPickerRoot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAMpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,6GA8EjC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ColorSwatchPickerContextValue, ColorSwatchPickerItemContextValue } from './types';
|
|
2
|
+
export declare const ColorSwatchPickerProvider: import("react").FunctionComponent<{
|
|
3
|
+
children: import("react").ReactNode;
|
|
4
|
+
value: ColorSwatchPickerContextValue;
|
|
5
|
+
}>, useColorSwatchPickerContext: () => ColorSwatchPickerContextValue;
|
|
6
|
+
export declare const ColorSwatchPickerItemProvider: import("react").Provider<ColorSwatchPickerItemContextValue | null>;
|
|
7
|
+
export declare function useColorSwatchPickerItemContext(): ColorSwatchPickerItemContextValue;
|
|
8
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/color-swatch-picker/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEhG,eAAO,MAAO,yBAAyB;;;IAAE,2BAA2B,qCACM,CAAC;AAM3E,eAAO,MAAM,6BAA6B,oEAAwC,CAAC;AAEnF,wBAAgB,+BAA+B,IAAI,iCAAiC,CAQnF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ColorSwatchPickerRoot, type ColorSwatchPickerRootProps } from './ColorSwatchPickerRoot';
|
|
2
|
+
export { ColorSwatchPickerItem, type ColorSwatchPickerItemProps } from './ColorSwatchPickerItem';
|
|
3
|
+
export { useColorSwatchPickerContext, useColorSwatchPickerItemContext } from './context';
|
|
4
|
+
export type { IColorSwatchPickerItemProps, IColorSwatchPickerProps } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/color-swatch-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAC;AACzF,YAAY,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
import type { Color } from '../color';
|
|
4
|
+
export interface IColorSwatchPickerProps extends Omit<ViewProps, 'children'> {
|
|
5
|
+
value?: Color;
|
|
6
|
+
defaultValue?: Color;
|
|
7
|
+
onValueChange?: (value: Color) => void;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface IColorSwatchPickerItemProps extends Omit<PressableProps, 'children'> {
|
|
12
|
+
color: Color;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
isHovered?: boolean;
|
|
15
|
+
isActive?: boolean;
|
|
16
|
+
isFocused?: boolean;
|
|
17
|
+
isFocusVisible?: boolean;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface ColorSwatchPickerContextValue {
|
|
21
|
+
registerColor: (color: Color) => () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface ColorSwatchPickerItemContextValue {
|
|
24
|
+
color: Color;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/color-swatch-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,c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CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"DateFieldRoot.d.ts","sourceRoot":"","sources":["../../../src/date-field/DateFieldRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,kBAAmB,SAAQ,eAAe,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,qGAqGzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFieldSegment.d.ts","sourceRoot":"","sources":["../../../src/date-field/DateFieldSegment.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EAEJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"DateFieldSegment.d.ts","sourceRoot":"","sources":["../../../src/date-field/DateFieldSegment.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EAEJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,wGAyF5B,CAAC"}
|
|
@@ -12,6 +12,8 @@ export interface DateFieldContextValue {
|
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
readOnly: boolean;
|
|
14
14
|
invalid: boolean;
|
|
15
|
+
/** Message the enclosing `Field` shows for the invalid state, if any. */
|
|
16
|
+
errorMessage?: string;
|
|
15
17
|
focusedSegmentIndex: number | null;
|
|
16
18
|
focusSegment: (index: number) => void;
|
|
17
19
|
blurSegment: (index: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/date-field/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,WAAW,EACX,OAAO,EACR,MAAM,oBAAoB,CAAC;AAE5B,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,cAAc,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACx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qB,CAM3D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
|
-
import type
|
|
3
|
+
import { type DateComponentLabels, type DateId, type DateValidationReason } from '@cdx-ui/formatters';
|
|
4
4
|
export interface DatePickerRootProps extends Omit<ViewProps, 'children'> {
|
|
5
5
|
asChild?: boolean;
|
|
6
6
|
children?: ReactNode;
|
|
@@ -14,12 +14,38 @@ export interface DatePickerRootProps extends Omit<ViewProps, 'children'> {
|
|
|
14
14
|
onOpenChange?: (open: boolean) => void;
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
isReadOnly?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Forces the invalid state. OR-ed with the picker's own validation: setting `true` marks the
|
|
19
|
+
* field invalid, but `false` never hides a `minValue` / `maxValue` / `isDateUnavailable` violation.
|
|
20
|
+
*/
|
|
17
21
|
isInvalid?: boolean;
|
|
18
22
|
isRequired?: boolean;
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Earliest selectable date, applied to the embedded calendar and to typed entry. Build with
|
|
25
|
+
* `dateId(...)`.
|
|
26
|
+
*/
|
|
20
27
|
minValue?: DateId;
|
|
21
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Latest selectable date, applied to the embedded calendar and to typed entry. Build with
|
|
30
|
+
* `dateId(...)`.
|
|
31
|
+
*/
|
|
22
32
|
maxValue?: DateId;
|
|
33
|
+
/**
|
|
34
|
+
* Returns `true` for dates that cannot be selected, such as weekends or holidays. The calendar
|
|
35
|
+
* renders them disabled; a typed unavailable date is kept and emitted but renders invalid. Pass
|
|
36
|
+
* a stable (memoized) function.
|
|
37
|
+
*/
|
|
38
|
+
isDateUnavailable?: (date: DateId) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Called when the committed value starts or stops violating `minValue`, `maxValue`, or
|
|
41
|
+
* `isDateUnavailable`, and again when the formatted message changes while the reason stays
|
|
42
|
+
* the same — a new bound, `locale`, or `labels` while the value is still `beforeMin`, for
|
|
43
|
+
* example. Receives the reason and its `labels` message formatted in `locale`, or `undefined`
|
|
44
|
+
* for both once the value is valid or cleared. Fires before paint, so state set here renders
|
|
45
|
+
* in the same frame as the invalid styling. Not needed to show the message: an empty
|
|
46
|
+
* `Field.Error` anywhere in the enclosing `Field` already renders it.
|
|
47
|
+
*/
|
|
48
|
+
onValidationChange?: (reason: DateValidationReason | undefined, message: string | undefined) => void;
|
|
23
49
|
name?: string;
|
|
24
50
|
locale?: string;
|
|
25
51
|
labels?: Partial<DateComponentLabels>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerRoot.d.ts","sourceRoot":"","sources":["../../../src/date-picker/DatePickerRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DatePickerRoot.d.ts","sourceRoot":"","sources":["../../../src/date-picker/DatePickerRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,MAAM,EACX,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAa5B,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,CACnB,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,KACxB,IAAI,CAAC;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvC;AAED,eAAO,MAAM,cAAc,sGAgN1B,CAAC"}
|
|
@@ -12,6 +12,7 @@ export interface DatePickerContextValue {
|
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
minValue?: DateId;
|
|
14
14
|
maxValue?: DateId;
|
|
15
|
+
isDateUnavailable?: (date: DateId) => boolean;
|
|
15
16
|
locale: string;
|
|
16
17
|
labels: DateComponentLabels;
|
|
17
18
|
registerSurface: (type: PickerSurfaceType) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/date-picker/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,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AG,aAAa,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,mBAAmB,CAAC;IAC5B,eAAe,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,gEAAgE;IAChE,SAAS,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAClC,gEAAgE;IAChE,UAAU,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,wDAAqD,CAAC;AAEpF,wBAAgB,oBAAoB,IAAI,sBAAsB,CAM7D"}
|
|
@@ -3,6 +3,12 @@ export * from './breadcrumbs';
|
|
|
3
3
|
export * from './button';
|
|
4
4
|
export * from './chip';
|
|
5
5
|
export * from './checkbox';
|
|
6
|
+
export * from './color';
|
|
7
|
+
export * from './color-area';
|
|
8
|
+
export * from './color-field';
|
|
9
|
+
export * from './color-picker';
|
|
10
|
+
export * from './color-slider';
|
|
11
|
+
export * from './color-swatch-picker';
|
|
6
12
|
export * from './dialog';
|
|
7
13
|
export * from './drawer';
|
|
8
14
|
export * from './field';
|
|
@@ -43,5 +49,6 @@ export { domDataAttributes, mergeDomDataAttributes, type DomDataAttributeValue,
|
|
|
43
49
|
export { mapViewPropsToDom, type MapViewPropsToDomOptions } from './utils/mapViewPropsToDom';
|
|
44
50
|
export { assignRef } from './utils/assignRef';
|
|
45
51
|
export { createPortalFn } from './utils/createPortal';
|
|
52
|
+
export { useHasTextAncestor } from './utils/textAncestor';
|
|
46
53
|
export { Slot } from './slot';
|
|
47
54
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,UAAU,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,EAC3B,kBA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M,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAS3B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,iBAAiB,GAAG,IAAI,EACrC,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,GAChB,MAAM,CAUR;AAQD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,SAAS,GACV,EAAE;IACD,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;uBAyBY,MAAM,SACN,MAAM,gBACC,MAAM,wBACE,iBAAiB;EAuE5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
type CreatePortalFn = (children:
|
|
1
|
+
import { type ReactNode, type ReactPortal } from 'react';
|
|
2
|
+
type CreatePortalFn = (children: ReactNode, container: Element) => ReactPortal;
|
|
3
3
|
/**
|
|
4
4
|
* Web implementation — statically imports `ReactDOM.createPortal`.
|
|
5
5
|
*
|
|
@@ -11,6 +11,10 @@ type CreatePortalFn = (children: React.ReactNode, container: Element) => React.R
|
|
|
11
11
|
* layout-animation path, leaving web overlays (Select, DatePicker) stuck at
|
|
12
12
|
* opacity 0. A static ESM import guarantees `createPortalFn` resolves on web
|
|
13
13
|
* regardless of the bundler's CommonJS interop.
|
|
14
|
+
*
|
|
15
|
+
* Portaled content leaves the DOM subtree of any `Text` it was rendered from,
|
|
16
|
+
* so the text-ancestor context is reset; otherwise a `Text` inside an overlay
|
|
17
|
+
* opened from a `Text` would skip its own typography and inherit nothing.
|
|
14
18
|
*/
|
|
15
19
|
export declare const createPortalFn: CreatePortalFn;
|
|
16
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPortal.web.d.ts","sourceRoot":"","sources":["../../../src/utils/createPortal.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"createPortal.web.d.ts","sourceRoot":"","sources":["../../../src/utils/createPortal.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIxE,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,KAAK,WAAW,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,EAAE,cACqE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Context } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* React Native's own text-ancestor context: `Text` provides `true`, and `View`
|
|
4
|
+
* (including the one inside `Modal`) resets it to `false`.
|
|
5
|
+
*
|
|
6
|
+
* It is exported as `unstable_`, so a React Native release that drops it falls
|
|
7
|
+
* back to a context nothing provides — every `Text` then styles itself as
|
|
8
|
+
* top-level instead of the module failing to load.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TextAncestorContext: Context<boolean>;
|
|
11
|
+
/** `true` when the calling component renders inside a host `Text`. */
|
|
12
|
+
export declare function useHasTextAncestor(): boolean;
|
|
13
|
+
//# sourceMappingURL=textAncestor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textAncestor.d.ts","sourceRoot":"","sources":["../../../src/utils/textAncestor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAEQ,CAAC;AAE1D,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Context } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* React Native Web's text-ancestor context, which its `Text` provides. RNW does
|
|
4
|
+
* not export it, so this is a deep import. RNW's ESM and CommonJS builds each
|
|
5
|
+
* create their own context, so this must stay on the ESM path: it is the build
|
|
6
|
+
* bundlers resolve `react-native-web` to, and the path `babel-preset-expo`
|
|
7
|
+
* rewrites `react-native` imports to under Jest.
|
|
8
|
+
*
|
|
9
|
+
* Unlike native, RNW's `View` does not reset the context — CSS inherits through
|
|
10
|
+
* an inline `View` inside `Text`. DOM portals reset it in `createPortal.web.ts`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TextAncestorContext: Context<boolean>;
|
|
13
|
+
/** `true` when the calling component renders inside a host `Text`. */
|
|
14
|
+
export declare function useHasTextAncestor(): boolean;
|
|
15
|
+
//# sourceMappingURL=textAncestor.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textAncestor.web.d.ts","sourceRoot":"","sources":["../../../src/utils/textAncestor.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAGjD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAA0B,CAAC;AAE5E,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/primitives",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,11 +65,12 @@
|
|
|
65
65
|
"@react-native-aria/interactions": "^0.2.16",
|
|
66
66
|
"@react-native-aria/radio": "0.2.13",
|
|
67
67
|
"@react-stately/checkbox": "3.7.4",
|
|
68
|
+
"@react-stately/color": "3.10.1",
|
|
68
69
|
"@react-stately/disclosure": "3.1.1",
|
|
69
70
|
"@react-stately/radio": "3.12.0",
|
|
70
71
|
"@react-stately/toggle": "3.9.4",
|
|
71
|
-
"@cdx-ui/
|
|
72
|
-
"@cdx-ui/
|
|
72
|
+
"@cdx-ui/utils": "0.2.1",
|
|
73
|
+
"@cdx-ui/formatters": "0.2.1"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@types/react": "19.1.17",
|
|
@@ -42,6 +42,7 @@ export const CalendarRoot = forwardRef<ComponentRef<typeof View>, CalendarRootPr
|
|
|
42
42
|
onMonthIdChange,
|
|
43
43
|
minValue,
|
|
44
44
|
maxValue,
|
|
45
|
+
isDateUnavailable,
|
|
45
46
|
disabled = false,
|
|
46
47
|
locale = 'en-US',
|
|
47
48
|
labels: labelsProp,
|
|
@@ -96,6 +97,7 @@ export const CalendarRoot = forwardRef<ComponentRef<typeof View>, CalendarRootPr
|
|
|
96
97
|
onMonthIdChange: setMonthId,
|
|
97
98
|
minValue,
|
|
98
99
|
maxValue,
|
|
100
|
+
isDateUnavailable,
|
|
99
101
|
disabled,
|
|
100
102
|
locale,
|
|
101
103
|
labels,
|
|
@@ -109,6 +111,7 @@ export const CalendarRoot = forwardRef<ComponentRef<typeof View>, CalendarRootPr
|
|
|
109
111
|
setMonthId,
|
|
110
112
|
minValue,
|
|
111
113
|
maxValue,
|
|
114
|
+
isDateUnavailable,
|
|
112
115
|
disabled,
|
|
113
116
|
locale,
|
|
114
117
|
labels,
|
package/src/calendar/context.tsx
CHANGED
package/src/calendar/types.ts
CHANGED
|
@@ -17,6 +17,13 @@ export interface ICalendarProps {
|
|
|
17
17
|
minValue?: DateId;
|
|
18
18
|
/** Latest selectable date. Build with `dateId(...)` from `@cdx-ui/formatters`. */
|
|
19
19
|
maxValue?: DateId;
|
|
20
|
+
/**
|
|
21
|
+
* Returns `true` for days that cannot be selected, such as weekends or holidays. Unavailable
|
|
22
|
+
* days render disabled and ignore presses, combined with `minValue` / `maxValue`. An inline
|
|
23
|
+
* function is safe; a stable (module-level or memoized) one also skips re-checking every day of
|
|
24
|
+
* the visible month on each render.
|
|
25
|
+
*/
|
|
26
|
+
isDateUnavailable?: (date: DateId) => boolean;
|
|
20
27
|
disabled?: boolean;
|
|
21
28
|
/** BCP 47 locale for weekday and month formatting. Defaults to `en-US`. */
|
|
22
29
|
locale?: string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { parseColor as parseStatelyColor } from '@react-stately/color';
|
|
2
|
+
import type { Color, ColorChannelBySpace, ColorFormat, ColorSpace } from './types';
|
|
3
|
+
|
|
4
|
+
const NUMBER_PATTERN = '[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)';
|
|
5
|
+
const HEX_PATTERN = /^#[\da-f]{3}(?:[\da-f]{3})?$/iu;
|
|
6
|
+
const RGB_PATTERN = new RegExp(
|
|
7
|
+
`^rgb\\(\\s*${NUMBER_PATTERN}\\s*,\\s*${NUMBER_PATTERN}\\s*,\\s*${NUMBER_PATTERN}\\s*\\)$`,
|
|
8
|
+
'iu',
|
|
9
|
+
);
|
|
10
|
+
const HSL_PATTERN = new RegExp(
|
|
11
|
+
`^hsl\\(\\s*${NUMBER_PATTERN}\\s*,\\s*${NUMBER_PATTERN}%\\s*,\\s*${NUMBER_PATTERN}%\\s*\\)$`,
|
|
12
|
+
'iu',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
type StatelyColor = ReturnType<typeof parseStatelyColor>;
|
|
16
|
+
|
|
17
|
+
function isSupportedOpaqueColor(value: string): boolean {
|
|
18
|
+
return HEX_PATTERN.test(value) || RGB_PATTERN.test(value) || HSL_PATTERN.test(value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function normalizeHue(value: number): number {
|
|
22
|
+
if (!Number.isFinite(value)) {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return ((value % 360) + 360) % 360;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function normalizeChannelValue(
|
|
30
|
+
color: StatelyColor,
|
|
31
|
+
channel: ColorChannelBySpace[ColorSpace],
|
|
32
|
+
value: number,
|
|
33
|
+
): number {
|
|
34
|
+
if (!Number.isFinite(value)) {
|
|
35
|
+
return color.getChannelValue(channel);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (channel === 'hue') {
|
|
39
|
+
return normalizeHue(value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const { minValue, maxValue } = color.getChannelRange(channel);
|
|
43
|
+
const clampedValue = Math.min(maxValue, Math.max(minValue, value));
|
|
44
|
+
|
|
45
|
+
return channel === 'red' || channel === 'green' || channel === 'blue'
|
|
46
|
+
? Math.round(clampedValue)
|
|
47
|
+
: clampedValue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function createColor(color: StatelyColor): Color {
|
|
51
|
+
return {
|
|
52
|
+
toString(format: ColorFormat): string {
|
|
53
|
+
const value = color.toString(format);
|
|
54
|
+
return format === 'hex' ? value.toUpperCase() : value;
|
|
55
|
+
},
|
|
56
|
+
getChannel<S extends ColorSpace>(space: S, channel: ColorChannelBySpace[S]): number {
|
|
57
|
+
const value = color.toFormat(space).getChannelValue(channel);
|
|
58
|
+
return channel === 'hue' ? normalizeHue(value) : value;
|
|
59
|
+
},
|
|
60
|
+
withChannel<S extends ColorSpace>(
|
|
61
|
+
space: S,
|
|
62
|
+
channel: ColorChannelBySpace[S],
|
|
63
|
+
value: number,
|
|
64
|
+
): Color {
|
|
65
|
+
const convertedColor = color.toFormat(space);
|
|
66
|
+
const channelValue = normalizeChannelValue(convertedColor, channel, value);
|
|
67
|
+
return createColor(convertedColor.withChannelValue(channel, channelValue));
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function parseColor(value: string): Color | undefined {
|
|
73
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
74
|
+
|
|
75
|
+
if (!isSupportedOpaqueColor(normalizedValue)) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
let color = parseStatelyColor(normalizedValue);
|
|
81
|
+
|
|
82
|
+
if (RGB_PATTERN.test(normalizedValue)) {
|
|
83
|
+
color = color
|
|
84
|
+
.withChannelValue('red', Math.round(color.getChannelValue('red')))
|
|
85
|
+
.withChannelValue('green', Math.round(color.getChannelValue('green')))
|
|
86
|
+
.withChannelValue('blue', Math.round(color.getChannelValue('blue')));
|
|
87
|
+
} else if (HSL_PATTERN.test(normalizedValue)) {
|
|
88
|
+
color = color.withChannelValue('hue', normalizeHue(color.getChannelValue('hue')));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return createColor(color);
|
|
92
|
+
} catch {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ColorFormat = 'hex' | 'rgb' | 'hsl';
|
|
2
|
+
|
|
3
|
+
export type ColorSpace = 'rgb' | 'hsl' | 'hsb';
|
|
4
|
+
|
|
5
|
+
export interface ColorChannelBySpace {
|
|
6
|
+
rgb: 'red' | 'green' | 'blue';
|
|
7
|
+
hsl: 'hue' | 'saturation' | 'lightness';
|
|
8
|
+
hsb: 'hue' | 'saturation' | 'brightness';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Color {
|
|
12
|
+
toString(format: ColorFormat): string;
|
|
13
|
+
getChannel<S extends ColorSpace>(space: S, channel: ColorChannelBySpace[S]): number;
|
|
14
|
+
withChannel<S extends ColorSpace>(
|
|
15
|
+
space: S,
|
|
16
|
+
channel: ColorChannelBySpace[S],
|
|
17
|
+
value: number,
|
|
18
|
+
): Color;
|
|
19
|
+
}
|