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
@@ -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 BaseAutocompleteProps {
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
- * Extra classes applied to the floating dropdown.
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
- dropdownClassName?: string;
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 if the menu
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.dropdownClassName - Extra dropdown classes.
79
- * @param props.menuVariant - Dropdown variant. Defaults to "solid".
80
- * @param props.color - Dropdown color. Defaults to "default".
81
- * @param props.radius - Dropdown radius. Defaults to "md".
82
- * @param props.size - Dropdown density. Defaults to "sm".
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 for the input.
87
+ * @param props.placeholder - Placeholder text. Defaults to "Type to search...".
85
88
  * @param props.className - Extra classes for the input.
86
- * @param props.portal - Whether to render the dropdown in a portal. Defaults to true.
87
- * @param props.portalTarget - Custom portal target element. Defaults to document.body.
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;AAE1E,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAI/B,KAAK,qBAAqB,GAAG,kBAAkB,GAC7C,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D;;;;;OAKG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CA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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,146 +1,130 @@
1
1
  "use client";
2
- import { jsxs as te, jsx as b } from "react/jsx-runtime";
3
- import { useFocus as re, useDismiss as se, useRole as oe, useInteractions as le } from "@floating-ui/react";
4
- import { forwardRef as ae, useMemo as F, useState as A, useEffect as ce, useCallback as K } from "react";
5
- import { useAsheeConfig as ie } from "../../libs/context.js";
6
- import { resolveCascade as c, resolveRadiusKey as me } from "../../utils/resolve-token.js";
7
- import { Input as pe } from "../input/Input.js";
8
- import { SelectMenu as de } from "../select-menu/SelectMenu.js";
9
- import { FALLBACK_AUTOCOMPLETE_CONFIG as o } from "./autocomplete-config.js";
10
- import { useSelectFloating as ue } from "../select-menu/use-select-floating.js";
11
- const fe = ae(
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: l = [],
14
- value: r,
15
- onValueChange: s,
13
+ options: o = [],
14
+ value: s,
15
+ onValueChange: r,
16
16
  onInputChange: i,
17
17
  allowCustomValue: R = !1,
18
- belowList: P,
19
- dropdownClassName: L,
20
- menu: M,
21
- variant: z,
18
+ belowList: M,
19
+ menu: z,
20
+ variant: P,
22
21
  color: w,
23
22
  radius: E,
24
23
  size: N,
25
- endContent: j,
26
- onClick: v,
24
+ endContent: T,
25
+ onClick: n,
27
26
  disabled: O,
28
- placeholder: _ = "Type to search...",
29
- className: B,
30
- portal: D,
31
- portalTarget: G,
32
- ...I
33
- }, m) => {
34
- var x;
35
- const p = ie(), e = (x = p.components) == null ? void 0 : x.autocomplete, U = c(
36
- z,
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
- p.defaultVariant,
39
- o.variant
40
- ), q = c(
35
+ f.defaultVariant,
36
+ p.variant
37
+ ), G = v(
41
38
  w,
42
39
  e == null ? void 0 : e.color,
43
- p.defaultColor,
44
- o.color
45
- ), H = me(
40
+ f.defaultColor,
41
+ p.color
42
+ ), I = oe(
46
43
  E,
47
44
  e == null ? void 0 : e.radius,
48
- p.defaultRadius,
49
- o.radius
50
- ), J = c(
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
- o.size
55
- ), Q = c(
56
- D,
57
- e == null ? void 0 : e.portal,
58
- void 0,
59
- o.portal
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), [u, f] = 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
- ce(() => {
72
- a ? f(a.label) : r != null && f(String(r));
73
- }, [a, r]);
74
- const { refs: T, floatingStyles: X, context: n } = ue({
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: d,
63
+ onOpenChange: m,
77
64
  disabled: O
78
- }), Y = re(n), Z = se(n), $ = oe(n, { role: "combobox" }), { getReferenceProps: k, getFloatingProps: h } = le([
79
- Y,
80
- Z,
81
- $
82
- ]), V = F(() => u.trim() ? l.filter(
83
- (t) => t.label.toLowerCase().includes(u.toLowerCase())
84
- ) : l, [l, u]), g = K(
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
- f(y), i == null || i(y), d(!0), R && (s == null || s(y));
74
+ u(y), i == null || i(y), m(!0), R && (r == null || r(y));
88
75
  },
89
- [R, i, s]
90
- ), C = K(
76
+ [R, i, r]
77
+ ), $ = L(
91
78
  (t) => {
92
- f(t.label), s == null || s(t.value, t), d(!1);
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__ */ te("div", { className: "w-full relative inline-block", children: [
100
- /* @__PURE__ */ b(
101
- pe,
86
+ return /* @__PURE__ */ h("div", { className: "w-full relative inline-block", children: [
87
+ /* @__PURE__ */ A(
88
+ le,
102
89
  {
103
90
  ref: (t) => {
104
- T.setReference(t), typeof m == "function" ? m(t) : m && (m.current = t);
91
+ x.setReference(t), typeof c == "function" ? c(t) : c && (c.current = t);
105
92
  },
106
- variant: U,
107
- radius: H,
108
- color: q,
109
- size: J,
93
+ variant: D,
94
+ radius: I,
95
+ color: G,
96
+ size: U,
110
97
  disabled: O,
111
- placeholder: _,
112
- value: u,
113
- onChange: g,
98
+ placeholder: j,
99
+ value: a,
100
+ onChange: Z,
114
101
  onClick: (t) => {
115
- O || d(!0), v == null || v(t);
102
+ O || m(!0), n == null || n(t);
116
103
  },
117
104
  "aria-expanded": S,
118
105
  "aria-autocomplete": "none",
119
- endContent: j,
120
- className: B,
121
- ...k(I)
106
+ endContent: T,
107
+ className: _,
108
+ ...W(B)
122
109
  }
123
110
  ),
124
- /* @__PURE__ */ b(
125
- de,
111
+ /* @__PURE__ */ A(
112
+ ie,
126
113
  {
127
114
  isOpen: S,
128
- context: n,
129
- floatingStyles: X,
130
- getFloatingProps: h,
131
- setFloatingRef: T.setFloating,
132
- options: V,
133
- selectedValues: ee,
134
- onSelectMenuOption: C,
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: P,
137
- dropdownClassName: L,
138
- menuProps: M,
123
+ belowList: M,
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
  ] });
@@ -1,5 +1,5 @@
1
1
  import { FieldConfig } from '../field/field-config';
2
- import { SelectMenuConfig } from '../select-menu';
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?: SelectMenuConfig;
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,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAIvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;CAI/B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF"}
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 t } from "../../libs/registry.js";
3
- import { FALLBACK_FIELD_CONFIG as o, defaultFieldConfig as e } from "../field/field-config.js";
4
- const l = {
5
- ...e,
6
- portal: !0,
7
- portalTarget: null
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
- t("autocomplete", l);
9
+ o("autocomplete", C);
14
10
  export {
15
- p as FALLBACK_AUTOCOMPLETE_CONFIG,
16
- l as defaultAutocompleteConfig
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
- export type BaseButtonProps = ButtonConfig & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "disabled">;
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, and a press animation.
47
- * Visual tokens resolve through the standard AsheeUI cascade: prop,
48
- * component config, global theme defaults, and the built-in fallback.
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":"AA2BA,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAG5E;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,GACxC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE5E;;;;GAIG;AACH,UAAU,WAAY,SAAQ,eAAe;IAC3C;;;;;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,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