asheeui 0.6.8 → 0.6.9

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.
Files changed (107) hide show
  1. package/dist/components/autocomplete/Autocomplete.d.ts +34 -17
  2. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  3. package/dist/components/autocomplete/Autocomplete.js +86 -102
  4. package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
  5. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  6. package/dist/components/autocomplete/autocomplete-config.js +9 -13
  7. package/dist/components/button/Button.d.ts +31 -5
  8. package/dist/components/button/Button.d.ts.map +1 -1
  9. package/dist/components/button/Button.js +68 -64
  10. package/dist/components/card/Card.d.ts +58 -54
  11. package/dist/components/card/Card.d.ts.map +1 -1
  12. package/dist/components/card/Card.js +152 -158
  13. package/dist/components/card/card-config.d.ts +66 -33
  14. package/dist/components/card/card-config.d.ts.map +1 -1
  15. package/dist/components/card/card-config.js +9 -9
  16. package/dist/components/date-picker/Calendar.d.ts +57 -0
  17. package/dist/components/date-picker/Calendar.d.ts.map +1 -0
  18. package/dist/components/date-picker/Calendar.js +224 -0
  19. package/dist/components/date-picker/DatePicker.d.ts +68 -155
  20. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  21. package/dist/components/date-picker/DatePicker.js +194 -466
  22. package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
  23. package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
  24. package/dist/components/date-picker/TimeSpinner.js +84 -0
  25. package/dist/components/date-picker/date-picker-config.d.ts +21 -1
  26. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  27. package/dist/components/date-picker/date-picker-config.js +10 -14
  28. package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
  29. package/dist/components/date-picker/date-picker-styles.js +4 -11
  30. package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
  31. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
  32. package/dist/components/date-picker/date-picker.helpers.js +110 -0
  33. package/dist/components/date-picker/index.js +3 -0
  34. package/dist/components/input/Input.d.ts +13 -7
  35. package/dist/components/input/Input.d.ts.map +1 -1
  36. package/dist/components/input/Input.js +96 -91
  37. package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
  38. package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
  39. package/dist/components/keyboard/KeyboardContext.js +13 -0
  40. package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
  41. package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
  42. package/dist/components/keyboard/KeyboardProvider.js +183 -0
  43. package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
  44. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  45. package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
  46. package/dist/components/keyboard/index.d.ts +2 -1
  47. package/dist/components/keyboard/index.d.ts.map +1 -1
  48. package/dist/components/keyboard/index.js +2 -1
  49. package/dist/components/keyboard/keyboard-config.d.ts +40 -36
  50. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  51. package/dist/components/keyboard/keyboard-config.js +15 -10
  52. package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
  53. package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
  54. package/dist/components/keyboard/use-keyboard-field.js +12 -12
  55. package/dist/components/multi-select/MultiSelect.d.ts +75 -40
  56. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  57. package/dist/components/multi-select/MultiSelect.js +188 -188
  58. package/dist/components/multi-select/multi-select-config.d.ts +2 -20
  59. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  60. package/dist/components/multi-select/multi-select-config.js +10 -14
  61. package/dist/components/select/Select.d.ts +60 -45
  62. package/dist/components/select/Select.d.ts.map +1 -1
  63. package/dist/components/select/Select.js +147 -159
  64. package/dist/components/select/select-config.d.ts +3 -29
  65. package/dist/components/select/select-config.d.ts.map +1 -1
  66. package/dist/components/select/select-config.js +6 -14
  67. package/dist/components/select/select-styles.js +1 -6
  68. package/dist/components/select-menu/SelectMenu.d.ts +45 -30
  69. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  70. package/dist/components/select-menu/SelectMenu.js +125 -124
  71. package/dist/components/select-menu/select-menu-config.d.ts +25 -2
  72. package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
  73. package/dist/components/select-menu/select-menu-config.js +4 -3
  74. package/dist/components/switch/Switch.d.ts +9 -33
  75. package/dist/components/switch/Switch.d.ts.map +1 -1
  76. package/dist/components/switch/Switch.js +68 -74
  77. package/dist/components/switch/switch-styles.d.ts +1 -6
  78. package/dist/components/switch/switch-styles.d.ts.map +1 -1
  79. package/dist/components/switch/switch-styles.js +6 -12
  80. package/dist/components/textarea/Textarea.d.ts +19 -1
  81. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  82. package/dist/components/textarea/Textarea.js +95 -90
  83. package/dist/components/toast/ToastContext.d.ts +122 -0
  84. package/dist/components/toast/ToastContext.d.ts.map +1 -0
  85. package/dist/components/toast/ToastContext.js +28 -0
  86. package/dist/components/toast/ToastProvider.d.ts +98 -0
  87. package/dist/components/toast/ToastProvider.d.ts.map +1 -0
  88. package/dist/components/toast/ToastProvider.js +188 -0
  89. package/dist/components/toast/index.d.ts +2 -1
  90. package/dist/components/toast/index.d.ts.map +1 -1
  91. package/dist/components/toast/index.js +2 -1
  92. package/dist/components/toast/toast-config.d.ts +36 -0
  93. package/dist/components/toast/toast-config.d.ts.map +1 -1
  94. package/dist/icons/ChevronUpIcon.d.ts +3 -0
  95. package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
  96. package/dist/icons/ChevronUpIcon.js +21 -0
  97. package/dist/icons/index.d.ts +2 -0
  98. package/dist/icons/index.d.ts.map +1 -1
  99. package/dist/index.js +62 -59
  100. package/dist/theme/color.js +2 -2
  101. package/package.json +1 -1
  102. package/dist/components/keyboard/keyboard-context.d.ts +0 -118
  103. package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
  104. package/dist/components/keyboard/keyboard-context.js +0 -90
  105. package/dist/components/toast/toast-context.d.ts +0 -163
  106. package/dist/components/toast/toast-context.d.ts.map +0 -1
  107. package/dist/components/toast/toast-context.js +0 -177
@@ -0,0 +1,224 @@
1
+ "use client";
2
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
3
+ import { useState as f, useMemo as q } from "react";
4
+ import { ChevronLeftIcon as B } from "../../icons/ChevronLeftIcon.js";
5
+ import { ChevronRightIcon as J } from "../../icons/ChevronRightIcon.js";
6
+ import { buildDayCells as Q, MONTHS as U, DAYS_OF_WEEK as X } from "./date-picker.helpers.js";
7
+ import { CALENDAR_COLOR_CLASSES as L, DATE_PICKER_CELL_SIZE_CLASS as tt } from "./date-picker-styles.js";
8
+ import { TimeSpinner as y } from "./TimeSpinner.js";
9
+ import { cn as u } from "../../utils/cn.js";
10
+ function ut({
11
+ selected: n,
12
+ mode: s,
13
+ isClearable: C,
14
+ resolvedSizeKey: j,
15
+ resolvedColor: h,
16
+ radiusClass: a,
17
+ onSelect: v,
18
+ onClose: w,
19
+ disableFuture: Y = !1
20
+ }) {
21
+ const r = /* @__PURE__ */ new Date(), [l, k] = f(
22
+ (n == null ? void 0 : n.getFullYear()) ?? r.getFullYear()
23
+ ), [i, g] = f(
24
+ (n == null ? void 0 : n.getMonth()) ?? r.getMonth()
25
+ ), [b, A] = f((n == null ? void 0 : n.getHours()) ?? 0), [p, H] = f((n == null ? void 0 : n.getMinutes()) ?? 0), [x, T] = f((n == null ? void 0 : n.getSeconds()) ?? 0), m = L[h] ?? L.primary;
26
+ function M(t, e, Z) {
27
+ const S = n ?? /* @__PURE__ */ new Date();
28
+ v(
29
+ new Date(S.getFullYear(), S.getMonth(), S.getDate(), t, e, Z, 0)
30
+ );
31
+ }
32
+ function I(t) {
33
+ A(t), M(t, p, x);
34
+ }
35
+ function O(t) {
36
+ H(t), M(b, t, x);
37
+ }
38
+ function R(t) {
39
+ T(t), M(b, p, t);
40
+ }
41
+ function K(t) {
42
+ v(new Date(l, i, t, b, p, x, 0)), s === "date" && w();
43
+ }
44
+ function P() {
45
+ i === 0 ? (g(11), k((t) => t - 1)) : g((t) => t - 1);
46
+ }
47
+ function V() {
48
+ i === 11 ? (g(0), k((t) => t + 1)) : g((t) => t + 1);
49
+ }
50
+ function d(t) {
51
+ return !!n && n.getFullYear() === l && n.getMonth() === i && n.getDate() === t;
52
+ }
53
+ function N(t) {
54
+ return r.getFullYear() === l && r.getMonth() === i && r.getDate() === t;
55
+ }
56
+ const $ = new Date(
57
+ r.getFullYear(),
58
+ r.getMonth(),
59
+ r.getDate()
60
+ );
61
+ function D(t) {
62
+ return Y ? new Date(l, i, t) > $ : !1;
63
+ }
64
+ const F = !Y || l < r.getFullYear() || l === r.getFullYear() && i < r.getMonth(), E = s === "date" || s === "datetime", z = s === "time" || s === "datetime", G = s !== "date" || C && !!n, _ = Q(l, i), W = q(() => _.map((t, e) => ({
65
+ key: t !== null ? `day-${t}` : `empty-slot-${e}`,
66
+ day: t
67
+ })), [_]);
68
+ return /* @__PURE__ */ c(
69
+ "div",
70
+ {
71
+ className: u(
72
+ "bg-background border border-border/70 shadow-xl select-none p-4 w-max",
73
+ a
74
+ ),
75
+ children: [
76
+ /* @__PURE__ */ c("div", { className: "flex flex-row", children: [
77
+ E && /* @__PURE__ */ c("div", { className: "flex flex-col w-[264px]", children: [
78
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between pb-3 mb-2 border-b border-border/60", children: [
79
+ /* @__PURE__ */ o(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ onClick: P,
84
+ "aria-label": "Previous month",
85
+ className: u(
86
+ "p-1.5 text-foreground/70 transition-all active:scale-95",
87
+ "hover:text-foreground hover:bg-secondary",
88
+ a
89
+ ),
90
+ children: /* @__PURE__ */ o(B, {})
91
+ }
92
+ ),
93
+ /* @__PURE__ */ c("span", { className: "font-semibold text-sm text-foreground tracking-wide", children: [
94
+ U[i],
95
+ " ",
96
+ l
97
+ ] }),
98
+ /* @__PURE__ */ o(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ onClick: V,
103
+ disabled: !F,
104
+ "aria-label": "Next month",
105
+ className: u(
106
+ "p-1.5 text-foreground/70 transition-all",
107
+ F ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed",
108
+ a
109
+ ),
110
+ children: /* @__PURE__ */ o(J, {})
111
+ }
112
+ )
113
+ ] }),
114
+ /* @__PURE__ */ c("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
115
+ X.map((t) => /* @__PURE__ */ o(
116
+ "div",
117
+ {
118
+ className: "text-[11px] font-bold tracking-wider text-foreground/50 uppercase py-1 mb-1",
119
+ children: t
120
+ },
121
+ t
122
+ )),
123
+ W.map(
124
+ ({ key: t, day: e }) => e === null ? /* @__PURE__ */ o("div", {}, t) : /* @__PURE__ */ o(
125
+ "button",
126
+ {
127
+ type: "button",
128
+ onClick: () => K(e),
129
+ disabled: D(e),
130
+ className: u(
131
+ "w-full flex items-center justify-center font-medium transition-all duration-200",
132
+ tt[j],
133
+ a,
134
+ D(e) ? "opacity-30 cursor-not-allowed text-foreground/50" : "active:scale-90",
135
+ !D(e) && !d(e) && !N(e) && m.hover,
136
+ d(e) && u(m.bg, "font-semibold shadow-sm"),
137
+ N(e) && !d(e) && u("border", m.border, m.text),
138
+ !d(e) && !N(e) && "text-foreground"
139
+ ),
140
+ children: e
141
+ },
142
+ e
143
+ )
144
+ )
145
+ ] })
146
+ ] }),
147
+ z && /* @__PURE__ */ c(
148
+ "div",
149
+ {
150
+ className: u(
151
+ "flex items-center justify-center gap-4",
152
+ E && "pl-5 ml-4 border-l border-border/60"
153
+ ),
154
+ children: [
155
+ /* @__PURE__ */ o(
156
+ y,
157
+ {
158
+ value: b,
159
+ max: 23,
160
+ label: "HH",
161
+ onChange: I,
162
+ resolvedColor: h,
163
+ radiusClass: a
164
+ }
165
+ ),
166
+ /* @__PURE__ */ o(
167
+ y,
168
+ {
169
+ value: p,
170
+ max: 59,
171
+ label: "MM",
172
+ onChange: O,
173
+ resolvedColor: h,
174
+ radiusClass: a
175
+ }
176
+ ),
177
+ /* @__PURE__ */ o(
178
+ y,
179
+ {
180
+ value: x,
181
+ max: 59,
182
+ label: "SS",
183
+ onChange: R,
184
+ resolvedColor: h,
185
+ radiusClass: a
186
+ }
187
+ )
188
+ ]
189
+ }
190
+ )
191
+ ] }),
192
+ G && /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-t border-border/60 pt-3 mt-3", children: [
193
+ C && n ? /* @__PURE__ */ o(
194
+ "button",
195
+ {
196
+ type: "button",
197
+ onClick: () => {
198
+ v(null), w();
199
+ },
200
+ className: "text-xs font-medium text-foreground/50 hover:text-danger transition-colors active:scale-95 px-2 py-1",
201
+ children: "Clear"
202
+ }
203
+ ) : /* @__PURE__ */ o("div", {}),
204
+ s !== "date" && /* @__PURE__ */ o(
205
+ "button",
206
+ {
207
+ type: "button",
208
+ onClick: w,
209
+ className: u(
210
+ "ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm",
211
+ a,
212
+ m.bg
213
+ ),
214
+ children: "Done"
215
+ }
216
+ )
217
+ ] })
218
+ ]
219
+ }
220
+ );
221
+ }
222
+ export {
223
+ ut as Calendar
224
+ };
@@ -1,179 +1,90 @@
1
- import { CSSProperties } from 'react';
2
- import { Color, Radius, Variant } from '../../shared';
3
- import { FieldSizeKey, FieldStatus, LabelAlign } from '../field/field-config';
4
- import { PickerMode } from './date-picker-config';
5
- export interface DatePickerProps {
1
+ import { InputProps } from '../input/Input';
2
+ import { DatePickerConfig, PickerConfig } from './date-picker-config';
3
+ /**
4
+ * Picker menu configuration that extends PickerConfig with className.
5
+ * Used for styling the calendar popover.
6
+ */
7
+ export interface PickerMenu extends PickerConfig {
8
+ /**
9
+ * Extra CSS classes for the calendar popover.
10
+ */
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Base DatePicker props excluding the picker configuration.
15
+ * Combines DatePickerConfig (minus picker) with InputProps (minus value-related props).
16
+ */
17
+ export type BaseDatePickerProps = Omit<DatePickerConfig, "picker"> & Omit<InputProps, "onChange" | "value" | "defaultValue" | "endContent" | "startContent">;
18
+ /**
19
+ * Configuration options for the DatePicker component.
20
+ * Extends InputProps but omits value-related props that are replaced
21
+ * with date-specific equivalents.
22
+ */
23
+ export interface DatePickerProps extends BaseDatePickerProps {
6
24
  /**
7
25
  * The currently selected date.
8
- * Use null for no selection.
26
+ * Pass null for no selection.
9
27
  */
10
28
  selected?: Date | null;
11
29
  /**
12
30
  * Callback fired when the selected date changes.
13
- * Receives the new date or null when cleared.
31
+ * Receives the new date or null if cleared.
14
32
  */
15
33
  onChange?: (date: Date | null) => void;
16
34
  /**
17
- * The selection mode of the picker.
18
- * Determines whether the picker shows date, time, or both.
19
- *
20
- * @default "date"
21
- */
22
- mode?: PickerMode;
23
- /**
24
- * Size of the date picker.
25
- * Controls the height and font size of the trigger.
26
- *
27
- * @default "md"
28
- */
29
- size?: FieldSizeKey;
30
- /**
31
- * Corner rounding of the date picker.
32
- *
33
- * @default "md"
34
- */
35
- radius?: Radius;
36
- /**
37
- * Visual style variant of the date picker trigger.
38
- *
39
- * @default "bordered"
40
- */
41
- variant?: Variant;
42
- /**
43
- * Theme accent color of the date picker.
44
- *
45
- * @default "primary"
46
- */
47
- color?: Color;
48
- /**
49
- * Validation status of the field.
50
- * Controls border color and message styling.
51
- */
52
- status?: FieldStatus;
53
- /**
54
- * Label text for the date picker.
55
- */
56
- label?: string;
57
- /**
58
- * Alignment of the label relative to the input.
59
- *
60
- * @default "left"
61
- */
62
- labelAlign?: LabelAlign;
63
- /**
64
- * Description text shown below the field.
65
- */
66
- description?: string;
67
- /**
68
- * Validation message shown below the field.
69
- * Color is determined by the status prop.
70
- */
71
- message?: string;
72
- /**
73
- * Whether the field is required.
74
- * Adds a required indicator to the label.
75
- *
76
- * @default false
77
- */
78
- required?: boolean;
79
- /**
80
- * Whether the field is in a loading state.
81
- * Shows a loading spinner.
82
- *
83
- * @default false
84
- */
85
- isLoading?: boolean;
86
- /**
87
- * Whether the field is disabled.
88
- * Prevents interaction and dims the field.
89
- *
90
- * @default false
35
+ * Picker configuration overrides including portal, portalTarget, and className.
36
+ * All picker-related props should be passed through this object.
91
37
  */
92
- disabled?: boolean;
38
+ picker?: PickerMenu;
93
39
  /**
94
- * Whether a clear button is shown when a value is selected.
40
+ * Whether a clear button is shown in the input.
41
+ * When true, a clear button appears when a date is selected.
95
42
  *
96
43
  * @default false
97
44
  */
98
45
  isClearable?: boolean;
99
46
  /**
100
- * Whether future dates are disabled for selection.
47
+ * Whether future dates are disabled in the calendar.
48
+ * When true, dates after today cannot be selected.
101
49
  *
102
50
  * @default false
103
51
  */
104
52
  disableFuture?: boolean;
105
- /**
106
- * Custom placeholder text.
107
- * Overrides the default placeholder for the selected mode.
108
- */
109
- placeholder?: string;
110
- /**
111
- * Extra CSS classes for the date picker.
112
- */
113
- className?: string;
114
- /**
115
- * Optional ID for the field.
116
- */
117
- id?: string;
118
- /**
119
- * Inline styles for the date picker.
120
- */
121
- style?: CSSProperties;
122
- /**
123
- * Whether to render the calendar popover in a React portal.
124
- * When true, the popover is rendered at the document body level.
125
- * Defaults to true.
126
- */
127
- portal?: boolean;
128
- /**
129
- * Custom portal target element for the calendar popover.
130
- * When portal is enabled, the popover is rendered into this element.
131
- * Defaults to document.body.
132
- */
133
- portalTarget?: HTMLElement | null;
134
53
  }
135
54
  /**
136
- * A date, time, or datetime picker component with a calendar popover.
55
+ * A date/time picker component with calendar popover and time selection.
137
56
  *
138
- * DatePicker displays a trigger input that opens a calendar panel for
139
- * selecting dates and times. It supports multiple modes (date, time,
140
- * datetime), clearable values, validation states, and the standard
141
- * AsheeUI cascade for visual tokens.
142
- *
143
- * The component automatically handles accessibility attributes including
144
- * role="combobox", aria-expanded, aria-invalid, and proper focus management
145
- * through Floating UI.
57
+ * DatePicker renders an input field with a calendar popover that allows
58
+ * selecting dates and/or times. It supports date, time, and datetime modes,
59
+ * clearable selection, and future date restrictions. The component integrates
60
+ * with Floating UI for popover positioning and follows the standard AsheeUI
61
+ * cascade system for visual tokens.
146
62
  *
147
63
  * By default, the calendar popover uses React's createPortal to render at the
148
64
  * document body level. This ensures the popover escapes CSS containment,
149
65
  * overflow clipping, and stacking context issues. The portal can be disabled
150
- * via the `portal` prop or `components.datePicker.portal` in the config if
151
- * the popover needs to stay within a specific parent container.
66
+ * via the `picker.portal` prop or `components.datePicker.picker.portal` in
67
+ * the config if the popover needs to stay within a specific parent container.
152
68
  *
153
69
  * @param props - DatePicker configuration options.
154
- * @param props.selected - The currently selected date.
155
- * @param props.onChange - Callback fired when the selected date changes.
156
- * @param props.mode - Selection mode. Defaults to "date".
157
- * @param props.size - Size of the picker. Defaults to "md".
70
+ * @param props.selected - Currently selected date or null.
71
+ * @param props.onChange - Callback fired when the date changes.
72
+ * @param props.mode - Selection mode: "date", "time", or "datetime". Defaults to "date".
73
+ * @param props.isClearable - Whether a clear button is shown. Defaults to false.
74
+ * @param props.disableFuture - Whether future dates are disabled. Defaults to false.
75
+ * @param props.placeholder - Placeholder text.
76
+ * @param props.size - Size of the input. Defaults to "md".
158
77
  * @param props.radius - Corner rounding. Defaults to "md".
159
- * @param props.variant - Visual style variant. Defaults to "bordered".
160
78
  * @param props.color - Theme accent color. Defaults to "primary".
161
- * @param props.status - Validation status.
162
- * @param props.label - Label text.
163
- * @param props.labelAlign - Label alignment. Defaults to "left".
79
+ * @param props.disabled - Whether the input is disabled. Defaults to false.
80
+ * @param props.picker - Picker configuration overrides including className, portal, and portalTarget.
81
+ * @param props.label - Field label text.
164
82
  * @param props.description - Description text.
165
83
  * @param props.message - Validation message.
166
- * @param props.required - Whether the field is required.
167
- * @param props.isLoading - Loading state.
168
- * @param props.disabled - Disabled state.
169
- * @param props.isClearable - Whether a clear button is shown.
170
- * @param props.disableFuture - Whether future dates are disabled.
171
- * @param props.placeholder - Custom placeholder text.
172
- * @param props.className - Extra CSS classes.
173
- * @param props.id - Optional ID for the field.
174
- * @param props.style - Inline styles.
175
- * @param props.portal - Whether to render the popover in a portal. Defaults to true.
176
- * @param props.portalTarget - Custom portal target element. Defaults to document.body.
84
+ * @param props.required - Whether the field is required. Defaults to false.
85
+ * @param props.isLoading - Loading state. Defaults to false.
86
+ * @param props.status - Validation status.
87
+ * @param props.labelAlign - Alignment of the label. Defaults to "left".
177
88
  *
178
89
  * @example
179
90
  * ```tsx
@@ -181,13 +92,13 @@ export interface DatePickerProps {
181
92
  * import { useState } from "react";
182
93
  *
183
94
  * export function Example() {
184
- * const [date, setDate] = useState<Date | null>(null);
95
+ * const [selected, setSelected] = useState<Date | null>(null);
185
96
  *
186
97
  * return (
187
98
  * <DatePicker
188
- * selected={date}
189
- * onChange={setDate}
190
- * label="Select a date"
99
+ * selected={selected}
100
+ * onChange={setSelected}
101
+ * label="Select Date"
191
102
  * isClearable
192
103
  * />
193
104
  * );
@@ -196,19 +107,21 @@ export interface DatePickerProps {
196
107
  *
197
108
  * @example
198
109
  * ```tsx
199
- * // DateTime picker with time selection
110
+ * // With datetime mode and custom picker configuration
200
111
  * <DatePicker
201
112
  * mode="datetime"
202
- * selected={dateTime}
203
- * onChange={setDateTime}
204
- * label="Select date and time"
205
- * disableFuture
113
+ * label="Select Date and Time"
114
+ * isClearable
115
+ * picker={{
116
+ * className: "custom-calendar",
117
+ * portal: false,
118
+ * }}
206
119
  * />
207
120
  * ```
208
121
  *
209
122
  * @see DatePickerConfig - The configuration type for component defaults.
210
- * @see FieldShell - The wrapper component for label and validation.
211
- * @see useAsheeConfig - Hook for accessing the global configuration.
123
+ * @see Input - The underlying input component.
124
+ * @see Calendar - The calendar popover component.
212
125
  */
213
- export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
126
+ export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
214
127
  //# sourceMappingURL=DatePicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;AAQf,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,MAAM,EAEX,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAsa9B,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,eAAO,MAAM,UAAU,4GA+QtB,CAAC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASxD,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAChE,IAAI,CACF,UAAU,EACV,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CACtE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,eAAO,MAAM,UAAU,8GAiTtB,CAAC"}