@krollins/blueprint 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +407 -0
- package/dist/components/accordion/accordion.d.ts +113 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.style.d.ts +2 -0
- package/dist/components/accordion/accordion.style.d.ts.map +1 -0
- package/dist/components/alert/alert.d.ts +37 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.style.d.ts +2 -0
- package/dist/components/alert/alert.style.d.ts.map +1 -0
- package/dist/components/avatar/avatar.d.ts +75 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.style.d.ts +2 -0
- package/dist/components/avatar/avatar.style.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +46 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.style.d.ts +2 -0
- package/dist/components/badge/badge.style.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +110 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.style.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.style.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +19 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.style.d.ts +2 -0
- package/dist/components/button/button.style.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +62 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.style.d.ts +2 -0
- package/dist/components/card/card.style.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +89 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.style.d.ts +2 -0
- package/dist/components/checkbox/checkbox.style.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.d.ts +366 -0
- package/dist/components/color-picker/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.style.d.ts +14 -0
- package/dist/components/color-picker/color-picker.style.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.utils.d.ts +100 -0
- package/dist/components/color-picker/color-picker.utils.d.ts.map +1 -0
- package/dist/components/combobox/combobox.d.ts +74 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/combobox.style.d.ts +2 -0
- package/dist/components/combobox/combobox.style.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +65 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.style.d.ts +2 -0
- package/dist/components/date-picker/date-picker.style.d.ts.map +1 -0
- package/dist/components/divider/divider.d.ts +54 -0
- package/dist/components/divider/divider.d.ts.map +1 -0
- package/dist/components/divider/divider.style.d.ts +2 -0
- package/dist/components/divider/divider.style.d.ts.map +1 -0
- package/dist/components/drawer/drawer.d.ts +113 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/drawer.style.d.ts +2 -0
- package/dist/components/drawer/drawer.style.d.ts.map +1 -0
- package/dist/components/dropdown/dropdown.d.ts +80 -0
- package/dist/components/dropdown/dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/dropdown.style.d.ts +2 -0
- package/dist/components/dropdown/dropdown.style.d.ts.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +116 -0
- package/dist/components/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload/file-upload.style.d.ts +2 -0
- package/dist/components/file-upload/file-upload.style.d.ts.map +1 -0
- package/dist/components/heading/heading.d.ts +46 -0
- package/dist/components/heading/heading.d.ts.map +1 -0
- package/dist/components/heading/heading.style.d.ts +2 -0
- package/dist/components/heading/heading.style.d.ts.map +1 -0
- package/dist/components/icon/icon.d.ts +57 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.style.d.ts +2 -0
- package/dist/components/icon/icon.style.d.ts.map +1 -0
- package/dist/components/icon/icons/registry.generated.d.ts +25 -0
- package/dist/components/icon/icons/registry.generated.d.ts.map +1 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/input/input.d.ts +56 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.style.d.ts +2 -0
- package/dist/components/input/input.style.d.ts.map +1 -0
- package/dist/components/link/link.d.ts +62 -0
- package/dist/components/link/link.d.ts.map +1 -0
- package/dist/components/link/link.style.d.ts +2 -0
- package/dist/components/link/link.style.d.ts.map +1 -0
- package/dist/components/menu/menu.d.ts +86 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.style.d.ts +2 -0
- package/dist/components/menu/menu.style.d.ts.map +1 -0
- package/dist/components/modal/modal.d.ts +40 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/modal/modal.style.d.ts +2 -0
- package/dist/components/modal/modal.style.d.ts.map +1 -0
- package/dist/components/multi-select/multi-select.d.ts +69 -0
- package/dist/components/multi-select/multi-select.d.ts.map +1 -0
- package/dist/components/multi-select/multi-select.style.d.ts +2 -0
- package/dist/components/multi-select/multi-select.style.d.ts.map +1 -0
- package/dist/components/notification/notification.d.ts +102 -0
- package/dist/components/notification/notification.d.ts.map +1 -0
- package/dist/components/notification/notification.style.d.ts +2 -0
- package/dist/components/notification/notification.style.d.ts.map +1 -0
- package/dist/components/number-input/number-input.d.ts +139 -0
- package/dist/components/number-input/number-input.d.ts.map +1 -0
- package/dist/components/number-input/number-input.style.d.ts +2 -0
- package/dist/components/number-input/number-input.style.d.ts.map +1 -0
- package/dist/components/pagination/pagination.d.ts +49 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.style.d.ts +2 -0
- package/dist/components/pagination/pagination.style.d.ts.map +1 -0
- package/dist/components/popover/popover.d.ts +153 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.style.d.ts +2 -0
- package/dist/components/popover/popover.style.d.ts.map +1 -0
- package/dist/components/progress/progress.d.ts +50 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.style.d.ts +2 -0
- package/dist/components/progress/progress.style.d.ts.map +1 -0
- package/dist/components/radio/radio.d.ts +95 -0
- package/dist/components/radio/radio.d.ts.map +1 -0
- package/dist/components/radio/radio.style.d.ts +2 -0
- package/dist/components/radio/radio.style.d.ts.map +1 -0
- package/dist/components/select/select.d.ts +49 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/select/select.style.d.ts +2 -0
- package/dist/components/select/select.style.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +50 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.style.d.ts +2 -0
- package/dist/components/skeleton/skeleton.style.d.ts.map +1 -0
- package/dist/components/slider/slider.d.ts +115 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/slider/slider.style.d.ts +2 -0
- package/dist/components/slider/slider.style.d.ts.map +1 -0
- package/dist/components/spinner/spinner.d.ts +36 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.style.d.ts +2 -0
- package/dist/components/spinner/spinner.style.d.ts.map +1 -0
- package/dist/components/stepper/stepper.d.ts +228 -0
- package/dist/components/stepper/stepper.d.ts.map +1 -0
- package/dist/components/stepper/stepper.style.d.ts +2 -0
- package/dist/components/stepper/stepper.style.d.ts.map +1 -0
- package/dist/components/switch/switch.d.ts +90 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.style.d.ts +2 -0
- package/dist/components/switch/switch.style.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +176 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/table/table.style.d.ts +2 -0
- package/dist/components/table/table.style.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +124 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.style.d.ts +2 -0
- package/dist/components/tabs/tabs.style.d.ts.map +1 -0
- package/dist/components/tag/tag.d.ts +64 -0
- package/dist/components/tag/tag.d.ts.map +1 -0
- package/dist/components/tag/tag.style.d.ts +2 -0
- package/dist/components/tag/tag.style.d.ts.map +1 -0
- package/dist/components/text/text.d.ts +86 -0
- package/dist/components/text/text.d.ts.map +1 -0
- package/dist/components/text/text.style.d.ts +2 -0
- package/dist/components/text/text.style.d.ts.map +1 -0
- package/dist/components/textarea/textarea.d.ts +94 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/textarea/textarea.style.d.ts +2 -0
- package/dist/components/textarea/textarea.style.d.ts.map +1 -0
- package/dist/components/time-picker/time-picker.d.ts +51 -0
- package/dist/components/time-picker/time-picker.d.ts.map +1 -0
- package/dist/components/time-picker/time-picker.style.d.ts +2 -0
- package/dist/components/time-picker/time-picker.style.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +52 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.style.d.ts +2 -0
- package/dist/components/tooltip/tooltip.style.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +188 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree/tree.style.d.ts +2 -0
- package/dist/components/tree/tree.style.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17802 -0
- package/dist/index.js.map +1 -0
- package/dist/utilities/boolean-converter.d.ts +23 -0
- package/dist/utilities/boolean-converter.d.ts.map +1 -0
- package/dist/utilities/debounce.d.ts +12 -0
- package/dist/utilities/debounce.d.ts.map +1 -0
- package/dist/utilities/index.d.ts +5 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/memoize.d.ts +7 -0
- package/dist/utilities/memoize.d.ts.map +1 -0
- package/dist/utilities/throttle.d.ts +12 -0
- package/dist/utilities/throttle.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { type ColorFormat } from './color-picker.utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Color picker size
|
|
5
|
+
*/
|
|
6
|
+
export type ColorPickerSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
/**
|
|
8
|
+
* A color picker component that provides a consistent, accessible, and feature-rich
|
|
9
|
+
* color selection experience. Supports HEX, RGB, and HSL formats with optional alpha channel.
|
|
10
|
+
*
|
|
11
|
+
* @element bp-color-picker
|
|
12
|
+
*
|
|
13
|
+
* @slot trigger - Custom trigger button content
|
|
14
|
+
* @slot swatches - Custom swatch elements
|
|
15
|
+
* @slot footer - Additional content below picker
|
|
16
|
+
*
|
|
17
|
+
* @csspart trigger - The popover trigger button
|
|
18
|
+
* @csspart popover - The popover container
|
|
19
|
+
* @csspart color-area - The 2D saturation/value gradient
|
|
20
|
+
* @csspart hue-slider - The hue selection slider
|
|
21
|
+
* @csspart alpha-slider - The alpha selection slider
|
|
22
|
+
* @csspart preview - The color preview swatch
|
|
23
|
+
* @csspart input - Text input fields
|
|
24
|
+
* @csspart swatches - Swatches container
|
|
25
|
+
* @csspart swatch - Individual swatch items
|
|
26
|
+
*
|
|
27
|
+
* @fires bp-change - Fired when value changes (on blur/confirm)
|
|
28
|
+
* @fires bp-input - Fired on every input (live updates)
|
|
29
|
+
* @fires bp-open - Popover opened
|
|
30
|
+
* @fires bp-close - Popover closed
|
|
31
|
+
*/
|
|
32
|
+
export declare class BpColorPicker extends LitElement {
|
|
33
|
+
static styles: import("lit").CSSResult[];
|
|
34
|
+
/** Current color value */
|
|
35
|
+
value: string;
|
|
36
|
+
/** Output format for value */
|
|
37
|
+
format: ColorFormat;
|
|
38
|
+
/** Enable alpha channel */
|
|
39
|
+
alpha: boolean;
|
|
40
|
+
/** Predefined swatch colors */
|
|
41
|
+
swatches: string[];
|
|
42
|
+
/** Render inline instead of popover */
|
|
43
|
+
inline: boolean;
|
|
44
|
+
/** Disable all interactions */
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
/** Show value but prevent editing */
|
|
47
|
+
readonly: boolean;
|
|
48
|
+
/** Component size */
|
|
49
|
+
size: ColorPickerSize;
|
|
50
|
+
/** Accessible label */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Form field name */
|
|
53
|
+
name: string;
|
|
54
|
+
/** Placeholder for trigger */
|
|
55
|
+
placeholder: string;
|
|
56
|
+
/** Whether the popover is open */
|
|
57
|
+
private _open;
|
|
58
|
+
/** Internal HSV color state */
|
|
59
|
+
private _hsv;
|
|
60
|
+
/** Original color when popover opened */
|
|
61
|
+
private _originalValue;
|
|
62
|
+
/** Whether eyedropper is supported */
|
|
63
|
+
private _eyedropperSupported;
|
|
64
|
+
/** Current input mode for format toggle */
|
|
65
|
+
private _inputMode;
|
|
66
|
+
/** HEX input value for controlled input */
|
|
67
|
+
private _hexInputValue;
|
|
68
|
+
/** Whether eyedropper is currently active */
|
|
69
|
+
private _isPickingColor;
|
|
70
|
+
private _colorArea;
|
|
71
|
+
private _hueSlider;
|
|
72
|
+
private _alphaSlider;
|
|
73
|
+
private _isDraggingArea;
|
|
74
|
+
private _isDraggingHue;
|
|
75
|
+
private _isDraggingAlpha;
|
|
76
|
+
constructor();
|
|
77
|
+
connectedCallback(): void;
|
|
78
|
+
disconnectedCallback(): void;
|
|
79
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
80
|
+
private _isDragging;
|
|
81
|
+
/**
|
|
82
|
+
* Parses a color value string and updates internal HSV state
|
|
83
|
+
* @param value Color string in hex, rgb, or hsl format
|
|
84
|
+
*/
|
|
85
|
+
private _parseValue;
|
|
86
|
+
/**
|
|
87
|
+
* Formats the current HSV color to the specified output format
|
|
88
|
+
* @param format Output format (hex, rgb, or hsl), defaults to this.format
|
|
89
|
+
* @returns Formatted color string
|
|
90
|
+
*/
|
|
91
|
+
private _formatOutput;
|
|
92
|
+
/**
|
|
93
|
+
* Handles click events on the trigger button
|
|
94
|
+
* Toggles the picker popover open/closed state
|
|
95
|
+
*/
|
|
96
|
+
private _handleTriggerClick;
|
|
97
|
+
/**
|
|
98
|
+
* Handles keyboard events on the trigger button
|
|
99
|
+
* Opens picker on Enter or Space key
|
|
100
|
+
* @param event Keyboard event
|
|
101
|
+
*/
|
|
102
|
+
private _handleTriggerKeydown;
|
|
103
|
+
/**
|
|
104
|
+
* Toggles the picker popover between open and closed states
|
|
105
|
+
* Saves original value when opening and emits bp-open/bp-close events
|
|
106
|
+
*/
|
|
107
|
+
private _toggleOpen;
|
|
108
|
+
/**
|
|
109
|
+
* Closes the picker popover
|
|
110
|
+
* Removes global event listeners and emits bp-close event
|
|
111
|
+
*/
|
|
112
|
+
private _close;
|
|
113
|
+
private _handleOutsideClick;
|
|
114
|
+
private _handleEscapeKey;
|
|
115
|
+
/**
|
|
116
|
+
* Adds global document event listeners for outside clicks and escape key
|
|
117
|
+
* Used when picker popover is open
|
|
118
|
+
*/
|
|
119
|
+
private _addGlobalListeners;
|
|
120
|
+
/**
|
|
121
|
+
* Removes global document event listeners
|
|
122
|
+
* Called when picker popover is closed
|
|
123
|
+
*/
|
|
124
|
+
private _removeGlobalListeners;
|
|
125
|
+
/**
|
|
126
|
+
* Handles pointer down events on the color area
|
|
127
|
+
* Starts saturation/value drag interaction
|
|
128
|
+
* @param event Pointer event
|
|
129
|
+
*/
|
|
130
|
+
private _handleColorAreaPointerDown;
|
|
131
|
+
/**
|
|
132
|
+
* Handles pointer move events on the color area during drag
|
|
133
|
+
* Updates color based on pointer position
|
|
134
|
+
* @param event Pointer event
|
|
135
|
+
*/
|
|
136
|
+
private _handleColorAreaPointerMove;
|
|
137
|
+
/**
|
|
138
|
+
* Handles pointer up events on the color area
|
|
139
|
+
* Ends drag interaction and emits change event
|
|
140
|
+
* @param event Pointer event
|
|
141
|
+
*/
|
|
142
|
+
private _handleColorAreaPointerUp;
|
|
143
|
+
/**
|
|
144
|
+
* Updates color saturation and value based on pointer position in color area
|
|
145
|
+
* @param event Pointer event with clientX/clientY coordinates
|
|
146
|
+
*/
|
|
147
|
+
private _updateColorFromPointer;
|
|
148
|
+
/**
|
|
149
|
+
* Handles keyboard navigation on the color area
|
|
150
|
+
* Arrow keys adjust saturation/value, Shift increases step size
|
|
151
|
+
* @param event Keyboard event
|
|
152
|
+
*/
|
|
153
|
+
private _handleColorAreaKeydown;
|
|
154
|
+
/**
|
|
155
|
+
* Handles pointer down events on the hue slider
|
|
156
|
+
* Starts hue drag interaction
|
|
157
|
+
* @param event Pointer event
|
|
158
|
+
*/
|
|
159
|
+
private _handleHuePointerDown;
|
|
160
|
+
/**
|
|
161
|
+
* Handles pointer move events on the hue slider during drag
|
|
162
|
+
* Updates hue based on pointer position
|
|
163
|
+
* @param event Pointer event
|
|
164
|
+
*/
|
|
165
|
+
private _handleHuePointerMove;
|
|
166
|
+
/**
|
|
167
|
+
* Handles pointer up events on the hue slider
|
|
168
|
+
* Ends drag interaction and emits change event
|
|
169
|
+
* @param event Pointer event
|
|
170
|
+
*/
|
|
171
|
+
private _handleHuePointerUp;
|
|
172
|
+
/**
|
|
173
|
+
* Updates hue based on pointer position in hue slider
|
|
174
|
+
* @param event Pointer event with clientY coordinate
|
|
175
|
+
*/
|
|
176
|
+
private _updateHueFromPointer;
|
|
177
|
+
/**
|
|
178
|
+
* Handles keyboard navigation on the hue slider
|
|
179
|
+
* Arrow keys adjust hue, Shift increases step size
|
|
180
|
+
* @param event Keyboard event
|
|
181
|
+
*/
|
|
182
|
+
private _handleHueKeydown;
|
|
183
|
+
/**
|
|
184
|
+
* Handles pointer down events on the alpha slider
|
|
185
|
+
* Starts alpha drag interaction
|
|
186
|
+
* @param event Pointer event
|
|
187
|
+
*/
|
|
188
|
+
private _handleAlphaPointerDown;
|
|
189
|
+
/**
|
|
190
|
+
* Handles pointer move events on the alpha slider during drag
|
|
191
|
+
* Updates alpha based on pointer position
|
|
192
|
+
* @param event Pointer event
|
|
193
|
+
*/
|
|
194
|
+
private _handleAlphaPointerMove;
|
|
195
|
+
/**
|
|
196
|
+
* Handles pointer up events on the alpha slider
|
|
197
|
+
* Ends drag interaction and emits change event
|
|
198
|
+
* @param event Pointer event
|
|
199
|
+
*/
|
|
200
|
+
private _handleAlphaPointerUp;
|
|
201
|
+
/**
|
|
202
|
+
* Updates alpha based on pointer position in alpha slider
|
|
203
|
+
* @param event Pointer event with clientX coordinate
|
|
204
|
+
*/
|
|
205
|
+
private _updateAlphaFromPointer;
|
|
206
|
+
/**
|
|
207
|
+
* Handles keyboard navigation on the alpha slider
|
|
208
|
+
* Arrow keys adjust alpha, Shift increases step size
|
|
209
|
+
* @param event Keyboard event
|
|
210
|
+
*/
|
|
211
|
+
private _handleAlphaKeydown;
|
|
212
|
+
/**
|
|
213
|
+
* Handles input events on the hex input field
|
|
214
|
+
* Updates controlled input value
|
|
215
|
+
* @param event Input event
|
|
216
|
+
*/
|
|
217
|
+
private _handleHexInput;
|
|
218
|
+
/**
|
|
219
|
+
* Handles change events on the hex input field
|
|
220
|
+
* Parses and applies hex color value, adds # prefix if missing
|
|
221
|
+
* @param event Change event
|
|
222
|
+
*/
|
|
223
|
+
private _handleHexChange;
|
|
224
|
+
/**
|
|
225
|
+
* Handles input events on RGB channel inputs
|
|
226
|
+
* Updates color based on red, green, or blue channel value
|
|
227
|
+
* @param channel RGB channel to update ('r', 'g', or 'b')
|
|
228
|
+
* @param event Input event
|
|
229
|
+
*/
|
|
230
|
+
private _handleRgbInput;
|
|
231
|
+
/**
|
|
232
|
+
* Handles change events on RGB inputs
|
|
233
|
+
* Emits bp-change event
|
|
234
|
+
*/
|
|
235
|
+
private _handleRgbChange;
|
|
236
|
+
/**
|
|
237
|
+
* Handles input events on HSL channel inputs
|
|
238
|
+
* Updates color based on hue, saturation, or lightness value
|
|
239
|
+
* @param channel HSL channel to update ('h', 's', or 'l')
|
|
240
|
+
* @param event Input event
|
|
241
|
+
*/
|
|
242
|
+
private _handleHslInput;
|
|
243
|
+
/**
|
|
244
|
+
* Handles change events on HSL inputs
|
|
245
|
+
* Emits bp-change event
|
|
246
|
+
*/
|
|
247
|
+
private _handleHslChange;
|
|
248
|
+
/**
|
|
249
|
+
* Handles input events on the alpha percentage input
|
|
250
|
+
* Updates alpha channel (0-100%)
|
|
251
|
+
* @param event Input event
|
|
252
|
+
*/
|
|
253
|
+
private _handleAlphaInput;
|
|
254
|
+
/**
|
|
255
|
+
* Handles change events on alpha input
|
|
256
|
+
* Emits bp-change event
|
|
257
|
+
*/
|
|
258
|
+
private _handleAlphaInputChange;
|
|
259
|
+
/**
|
|
260
|
+
* Handles format toggle button click
|
|
261
|
+
* Cycles through hex → rgb → hsl input modes
|
|
262
|
+
*/
|
|
263
|
+
private _handleFormatToggle;
|
|
264
|
+
/**
|
|
265
|
+
* Handles click events on predefined color swatches
|
|
266
|
+
* Updates color to the swatch value
|
|
267
|
+
* @param color Color string to apply
|
|
268
|
+
*/
|
|
269
|
+
private _handleSwatchClick;
|
|
270
|
+
/**
|
|
271
|
+
* Handles keyboard events on swatch elements
|
|
272
|
+
* Activates swatch on Enter or Space key
|
|
273
|
+
* @param color Color string to apply
|
|
274
|
+
* @param event Keyboard event
|
|
275
|
+
*/
|
|
276
|
+
private _handleSwatchKeydown;
|
|
277
|
+
/**
|
|
278
|
+
* Handles eyedropper button click
|
|
279
|
+
* Opens native EyeDropper API to pick color from screen
|
|
280
|
+
* Only available in browsers that support the EyeDropper API
|
|
281
|
+
*/
|
|
282
|
+
private _handleEyedropper;
|
|
283
|
+
/**
|
|
284
|
+
* Emits bp-input event with current formatted color value
|
|
285
|
+
* Fired during live color updates (dragging, typing)
|
|
286
|
+
*/
|
|
287
|
+
private _emitInput;
|
|
288
|
+
/**
|
|
289
|
+
* Emits bp-change event and updates the value property
|
|
290
|
+
* Fired on blur/confirm actions (drag end, input blur)
|
|
291
|
+
*/
|
|
292
|
+
private _emitChange;
|
|
293
|
+
/**
|
|
294
|
+
* Renders the 2D color area for saturation and value selection
|
|
295
|
+
* @returns TemplateResult for color area with draggable handle
|
|
296
|
+
*/
|
|
297
|
+
private _renderColorArea;
|
|
298
|
+
/**
|
|
299
|
+
* Renders the vertical hue slider (0-360 degrees)
|
|
300
|
+
* @returns TemplateResult for hue slider with draggable handle
|
|
301
|
+
*/
|
|
302
|
+
private _renderHueSlider;
|
|
303
|
+
/**
|
|
304
|
+
* Renders the horizontal alpha slider (0-100%)
|
|
305
|
+
* Only shown when alpha property is true
|
|
306
|
+
* @returns TemplateResult for alpha slider or nothing
|
|
307
|
+
*/
|
|
308
|
+
private _renderAlphaSlider;
|
|
309
|
+
/**
|
|
310
|
+
* Renders the color preview showing original and current colors
|
|
311
|
+
* Displays side-by-side comparison with checkerboard background for transparency
|
|
312
|
+
* @returns TemplateResult for preview swatches
|
|
313
|
+
*/
|
|
314
|
+
private _renderPreview;
|
|
315
|
+
/**
|
|
316
|
+
* Renders the hex color input field
|
|
317
|
+
* @returns TemplateResult for hex input group
|
|
318
|
+
*/
|
|
319
|
+
private _renderHexInput;
|
|
320
|
+
/**
|
|
321
|
+
* Renders RGB color input fields (R, G, B, and optionally A)
|
|
322
|
+
* @returns TemplateResult for RGB input row
|
|
323
|
+
*/
|
|
324
|
+
private _renderRgbInputs;
|
|
325
|
+
/**
|
|
326
|
+
* Renders HSL color input fields (H, S, L, and optionally A)
|
|
327
|
+
* @returns TemplateResult for HSL input row
|
|
328
|
+
*/
|
|
329
|
+
private _renderHslInputs;
|
|
330
|
+
/**
|
|
331
|
+
* Renders the input controls container with format toggle button
|
|
332
|
+
* Shows hex, rgb, or hsl inputs based on current input mode
|
|
333
|
+
* @returns TemplateResult for inputs container
|
|
334
|
+
*/
|
|
335
|
+
private _renderInputs;
|
|
336
|
+
/**
|
|
337
|
+
* Renders predefined color swatches
|
|
338
|
+
* Shows swatches from the swatches property or slotted content
|
|
339
|
+
* @returns TemplateResult for swatches container or nothing
|
|
340
|
+
*/
|
|
341
|
+
private _renderSwatches;
|
|
342
|
+
/**
|
|
343
|
+
* Renders the eyedropper button if API is supported
|
|
344
|
+
* @returns TemplateResult for eyedropper button or nothing
|
|
345
|
+
*/
|
|
346
|
+
private _renderEyedropper;
|
|
347
|
+
/**
|
|
348
|
+
* Renders the complete color picker panel
|
|
349
|
+
* Includes color area, sliders, preview, inputs, and swatches
|
|
350
|
+
* @returns TemplateResult for picker panel
|
|
351
|
+
*/
|
|
352
|
+
private _renderPicker;
|
|
353
|
+
/**
|
|
354
|
+
* Renders the trigger button to open the picker popover
|
|
355
|
+
* Shows current color swatch and optional label
|
|
356
|
+
* @returns TemplateResult for trigger button
|
|
357
|
+
*/
|
|
358
|
+
private _renderTrigger;
|
|
359
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
360
|
+
}
|
|
361
|
+
declare global {
|
|
362
|
+
interface HTMLElementTagNameMap {
|
|
363
|
+
'bp-color-picker': BpColorPicker;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=color-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../source/components/color-picker/color-picker.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Picker Styles
|
|
3
|
+
*
|
|
4
|
+
* INTENTIONAL HARDCODED VALUES (functional, not themed):
|
|
5
|
+
* - Checkerboard pattern (#ccc) - standard transparency visualization
|
|
6
|
+
* - Hue gradient (hsl spectrum) - must be actual hue colors
|
|
7
|
+
* - White (#fff) handles - must contrast on any color background
|
|
8
|
+
* - Black (#000) gradient - value gradient for color area
|
|
9
|
+
* - Component dimensions (280px, 160px) - not semantic spacing
|
|
10
|
+
*
|
|
11
|
+
* All other values use design tokens.
|
|
12
|
+
*/
|
|
13
|
+
export declare const colorPickerStyles: import("lit").CSSResult;
|
|
14
|
+
//# sourceMappingURL=color-picker.style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.style.d.ts","sourceRoot":"","sources":["../../../source/components/color-picker/color-picker.style.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,yBAwlB7B,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Picker Utilities
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for color parsing, conversion, and formatting.
|
|
5
|
+
* Supports HEX, RGB, HSL formats with alpha channel.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Internal HSV color representation
|
|
9
|
+
*/
|
|
10
|
+
export interface HSVColor {
|
|
11
|
+
h: number;
|
|
12
|
+
s: number;
|
|
13
|
+
v: number;
|
|
14
|
+
a: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* RGB color representation
|
|
18
|
+
*/
|
|
19
|
+
export interface RGBColor {
|
|
20
|
+
r: number;
|
|
21
|
+
g: number;
|
|
22
|
+
b: number;
|
|
23
|
+
a: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* HSL color representation
|
|
27
|
+
*/
|
|
28
|
+
export interface HSLColor {
|
|
29
|
+
h: number;
|
|
30
|
+
s: number;
|
|
31
|
+
l: number;
|
|
32
|
+
a: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Color output format
|
|
36
|
+
*/
|
|
37
|
+
export type ColorFormat = 'hex' | 'rgb' | 'hsl';
|
|
38
|
+
/**
|
|
39
|
+
* Parses a color string and returns HSV representation
|
|
40
|
+
* @param value Color string in hex, rgb, or hsl format
|
|
41
|
+
* @returns HSV color object or null if parsing fails
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseColor(value: string): HSVColor | null;
|
|
44
|
+
/**
|
|
45
|
+
* Parses a hex color string to HSV
|
|
46
|
+
* @param hex Hex color string (with or without #, 3/4/6/8 digits)
|
|
47
|
+
* @returns HSV color object or null if invalid
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseHex(hex: string): HSVColor | null;
|
|
50
|
+
/**
|
|
51
|
+
* Parses an rgb/rgba color string to HSV
|
|
52
|
+
* @param rgb RGB color string (e.g., 'rgb(255, 87, 51)' or 'rgba(255, 87, 51, 0.5)')
|
|
53
|
+
* @returns HSV color object or null if invalid
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseRgb(rgb: string): HSVColor | null;
|
|
56
|
+
/**
|
|
57
|
+
* Parses an hsl/hsla color string to HSV
|
|
58
|
+
* @param hsl HSL color string (e.g., 'hsl(14, 100%, 60%)' or 'hsla(14, 100%, 60%, 0.5)')
|
|
59
|
+
* @returns HSV color object or null if invalid
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseHsl(hsl: string): HSVColor | null;
|
|
62
|
+
/**
|
|
63
|
+
* Converts RGB color to HSV color space
|
|
64
|
+
* @param rgb RGB color object with r, g, b (0-255) and a (0-1)
|
|
65
|
+
* @returns HSV color object with h (0-360), s (0-100), v (0-100), a (0-1)
|
|
66
|
+
*/
|
|
67
|
+
export declare function rgbToHsv(rgb: RGBColor): HSVColor;
|
|
68
|
+
/**
|
|
69
|
+
* Converts HSV color to RGB color space
|
|
70
|
+
* @param hsv HSV color object with h (0-360), s (0-100), v (0-100), a (0-1)
|
|
71
|
+
* @returns RGB color object with r, g, b (0-255) and a (0-1)
|
|
72
|
+
*/
|
|
73
|
+
export declare function hsvToRgb(hsv: HSVColor): RGBColor;
|
|
74
|
+
/**
|
|
75
|
+
* Converts HSL color to HSV color space
|
|
76
|
+
* @param hsl HSL color object with h (0-360), s (0-100), l (0-100), a (0-1)
|
|
77
|
+
* @returns HSV color object with h (0-360), s (0-100), v (0-100), a (0-1)
|
|
78
|
+
*/
|
|
79
|
+
export declare function hslToHsv(hsl: HSLColor): HSVColor;
|
|
80
|
+
/**
|
|
81
|
+
* Converts HSV color to HSL color space
|
|
82
|
+
* @param hsv HSV color object with h (0-360), s (0-100), v (0-100), a (0-1)
|
|
83
|
+
* @returns HSL color object with h (0-360), s (0-100), l (0-100), a (0-1)
|
|
84
|
+
*/
|
|
85
|
+
export declare function hsvToHsl(hsv: HSVColor): HSLColor;
|
|
86
|
+
/**
|
|
87
|
+
* Rounds alpha value to 2 decimal places
|
|
88
|
+
* @param a Alpha value (0-1)
|
|
89
|
+
* @returns Rounded alpha value
|
|
90
|
+
*/
|
|
91
|
+
export declare function roundAlpha(a: number): number;
|
|
92
|
+
/**
|
|
93
|
+
* Formats an HSV color to the specified output format
|
|
94
|
+
* @param hsv HSV color object
|
|
95
|
+
* @param format Output format (hex, rgb, or hsl)
|
|
96
|
+
* @param includeAlpha Whether to include alpha channel in output
|
|
97
|
+
* @returns Formatted color string
|
|
98
|
+
*/
|
|
99
|
+
export declare function formatColorOutput(hsv: HSVColor, format: ColorFormat, includeAlpha: boolean): string;
|
|
100
|
+
//# sourceMappingURL=color-picker.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.utils.d.ts","sourceRoot":"","sources":["../../../source/components/color-picker/color-picker.utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAqBzD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAmCrD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAYrD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAYrD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CA0BhD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CA6ChD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAShD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAShD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,OAAO,GACpB,MAAM,CA+BR"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export type ComboboxSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type ComboboxVariant = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
4
|
+
export interface ComboboxOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class BpCombobox extends LitElement {
|
|
9
|
+
/** The current value of the combobox */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Name attribute for form submission */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Placeholder text when no value is selected */
|
|
14
|
+
placeholder: string;
|
|
15
|
+
/** Whether the combobox is disabled */
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
/** Whether the combobox is required */
|
|
18
|
+
required: boolean;
|
|
19
|
+
/** Size variant of the combobox */
|
|
20
|
+
size: ComboboxSize;
|
|
21
|
+
/** Visual variant for validation states */
|
|
22
|
+
variant: ComboboxVariant;
|
|
23
|
+
/** Whether to allow free-form input (not just from the options list) */
|
|
24
|
+
allowCustomValue: boolean;
|
|
25
|
+
/** Whether the dropdown is currently open */
|
|
26
|
+
private isOpen;
|
|
27
|
+
/** Current search/filter text */
|
|
28
|
+
private searchText;
|
|
29
|
+
/** Index of the focused option for keyboard navigation */
|
|
30
|
+
private focusedIndex;
|
|
31
|
+
/** Cached filtered options to avoid recomputation on every render */
|
|
32
|
+
private cachedFilteredOptions;
|
|
33
|
+
/** Cached options from slotted elements */
|
|
34
|
+
private cachedOptions;
|
|
35
|
+
/** Reference to the input element */
|
|
36
|
+
private inputElement;
|
|
37
|
+
/** Debounced filter computation for search input */
|
|
38
|
+
private debouncedFilter;
|
|
39
|
+
/**
|
|
40
|
+
* Memoized filter computation.
|
|
41
|
+
* Returns cached result when options array and searchText are the same references.
|
|
42
|
+
*/
|
|
43
|
+
private filterOptions;
|
|
44
|
+
static styles: import("lit").CSSResult[];
|
|
45
|
+
constructor();
|
|
46
|
+
connectedCallback(): void;
|
|
47
|
+
disconnectedCallback(): void;
|
|
48
|
+
private updateSearchText;
|
|
49
|
+
private handleDocumentClick;
|
|
50
|
+
private closeDropdown;
|
|
51
|
+
private getOptions;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the cached filtered options for rendering and keyboard navigation.
|
|
54
|
+
*/
|
|
55
|
+
private getFilteredOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Handle slot changes by refreshing the cached options.
|
|
58
|
+
*/
|
|
59
|
+
private handleSlotChange;
|
|
60
|
+
private handleInputFocus;
|
|
61
|
+
private handleInputClick;
|
|
62
|
+
private handleInputChange;
|
|
63
|
+
private handleOptionClick;
|
|
64
|
+
private handleInputKeyDown;
|
|
65
|
+
private handleClear;
|
|
66
|
+
private renderDropdown;
|
|
67
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
68
|
+
}
|
|
69
|
+
declare global {
|
|
70
|
+
interface HTMLElementTagNameMap {
|
|
71
|
+
'bp-combobox': BpCombobox;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../source/components/combobox/combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAQhD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBACa,UAAW,SAAQ,UAAU;IACxC,wCAAwC;IACW,KAAK,EAAE,MAAM,CAAC;IAEjE,yCAAyC;IACL,IAAI,EAAE,MAAM,CAAC;IAEjD,iDAAiD;IACb,WAAW,EAAE,MAAM,CAAC;IAExD,uCAAuC;IACa,QAAQ,EAAE,OAAO,CAAC;IAEtE,uCAAuC;IACa,QAAQ,EAAE,OAAO,CAAC;IAEtE,mCAAmC;IACgB,IAAI,EAAE,YAAY,CAAC;IAEtE,2CAA2C;IACQ,OAAO,EAAE,eAAe,CAAC;IAE5E,wEAAwE;IACnC,gBAAgB,EAAE,OAAO,CAAC;IAE/D,6CAA6C;IACpC,OAAO,CAAC,MAAM,CAAS;IAEhC,iCAAiC;IACxB,OAAO,CAAC,UAAU,CAAM;IAEjC,0DAA0D;IACjD,OAAO,CAAC,YAAY,CAAM;IAEnC,qEAAqE;IAC5D,OAAO,CAAC,qBAAqB,CAAwB;IAE9D,2CAA2C;IAClC,OAAO,CAAC,aAAa,CAAwB;IAEtD,qCAAqC;IACR,OAAO,CAAC,YAAY,CAAoB;IAErE,oDAAoD;IACpD,OAAO,CAAC,eAAe,CAKf;IAER;;;OAGG;IACH,OAAO,CAAC,aAAa,CAWnB;IAEF,MAAM,CAAC,MAAM,4BAAoB;;IAcjC,iBAAiB;IAgBjB,oBAAoB;IAQpB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,mBAAmB,CAIzB;IAEF,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,UAAU;IAalB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAMtB;IAEF,OAAO,CAAC,gBAAgB,CAItB;IAEF,OAAO,CAAC,gBAAgB,CAItB;IAEF,OAAO,CAAC,iBAAiB,CAyBvB;IAEF,OAAO,CAAC,iBAAiB,CAmCvB;IAEF,OAAO,CAAC,kBAAkB,CAmDxB;IAEF,OAAO,CAAC,WAAW,CAyBjB;IAEF,OAAO,CAAC,cAAc;IAyCtB,MAAM;CAwEP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.style.d.ts","sourceRoot":"","sources":["../../../source/components/combobox/combobox.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBAyR1B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export type DatePickerSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
/**
|
|
4
|
+
* A calendar-based date picker component.
|
|
5
|
+
*
|
|
6
|
+
* @element bp-date-picker
|
|
7
|
+
*
|
|
8
|
+
* @fires bp-change - Fired when the selected date changes
|
|
9
|
+
*
|
|
10
|
+
* @csspart control - The outer container
|
|
11
|
+
* @csspart input - The text input field
|
|
12
|
+
* @csspart indicator - The calendar icon
|
|
13
|
+
* @csspart clear-button - The clear button
|
|
14
|
+
* @csspart calendar - The calendar dropdown
|
|
15
|
+
* @csspart header - The calendar header with navigation
|
|
16
|
+
* @csspart nav-button - Month/year navigation buttons
|
|
17
|
+
* @csspart month-year - Month and year display
|
|
18
|
+
* @csspart weekday - Day of week header cell
|
|
19
|
+
* @csspart day - Individual day cell
|
|
20
|
+
*/
|
|
21
|
+
export declare class BpDatePicker extends LitElement {
|
|
22
|
+
value: string;
|
|
23
|
+
name: string;
|
|
24
|
+
label: string;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
size: DatePickerSize;
|
|
29
|
+
min: string;
|
|
30
|
+
max: string;
|
|
31
|
+
firstDayOfWeek: '0' | '1';
|
|
32
|
+
private isOpen;
|
|
33
|
+
private displayMonth;
|
|
34
|
+
private displayYear;
|
|
35
|
+
private focusedDate;
|
|
36
|
+
static styles: import("lit").CSSResult[];
|
|
37
|
+
constructor();
|
|
38
|
+
private handleInputClick;
|
|
39
|
+
private handlePreviousMonth;
|
|
40
|
+
private handleNextMonth;
|
|
41
|
+
private handleDateSelect;
|
|
42
|
+
private handleClear;
|
|
43
|
+
private handleKeyDown;
|
|
44
|
+
private updateDisplayMonth;
|
|
45
|
+
private addDays;
|
|
46
|
+
private addMonths;
|
|
47
|
+
private formatDate;
|
|
48
|
+
private parseDate;
|
|
49
|
+
private getSelectedDate;
|
|
50
|
+
private getTodayDate;
|
|
51
|
+
private isSameDay;
|
|
52
|
+
private isDateDisabled;
|
|
53
|
+
private getCalendarDays;
|
|
54
|
+
checkValidity(): boolean;
|
|
55
|
+
private getWeekdayNames;
|
|
56
|
+
private getMonthName;
|
|
57
|
+
private getFormattedValue;
|
|
58
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
59
|
+
}
|
|
60
|
+
declare global {
|
|
61
|
+
interface HTMLElementTagNameMap {
|
|
62
|
+
'bp-date-picker': BpDatePicker;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../source/components/date-picker/date-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,YAAa,SAAQ,UAAU;IACS,KAAK,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACJ,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAExC,cAAc,EAAE,GAAG,GAAG,GAAG,CAAC;IAEzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAAqB;IAEjD,MAAM,CAAC,MAAM,4BAAsB;;IAgBnC,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,aAAa;IA+FrB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,SAAS;IAyBjB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,eAAe;IA+BhB,aAAa,IAAI,OAAO;IAe/B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,iBAAiB;IAMzB,MAAM;CAgKP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.style.d.ts","sourceRoot":"","sources":["../../../source/components/date-picker/date-picker.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,yBAuV5B,CAAC"}
|