asheeui 0.6.7 → 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.
- package/dist/components/autocomplete/Autocomplete.d.ts +34 -17
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +90 -106
- package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +9 -13
- package/dist/components/button/Button.d.ts +31 -5
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +68 -64
- package/dist/components/card/Card.d.ts +58 -54
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +152 -158
- package/dist/components/card/card-config.d.ts +66 -33
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +9 -9
- package/dist/components/date-picker/Calendar.d.ts +57 -0
- package/dist/components/date-picker/Calendar.d.ts.map +1 -0
- package/dist/components/date-picker/Calendar.js +224 -0
- package/dist/components/date-picker/DatePicker.d.ts +68 -155
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +194 -466
- package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
- package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
- package/dist/components/date-picker/TimeSpinner.js +84 -0
- package/dist/components/date-picker/date-picker-config.d.ts +21 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -14
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +4 -11
- package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.helpers.js +110 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/input/Input.d.ts +13 -7
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +96 -91
- package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
- package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardContext.js +13 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardProvider.js +183 -0
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
- package/dist/components/keyboard/index.d.ts +2 -1
- package/dist/components/keyboard/index.d.ts.map +1 -1
- package/dist/components/keyboard/index.js +2 -1
- package/dist/components/keyboard/keyboard-config.d.ts +40 -36
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +15 -10
- package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/keyboard/use-keyboard-field.js +12 -12
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +59 -65
- package/dist/components/multi-select/MultiSelect.d.ts +75 -40
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +188 -188
- package/dist/components/multi-select/multi-select-config.d.ts +2 -20
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +10 -14
- package/dist/components/select/Select.d.ts +60 -45
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +149 -161
- package/dist/components/select/select-config.d.ts +3 -29
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -14
- package/dist/components/select/select-styles.js +1 -6
- package/dist/components/select-menu/SelectMenu.d.ts +48 -42
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +137 -123
- package/dist/components/select-menu/select-menu-config.d.ts +33 -2
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +3 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/switch/Switch.d.ts +9 -33
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +68 -74
- package/dist/components/switch/switch-styles.d.ts +1 -6
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/switch/switch-styles.js +6 -12
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/textarea/Textarea.d.ts +19 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +95 -90
- package/dist/components/toast/ToastContext.d.ts +122 -0
- package/dist/components/toast/ToastContext.d.ts.map +1 -0
- package/dist/components/toast/ToastContext.js +28 -0
- package/dist/components/toast/ToastProvider.d.ts +98 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.js +188 -0
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/index.js +2 -1
- package/dist/components/toast/toast-config.d.ts +36 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/icons/ChevronUpIcon.d.ts +3 -0
- package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/icons/ChevronUpIcon.js +21 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.css +24 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/theme/color.js +2 -2
- package/package.json +1 -1
- package/dist/components/keyboard/keyboard-context.d.ts +0 -118
- package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
- package/dist/components/keyboard/keyboard-context.js +0 -90
- package/dist/components/toast/toast-context.d.ts +0 -163
- package/dist/components/toast/toast-context.d.ts.map +0 -1
- package/dist/components/toast/toast-context.js +0 -177
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { InputProps } from '../input/Input';
|
|
3
3
|
import { SelectMenuOption } from '../select-menu';
|
|
4
|
+
import { MenuProps } from '../select-menu/SelectMenu';
|
|
4
5
|
import { AutocompleteConfig } from './autocomplete-config';
|
|
5
|
-
type BaseAutocompleteProps = AutocompleteConfig & Omit<InputProps, "value" | "onChange">;
|
|
6
6
|
/**
|
|
7
7
|
* Configuration options for the Autocomplete component.
|
|
8
|
+
* Extends InputProps to inherit all input field capabilities including
|
|
9
|
+
* label, description, validation, and content slots.
|
|
8
10
|
*/
|
|
9
|
-
export interface AutocompleteProps extends
|
|
11
|
+
export interface AutocompleteProps extends Omit<InputProps, "value" | "onChange" | "children">, Omit<AutocompleteConfig, "menu"> {
|
|
10
12
|
/**
|
|
11
13
|
* Suggestions shown while the user types.
|
|
12
14
|
* Each option must have a label and a unique value.
|
|
@@ -45,9 +47,10 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
45
47
|
*/
|
|
46
48
|
belowList?: ReactNode;
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
50
|
+
* Menu configuration overrides including portal, portalTarget, className, and visual styles.
|
|
51
|
+
* All menu-related props should be passed through this object.
|
|
49
52
|
*/
|
|
50
|
-
|
|
53
|
+
menu?: MenuProps;
|
|
51
54
|
}
|
|
52
55
|
/**
|
|
53
56
|
* A text input with a filterable suggestion dropdown.
|
|
@@ -65,26 +68,31 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
65
68
|
* By default, the dropdown menu uses React's createPortal to render at the
|
|
66
69
|
* document body level. This ensures the menu escapes CSS containment, overflow
|
|
67
70
|
* clipping, and stacking context issues. The portal can be disabled via the
|
|
68
|
-
* `portal` prop or `components.autocomplete.portal` in the config
|
|
69
|
-
* needs to stay within a specific parent container.
|
|
71
|
+
* `menu.portal` prop or `components.autocomplete.menu.portal` in the config
|
|
72
|
+
* if the menu needs to stay within a specific parent container.
|
|
70
73
|
*
|
|
71
74
|
* @param props - Autocomplete configuration options and input props.
|
|
72
|
-
* @param props.options - Suggestion list.
|
|
75
|
+
* @param props.options - Suggestion list. Defaults to [].
|
|
73
76
|
* @param props.value - Controlled selected value.
|
|
74
77
|
* @param props.onValueChange - Selection callback.
|
|
75
78
|
* @param props.onInputChange - Raw input change callback.
|
|
76
79
|
* @param props.allowCustomValue - Allow free-form values. Defaults to false.
|
|
77
80
|
* @param props.belowList - Content below the options list.
|
|
78
|
-
* @param props.
|
|
79
|
-
* @param props.
|
|
80
|
-
* @param props.color -
|
|
81
|
-
* @param props.radius -
|
|
82
|
-
* @param props.size -
|
|
81
|
+
* @param props.menu - Menu configuration overrides including className, portal, portalTarget, and visual styles.
|
|
82
|
+
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
83
|
+
* @param props.color - Theme accent color. Defaults to "primary".
|
|
84
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
85
|
+
* @param props.size - Size of the input. Defaults to "md".
|
|
83
86
|
* @param props.disabled - Whether the input is disabled.
|
|
84
|
-
* @param props.placeholder - Placeholder text
|
|
87
|
+
* @param props.placeholder - Placeholder text. Defaults to "Type to search...".
|
|
85
88
|
* @param props.className - Extra classes for the input.
|
|
86
|
-
* @param props.
|
|
87
|
-
* @param props.
|
|
89
|
+
* @param props.label - Label text for the input.
|
|
90
|
+
* @param props.description - Description text.
|
|
91
|
+
* @param props.message - Validation message.
|
|
92
|
+
* @param props.required - Whether the field is required. Defaults to false.
|
|
93
|
+
* @param props.status - Validation status.
|
|
94
|
+
* @param props.startContent - Content at the start of the input.
|
|
95
|
+
* @param props.endContent - Content at the end of the input.
|
|
88
96
|
*
|
|
89
97
|
* @example
|
|
90
98
|
* ```tsx
|
|
@@ -99,6 +107,8 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
99
107
|
* { label: "Svelte", value: "svelte" },
|
|
100
108
|
* ]}
|
|
101
109
|
* onValueChange={(value) => console.log(value)}
|
|
110
|
+
* label="Framework"
|
|
111
|
+
* description="Choose your preferred framework"
|
|
102
112
|
* />
|
|
103
113
|
* );
|
|
104
114
|
* }
|
|
@@ -106,19 +116,26 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
106
116
|
*
|
|
107
117
|
* @example
|
|
108
118
|
* ```tsx
|
|
109
|
-
* // With free-form values
|
|
119
|
+
* // With free-form values, custom content, and menu configuration
|
|
110
120
|
* <Autocomplete
|
|
111
121
|
* allowCustomValue
|
|
112
122
|
* options={fruits}
|
|
113
123
|
* onValueChange={(value) => console.log('Selected:', value)}
|
|
114
124
|
* placeholder="Type a fruit name..."
|
|
125
|
+
* belowList={<button onClick={addNew}>Add new fruit</button>}
|
|
126
|
+
* isClearable
|
|
127
|
+
* menu={{
|
|
128
|
+
* className: "custom-dropdown",
|
|
129
|
+
* portal: false,
|
|
130
|
+
* itemVariant: "solid"
|
|
131
|
+
* }}
|
|
115
132
|
* />
|
|
116
133
|
* ```
|
|
117
134
|
*
|
|
118
135
|
* @see AutocompleteConfig - The configuration type for component defaults.
|
|
136
|
+
* @see Input - The underlying input component for the trigger.
|
|
119
137
|
* @see SelectMenu - The dropdown component used for suggestions.
|
|
120
138
|
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
121
139
|
*/
|
|
122
140
|
export declare const Autocomplete: import('react').ForwardRefExoticComponent<AutocompleteProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
123
|
-
export {};
|
|
124
141
|
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAI/B;;;;GAIG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC,EACzD,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE5E;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,eAAO,MAAM,YAAY,gHAiMxB,CAAC"}
|
|
@@ -1,152 +1,136 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useFocus as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useAsheeConfig as
|
|
6
|
-
import { resolveCascade as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { SelectMenu as
|
|
9
|
-
import { FALLBACK_AUTOCOMPLETE_CONFIG as
|
|
10
|
-
import { useSelectFloating as
|
|
11
|
-
const
|
|
2
|
+
import { jsxs as h, jsx as A } from "react/jsx-runtime";
|
|
3
|
+
import { useFocus as V, useDismiss as g, useRole as C, useInteractions as ee } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as te, useMemo as F, useState as K, useEffect as se, useCallback as L } from "react";
|
|
5
|
+
import { useAsheeConfig as re } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as v, resolveRadiusKey as oe } from "../../utils/resolve-token.js";
|
|
7
|
+
import { Input as le } from "../input/Input.js";
|
|
8
|
+
import { SelectMenu as ie } from "../select-menu/SelectMenu.js";
|
|
9
|
+
import { FALLBACK_AUTOCOMPLETE_CONFIG as p } from "./autocomplete-config.js";
|
|
10
|
+
import { useSelectFloating as ce } from "../select-menu/use-select-floating.js";
|
|
11
|
+
const fe = te(
|
|
12
12
|
({
|
|
13
|
-
options:
|
|
14
|
-
value:
|
|
15
|
-
onValueChange:
|
|
13
|
+
options: o = [],
|
|
14
|
+
value: s,
|
|
15
|
+
onValueChange: r,
|
|
16
16
|
onInputChange: i,
|
|
17
17
|
allowCustomValue: R = !1,
|
|
18
|
-
belowList:
|
|
19
|
-
dropdownClassName: L,
|
|
18
|
+
belowList: M,
|
|
20
19
|
menu: z,
|
|
21
|
-
variant:
|
|
22
|
-
color:
|
|
23
|
-
radius:
|
|
20
|
+
variant: P,
|
|
21
|
+
color: w,
|
|
22
|
+
radius: E,
|
|
24
23
|
size: N,
|
|
25
|
-
endContent:
|
|
26
|
-
onClick:
|
|
24
|
+
endContent: T,
|
|
25
|
+
onClick: n,
|
|
27
26
|
disabled: O,
|
|
28
|
-
placeholder:
|
|
29
|
-
className:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const p = ie(), e = (x = p.components) == null ? void 0 : x.autocomplete, U = c(
|
|
36
|
-
w,
|
|
27
|
+
placeholder: j = "Type to search...",
|
|
28
|
+
className: _,
|
|
29
|
+
...B
|
|
30
|
+
}, c) => {
|
|
31
|
+
var b;
|
|
32
|
+
const f = re(), e = (b = f.components) == null ? void 0 : b.autocomplete, D = v(
|
|
33
|
+
P,
|
|
37
34
|
e == null ? void 0 : e.variant,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
),
|
|
41
|
-
|
|
35
|
+
f.defaultVariant,
|
|
36
|
+
p.variant
|
|
37
|
+
), G = v(
|
|
38
|
+
w,
|
|
42
39
|
e == null ? void 0 : e.color,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
),
|
|
46
|
-
|
|
40
|
+
f.defaultColor,
|
|
41
|
+
p.color
|
|
42
|
+
), I = oe(
|
|
43
|
+
E,
|
|
47
44
|
e == null ? void 0 : e.radius,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
),
|
|
45
|
+
f.defaultRadius,
|
|
46
|
+
p.radius
|
|
47
|
+
), U = v(
|
|
51
48
|
N,
|
|
52
49
|
e == null ? void 0 : e.size,
|
|
53
50
|
void 0,
|
|
54
|
-
|
|
55
|
-
),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
), W = c(
|
|
61
|
-
G,
|
|
62
|
-
e == null ? void 0 : e.portalTarget,
|
|
63
|
-
void 0,
|
|
64
|
-
o.portalTarget
|
|
65
|
-
), a = F(
|
|
66
|
-
() => l.find((t) => t.value === r),
|
|
67
|
-
[l, r]
|
|
68
|
-
), [S, d] = A(!1), [f, u] = A(
|
|
69
|
-
() => a ? a.label : String(r ?? "")
|
|
51
|
+
p.size
|
|
52
|
+
), l = F(
|
|
53
|
+
() => o.find((t) => t.value === s),
|
|
54
|
+
[o, s]
|
|
55
|
+
), [S, m] = K(!1), [a, u] = K(
|
|
56
|
+
() => l ? l.label : String(s ?? "")
|
|
70
57
|
);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
const { refs:
|
|
58
|
+
se(() => {
|
|
59
|
+
l ? u(l.label) : s != null && u(String(s));
|
|
60
|
+
}, [l, s]);
|
|
61
|
+
const { refs: x, floatingStyles: q, context: d } = ce({
|
|
75
62
|
isOpen: S,
|
|
76
|
-
onOpenChange:
|
|
63
|
+
onOpenChange: m,
|
|
77
64
|
disabled: O
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]),
|
|
83
|
-
(t) => t.label.toLowerCase().includes(
|
|
84
|
-
) :
|
|
65
|
+
}), H = V(d), J = g(d), Q = C(d, { role: "combobox" }), { getReferenceProps: W, getFloatingProps: X } = ee([
|
|
66
|
+
H,
|
|
67
|
+
J,
|
|
68
|
+
Q
|
|
69
|
+
]), Y = F(() => a.trim() ? o.filter(
|
|
70
|
+
(t) => t.label.toLowerCase().includes(a.toLowerCase())
|
|
71
|
+
) : o, [o, a]), Z = L(
|
|
85
72
|
(t) => {
|
|
86
73
|
const y = t.target.value;
|
|
87
|
-
u(y), i == null || i(y),
|
|
74
|
+
u(y), i == null || i(y), m(!0), R && (r == null || r(y));
|
|
88
75
|
},
|
|
89
|
-
[R, i,
|
|
90
|
-
),
|
|
76
|
+
[R, i, r]
|
|
77
|
+
), $ = L(
|
|
91
78
|
(t) => {
|
|
92
|
-
u(t.label),
|
|
79
|
+
u(t.label), r == null || r(t.value, t), m(!1);
|
|
93
80
|
},
|
|
94
|
-
[s]
|
|
95
|
-
), ee = F(
|
|
96
|
-
() => r != null ? [r] : [],
|
|
97
81
|
[r]
|
|
82
|
+
), k = F(
|
|
83
|
+
() => s != null ? [s] : [],
|
|
84
|
+
[s]
|
|
98
85
|
);
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
86
|
+
return /* @__PURE__ */ h("div", { className: "w-full relative inline-block", children: [
|
|
87
|
+
/* @__PURE__ */ A(
|
|
88
|
+
le,
|
|
102
89
|
{
|
|
103
90
|
ref: (t) => {
|
|
104
|
-
|
|
91
|
+
x.setReference(t), typeof c == "function" ? c(t) : c && (c.current = t);
|
|
105
92
|
},
|
|
106
|
-
variant:
|
|
107
|
-
radius:
|
|
108
|
-
color:
|
|
109
|
-
size:
|
|
93
|
+
variant: D,
|
|
94
|
+
radius: I,
|
|
95
|
+
color: G,
|
|
96
|
+
size: U,
|
|
110
97
|
disabled: O,
|
|
111
|
-
placeholder:
|
|
112
|
-
value:
|
|
113
|
-
onChange:
|
|
98
|
+
placeholder: j,
|
|
99
|
+
value: a,
|
|
100
|
+
onChange: Z,
|
|
114
101
|
onClick: (t) => {
|
|
115
|
-
O ||
|
|
102
|
+
O || m(!0), n == null || n(t);
|
|
116
103
|
},
|
|
117
104
|
"aria-expanded": S,
|
|
118
105
|
"aria-autocomplete": "none",
|
|
119
|
-
endContent:
|
|
120
|
-
className:
|
|
121
|
-
...
|
|
106
|
+
endContent: T,
|
|
107
|
+
className: _,
|
|
108
|
+
...W(B)
|
|
122
109
|
}
|
|
123
110
|
),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
111
|
+
/* @__PURE__ */ A(
|
|
112
|
+
ie,
|
|
126
113
|
{
|
|
127
114
|
isOpen: S,
|
|
128
|
-
context:
|
|
129
|
-
floatingStyles:
|
|
130
|
-
getFloatingProps:
|
|
131
|
-
setFloatingRef:
|
|
132
|
-
options:
|
|
133
|
-
selectedValues:
|
|
134
|
-
|
|
115
|
+
context: d,
|
|
116
|
+
floatingStyles: q,
|
|
117
|
+
getFloatingProps: X,
|
|
118
|
+
setFloatingRef: x.setFloating,
|
|
119
|
+
options: Y,
|
|
120
|
+
selectedValues: k,
|
|
121
|
+
onSelectMenuOption: $,
|
|
135
122
|
isSearch: !1,
|
|
136
|
-
belowList:
|
|
137
|
-
dropdownClassName: L,
|
|
123
|
+
belowList: M,
|
|
138
124
|
menuProps: z,
|
|
139
125
|
menuConfig: e == null ? void 0 : e.menu,
|
|
140
126
|
initialFocus: -1,
|
|
141
|
-
returnFocus: !1
|
|
142
|
-
portal: Q,
|
|
143
|
-
portalTarget: W
|
|
127
|
+
returnFocus: !1
|
|
144
128
|
}
|
|
145
129
|
)
|
|
146
130
|
] });
|
|
147
131
|
}
|
|
148
132
|
);
|
|
149
|
-
|
|
133
|
+
fe.displayName = "Autocomplete";
|
|
150
134
|
export {
|
|
151
|
-
|
|
135
|
+
fe as Autocomplete
|
|
152
136
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldConfig } from '../field/field-config';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuConfig } from '../select-menu';
|
|
3
3
|
/**
|
|
4
4
|
* Theme configuration options for the Autocomplete component.
|
|
5
5
|
*
|
|
@@ -12,23 +12,7 @@ export interface AutocompleteConfig extends FieldConfig {
|
|
|
12
12
|
* Configuration for the dropdown menu that displays suggestions.
|
|
13
13
|
* Controls the menu's visual appearance and behavior.
|
|
14
14
|
*/
|
|
15
|
-
menu?:
|
|
16
|
-
/**
|
|
17
|
-
* Whether to render the dropdown menu in a React portal.
|
|
18
|
-
* When true, the menu is rendered at the document body level,
|
|
19
|
-
* escaping any parent DOM hierarchy. This prevents CSS containment
|
|
20
|
-
* and stacking context issues. Defaults to true because dropdowns
|
|
21
|
-
* should always appear above other content.
|
|
22
|
-
*
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
portal?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Custom portal target element for the dropdown menu.
|
|
28
|
-
* When portal is enabled, the menu is rendered into this element.
|
|
29
|
-
* Defaults to document.body.
|
|
30
|
-
*/
|
|
31
|
-
portalTarget?: HTMLElement | null;
|
|
15
|
+
menu?: MenuConfig;
|
|
32
16
|
}
|
|
33
17
|
/**
|
|
34
18
|
* Default config values registered for the Autocomplete component.
|
|
@@ -42,8 +26,6 @@ export declare const defaultAutocompleteConfig: AutocompleteConfig;
|
|
|
42
26
|
* and global defaults are all undefined.
|
|
43
27
|
*/
|
|
44
28
|
export declare const FALLBACK_AUTOCOMPLETE_CONFIG: {
|
|
45
|
-
readonly portal: true;
|
|
46
|
-
readonly portalTarget: null;
|
|
47
29
|
readonly size: import('../field').FieldSizeKey;
|
|
48
30
|
readonly radius: import('../..').Radius;
|
|
49
31
|
readonly variant: import('../..').Variant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAEvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;CAE/B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
const
|
|
5
|
-
...e
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, p = {
|
|
9
|
-
...o,
|
|
10
|
-
portal: !0,
|
|
11
|
-
portalTarget: null
|
|
2
|
+
import { registerComponentDefaults as o } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as t, defaultFieldConfig as e } from "../field/field-config.js";
|
|
4
|
+
const C = {
|
|
5
|
+
...e
|
|
6
|
+
}, l = {
|
|
7
|
+
...t
|
|
12
8
|
};
|
|
13
|
-
|
|
9
|
+
o("autocomplete", C);
|
|
14
10
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
l as FALLBACK_AUTOCOMPLETE_CONFIG,
|
|
12
|
+
C as defaultAutocompleteConfig
|
|
17
13
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { ButtonConfig } from './button-config';
|
|
2
3
|
/**
|
|
3
4
|
* Visual and behavioural options shared by button-like elements.
|
|
4
5
|
* This type combines the ButtonConfig with native button HTML attributes.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
type BaseButtonProps = ButtonConfig & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "disabled">;
|
|
7
8
|
/**
|
|
8
9
|
* Configuration options for the Button component.
|
|
9
10
|
*
|
|
10
11
|
* @see {@link ButtonCommonProps} for the shared visual props.
|
|
11
12
|
*/
|
|
12
|
-
interface ButtonProps extends BaseButtonProps {
|
|
13
|
+
export interface ButtonProps extends BaseButtonProps {
|
|
13
14
|
/**
|
|
14
15
|
* Whether the button is in a disabled state.
|
|
15
16
|
* Disabled buttons cannot be interacted with and appear dimmed.
|
|
@@ -38,14 +39,25 @@ interface ButtonProps extends BaseButtonProps {
|
|
|
38
39
|
* @default false
|
|
39
40
|
*/
|
|
40
41
|
icon?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Content rendered at the start of the button.
|
|
44
|
+
* Typically an icon or adornment.
|
|
45
|
+
*/
|
|
46
|
+
startContent?: ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Content rendered at the end of the button.
|
|
49
|
+
* Typically an icon, badge, or adornment.
|
|
50
|
+
*/
|
|
51
|
+
endContent?: ReactNode;
|
|
41
52
|
}
|
|
42
53
|
/**
|
|
43
54
|
* A clickable element that triggers an action or event.
|
|
44
55
|
*
|
|
45
56
|
* Button supports multiple visual variants, theme colors, density and
|
|
46
|
-
* radius scales, icon-only mode, loading state,
|
|
47
|
-
*
|
|
48
|
-
*
|
|
57
|
+
* radius scales, icon-only mode, loading state, press animation, and
|
|
58
|
+
* start/end content slots for icons and adornments. Visual tokens resolve
|
|
59
|
+
* through the standard AsheeUI cascade: prop, component config, global
|
|
60
|
+
* theme defaults, and the built-in fallback.
|
|
49
61
|
*
|
|
50
62
|
* The component automatically handles accessibility attributes including
|
|
51
63
|
* aria-disabled, aria-busy for loading states, and proper focus management.
|
|
@@ -62,6 +74,8 @@ interface ButtonProps extends BaseButtonProps {
|
|
|
62
74
|
* @param props.isLoading - Loading state. Defaults to false.
|
|
63
75
|
* @param props.type - Native button type. Defaults to "button".
|
|
64
76
|
* @param props.icon - Icon-only compact layout. Defaults to false.
|
|
77
|
+
* @param props.startContent - Content at the start of the button.
|
|
78
|
+
* @param props.endContent - Content at the end of the button.
|
|
65
79
|
* @param props.children - Button label content.
|
|
66
80
|
* @param props.className - Extra CSS classes for the button.
|
|
67
81
|
*
|
|
@@ -75,6 +89,7 @@ interface ButtonProps extends BaseButtonProps {
|
|
|
75
89
|
* variant="solid"
|
|
76
90
|
* color="primary"
|
|
77
91
|
* onClick={() => console.log("Clicked")}
|
|
92
|
+
* startContent={<Icon />}
|
|
78
93
|
* >
|
|
79
94
|
* Click me
|
|
80
95
|
* </Button>
|
|
@@ -95,6 +110,17 @@ interface ButtonProps extends BaseButtonProps {
|
|
|
95
110
|
* </Button>
|
|
96
111
|
* ```
|
|
97
112
|
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* // With end content badge
|
|
116
|
+
* <Button
|
|
117
|
+
* variant="bordered"
|
|
118
|
+
* endContent={<Badge count={5} />}
|
|
119
|
+
* >
|
|
120
|
+
* Notifications
|
|
121
|
+
* </Button>
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
98
124
|
* @see ButtonConfig - The configuration type for component defaults.
|
|
99
125
|
* @see resolveVariantClass - Utility for resolving variant and color styles.
|
|
100
126
|
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBpE,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,eAAO,MAAM,MAAM,2GAoHlB,CAAC"}
|