@tempots/beatui 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-Wr6gMs-M.cjs +1 -0
- package/dist/{ar-C-kUt6f9.js → ar-fdUqbCvM.js} +154 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-DewHpITQ.cjs +1 -0
- package/dist/{auth-divider-BIATan1F.js → auth-divider-qnJuYK-x.js} +7 -7
- package/dist/beatui.css +1711 -132
- package/dist/beatui.tailwind.css +1711 -132
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/{modal-BHlp4QeT.js → custom-validation-BetUqAEz.js} +186 -186
- package/dist/custom-validation-CLscGHY4.cjs +1 -0
- package/dist/{de-CP0kbElb.js → de-C5-k5Eov.js} +156 -3
- package/dist/de-DZqdSEta.cjs +1 -0
- package/dist/deep-merge-D90SW1Ci.cjs +1 -0
- package/dist/deep-merge-ZVigk5Qf.js +1765 -0
- package/dist/{duration-input-C5il_E0F.cjs → duration-input-4AQnQpyo.cjs} +1 -1
- package/dist/{duration-input-DoCCrqOG.js → duration-input-GMBmT1BE.js} +4 -4
- package/dist/{editor-toolbar-group-QVdBUbB8.cjs → editor-toolbar-group-C_ft_T8D.cjs} +1 -1
- package/dist/{editor-toolbar-group-DWUWUO-B.js → editor-toolbar-group-FpOHrmtx.js} +2 -2
- package/dist/es-CJgYfRap.cjs +1 -0
- package/dist/{es-BtIkcnsw.js → es-h6jmoF4X.js} +156 -3
- package/dist/fa-BQ5PzwNY.cjs +1 -0
- package/dist/{fa-11-rZmQ-.js → fa-BuxK837l.js} +154 -1
- package/dist/fr-Bv3TG44U.cjs +1 -0
- package/dist/{fr-C-L2F8w2.js → fr-BwILQ9G2.js} +165 -12
- package/dist/he-5LbvgMCC.cjs +1 -0
- package/dist/{he-Bu1xGoQ9.js → he-yC9Sc7JD.js} +154 -1
- package/dist/{hi-CewH-MAH.js → hi-Da7rcCpP.js} +154 -1
- package/dist/hi-YWhWcG_L.cjs +1 -0
- package/dist/{index-BGKz2Nol.js → index-DI8bf9oC.js} +175 -172
- package/dist/index-DeUj-5ph.cjs +1 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +11548 -8326
- package/dist/{input-container-CO3DNqpp.js → input-container-8JFB11xN.js} +1 -1
- package/dist/{input-container-BkPcNDaZ.cjs → input-container-CyOgiiQD.cjs} +1 -1
- package/dist/it-BxOIJE45.cjs +1 -0
- package/dist/{it-5hiKQO_p.js → it-Yeklau78.js} +156 -3
- package/dist/ja-CNhjK06P.cjs +1 -0
- package/dist/{ja-CGfEmZrm.js → ja-Dxj9Q5Yd.js} +155 -2
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +10 -10
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/ko-DgkqcXTs.cjs +1 -0
- package/dist/{ko-DZthvREd.js → ko-gn_MsegK.js} +154 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +4 -4
- package/dist/nl-Dy9lmbBO.cjs +1 -0
- package/dist/{nl-CcKyHlQ7.js → nl-vHNFtXXb.js} +162 -9
- package/dist/{notice-BXKtBEiC.js → notice-B6ojfenv.js} +4 -4
- package/dist/{notice-BBnSXYUc.cjs → notice-p2IqXS5-.cjs} +1 -1
- package/dist/{oneof-branch-detection-DSzC0PkO.js → oneof-branch-detection-Q_jxvJIA.js} +1 -1
- package/dist/{oneof-branch-detection-BEkAezNi.cjs → oneof-branch-detection-xDDDdYRk.cjs} +1 -1
- package/dist/pl-BtYbtsmG.cjs +1 -0
- package/dist/{pl-Mwtjp4MV.js → pl-C0UdHla0.js} +184 -31
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/pt-CtNmqQ1X.cjs +1 -0
- package/dist/{pt-BaTsY-8f.js → pt-DGKtfN0d.js} +156 -3
- package/dist/ru-BaL_NPRU.cjs +1 -0
- package/dist/{ru-CvbGmz5s.js → ru-CpXYLt-v.js} +154 -1
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +1 -1
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/{text-input-D_IxFd0M.cjs → text-input-DS5zlXb2.cjs} +1 -1
- package/dist/{text-input-BAn02BzO.js → text-input-NJypZSnE.js} +1 -1
- package/dist/{toolbar-CnecqhaU.cjs → toolbar-BBwfe8U9.cjs} +1 -1
- package/dist/{toolbar-BKan3NHw.js → toolbar-BF2L6WKC.js} +1 -1
- package/dist/{tr-YFqQdZjM.js → tr-DIFZDFW_.js} +156 -3
- package/dist/tr-DwOd87oB.cjs +1 -0
- package/dist/{translations-CxDUnbXn.js → translations-5cXBrENb.js} +1 -1
- package/dist/{translations-DT5QQ4WO.js → translations-BCMP-h52.js} +269 -115
- package/dist/{translations-C_-cObaF.cjs → translations-BqWc0ZHz.cjs} +1 -1
- package/dist/translations-EwEmHe3v.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +109 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +109 -0
- package/dist/types/beatui-i18n/translations.d.ts +109 -0
- package/dist/types/components/button/copy-button.d.ts +42 -0
- package/dist/types/components/button/index.d.ts +1 -0
- package/dist/types/components/button/toggle-button-group.d.ts +2 -2
- package/dist/types/components/button/toggle-button.d.ts +2 -2
- package/dist/types/components/data/date-picker-shared.d.ts +2 -5
- package/dist/types/components/data/date-picker.d.ts +1 -1
- package/dist/types/components/data/date-range-picker.d.ts +1 -1
- package/dist/types/components/data/index.d.ts +3 -0
- package/dist/types/components/data/stat-card.d.ts +108 -0
- package/dist/types/components/data/time-picker.d.ts +54 -0
- package/dist/types/components/data/virtual-scrolling/index.d.ts +1 -0
- package/dist/types/components/data/virtual-scrolling/virtual-list.d.ts +91 -0
- package/dist/types/components/form/input/checkbox-input.d.ts +1 -1
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-picker/canvas-draw.d.ts +12 -0
- package/dist/types/components/form/input/color-picker/channel-picker.d.ts +71 -0
- package/dist/types/components/form/input/color-picker/hex-color-picker.d.ts +20 -0
- package/dist/types/components/form/input/color-picker/hsl-color-picker.d.ts +14 -0
- package/dist/types/components/form/input/color-picker/hwb-color-picker.d.ts +15 -0
- package/dist/types/components/form/input/color-picker/index.d.ts +7 -0
- package/dist/types/components/form/input/color-picker/oklch-color-picker.d.ts +15 -0
- package/dist/types/components/form/input/color-picker/rgb-color-picker.d.ts +17 -0
- package/dist/types/components/form/input/color-swatch-input.d.ts +1 -1
- package/dist/types/components/form/input/combobox-input.d.ts +1 -1
- package/dist/types/components/form/input/date-input.d.ts +1 -1
- package/dist/types/components/form/input/date-range-select-base.d.ts +23 -0
- package/dist/types/components/form/input/date-range-select.d.ts +64 -0
- package/dist/types/components/form/input/date-select.d.ts +52 -0
- package/dist/types/components/form/input/date-time-input.d.ts +1 -1
- package/dist/types/components/form/input/date-time-select-base.d.ts +23 -0
- package/dist/types/components/form/input/date-time-select.d.ts +66 -0
- package/dist/types/components/form/input/dropdown-input.d.ts +1 -1
- package/dist/types/components/form/input/email-input.d.ts +1 -1
- package/dist/types/components/form/input/index.d.ts +17 -0
- package/dist/types/components/form/input/nullable-date-select.d.ts +55 -0
- package/dist/types/components/form/input/nullable-date-time-select.d.ts +68 -0
- package/dist/types/components/form/input/nullable-time-select.d.ts +64 -0
- package/dist/types/components/form/input/number-input.d.ts +5 -40
- package/dist/types/components/form/input/number-stepper.d.ts +53 -0
- package/dist/types/components/form/input/open-date-range-select.d.ts +75 -0
- package/dist/types/components/form/input/otp-input.d.ts +2 -2
- package/dist/types/components/form/input/password-input.d.ts +1 -1
- package/dist/types/components/form/input/radio-group.d.ts +1 -1
- package/dist/types/components/form/input/range-slider.d.ts +4 -4
- package/dist/types/components/form/input/rating-input.d.ts +1 -1
- package/dist/types/components/form/input/segmented-input.d.ts +6 -2
- package/dist/types/components/form/input/segmented-select.d.ts +84 -0
- package/dist/types/components/form/input/slider-input.d.ts +2 -2
- package/dist/types/components/form/input/sortable-list.d.ts +68 -0
- package/dist/types/components/form/input/switch.d.ts +1 -1
- package/dist/types/components/form/input/text-area.d.ts +1 -1
- package/dist/types/components/form/input/text-input.d.ts +1 -1
- package/dist/types/components/form/input/time-format.d.ts +31 -0
- package/dist/types/components/form/input/time-select-base.d.ts +23 -0
- package/dist/types/components/form/input/time-select.d.ts +61 -0
- package/dist/types/components/form/input/transfer-list.d.ts +56 -0
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +1 -1
- package/dist/types/components/form/input/url-input.d.ts +1 -1
- package/dist/types/components/layout/nine-slice-scroll-view.d.ts +1 -1
- package/dist/types/components/navigation/index.d.ts +1 -0
- package/dist/types/components/navigation/stepper.d.ts +102 -0
- package/dist/types/components/overlay/index.d.ts +1 -1
- package/dist/types/components/overlay/spotlight.d.ts +62 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/ur-D9nLchps.cjs +1 -0
- package/dist/{ur-CdnwwnG_.js → ur-DBst-TXc.js} +154 -1
- package/dist/{use-form-CP6nftVl.cjs → use-form-Dcra7GeE.cjs} +1 -1
- package/dist/{use-form-CmQdxpOi.js → use-form-NfobsGNl.js} +2 -2
- package/dist/{vi-Bwvz1d_n.js → vi-DQOJp32U.js} +183 -30
- package/dist/vi-Dg1aiMr5.cjs +1 -0
- package/dist/widget-customization-BtkexHgm.js +1458 -0
- package/dist/widget-customization-pqmtsraC.cjs +1 -0
- package/dist/{zh-hy7Uw6c5.js → zh-DPK4HXl2.js} +154 -1
- package/dist/zh-tbwSTbmn.cjs +1 -0
- package/package.json +9 -9
- package/dist/ar-Dc56zcjW.cjs +0 -1
- package/dist/auth-divider-CVKfA8Cp.cjs +0 -1
- package/dist/de-DboQlEC4.cjs +0 -1
- package/dist/deep-merge-B33Qtlmw.cjs +0 -1
- package/dist/deep-merge-BUsrE2v4.js +0 -1704
- package/dist/es-CAmE_0Ph.cjs +0 -1
- package/dist/fa-D9LrFZdW.cjs +0 -1
- package/dist/fr-DKogQyss.cjs +0 -1
- package/dist/he-CVx91Jdr.cjs +0 -1
- package/dist/hi-BgrHV72l.cjs +0 -1
- package/dist/index-DFF7Uahh.cjs +0 -1
- package/dist/it-B1rA1F9l.cjs +0 -1
- package/dist/ja-DZnjjqoi.cjs +0 -1
- package/dist/ko-CDnYKYWU.cjs +0 -1
- package/dist/modal-BmpfNL48.cjs +0 -1
- package/dist/nl-Bj8QnDEY.cjs +0 -1
- package/dist/pl-BmuuxxVd.cjs +0 -1
- package/dist/pt-RiC0yeVA.cjs +0 -1
- package/dist/ru-pRqtOQHF.cjs +0 -1
- package/dist/tr-B9JhBJeL.cjs +0 -1
- package/dist/translations-qefRsdGi.cjs +0 -1
- package/dist/types/components/overlay/command-palette.d.ts +0 -17
- package/dist/types/utils/color.d.ts +0 -346
- package/dist/ur-BZakU0iv.cjs +0 -1
- package/dist/vi-D1nly0nb.cjs +0 -1
- package/dist/widget-customization-B0y-eesp.cjs +0 -1
- package/dist/widget-customization-CKbR4Dsg.js +0 -1066
- package/dist/zh-DBk7sSD9.cjs +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Value, type Renderable } from '@tempots/dom';
|
|
2
|
+
import { ControlSize } from '../theme';
|
|
3
|
+
import { ThemeColorName } from '../../tokens';
|
|
4
|
+
import type { PlainTime } from '../../temporal/types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link TimePicker} component.
|
|
7
|
+
* Uses Temporal `PlainTime` for time values — no date or timezone concerns.
|
|
8
|
+
*/
|
|
9
|
+
export interface TimePickerOptions {
|
|
10
|
+
/** The currently selected time. */
|
|
11
|
+
value?: Value<PlainTime | null>;
|
|
12
|
+
/** Callback invoked when a time is selected. */
|
|
13
|
+
onSelect?: (time: PlainTime) => void;
|
|
14
|
+
/** Whether to show the seconds column. @default false */
|
|
15
|
+
showSeconds?: Value<boolean>;
|
|
16
|
+
/** Whether the picker uses 12-hour format with AM/PM. When omitted, auto-detected from the current locale. */
|
|
17
|
+
use12Hour?: Value<boolean>;
|
|
18
|
+
/** Theme color for the selected highlight. @default 'primary' */
|
|
19
|
+
color?: Value<ThemeColorName>;
|
|
20
|
+
/** Visual size of the time picker. @default 'md' */
|
|
21
|
+
size?: Value<ControlSize>;
|
|
22
|
+
/** Whether the time picker is disabled. @default false */
|
|
23
|
+
disabled?: Value<boolean>;
|
|
24
|
+
/** Step for minutes column. @default 1 */
|
|
25
|
+
minuteStep?: Value<number>;
|
|
26
|
+
/** Step for seconds column. @default 1 */
|
|
27
|
+
secondStep?: Value<number>;
|
|
28
|
+
/** Whether to show a "Now" button that sets the time to the current local time. @default false */
|
|
29
|
+
showNow?: Value<boolean>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A time picker component for selecting hours, minutes, and optionally seconds.
|
|
33
|
+
*
|
|
34
|
+
* Uses Temporal `PlainTime` internally — a time-only type with no date or
|
|
35
|
+
* timezone concerns. Renders scrollable columns for hours and minutes (and
|
|
36
|
+
* optionally seconds), with support for 12-hour format with AM/PM.
|
|
37
|
+
*
|
|
38
|
+
* @param options - Configuration for the time picker
|
|
39
|
+
* @returns A time picker element with time selection capability
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { prop } from '@tempots/dom'
|
|
44
|
+
* import { TimePicker } from '@tempots/beatui'
|
|
45
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
46
|
+
*
|
|
47
|
+
* const time = prop<PlainTime | null>(Temporal.PlainTime.from('14:30'))
|
|
48
|
+
* TimePicker({
|
|
49
|
+
* value: time,
|
|
50
|
+
* onSelect: v => time.set(v),
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function TimePicker(options?: TimePickerOptions): Renderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './virtual-list';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the {@link VirtualList} component.
|
|
4
|
+
*
|
|
5
|
+
* A virtualized list that renders only visible items for performance with
|
|
6
|
+
* large datasets. Items outside the visible viewport are not rendered in the
|
|
7
|
+
* DOM, dramatically reducing memory usage and rendering time.
|
|
8
|
+
*
|
|
9
|
+
* @typeParam T - The type of items in the list
|
|
10
|
+
*/
|
|
11
|
+
export interface VirtualListOptions<T> {
|
|
12
|
+
/** The array of items to render. May be a static array or a reactive signal. */
|
|
13
|
+
items: Value<T[]>;
|
|
14
|
+
/**
|
|
15
|
+
* A function that renders a single item. Called only for visible items.
|
|
16
|
+
*
|
|
17
|
+
* @param item - The item data
|
|
18
|
+
* @param index - The item's index in the full items array
|
|
19
|
+
* @returns A TNode representing the rendered item
|
|
20
|
+
*/
|
|
21
|
+
renderItem: (item: T, index: number) => TNode;
|
|
22
|
+
/**
|
|
23
|
+
* The height of each item. Can be a fixed number (pixels) for uniform-height
|
|
24
|
+
* lists, or a function that returns the height for a given index for
|
|
25
|
+
* variable-height lists.
|
|
26
|
+
*
|
|
27
|
+
* Fixed heights are more performant as they avoid cumulative height calculations.
|
|
28
|
+
*/
|
|
29
|
+
itemHeight: number | ((index: number) => number);
|
|
30
|
+
/**
|
|
31
|
+
* Number of extra items to render above and below the visible viewport.
|
|
32
|
+
* Larger values reduce the chance of blank flickers during fast scrolling
|
|
33
|
+
* at the cost of rendering more items.
|
|
34
|
+
*
|
|
35
|
+
* @default 5
|
|
36
|
+
*/
|
|
37
|
+
overscan?: Value<number>;
|
|
38
|
+
/**
|
|
39
|
+
* The height of the scroll container. Can be a pixel number (e.g. 400) or
|
|
40
|
+
* a CSS string (e.g. '100%', '50vh').
|
|
41
|
+
*/
|
|
42
|
+
containerHeight: Value<number | string>;
|
|
43
|
+
/** Additional CSS class names to apply to the outer container element. */
|
|
44
|
+
class?: Value<string>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A virtualized list component that renders only visible items for high
|
|
48
|
+
* performance with large datasets (10,000+ items).
|
|
49
|
+
*
|
|
50
|
+
* The component maintains a scroll container with a spacer element sized to
|
|
51
|
+
* the total height of all items. Only items within the visible viewport (plus
|
|
52
|
+
* an overscan buffer) are rendered in the DOM.
|
|
53
|
+
*
|
|
54
|
+
* Supports both fixed-height items (more performant) and variable-height items
|
|
55
|
+
* via a height function.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam T - The type of items in the list
|
|
58
|
+
* @param options - Configuration for the virtual list
|
|
59
|
+
* @returns A scroll container with virtualized item rendering
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* // Fixed-height virtual list with 10,000 items
|
|
64
|
+
* const items = prop(Array.from({ length: 10000 }, (_, i) => ({ id: i, label: `Item ${i}` })))
|
|
65
|
+
*
|
|
66
|
+
* VirtualList({
|
|
67
|
+
* items,
|
|
68
|
+
* itemHeight: 48,
|
|
69
|
+
* containerHeight: 400,
|
|
70
|
+
* renderItem: (item, index) =>
|
|
71
|
+
* html.div(
|
|
72
|
+
* attr.class('flex items-center px-4 border-b'),
|
|
73
|
+
* attr.style('height: 48px'),
|
|
74
|
+
* `${index}: ${item.label}`
|
|
75
|
+
* ),
|
|
76
|
+
* })
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* // Variable-height items
|
|
82
|
+
* VirtualList({
|
|
83
|
+
* items: myItems,
|
|
84
|
+
* itemHeight: index => index % 3 === 0 ? 72 : 48,
|
|
85
|
+
* containerHeight: '100%',
|
|
86
|
+
* overscan: 10,
|
|
87
|
+
* renderItem: (item) => html.div(item.label),
|
|
88
|
+
* })
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function VirtualList<T>({ items, renderItem, itemHeight, overscan: overscanOpt, containerHeight, class: className, }: VirtualListOptions<T>): TNode;
|
|
@@ -35,7 +35,7 @@ export type CheckboxInputOptions = InputOptions<boolean> & {
|
|
|
35
35
|
* const agreed = prop(false)
|
|
36
36
|
* CheckboxInput({
|
|
37
37
|
* value: agreed,
|
|
38
|
-
* onChange: agreed.set,
|
|
38
|
+
* onChange: v => agreed.set(v),
|
|
39
39
|
* placeholder: 'I agree to the terms and conditions',
|
|
40
40
|
* })
|
|
41
41
|
* ```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draw a full hue rainbow strip (0→360) on a canvas.
|
|
3
|
+
*/
|
|
4
|
+
export declare function drawHueCanvas({ ctx, width, height, }: {
|
|
5
|
+
ctx: CanvasRenderingContext2D;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}): void;
|
|
9
|
+
/**
|
|
10
|
+
* Draw a checkerboard pattern (used as background for alpha strips/swatches).
|
|
11
|
+
*/
|
|
12
|
+
export declare function drawCheckerboard(ctx: CanvasRenderingContext2D, width: number, height: number, size?: number): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Renderable, Value, TNode, Signal, Prop } from '@tempots/dom';
|
|
2
|
+
import { Color } from '@tempots/std';
|
|
3
|
+
export interface RenderOptions {
|
|
4
|
+
canvas: HTMLCanvasElement;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
ctx: CanvasRenderingContext2D;
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelPickerOptions {
|
|
10
|
+
/** Current value. */
|
|
11
|
+
value: Value<number>;
|
|
12
|
+
/** Callback on value change. */
|
|
13
|
+
onChange?: (value: number) => void;
|
|
14
|
+
/** Callback on value input. */
|
|
15
|
+
onInput?: (value: number) => void;
|
|
16
|
+
/** Function to draw the strip background. */
|
|
17
|
+
draw: (options: RenderOptions) => void;
|
|
18
|
+
/** Dependencies that trigger a redraw. */
|
|
19
|
+
dependencies?: (Signal<any> | Prop<never>)[];
|
|
20
|
+
/** Min for the number input. */
|
|
21
|
+
min: Value<number>;
|
|
22
|
+
/** Max for the number input. */
|
|
23
|
+
max: Value<number>;
|
|
24
|
+
/** Step for the number input. */
|
|
25
|
+
step?: Value<number>;
|
|
26
|
+
unit?: TNode;
|
|
27
|
+
/** Handle color as CSS string. */
|
|
28
|
+
handleColor?: Value<string>;
|
|
29
|
+
/** Whether disabled. @default false */
|
|
30
|
+
disabled?: Value<boolean>;
|
|
31
|
+
/** Strip height. @default 14 */
|
|
32
|
+
stripHeight?: Value<number>;
|
|
33
|
+
label: Value<string>;
|
|
34
|
+
}
|
|
35
|
+
export declare function ChannelPicker(options: ChannelPickerOptions): Renderable;
|
|
36
|
+
export interface AlphaChannelPickerOptions {
|
|
37
|
+
/** Current value. */
|
|
38
|
+
value: Value<number>;
|
|
39
|
+
/** The color to use for the strip. */
|
|
40
|
+
color: Signal<Color>;
|
|
41
|
+
/** Callback on value change. */
|
|
42
|
+
onChange?: (value: number) => void;
|
|
43
|
+
/** Callback on value input. */
|
|
44
|
+
onInput?: (value: number) => void;
|
|
45
|
+
/** Dependencies that trigger a redraw. */
|
|
46
|
+
dependencies?: (Signal<any> | Prop<never>)[];
|
|
47
|
+
/** Whether disabled. @default false */
|
|
48
|
+
disabled?: Value<boolean>;
|
|
49
|
+
/** Label for the alpha channel. @default 'Alpha' */
|
|
50
|
+
label?: Value<string>;
|
|
51
|
+
}
|
|
52
|
+
export declare function AlphaChannelPicker(options: AlphaChannelPickerOptions): Renderable;
|
|
53
|
+
export interface ColorFieldOptions {
|
|
54
|
+
render: (options: RenderOptions) => void;
|
|
55
|
+
dependencies?: Signal<any>[];
|
|
56
|
+
handlePosition?: Signal<{
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
}>;
|
|
60
|
+
handleColor?: Value<string>;
|
|
61
|
+
disabled?: Value<boolean>;
|
|
62
|
+
onChange?: (value: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
}) => void;
|
|
66
|
+
onInput?: (value: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
}) => void;
|
|
70
|
+
}
|
|
71
|
+
export declare function ColorField(options: ColorFieldOptions): Renderable;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
export interface HexColorPickerOptions {
|
|
3
|
+
/** The current color as a hex string (e.g. '#ff0000', '#ff000080'). */
|
|
4
|
+
value: Value<string>;
|
|
5
|
+
/** Callback with the new hex string. */
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
/** Callback with the new hex string (on input). */
|
|
8
|
+
onInput?: (value: string) => void;
|
|
9
|
+
withAlpha?: Value<boolean>;
|
|
10
|
+
disabled?: Value<boolean>;
|
|
11
|
+
displayColorSwatch?: Value<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Standalone hex color picker with color field, hue channel strip,
|
|
15
|
+
* hex text input, optional alpha, and color swatch preview.
|
|
16
|
+
*
|
|
17
|
+
* Accepts and emits hex strings. Internally converts to RGBA (0-1) for
|
|
18
|
+
* the color field and channel strips.
|
|
19
|
+
*/
|
|
20
|
+
export declare function HexColorPicker(options: HexColorPickerOptions): Renderable;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
import { type HSLA } from '@tempots/std/color';
|
|
3
|
+
export interface HslColorPickerOptions {
|
|
4
|
+
value: Value<HSLA>;
|
|
5
|
+
onChange?: (value: HSLA) => void;
|
|
6
|
+
onInput?: (value: HSLA) => void;
|
|
7
|
+
withAlpha?: Value<boolean>;
|
|
8
|
+
disabled?: Value<boolean>;
|
|
9
|
+
displayColorSwatch?: Value<boolean>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The HSL format input panel.
|
|
13
|
+
*/
|
|
14
|
+
export declare function HslColorPicker(options: HslColorPickerOptions): Renderable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
import { type HWBA } from '@tempots/std/color';
|
|
3
|
+
export interface HwbColorPickerOptions {
|
|
4
|
+
value: Value<HWBA>;
|
|
5
|
+
onChange?: (value: HWBA) => void;
|
|
6
|
+
onInput?: (value: HWBA) => void;
|
|
7
|
+
withAlpha?: Value<boolean>;
|
|
8
|
+
disabled?: Value<boolean>;
|
|
9
|
+
displayColorSwatch?: Value<boolean>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Standalone HWB color picker with color field, H/W/B channel strips,
|
|
13
|
+
* optional alpha, and color swatch preview.
|
|
14
|
+
*/
|
|
15
|
+
export declare function HwbColorPicker(options: HwbColorPickerOptions): Renderable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
import { type OKLCHA } from '@tempots/std/color';
|
|
3
|
+
export interface OklchColorPickerOptions {
|
|
4
|
+
value: Value<OKLCHA>;
|
|
5
|
+
onChange?: (value: OKLCHA) => void;
|
|
6
|
+
onInput?: (value: OKLCHA) => void;
|
|
7
|
+
withAlpha?: Value<boolean>;
|
|
8
|
+
disabled?: Value<boolean>;
|
|
9
|
+
displayColorSwatch?: Value<boolean>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Standalone OKLCH color picker with color field, L/C/H channel strips,
|
|
13
|
+
* optional alpha, and color swatch preview.
|
|
14
|
+
*/
|
|
15
|
+
export declare function OklchColorPicker(options: OklchColorPickerOptions): Renderable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
import { type RGBA } from '@tempots/std/color';
|
|
3
|
+
export interface RgbColorPickerOptions {
|
|
4
|
+
value: Value<RGBA>;
|
|
5
|
+
onChange?: (value: RGBA) => void;
|
|
6
|
+
onInput?: (value: RGBA) => void;
|
|
7
|
+
withAlpha?: Value<boolean>;
|
|
8
|
+
disabled?: Value<boolean>;
|
|
9
|
+
displayColorSwatch?: Value<boolean>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Standalone RGB color picker with color field, R/G/B channel strips,
|
|
13
|
+
* optional alpha, and color swatch preview.
|
|
14
|
+
*
|
|
15
|
+
* RGBA channels are 0–1 internally. Displayed as 0–100% in the inputs.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RgbColorPicker(options: RgbColorPickerOptions): Renderable;
|
|
@@ -54,7 +54,7 @@ export type ComboboxInputOptions<T> = Merge<InputOptions<T>, {
|
|
|
54
54
|
* const user = prop<User | null>(null)
|
|
55
55
|
* ComboboxInput({
|
|
56
56
|
* value: user,
|
|
57
|
-
* onChange: user.set,
|
|
57
|
+
* onChange: v => user.set(v),
|
|
58
58
|
* loadOptions: async (search) => {
|
|
59
59
|
* const users = await fetchUsers(search)
|
|
60
60
|
* return users.map(u => Option.value(u, u.name))
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
/**
|
|
4
|
+
* Internal base options for the date range select shell (trigger + flyout).
|
|
5
|
+
* The actual picker content is provided via `panelContent`.
|
|
6
|
+
*/
|
|
7
|
+
export interface DateRangeSelectShellOptions extends CommonInputOptions {
|
|
8
|
+
/** The display text shown in the trigger. */
|
|
9
|
+
displayText: Value<string>;
|
|
10
|
+
/** The content to render inside the flyout panel. */
|
|
11
|
+
panelContent: TNode;
|
|
12
|
+
/** Callback invoked on blur. */
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
/** Content to render before the display text. */
|
|
15
|
+
before?: TNode;
|
|
16
|
+
/** Content to render after the display text. */
|
|
17
|
+
after?: TNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shared shell for date range selectors: trigger button + flyout panel.
|
|
21
|
+
* Used by both DateRangeSelect and OpenDateRangeSelect.
|
|
22
|
+
*/
|
|
23
|
+
export declare function DateRangeSelectShell(options: DateRangeSelectShellOptions): TNode;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* A date range as a `[start, end]` tuple where both dates are required.
|
|
7
|
+
*/
|
|
8
|
+
export type DateRange = [PlainDate, PlainDate];
|
|
9
|
+
/**
|
|
10
|
+
* Configuration options for the {@link DateRangeSelect} component.
|
|
11
|
+
*
|
|
12
|
+
* Both start and end dates are required. Use {@link OpenDateRangeSelect}
|
|
13
|
+
* if either end can be null/undefined.
|
|
14
|
+
*/
|
|
15
|
+
export type DateRangeSelectOptions = Merge<CommonInputOptions, {
|
|
16
|
+
/** The selected date range as `[start, end]`. */
|
|
17
|
+
value: Value<DateRange>;
|
|
18
|
+
/** Callback invoked when the range changes. */
|
|
19
|
+
onChange?: (range: DateRange) => void;
|
|
20
|
+
/** Callback invoked on blur. */
|
|
21
|
+
onBlur?: () => void;
|
|
22
|
+
/** Predicate returning true if a date should be disabled. */
|
|
23
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
24
|
+
/** Theme color. @default 'primary' */
|
|
25
|
+
color?: Value<ThemeColorName>;
|
|
26
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
27
|
+
weekStartsOn?: Value<number>;
|
|
28
|
+
/** Format a PlainDate for display. Defaults to ISO string. */
|
|
29
|
+
formatDate?: (date: PlainDate) => string;
|
|
30
|
+
/** Content to render before the display text. */
|
|
31
|
+
before?: TNode;
|
|
32
|
+
/** Content to render after the display text. */
|
|
33
|
+
after?: TNode;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* A date range selector using a single calendar with range highlighting.
|
|
37
|
+
*
|
|
38
|
+
* Displays the selected range in a styled trigger button. Clicking opens a
|
|
39
|
+
* flyout panel with a {@link DateRangePicker} — a single calendar where the
|
|
40
|
+
* user clicks to set the start date, then clicks again to set the end date,
|
|
41
|
+
* with a hover preview showing the prospective range.
|
|
42
|
+
*
|
|
43
|
+
* Use {@link OpenDateRangeSelect} if either date can be null/undefined.
|
|
44
|
+
*
|
|
45
|
+
* @param options - Configuration for the date range selector
|
|
46
|
+
* @returns A date range selector element
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { prop } from '@tempots/dom'
|
|
51
|
+
* import { DateRangeSelect } from '@tempots/beatui'
|
|
52
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
53
|
+
*
|
|
54
|
+
* const range = prop<DateRange>([
|
|
55
|
+
* Temporal.PlainDate.from('2026-01-01'),
|
|
56
|
+
* Temporal.PlainDate.from('2026-01-31'),
|
|
57
|
+
* ])
|
|
58
|
+
* DateRangeSelect({
|
|
59
|
+
* value: range,
|
|
60
|
+
* onChange: v => range.set(v),
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function DateRangeSelect(options: DateRangeSelectOptions): TNode;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DateSelect} component.
|
|
7
|
+
*/
|
|
8
|
+
export type DateSelectOptions = Merge<CommonInputOptions, {
|
|
9
|
+
/** The selected date. */
|
|
10
|
+
value: Value<PlainDate>;
|
|
11
|
+
/** Callback invoked when the date changes. */
|
|
12
|
+
onChange?: (date: PlainDate) => void;
|
|
13
|
+
/** Callback invoked on blur. */
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
/** Predicate returning true if a date should be disabled. */
|
|
16
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
17
|
+
/** Theme color. @default 'primary' */
|
|
18
|
+
color?: Value<ThemeColorName>;
|
|
19
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
20
|
+
weekStartsOn?: Value<number>;
|
|
21
|
+
/** Format a PlainDate for display. Defaults to ISO string. */
|
|
22
|
+
formatDate?: (date: PlainDate) => string;
|
|
23
|
+
/** Content to render before the display text. */
|
|
24
|
+
before?: TNode;
|
|
25
|
+
/** Content to render after the display text. */
|
|
26
|
+
after?: TNode;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* A dropdown single-date selector.
|
|
30
|
+
*
|
|
31
|
+
* Displays the selected date in a styled trigger button. Clicking opens a
|
|
32
|
+
* flyout panel with a {@link DatePicker} for selecting a date.
|
|
33
|
+
*
|
|
34
|
+
* Use {@link NullableDateSelect} when the date can be null/unset.
|
|
35
|
+
*
|
|
36
|
+
* @param options - Configuration for the date selector
|
|
37
|
+
* @returns A date selector element
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { prop } from '@tempots/dom'
|
|
42
|
+
* import { DateSelect } from '@tempots/beatui'
|
|
43
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
44
|
+
*
|
|
45
|
+
* const date = prop(Temporal.Now.plainDateISO())
|
|
46
|
+
* DateSelect({
|
|
47
|
+
* value: date,
|
|
48
|
+
* onChange: v => date.set(v),
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function DateSelect(options: DateSelectOptions): TNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TNode, Value } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
/**
|
|
4
|
+
* Internal base options for the date-time select shell (trigger + flyout).
|
|
5
|
+
* The actual picker content is provided via `panelContent`.
|
|
6
|
+
*/
|
|
7
|
+
export interface DateTimeSelectShellOptions extends CommonInputOptions {
|
|
8
|
+
/** The display text shown in the trigger. */
|
|
9
|
+
displayText: Value<string>;
|
|
10
|
+
/** The content to render inside the flyout panel. */
|
|
11
|
+
panelContent: TNode;
|
|
12
|
+
/** Callback invoked on blur. */
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
/** Content to render before the display text. */
|
|
15
|
+
before?: TNode;
|
|
16
|
+
/** Content to render after the display text. */
|
|
17
|
+
after?: TNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shared shell for date-time selectors: trigger button + flyout panel.
|
|
21
|
+
* Used by both DateTimeSelect and NullableDateTimeSelect.
|
|
22
|
+
*/
|
|
23
|
+
export declare function DateTimeSelectShell(options: DateTimeSelectShellOptions): TNode;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type TNode, Value, type Merge } from '@tempots/dom';
|
|
2
|
+
import { CommonInputOptions } from './input-options';
|
|
3
|
+
import type { PlainDate, PlainDateTime } from '../../../temporal/types';
|
|
4
|
+
import { ThemeColorName } from '../../../tokens';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link DateTimeSelect} component.
|
|
7
|
+
*/
|
|
8
|
+
export type DateTimeSelectOptions = Merge<CommonInputOptions, {
|
|
9
|
+
/** The selected date-time. */
|
|
10
|
+
value: Value<PlainDateTime>;
|
|
11
|
+
/** Callback invoked when the date-time changes. */
|
|
12
|
+
onChange?: (dateTime: PlainDateTime) => void;
|
|
13
|
+
/** Callback invoked on blur. */
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
/** Predicate returning true if a date should be disabled. */
|
|
16
|
+
isDateDisabled?: (date: PlainDate) => boolean;
|
|
17
|
+
/** Theme color. @default 'primary' */
|
|
18
|
+
color?: Value<ThemeColorName>;
|
|
19
|
+
/** The day the week starts on (0=Sun, 1=Mon). @default 0 */
|
|
20
|
+
weekStartsOn?: Value<number>;
|
|
21
|
+
/** Whether to show seconds in the time picker. @default false */
|
|
22
|
+
showSeconds?: Value<boolean>;
|
|
23
|
+
/** Whether to use 12-hour format. When omitted, auto-detected from locale. */
|
|
24
|
+
use12Hour?: Value<boolean>;
|
|
25
|
+
/** Step for minutes column. @default 1 */
|
|
26
|
+
minuteStep?: Value<number>;
|
|
27
|
+
/** Step for seconds column. @default 1 */
|
|
28
|
+
secondStep?: Value<number>;
|
|
29
|
+
/** Whether to show a "Now" button in the time picker. @default false */
|
|
30
|
+
showNow?: Value<boolean>;
|
|
31
|
+
/** Format a PlainDateTime for display. When omitted, uses locale-aware 12/24-hour format. */
|
|
32
|
+
formatDateTime?: (dt: PlainDateTime) => string;
|
|
33
|
+
/** Content to render before the display text. */
|
|
34
|
+
before?: TNode;
|
|
35
|
+
/** Content to render after the display text. */
|
|
36
|
+
after?: TNode;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* A dropdown date-time selector combining a date picker and time picker.
|
|
40
|
+
*
|
|
41
|
+
* Displays the selected date-time in a styled trigger button. Clicking opens a
|
|
42
|
+
* flyout panel with a {@link DatePicker} and {@link TimePicker} side by side,
|
|
43
|
+
* separated by a visual divider.
|
|
44
|
+
*
|
|
45
|
+
* When no custom `formatDateTime` is provided, the time portion adapts to the
|
|
46
|
+
* locale's 12/24-hour convention (or the explicit `use12Hour` prop).
|
|
47
|
+
*
|
|
48
|
+
* Use {@link NullableDateTimeSelect} when the date-time can be null/unset.
|
|
49
|
+
*
|
|
50
|
+
* @param options - Configuration for the date-time selector
|
|
51
|
+
* @returns A date-time selector element
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { prop } from '@tempots/dom'
|
|
56
|
+
* import { DateTimeSelect } from '@tempots/beatui'
|
|
57
|
+
* import { Temporal } from '@js-temporal/polyfill'
|
|
58
|
+
*
|
|
59
|
+
* const dt = prop(Temporal.Now.plainDateTimeISO())
|
|
60
|
+
* DateTimeSelect({
|
|
61
|
+
* value: dt,
|
|
62
|
+
* onChange: v => dt.set(v),
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function DateTimeSelect(options: DateTimeSelectOptions): TNode;
|
|
@@ -44,7 +44,7 @@ export type DropdownInputOptions<T> = Merge<InputOptions<T>, {
|
|
|
44
44
|
* const color = prop('red')
|
|
45
45
|
* DropdownInput({
|
|
46
46
|
* value: color,
|
|
47
|
-
* onChange: color.set,
|
|
47
|
+
* onChange: v => color.set(v),
|
|
48
48
|
* options: [
|
|
49
49
|
* Option.value('red', 'Red'),
|
|
50
50
|
* Option.value('green', 'Green'),
|