@kumix/ui 0.4.0 → 0.4.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/README.md +15 -15
- package/dist/components/agents/approval-card/index.d.ts +2 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -0
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/citations.d.ts +14 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +11 -7
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +3 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -2
- package/dist/components/charts/bump-chart/plot.js +1 -2
- package/dist/components/charts/bump-chart/point.js +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +1 -0
- package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/context.js +69 -0
- package/dist/components/charts/candlestick-chart/context.js.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.js +56 -0
- package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.js +218 -0
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
- package/dist/components/charts/candlestick-chart.d.ts +18 -0
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart.js +34 -0
- package/dist/components/charts/candlestick-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.js +1 -2
- package/dist/components/charts/composition-chart/plot.js +1 -1
- package/dist/components/charts/donut-chart/center.d.ts +16 -0
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/center.js +78 -0
- package/dist/components/charts/donut-chart/center.js.map +1 -0
- package/dist/components/charts/donut-chart/context.d.ts +68 -0
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/context.js +2 -0
- package/dist/components/charts/donut-chart/legend.d.ts +17 -0
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/legend.js +85 -0
- package/dist/components/charts/donut-chart/legend.js.map +1 -0
- package/dist/components/charts/donut-chart/plot.d.ts +10 -0
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/plot.js +108 -0
- package/dist/components/charts/donut-chart/plot.js.map +1 -0
- package/dist/components/charts/donut-chart.d.ts +22 -0
- package/dist/components/charts/donut-chart.d.ts.map +1 -0
- package/dist/components/charts/donut-chart.js +37 -0
- package/dist/components/charts/donut-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +1 -2
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +1 -1
- package/dist/components/charts/liquidity-heatmap.js +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +8 -2
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +11 -3
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +33 -1
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +92 -17
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +1 -1
- package/dist/components/charts/status-bar/tooltip.js +1 -1
- package/dist/components/charts/treemap/tooltip.js +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +3 -0
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +1 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -2
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.d.ts +1 -0
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +34 -42
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +3 -0
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card.d.ts +44 -0
- package/dist/components/motion/card.d.ts.map +1 -0
- package/dist/components/motion/card.js +122 -0
- package/dist/components/motion/card.js.map +1 -0
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +18 -6
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +110 -0
- package/dist/components/motion/color-picker.d.ts.map +1 -0
- package/dist/components/motion/color-picker.js +1053 -0
- package/dist/components/motion/color-picker.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +9 -2
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +1 -0
- package/dist/components/motion/command-palette.js +2 -2
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +1 -0
- package/dist/components/motion/digit-swap.d.ts +9 -1
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +18 -7
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +1 -0
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +1 -2
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +54 -0
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
- package/dist/components/motion/morphing-search-chips.js +599 -0
- package/dist/components/motion/morphing-search-chips.js.map +1 -0
- package/dist/components/motion/multi-select/content.d.ts +1 -0
- package/dist/components/motion/not-found/shared.d.ts +1 -0
- package/dist/components/motion/number-ticker.d.ts +6 -1
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +19 -9
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +1 -0
- package/dist/components/motion/popover-morph.js +3 -0
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- package/dist/components/motion/prediction-market-card.js +2 -3
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/radio.d.ts +3 -1
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +17 -5
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/shader-background.d.ts +1 -0
- package/dist/components/motion/sortable-list.d.ts +1 -0
- package/dist/components/motion/sortable-stack.js +1 -2
- package/dist/components/motion/tabs.d.ts +1 -0
- package/dist/components/motion/text-reveal.d.ts +1 -0
- package/dist/components/motion/tooltip/positioner.d.ts +8 -26
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -2
- package/dist/components/motion/tooltip.d.ts +62 -20
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -135
- package/dist/components/motion/wallet-card/account-avatar.js +1 -2
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/color-picker.d.ts +280 -0
- package/dist/components/reui/color-picker.d.ts.map +1 -0
- package/dist/components/reui/color-picker.js +2013 -0
- package/dist/components/reui/color-picker.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +43 -21
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +9 -3
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +12 -8
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +52 -13
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +35 -41
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts +168 -5
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +203 -69
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +39 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +33 -1
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +1 -0
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/emoji-picker.d.ts +367 -0
- package/dist/components/reui/emoji-picker.d.ts.map +1 -0
- package/dist/components/reui/emoji-picker.js +1768 -0
- package/dist/components/reui/emoji-picker.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
- package/dist/components/reui/file-type.d.ts +496 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +964 -0
- package/dist/components/reui/file-type.js.map +1 -0
- package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-chip.d.ts +5 -1
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +2 -2
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/icon-tile.js +8 -7
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts +3 -3
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +3 -3
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/item.d.ts +2 -2
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-BXUh52bu.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-BXUh52bu.js.map} +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +1 -0
- package/dist/hooks/use-scroll-position.d.ts +1 -0
- package/dist/hooks/use-slider-input.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +1 -0
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-NSIg2p7a.d.ts +20 -0
- package/dist/model-NSIg2p7a.d.ts.map +1 -0
- package/dist/model-_mRyI6V9.d.ts +18 -0
- package/dist/model-_mRyI6V9.d.ts.map +1 -0
- package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
- package/dist/positioner-3r3cfkqT.js.map +1 -0
- package/dist/tooltip-Bam5KeYe.js +535 -0
- package/dist/tooltip-Bam5KeYe.js.map +1 -0
- package/dist/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/model-DfeFradZ.d.ts +0 -9
- package/dist/model-DfeFradZ.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Button } from "../ui/button.js";
|
|
2
|
+
import { InputGroup, InputGroupInput } from "../ui/input-group.js";
|
|
3
|
+
import { PopoverContent } from "../ui/popover.js";
|
|
4
|
+
import { ComponentProps, ReactNode, Ref } from "react";
|
|
5
|
+
//#region src/components/reui/color-picker.d.ts
|
|
6
|
+
/** How a value is written: what `onValueChange` emits and what the fields show. */
|
|
7
|
+
export type ColorPickerFormat = "hex" | "rgb" | "hsl" | "hsb" | "oklch";
|
|
8
|
+
/** Where channels live. HSB is `hsv` here, after the math. */
|
|
9
|
+
export type ColorPickerColorSpace = "rgb" | "hsl" | "hsv" | "oklch";
|
|
10
|
+
export type ColorPickerChannel = "hue" | "saturation" | "brightness" | "lightness" | "chroma" | "red" | "green" | "blue" | "alpha";
|
|
11
|
+
/**
|
|
12
|
+
* A parsed color. Channels stay in the space they were given or edited in,
|
|
13
|
+
* so the hue of a gray and an OKLCH color outside sRGB survive a round trip.
|
|
14
|
+
* rgb runs 0 to 255; hsl and hsv take hue 0 to 360 and the rest 0 to 100;
|
|
15
|
+
* oklch takes lightness 0 to 100, chroma 0 to 0.4 and hue 0 to 360. Alpha is
|
|
16
|
+
* 0 to 1.
|
|
17
|
+
*/
|
|
18
|
+
export type ColorPickerColor = {
|
|
19
|
+
space: ColorPickerColorSpace;
|
|
20
|
+
channels: [number, number, number];
|
|
21
|
+
alpha: number;
|
|
22
|
+
};
|
|
23
|
+
export type ColorPickerLabels = {
|
|
24
|
+
/** Trigger text while there is no value. */
|
|
25
|
+
placeholder: string;
|
|
26
|
+
/** Names the popup and an inline panel. */
|
|
27
|
+
panelLabel: string;
|
|
28
|
+
/** The swatch button in `ColorPickerInput`. */
|
|
29
|
+
openPicker: string;
|
|
30
|
+
/** The saturation and brightness area. */
|
|
31
|
+
area: string;
|
|
32
|
+
hue: string;
|
|
33
|
+
saturation: string;
|
|
34
|
+
brightness: string;
|
|
35
|
+
lightness: string;
|
|
36
|
+
chroma: string;
|
|
37
|
+
red: string;
|
|
38
|
+
green: string;
|
|
39
|
+
blue: string;
|
|
40
|
+
alpha: string;
|
|
41
|
+
hex: string;
|
|
42
|
+
format: string;
|
|
43
|
+
eyeDropper: string;
|
|
44
|
+
copy: string;
|
|
45
|
+
copied: string;
|
|
46
|
+
clear: string;
|
|
47
|
+
swatches: string;
|
|
48
|
+
};
|
|
49
|
+
export type ColorPickerFunctions = {
|
|
50
|
+
/** Names a color for screen readers, in the area, the sliders and unlabelled swatches. */
|
|
51
|
+
getColorName: (color: ColorPickerColor) => string;
|
|
52
|
+
};
|
|
53
|
+
export type ColorPickerI18nConfig = {
|
|
54
|
+
labels: ColorPickerLabels;
|
|
55
|
+
functions: ColorPickerFunctions;
|
|
56
|
+
};
|
|
57
|
+
/** One level deeper than `Partial`, so a single label can be overridden. */
|
|
58
|
+
export type ColorPickerI18nOverrides = {
|
|
59
|
+
labels?: Partial<ColorPickerLabels>;
|
|
60
|
+
functions?: Partial<ColorPickerFunctions>;
|
|
61
|
+
};
|
|
62
|
+
export declare const COLOR_PICKER_FORMATS: ColorPickerFormat[];
|
|
63
|
+
/** Whether a color fits sRGB. OKLCH can reach past it; the picker then maps it into sRGB the way CSS does. */
|
|
64
|
+
export declare function isColorInSrgb(color: ColorPickerColor): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Reads a CSS color: hex with 3, 4, 6 or 8 digits, `#` optional; the 148
|
|
67
|
+
* named colors and `transparent`; `rgb()`, `hsl()`, `hwb()`, `lab()`,
|
|
68
|
+
* `lch()`, `oklab()`, `oklch()` and `color()` in any of CSS Color 4's RGB
|
|
69
|
+
* and XYZ spaces, plus `hsb()` or `hsv()`; modern or comma syntax, with or
|
|
70
|
+
* without alpha. A color that can fall outside sRGB is kept as OKLCH.
|
|
71
|
+
* Anything else, `var()` and `currentColor` included, is `null`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseColor(input: string | null | undefined): ColorPickerColor | null;
|
|
74
|
+
/**
|
|
75
|
+
* Writes a color in a format. HEX gains a fourth byte and the others a
|
|
76
|
+
* `/ alpha` only when the color is translucent; OKLCH keeps channels outside
|
|
77
|
+
* sRGB, every other format maps the color into sRGB the way CSS does.
|
|
78
|
+
*/
|
|
79
|
+
export declare function formatColor(color: ColorPickerColor, format: ColorPickerFormat): string;
|
|
80
|
+
/**
|
|
81
|
+
* The WCAG 2 contrast ratio, 1 to 21. A translucent foreground is laid over
|
|
82
|
+
* the background, and a translucent background over white. `null` when either
|
|
83
|
+
* color does not parse.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getContrastRatio(foreground: string | ColorPickerColor, background: string | ColorPickerColor): number | null;
|
|
86
|
+
/**
|
|
87
|
+
* The text color that reads better on a background: `light` on a dark one,
|
|
88
|
+
* `dark` on a light one. Light text also has to reach 3:1 by WCAG 2, the AA
|
|
89
|
+
* bar for large text and icons, so orange-500 and sky-500 take dark text.
|
|
90
|
+
* A translucent background is laid over white, as in `getContrastRatio`.
|
|
91
|
+
* `null` when the background does not parse.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getForegroundColor(background: string | ColorPickerColor, { light, dark }?: {
|
|
94
|
+
light?: string;
|
|
95
|
+
dark?: string;
|
|
96
|
+
}): string | null;
|
|
97
|
+
export declare const DEFAULT_COLOR_PICKER_I18N: ColorPickerI18nConfig;
|
|
98
|
+
/** Merges per section, so an override can carry one key without restating the rest. */
|
|
99
|
+
export declare function mergeColorPickerI18n(overrides?: ColorPickerI18nOverrides): ColorPickerI18nConfig;
|
|
100
|
+
export type ColorPickerApi = {
|
|
101
|
+
/** The value as emitted, or `null`. */
|
|
102
|
+
value: string | null;
|
|
103
|
+
color: ColorPickerColor | null;
|
|
104
|
+
format: ColorPickerFormat;
|
|
105
|
+
open: boolean;
|
|
106
|
+
setOpen: (open: boolean) => void;
|
|
107
|
+
/** Commits any color `parseColor` reads; `null` or `""` clears, anything else is ignored. */
|
|
108
|
+
setValue: (value: string | null) => void;
|
|
109
|
+
clear: () => void;
|
|
110
|
+
};
|
|
111
|
+
/** The picker's state and actions, inside a `ColorPicker`. */
|
|
112
|
+
export declare function useColorPicker(): ColorPickerApi;
|
|
113
|
+
export type ColorPickerProps = {
|
|
114
|
+
/** Controlled value: any color `parseColor` reads. `null` is empty. */
|
|
115
|
+
value?: string | null;
|
|
116
|
+
defaultValue?: string | null;
|
|
117
|
+
/** Fires on every change, a drag included, with the value in `format`. */
|
|
118
|
+
onValueChange?: (value: string | null) => void;
|
|
119
|
+
/** Fires once an interaction ends: a drag released, a key, a field, a swatch. */
|
|
120
|
+
onValueCommit?: (value: string | null) => void;
|
|
121
|
+
/** How the value is written. */
|
|
122
|
+
format?: ColorPickerFormat;
|
|
123
|
+
/** Adds the opacity slider and field, and lets the value carry alpha. */
|
|
124
|
+
alpha?: boolean;
|
|
125
|
+
/** Preset colors under the default panel. */
|
|
126
|
+
swatches?: string[];
|
|
127
|
+
open?: boolean;
|
|
128
|
+
defaultOpen?: boolean;
|
|
129
|
+
onOpenChange?: (open: boolean) => void;
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
readOnly?: boolean;
|
|
132
|
+
invalid?: boolean;
|
|
133
|
+
/** Submits the value with a native form under this name. */
|
|
134
|
+
name?: string;
|
|
135
|
+
form?: string;
|
|
136
|
+
required?: boolean;
|
|
137
|
+
/** The hidden form field, for form libraries that focus a field on error. */
|
|
138
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
139
|
+
/** Lands on the trigger or the input. */
|
|
140
|
+
id?: string;
|
|
141
|
+
"aria-label"?: string;
|
|
142
|
+
"aria-labelledby"?: string;
|
|
143
|
+
"aria-describedby"?: string;
|
|
144
|
+
i18n?: ColorPickerI18nOverrides;
|
|
145
|
+
/** Without children the picker renders a trigger and a popover; these reach the trigger. */
|
|
146
|
+
placeholder?: string;
|
|
147
|
+
className?: string;
|
|
148
|
+
children?: ReactNode;
|
|
149
|
+
};
|
|
150
|
+
export declare function ColorPicker({ value, defaultValue, onValueChange, onValueCommit, format, alpha, swatches, open: openProp, defaultOpen, onOpenChange, disabled, readOnly, invalid, name, form, required, inputRef, id: idProp, "aria-label": label, "aria-labelledby": labelledBy, "aria-describedby": describedBy, i18n: i18nProp, placeholder, className, children }: ColorPickerProps): import("react").JSX.Element;
|
|
151
|
+
export type ColorPickerSwatchProps = Omit<ComponentProps<"span">, "color"> & {
|
|
152
|
+
/** The color to show. Defaults to the picker's value, so it also works outside one. */
|
|
153
|
+
color?: string | null;
|
|
154
|
+
/** `square` follows each style's radius; `circle` is round in all of them. */
|
|
155
|
+
shape?: "square" | "circle";
|
|
156
|
+
};
|
|
157
|
+
/** A color chip: the value in a trigger, or any color in a table or a legend. */
|
|
158
|
+
export declare function ColorPickerSwatch({ color: colorProp, shape, className, style, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
|
|
159
|
+
export type ColorPickerValueProps = Omit<ComponentProps<"span">, "children"> & {
|
|
160
|
+
placeholder?: ReactNode;
|
|
161
|
+
};
|
|
162
|
+
/** The value as text, or the placeholder. For custom trigger content. */
|
|
163
|
+
export declare function ColorPickerValue({ placeholder, className, ...props }: ColorPickerValueProps): import("react").JSX.Element;
|
|
164
|
+
export type ColorPickerTriggerProps = ComponentProps<typeof Button> & {
|
|
165
|
+
placeholder?: ReactNode;
|
|
166
|
+
};
|
|
167
|
+
/** A shadcn Button that opens the picker. Children replace the swatch, value and chevron. */
|
|
168
|
+
export declare function ColorPickerTrigger({ className, variant, placeholder, children, ref, ...props }: ColorPickerTriggerProps): import("react").JSX.Element;
|
|
169
|
+
export type ColorPickerInputProps = Omit<ComponentProps<typeof InputGroupInput>, "value" | "defaultValue">;
|
|
170
|
+
/**
|
|
171
|
+
* A typable field with a swatch button that opens the picker. It reads any
|
|
172
|
+
* CSS color the browser knows, named colors included, on blur and Enter;
|
|
173
|
+
* Escape restores the value and Alt+ArrowDown opens the popover.
|
|
174
|
+
*/
|
|
175
|
+
export declare function ColorPickerInput({ className, placeholder, onBlur, onKeyDown, onChange, ref, ...props }: ColorPickerInputProps): import("react").JSX.Element;
|
|
176
|
+
export type ColorPickerContentProps = ComponentProps<typeof PopoverContent>;
|
|
177
|
+
/**
|
|
178
|
+
* The popover: the default panel unless given children. Tab cycles inside
|
|
179
|
+
* it, as in a date picker dialog, in both twins.
|
|
180
|
+
*/
|
|
181
|
+
export declare function ColorPickerContent({ className, align, onKeyDown, children, ...props }: ColorPickerContentProps): import("react").JSX.Element;
|
|
182
|
+
export type ColorPickerPanelProps = ComponentProps<"div">;
|
|
183
|
+
/**
|
|
184
|
+
* The area, the sliders, the fields and any `swatches`, rendered in place:
|
|
185
|
+
* put it straight inside a `ColorPicker` for an always-open picker.
|
|
186
|
+
*/
|
|
187
|
+
export declare function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps): import("react").JSX.Element;
|
|
188
|
+
export type ColorPickerAreaProps = ComponentProps<"div">;
|
|
189
|
+
/**
|
|
190
|
+
* The saturation and brightness square, at the current hue. A single slider
|
|
191
|
+
* to assistive tech, whose value text names both channels and the color.
|
|
192
|
+
* Arrows move it, Shift by ten, Page keys move brightness.
|
|
193
|
+
*/
|
|
194
|
+
export declare function ColorPickerArea({ className, style, onKeyDown, ...props }: ColorPickerAreaProps): import("react").JSX.Element;
|
|
195
|
+
export type ColorPickerSliderProps = Omit<ComponentProps<"div">, "children"> & {
|
|
196
|
+
channel: ColorPickerChannel;
|
|
197
|
+
/** The space the channel belongs to. Defaults to HSB for hue, saturation and brightness, HSL for lightness, OKLCH for chroma and RGB for red, green and blue. */
|
|
198
|
+
colorSpace?: ColorPickerColorSpace;
|
|
199
|
+
orientation?: "horizontal" | "vertical";
|
|
200
|
+
};
|
|
201
|
+
/** One channel as a gradient track. Vertical tracks run bottom to top. */
|
|
202
|
+
export declare function ColorPickerSlider({ channel, colorSpace, orientation, className, style, onKeyDown, ...props }: ColorPickerSliderProps): import("react").JSX.Element;
|
|
203
|
+
export type ColorPickerWheelProps = ComponentProps<"div">;
|
|
204
|
+
/**
|
|
205
|
+
* A hue ring. Children fill the square inscribed in its hole: an area there
|
|
206
|
+
* gives the classic ring-and-square picker. `--color-picker-wheel-thickness`
|
|
207
|
+
* sets the ring's width.
|
|
208
|
+
*/
|
|
209
|
+
export declare function ColorPickerWheel({ className, children, onKeyDown, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
|
|
210
|
+
export type ColorPickerActionProps = ComponentProps<typeof Button>;
|
|
211
|
+
/**
|
|
212
|
+
* Samples a color from anywhere on screen, keeping the current opacity.
|
|
213
|
+
* Renders nothing where the browser has no EyeDropper (Firefox, Safari).
|
|
214
|
+
*/
|
|
215
|
+
export declare function ColorPickerEyeDropper({ variant, size, onClick, children, ...props }: ColorPickerActionProps): import("react").JSX.Element | null;
|
|
216
|
+
export type ColorPickerCopyProps = ColorPickerActionProps & {
|
|
217
|
+
/** The format copied. Defaults to the picker's. */
|
|
218
|
+
format?: ColorPickerFormat;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Copies the value and confirms for a moment, in `format` or, by default, the
|
|
222
|
+
* format on screen: what the fields show, else the picker's.
|
|
223
|
+
*/
|
|
224
|
+
export declare function ColorPickerCopy({ format, variant, size, onClick, children, ...props }: ColorPickerCopyProps): import("react").JSX.Element;
|
|
225
|
+
/**
|
|
226
|
+
* Empties the value, for an optional color. It stays enabled while empty:
|
|
227
|
+
* disabling itself on click would drop keyboard focus to the page.
|
|
228
|
+
*/
|
|
229
|
+
export declare function ColorPickerClear({ variant, size, onClick, children, ...props }: ColorPickerActionProps): import("react").JSX.Element;
|
|
230
|
+
type FieldChannel = ColorPickerChannel | "hex";
|
|
231
|
+
export type ColorPickerChannelInputProps = Omit<ComponentProps<typeof InputGroupInput>, "value" | "defaultValue"> & {
|
|
232
|
+
/** A channel, or `"hex"` for the six hex digits. */
|
|
233
|
+
channel: FieldChannel;
|
|
234
|
+
colorSpace?: ColorPickerColorSpace;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* One channel as a borderless field for an `InputGroup`. Text is read on blur
|
|
238
|
+
* and Enter; ArrowUp and ArrowDown step it, Shift by ten.
|
|
239
|
+
*/
|
|
240
|
+
export declare function ColorPickerChannelInput({ channel, colorSpace, className, onBlur, onKeyDown, onChange, ref, ...props }: ColorPickerChannelInputProps): import("react").JSX.Element;
|
|
241
|
+
export type ColorPickerFieldsProps = Omit<ComponentProps<typeof InputGroup>, "children"> & {
|
|
242
|
+
/** The format shown, controlled. It does not change what `onValueChange` emits. */
|
|
243
|
+
format?: ColorPickerFormat;
|
|
244
|
+
/** Defaults to the picker's `format`. */
|
|
245
|
+
defaultFormat?: ColorPickerFormat;
|
|
246
|
+
onFormatChange?: (format: ColorPickerFormat) => void;
|
|
247
|
+
/** The formats in the menu. One format hides the menu. */
|
|
248
|
+
formats?: ColorPickerFormat[];
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* A format menu and the value's channels as joined fields: one hex field, or
|
|
252
|
+
* three channels, plus opacity when the picker takes alpha.
|
|
253
|
+
*/
|
|
254
|
+
export declare function ColorPickerFields({ format: formatProp, defaultFormat, onFormatChange, formats, className, ...props }: ColorPickerFieldsProps): import("react").JSX.Element;
|
|
255
|
+
export type ColorPickerSwatchInput = string | {
|
|
256
|
+
value: string;
|
|
257
|
+
label?: string;
|
|
258
|
+
};
|
|
259
|
+
export type ColorPickerSwatchesProps = Omit<ComponentProps<"div">, "children"> & {
|
|
260
|
+
colors?: ColorPickerSwatchInput[];
|
|
261
|
+
shape?: "square" | "circle";
|
|
262
|
+
children?: ReactNode;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Preset colors as a listbox: one tab stop, arrow keys move through them in
|
|
266
|
+
* order, Enter or Space picks. `--color-picker-swatch-size` sets the chip size.
|
|
267
|
+
*/
|
|
268
|
+
export declare function ColorPickerSwatches({ colors, shape, className, children, onKeyDown, onFocus, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
|
|
269
|
+
export type ColorPickerSwatchItemProps = Omit<ComponentProps<"div">, "children"> & {
|
|
270
|
+
/** Any color `parseColor` reads. */
|
|
271
|
+
value: string;
|
|
272
|
+
/** Read out instead of the generated color name. */
|
|
273
|
+
label?: string;
|
|
274
|
+
disabled?: boolean;
|
|
275
|
+
};
|
|
276
|
+
/** One preset. Selected while the picker's value is this color. */
|
|
277
|
+
export declare function ColorPickerSwatchItem({ value, label, disabled, className, style, onClick, ...props }: ColorPickerSwatchItemProps): import("react").JSX.Element;
|
|
278
|
+
//#endregion
|
|
279
|
+
export {};
|
|
280
|
+
//# sourceMappingURL=color-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","names":[],"sources":["../../../src/components/reui/color-picker.tsx"],"mappings":";;;;;;YAyCY;;YAGA;YAEA;;;;;;;;YAkBA;EACV,OAAO;EACP;EACA;;YAGU;;EAEV;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;;EAEV,eAAe,OAAO;;YAGZ;EACV,QAAQ;EACR,WAAW;;;YAID;EACV,SAAS,QAAQ;EACjB,YAAY,QAAQ;;qBAeT,sBAAsB;;wBAwLnB,cAAc,OAAO;;;;;;;;;wBAkRrB,WAAW,mCAAmC;;;;;;wBAgF9C,YAAY,OAAO,kBAAkB,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