haze-ui 1.14.0 → 1.16.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/README.md +89 -0
- package/dist/components/Button/Button.js +11 -25
- package/dist/components/Button/ButtonLink.js +23 -0
- package/dist/components/Button/styles.js +18 -0
- package/dist/components/Carousel/Carousel.js +5 -5
- package/dist/components/ChatInput/ChatInput.js +3 -3
- package/dist/components/Collapsible/Collapsible.js +6 -6
- package/dist/components/Combobox/Combobox.js +4 -4
- package/dist/components/Command/Command.js +8 -8
- package/dist/components/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/Disclosure/Disclosure.js +4 -4
- package/dist/components/Drawer/Drawer.js +4 -4
- package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/components/InlineEdit/InlineEdit.js +4 -4
- package/dist/components/LogViewer/LogViewer.js +3 -3
- package/dist/components/Menu/Menu.js +3 -3
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Stepper/Stepper.js +4 -4
- package/dist/components/Tooltip/Tooltip.js +5 -5
- package/dist/components/Transfer/Transfer.js +3 -3
- package/dist/components/Tree/Tree.js +3 -3
- package/dist/css/button.css +2 -1
- package/dist/form/FormItem.js +33 -22
- package/dist/haze-ui.css +2 -1
- package/dist/index.js +139 -138
- package/dist/types/components/Button/ButtonLink.d.ts +31 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Button/styles.d.ts +29 -0
- package/dist/types/form/FormItem.d.ts +70 -4
- package/dist/types/form/index.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +1 -1
package/dist/form/FormItem.js
CHANGED
|
@@ -6,8 +6,8 @@ import { useId as r } from "react";
|
|
|
6
6
|
import { useField as i } from "react-f0rm";
|
|
7
7
|
//#region src/lib/form/FormItem.tsx
|
|
8
8
|
var a = "haze-FormItem__item", o = "haze-FormItem__labelText", s = "haze-FormItem__errorText";
|
|
9
|
-
function c({ form: c, name: l, label: u, validate: d, mode: f, validateDebounce: p, delayError: m, rules: h, className: g, renderError: _, as: v, asProps: y,
|
|
10
|
-
let
|
|
9
|
+
function c({ form: c, name: l, label: u, validate: d, mode: f, validateDebounce: p, delayError: m, rules: h, className: g, renderError: _, as: v, asProps: y, input: b, eventToValue: x, valueToProps: S, children: C, ...w }) {
|
|
10
|
+
let T = `haze-field-${r()}`, E = `${T}-error`, { value: D, onChange: O, onBlur: k, errors: A } = i({
|
|
11
11
|
form: c,
|
|
12
12
|
name: l,
|
|
13
13
|
validate: d,
|
|
@@ -15,37 +15,48 @@ function c({ form: c, name: l, label: u, validate: d, mode: f, validateDebounce:
|
|
|
15
15
|
validateDebounce: p,
|
|
16
16
|
delayError: m,
|
|
17
17
|
rules: h
|
|
18
|
-
}),
|
|
18
|
+
}), j = A.length > 0, M = x ?? ((e) => e);
|
|
19
|
+
if (b && typeof C == "function") throw Error("FormItem: `input` and the render-prop `children` are mutually exclusive — the input component is wired declaratively; remove the render-prop.");
|
|
20
|
+
let N = b;
|
|
19
21
|
return /* @__PURE__ */ n("div", {
|
|
20
22
|
className: e([a, g]),
|
|
21
23
|
children: [
|
|
22
24
|
u !== void 0 && /* @__PURE__ */ t("label", {
|
|
23
|
-
htmlFor:
|
|
25
|
+
htmlFor: T,
|
|
24
26
|
className: e(o),
|
|
25
27
|
children: u
|
|
26
28
|
}),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"aria-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
N ? /* @__PURE__ */ t(N, {
|
|
30
|
+
...w,
|
|
31
|
+
id: T,
|
|
32
|
+
"aria-invalid": j || void 0,
|
|
33
|
+
"aria-describedby": j ? E : void 0,
|
|
34
|
+
onBlur: k,
|
|
35
|
+
onChange: (e) => O(M(e)),
|
|
36
|
+
...S ? S(D) : { value: D },
|
|
37
|
+
children: C
|
|
38
|
+
}) : v ? /* @__PURE__ */ t(v, {
|
|
39
|
+
id: T,
|
|
40
|
+
"aria-invalid": j || void 0,
|
|
41
|
+
"aria-describedby": j ? E : void 0,
|
|
42
|
+
onBlur: k,
|
|
43
|
+
onChange: (e) => O(M(e)),
|
|
33
44
|
...y,
|
|
34
|
-
...
|
|
35
|
-
}) :
|
|
36
|
-
id:
|
|
37
|
-
errorId:
|
|
38
|
-
invalid:
|
|
39
|
-
errors:
|
|
40
|
-
onBlur:
|
|
41
|
-
value:
|
|
42
|
-
onChange:
|
|
45
|
+
...S ? S(D) : { value: D }
|
|
46
|
+
}) : C({
|
|
47
|
+
id: T,
|
|
48
|
+
errorId: E,
|
|
49
|
+
invalid: j,
|
|
50
|
+
errors: A,
|
|
51
|
+
onBlur: k,
|
|
52
|
+
value: D,
|
|
53
|
+
onChange: O
|
|
43
54
|
}),
|
|
44
|
-
|
|
45
|
-
id:
|
|
55
|
+
j && /* @__PURE__ */ t("span", {
|
|
56
|
+
id: E,
|
|
46
57
|
role: "alert",
|
|
47
58
|
className: e(s),
|
|
48
|
-
children: _ ? _(
|
|
59
|
+
children: _ ? _(A[0].message, E) : A[0].message
|
|
49
60
|
})
|
|
50
61
|
]
|
|
51
62
|
});
|
package/dist/haze-ui.css
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
.haze-BottomSheet__overlay{z-index:100;-webkit-align-items:flex-end;-webkit-box-align:flex-end;-ms-flex-align:flex-end;background:#0006;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.haze-BottomSheet__sheet{background:var(--haze-color-bg);border-radius:var(--haze-radius-xl) var(--haze-radius-xl) 0 0;padding:var(--haze-space-4) var(--haze-space-6) calc(var(--haze-space-4) + env(safe-area-inset-bottom));width:100%;max-width:640px;max-height:80vh;font-family:var(--haze-font-sans);color:var(--haze-color-text);box-shadow:var(--haze-shadow-xl);overflow-y:auto}.haze-BottomSheet__handle{background:var(--haze-color-border);border-radius:var(--haze-radius-full);width:2rem;height:.25rem;margin:0 auto var(--haze-space-4)}
|
|
15
15
|
.haze-Breadcrumb__nav{font-family:var(--haze-font-sans);font-size:var(--haze-text-sm)}.haze-Breadcrumb__list{align-items:center;gap:var(--haze-space-2);white-space:nowrap;margin:0;padding:0;list-style:none;display:flex;overflow-x:auto}.haze-Breadcrumb__sep{color:var(--haze-color-text-muted);-webkit-user-select:none;user-select:none}
|
|
16
16
|
.haze-BreadcrumbItem__link{color:var(--haze-color-primary);-webkit-text-decoration:none;text-decoration:none;transition:color .15s}.haze-BreadcrumbItem__link:hover{color:var(--haze-color-primary-hover);-webkit-text-decoration:underline;text-decoration:underline}.haze-BreadcrumbItem__link:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);border-radius:var(--haze-radius-sm);outline:none}.haze-BreadcrumbItem__current{color:var(--haze-color-text);font-weight:var(--haze-weight-medium)}
|
|
17
|
-
.haze-
|
|
17
|
+
.haze-ButtonLink__link{-webkit-text-decoration:none;text-decoration:none}.haze-ButtonLink__link[aria-disabled=true]{opacity:.5;cursor:not-allowed;pointer-events:none}
|
|
18
|
+
.haze-styles__base{justify-content:center;align-items:center;gap:var(--haze-space-2);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-weight:var(--haze-weight-medium);line-height:var(--haze-leading-tight);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid #0000;transition:background .15s,color .15s,border-color .15s,box-shadow .15s;display:inline-flex}.haze-styles__base:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-styles__base:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.haze-styles__solid{background:var(--haze-color-primary);color:var(--haze-color-text-inverse)}.haze-styles__solid:hover{background:var(--haze-color-primary-hover)}.haze-styles__solid:active{background:var(--haze-color-primary-active)}.haze-styles__outline{border-color:var(--haze-color-border);color:var(--haze-color-text);background:0 0}.haze-styles__outline:hover{border-color:var(--haze-color-border-hover);background:var(--haze-color-bg-subtle)}.haze-styles__outline:active{background:var(--haze-color-bg-muted)}.haze-styles__ghost{color:var(--haze-color-text);background:0 0}.haze-styles__ghost:hover{background:var(--haze-color-bg-subtle)}.haze-styles__ghost:active{background:var(--haze-color-bg-muted)}.haze-styles__sizeSm{padding:var(--haze-space-1) var(--haze-space-3);font-size:var(--haze-text-sm)}.haze-styles__sizeMd{padding:var(--haze-space-2) var(--haze-space-4);font-size:var(--haze-text-sm)}.haze-styles__sizeLg{padding:var(--haze-space-3) var(--haze-space-6);font-size:var(--haze-text-base)}.haze-styles__squareSm{padding:var(--haze-space-1);font-size:var(--haze-text-sm)}.haze-styles__squareMd{padding:var(--haze-space-2);font-size:var(--haze-text-sm)}.haze-styles__squareLg{padding:var(--haze-space-3);font-size:var(--haze-text-base)}
|
|
18
19
|
.haze-Card__base{border-radius:var(--haze-radius-lg);padding:var(--haze-space-5);font-family:var(--haze-font-sans);color:var(--haze-color-text)}.haze-Card__elevated{background:var(--haze-color-bg);box-shadow:var(--haze-shadow-md)}.haze-Card__outlined{background:var(--haze-color-bg);border:1px solid var(--haze-color-border)}.haze-Card__filled{background:var(--haze-color-bg-subtle)}
|
|
19
20
|
.haze-Carousel__wrapper{border-radius:var(--haze-radius-lg);position:relative;overflow:hidden}.haze-Carousel__track{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;display:flex;overflow-x:auto}.haze-Carousel__track::-webkit-scrollbar{display:none}.haze-Carousel__navBtn{z-index:1;appearance:none;border-radius:var(--haze-radius-full);background:var(--haze-color-bg);width:2.5rem;height:2.5rem;color:var(--haze-color-text);font-size:var(--haze-text-lg);cursor:pointer;box-shadow:var(--haze-shadow-md);border:none;justify-content:center;align-items:center;transition:background .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.haze-Carousel__navBtn:hover{background:var(--haze-color-bg-subtle)}.haze-Carousel__navBtn:focus-visible{box-shadow:var(--haze-shadow-md),0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Carousel__prevBtn{left:var(--haze-space-2)}.haze-Carousel__nextBtn{right:var(--haze-space-2)}.haze-Carousel__indicators{justify-content:center;gap:var(--haze-space-1);padding:var(--haze-space-2) 0;display:flex}.haze-Carousel__dot{border-radius:var(--haze-radius-full);background:var(--haze-color-bg-muted);cursor:pointer;border:none;width:.625rem;height:.625rem;padding:.375rem;transition:background .15s}.haze-Carousel__dotActive{background:var(--haze-color-primary)}
|
|
20
21
|
.haze-CarouselSlide__slide{scroll-snap-snap-align:start;scroll-snap-align:start;flex:0 0 100%;min-width:0}
|
package/dist/index.js
CHANGED
|
@@ -3,141 +3,142 @@ import { spacing as n } from "./tokens/spacing.js";
|
|
|
3
3
|
import { typography as r } from "./tokens/typography.js";
|
|
4
4
|
import { COMPONENT_TOKENS as i, TOKEN_REGISTRY as a } from "./tokens/registry.js";
|
|
5
5
|
import o from "./components/Button/Button.js";
|
|
6
|
-
import s from "./components/
|
|
7
|
-
import c from "./components/Input/
|
|
8
|
-
import l from "./components/
|
|
9
|
-
import u from "./components/Select/
|
|
10
|
-
import d from "./components/Select/
|
|
11
|
-
import f from "./components/
|
|
12
|
-
import p from "./components/Checkbox/
|
|
13
|
-
import m from "./components/
|
|
14
|
-
import h from "./components/Switch/
|
|
15
|
-
import g from "./components/
|
|
16
|
-
import _ from "./components/
|
|
17
|
-
import v from "./components/
|
|
18
|
-
import y from "./components/
|
|
19
|
-
import b from "./components/
|
|
20
|
-
import x from "./components/
|
|
21
|
-
import S from "./components/Radio/
|
|
22
|
-
import C from "./components/Radio/
|
|
23
|
-
import w from "./components/
|
|
24
|
-
import T from "./components/Textarea/
|
|
25
|
-
import E from "./components/
|
|
26
|
-
import D from "./components/Slider/
|
|
27
|
-
import O from "./components/
|
|
28
|
-
import k from "./components/Tabs/
|
|
29
|
-
import A from "./components/Tabs/
|
|
30
|
-
import j from "./components/Tabs/
|
|
31
|
-
import M from "./components/
|
|
32
|
-
import N from "./components/Accordion/
|
|
33
|
-
import P from "./components/
|
|
34
|
-
import F from "./components/
|
|
35
|
-
import I from "./components/
|
|
36
|
-
import L from "./components/
|
|
37
|
-
import R from "./components/
|
|
38
|
-
import z from "./components/
|
|
39
|
-
import B from "./components/
|
|
40
|
-
import V from "./components/
|
|
41
|
-
import H from "./components/Breadcrumb/
|
|
42
|
-
import U from "./components/
|
|
43
|
-
import W from "./components/
|
|
44
|
-
import G from "./components/Menu/
|
|
45
|
-
import K from "./components/Menu/
|
|
46
|
-
import q from "./components/
|
|
47
|
-
import J from "./components/NumberInput/
|
|
48
|
-
import Y from "./components/
|
|
49
|
-
import X from "./components/
|
|
50
|
-
import Z from "./components/Toast/
|
|
51
|
-
import Q from "./components/Toast/
|
|
52
|
-
import $ from "./components/
|
|
53
|
-
import ee from "./components/List/
|
|
54
|
-
import te from "./components/
|
|
55
|
-
import ne from "./components/
|
|
56
|
-
import re from "./components/Table/
|
|
57
|
-
import ie from "./components/Table/
|
|
58
|
-
import ae from "./components/Table/
|
|
59
|
-
import oe from "./components/Table/
|
|
60
|
-
import se from "./components/
|
|
61
|
-
import ce from "./components/Carousel/
|
|
62
|
-
import le from "./components/
|
|
63
|
-
import ue from "./components/Datepicker/
|
|
64
|
-
import de from "./components/
|
|
65
|
-
import fe from "./components/
|
|
66
|
-
import pe from "./components/
|
|
67
|
-
import me from "./components/
|
|
68
|
-
import he from "./components/
|
|
69
|
-
import ge from "./components/
|
|
70
|
-
import _e from "./components/
|
|
71
|
-
import ve from "./components/Grid/
|
|
72
|
-
import ye from "./components/
|
|
73
|
-
import be from "./components/
|
|
74
|
-
import xe from "./components/Stepper/
|
|
75
|
-
import Se
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import Me from "./components/
|
|
79
|
-
import Ne from "./components/
|
|
80
|
-
import Pe from "./components/
|
|
81
|
-
import Fe from "./components/ColorPicker/
|
|
82
|
-
import Ie from "./components/
|
|
83
|
-
import Le from "./components/Rating/
|
|
84
|
-
import
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import Ge from "./components/
|
|
88
|
-
import Ke from "./components/Segmented/
|
|
89
|
-
import qe from "./components/
|
|
90
|
-
import Je from "./components/
|
|
91
|
-
import Ye from "./components/
|
|
92
|
-
import Xe from "./components/TimePicker/
|
|
93
|
-
import Ze from "./components/
|
|
94
|
-
import Qe from "./components/DateRangePicker/
|
|
95
|
-
import $e from "./components/
|
|
96
|
-
import et from "./components/OTPInput/
|
|
97
|
-
import tt from "./components/
|
|
98
|
-
import nt from "./components/PasswordInput/
|
|
99
|
-
import rt from "./components/
|
|
100
|
-
import it from "./components/TagInput/
|
|
101
|
-
import at from "./components/
|
|
102
|
-
import ot from "./components/
|
|
103
|
-
import st from "./components/DropdownMenu/
|
|
104
|
-
import ct from "./components/DropdownMenu/
|
|
105
|
-
import lt from "./components/DropdownMenu/
|
|
106
|
-
import ut from "./components/DropdownMenu/
|
|
107
|
-
import dt from "./components/
|
|
108
|
-
import ft from "./components/ContextMenu/
|
|
109
|
-
import pt from "./components/ContextMenu/
|
|
110
|
-
import mt from "./components/ContextMenu/
|
|
111
|
-
import ht from "./components/ContextMenu/
|
|
112
|
-
import gt from "./components/
|
|
113
|
-
import _t from "./components/NavigationBar/
|
|
114
|
-
import vt from "./components/
|
|
115
|
-
import yt from "./components/
|
|
116
|
-
import bt from "./components/
|
|
117
|
-
import xt from "./components/
|
|
118
|
-
import St from "./components/
|
|
119
|
-
import Ct from "./components/
|
|
120
|
-
import wt from "./components/
|
|
121
|
-
import Tt from "./components/
|
|
122
|
-
import Et from "./components/
|
|
123
|
-
import Dt from "./components/TagGroup/
|
|
124
|
-
import Ot from "./components/
|
|
125
|
-
import kt from "./components/
|
|
126
|
-
import At from "./components/
|
|
127
|
-
import jt from "./components/
|
|
128
|
-
import Mt from "./components/
|
|
129
|
-
import Nt from "./components/
|
|
130
|
-
import Pt from "./components/
|
|
131
|
-
import Ft from "./components/
|
|
132
|
-
import It from "./components/
|
|
133
|
-
import Lt
|
|
134
|
-
import zt from "./components/
|
|
135
|
-
import Bt from "./components/
|
|
136
|
-
import Vt from "./components/
|
|
137
|
-
import Ht from "./components/
|
|
138
|
-
import Ut from "./components/ConversationList/
|
|
139
|
-
import Wt from "./components/
|
|
140
|
-
import Gt from "./components/
|
|
141
|
-
import Kt from "./
|
|
142
|
-
import
|
|
143
|
-
|
|
6
|
+
import s from "./components/Button/ButtonLink.js";
|
|
7
|
+
import c from "./components/Input/InputCore.js";
|
|
8
|
+
import l from "./components/Input/Input.js";
|
|
9
|
+
import u from "./components/Select/SelectCore.js";
|
|
10
|
+
import d from "./components/Select/Select.js";
|
|
11
|
+
import f from "./components/Select/Option.js";
|
|
12
|
+
import p from "./components/Checkbox/CheckboxCore.js";
|
|
13
|
+
import m from "./components/Checkbox/Checkbox.js";
|
|
14
|
+
import h from "./components/Switch/SwitchCore.js";
|
|
15
|
+
import g from "./components/Switch/Switch.js";
|
|
16
|
+
import _ from "./components/Badge/Badge.js";
|
|
17
|
+
import v from "./components/Dialog/Dialog.js";
|
|
18
|
+
import y from "./components/Tooltip/Tooltip.js";
|
|
19
|
+
import b from "./components/Popover/Popover.js";
|
|
20
|
+
import x from "./components/Card/Card.js";
|
|
21
|
+
import S from "./components/Radio/Radio.js";
|
|
22
|
+
import C from "./components/Radio/RadioGroupCore.js";
|
|
23
|
+
import w from "./components/Radio/RadioGroup.js";
|
|
24
|
+
import T from "./components/Textarea/TextareaCore.js";
|
|
25
|
+
import E from "./components/Textarea/Textarea.js";
|
|
26
|
+
import D from "./components/Slider/SliderCore.js";
|
|
27
|
+
import O from "./components/Slider/Slider.js";
|
|
28
|
+
import k from "./components/Tabs/Tabs.js";
|
|
29
|
+
import A from "./components/Tabs/TabList.js";
|
|
30
|
+
import j from "./components/Tabs/Tab.js";
|
|
31
|
+
import M from "./components/Tabs/TabPanel.js";
|
|
32
|
+
import N from "./components/Accordion/Accordion.js";
|
|
33
|
+
import P from "./components/Accordion/AccordionItem.js";
|
|
34
|
+
import F from "./components/Alert/Alert.js";
|
|
35
|
+
import I from "./components/Avatar/Avatar.js";
|
|
36
|
+
import L from "./components/Tag/Tag.js";
|
|
37
|
+
import R from "./components/Skeleton/Skeleton.js";
|
|
38
|
+
import z from "./components/Icon/Icon.js";
|
|
39
|
+
import B from "./components/Image/Image.js";
|
|
40
|
+
import V from "./components/Flex/Flex.js";
|
|
41
|
+
import H from "./components/Breadcrumb/Breadcrumb.js";
|
|
42
|
+
import U from "./components/Breadcrumb/BreadcrumbItem.js";
|
|
43
|
+
import W from "./components/Disclosure/Disclosure.js";
|
|
44
|
+
import G from "./components/Menu/Menu.js";
|
|
45
|
+
import K from "./components/Menu/MenuItem.js";
|
|
46
|
+
import q from "./components/Menu/MenuDivider.js";
|
|
47
|
+
import J from "./components/NumberInput/NumberInputCore.js";
|
|
48
|
+
import Y from "./components/NumberInput/NumberInput.js";
|
|
49
|
+
import X from "./components/FileInput/FileInput.js";
|
|
50
|
+
import Z from "./components/Toast/Toast.js";
|
|
51
|
+
import Q from "./components/Toast/ToastContainer.js";
|
|
52
|
+
import $ from "./components/Toast/useToast.js";
|
|
53
|
+
import ee from "./components/List/List.js";
|
|
54
|
+
import te from "./components/List/ListItem.js";
|
|
55
|
+
import ne from "./components/Combobox/Combobox.js";
|
|
56
|
+
import re from "./components/Table/Table.js";
|
|
57
|
+
import ie from "./components/Table/TableHead.js";
|
|
58
|
+
import ae from "./components/Table/TableBody.js";
|
|
59
|
+
import oe from "./components/Table/TableRow.js";
|
|
60
|
+
import se from "./components/Table/TableCell.js";
|
|
61
|
+
import ce from "./components/Carousel/Carousel.js";
|
|
62
|
+
import le from "./components/Carousel/CarouselSlide.js";
|
|
63
|
+
import ue from "./components/Datepicker/DatepickerCore.js";
|
|
64
|
+
import de from "./components/Datepicker/Datepicker.js";
|
|
65
|
+
import fe from "./components/Tree/Tree.js";
|
|
66
|
+
import pe from "./components/Divider/Divider.js";
|
|
67
|
+
import me from "./components/Spinner/Spinner.js";
|
|
68
|
+
import he from "./components/Empty/Empty.js";
|
|
69
|
+
import ge from "./components/Progress/Progress.js";
|
|
70
|
+
import _e from "./components/Pagination/Pagination.js";
|
|
71
|
+
import ve from "./components/Grid/Grid.js";
|
|
72
|
+
import ye from "./components/Grid/GridItem.js";
|
|
73
|
+
import be from "./components/Drawer/Drawer.js";
|
|
74
|
+
import xe from "./components/Stepper/Stepper.js";
|
|
75
|
+
import Se from "./components/Stepper/Step.js";
|
|
76
|
+
import Ce, { CommandInput as we, CommandItem as Te, CommandList as Ee } from "./components/Command/Command.js";
|
|
77
|
+
import { ResizableGroup as De, ResizableHandle as Oe, ResizablePanel as ke } from "./components/Resizable/Resizable.js";
|
|
78
|
+
import { Collapsible as Ae, CollapsibleContent as je, CollapsibleTrigger as Me } from "./components/Collapsible/Collapsible.js";
|
|
79
|
+
import Ne from "./components/Transfer/Transfer.js";
|
|
80
|
+
import Pe from "./components/Upload/Upload.js";
|
|
81
|
+
import Fe from "./components/ColorPicker/ColorPickerCore.js";
|
|
82
|
+
import Ie from "./components/ColorPicker/ColorPicker.js";
|
|
83
|
+
import Le from "./components/Rating/RatingCore.js";
|
|
84
|
+
import Re from "./components/Rating/Rating.js";
|
|
85
|
+
import { Timeline as ze, TimelineItem as Be } from "./components/Timeline/Timeline.js";
|
|
86
|
+
import { Paragraph as Ve, Text as He, Title as Ue } from "./components/Typography/Typography.js";
|
|
87
|
+
import { Stat as We, StatGroup as Ge } from "./components/Stat/Stat.js";
|
|
88
|
+
import Ke from "./components/Segmented/SegmentedCore.js";
|
|
89
|
+
import qe from "./components/Segmented/Segmented.js";
|
|
90
|
+
import Je from "./components/Chip/Chip.js";
|
|
91
|
+
import Ye from "./components/ScrollArea/ScrollArea.js";
|
|
92
|
+
import Xe from "./components/TimePicker/TimePickerCore.js";
|
|
93
|
+
import Ze from "./components/TimePicker/TimePicker.js";
|
|
94
|
+
import Qe from "./components/DateRangePicker/DateRangePickerCore.js";
|
|
95
|
+
import $e from "./components/DateRangePicker/DateRangePicker.js";
|
|
96
|
+
import et from "./components/OTPInput/OTPInputCore.js";
|
|
97
|
+
import tt from "./components/OTPInput/OTPInput.js";
|
|
98
|
+
import nt from "./components/PasswordInput/PasswordInputCore.js";
|
|
99
|
+
import rt from "./components/PasswordInput/PasswordInput.js";
|
|
100
|
+
import it from "./components/TagInput/TagInputCore.js";
|
|
101
|
+
import at from "./components/TagInput/TagInput.js";
|
|
102
|
+
import ot from "./components/InlineEdit/InlineEdit.js";
|
|
103
|
+
import st from "./components/DropdownMenu/DropdownMenu.js";
|
|
104
|
+
import ct from "./components/DropdownMenu/DropdownMenuTrigger.js";
|
|
105
|
+
import lt from "./components/DropdownMenu/DropdownMenuContent.js";
|
|
106
|
+
import ut from "./components/DropdownMenu/DropdownMenuItem.js";
|
|
107
|
+
import dt from "./components/DropdownMenu/DropdownMenuSeparator.js";
|
|
108
|
+
import ft from "./components/ContextMenu/ContextMenu.js";
|
|
109
|
+
import pt from "./components/ContextMenu/ContextMenuTrigger.js";
|
|
110
|
+
import mt from "./components/ContextMenu/ContextMenuContent.js";
|
|
111
|
+
import ht from "./components/ContextMenu/ContextMenuItem.js";
|
|
112
|
+
import gt from "./components/ContextMenu/ContextMenuSeparator.js";
|
|
113
|
+
import _t from "./components/NavigationBar/NavigationBar.js";
|
|
114
|
+
import vt from "./components/NavigationBar/NavLink.js";
|
|
115
|
+
import yt from "./components/BackToTop/BackToTop.js";
|
|
116
|
+
import bt from "./components/Affix/Affix.js";
|
|
117
|
+
import xt from "./components/Container/Container.js";
|
|
118
|
+
import St from "./components/Banner/Banner.js";
|
|
119
|
+
import Ct from "./components/ConfirmDialog/ConfirmDialog.js";
|
|
120
|
+
import wt from "./components/CodeBlock/CodeBlock.js";
|
|
121
|
+
import Tt from "./components/AspectRatio/AspectRatio.js";
|
|
122
|
+
import Et from "./components/VirtualList/VirtualList.js";
|
|
123
|
+
import Dt from "./components/TagGroup/TagGroup.js";
|
|
124
|
+
import Ot from "./components/TagGroup/TagGroupItem.js";
|
|
125
|
+
import kt from "./components/BottomSheet/BottomSheet.js";
|
|
126
|
+
import At from "./components/SwipeAction/SwipeAction.js";
|
|
127
|
+
import jt from "./components/ChatMessage/ChatMessage.js";
|
|
128
|
+
import Mt from "./components/ChatContainer/ChatContainer.js";
|
|
129
|
+
import Nt from "./components/ChatInput/ChatInput.js";
|
|
130
|
+
import Pt from "./components/StreamingText/StreamingText.js";
|
|
131
|
+
import Ft from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
132
|
+
import It from "./components/ToolCallCard/ToolCallCard.js";
|
|
133
|
+
import Lt from "./components/ThinkingIndicator/ThinkingIndicator.js";
|
|
134
|
+
import Rt, { StepTimelineItem as zt } from "./components/StepTimeline/StepTimeline.js";
|
|
135
|
+
import Bt from "./components/ApprovalCard/ApprovalCard.js";
|
|
136
|
+
import Vt from "./components/TokenCounter/TokenCounter.js";
|
|
137
|
+
import Ht from "./components/ModelPicker/ModelPicker.js";
|
|
138
|
+
import Ut from "./components/ConversationList/ConversationList.js";
|
|
139
|
+
import Wt from "./components/ConversationList/ConversationItem.js";
|
|
140
|
+
import Gt from "./components/DiffViewer/DiffViewer.js";
|
|
141
|
+
import Kt from "./components/LogViewer/LogViewer.js";
|
|
142
|
+
import qt from "./form/FormItem.js";
|
|
143
|
+
import { useControl as Jt } from "react-use-control";
|
|
144
|
+
export { N as Accordion, P as AccordionItem, bt as Affix, F as Alert, Bt as ApprovalCard, Tt as AspectRatio, I as Avatar, yt as BackToTop, _ as Badge, St as Banner, kt as BottomSheet, H as Breadcrumb, U as BreadcrumbItem, o as Button, s as ButtonLink, i as COMPONENT_TOKENS, x as Card, ce as Carousel, le as CarouselSlide, Mt as ChatContainer, Nt as ChatInput, jt as ChatMessage, m as Checkbox, p as CheckboxCore, Je as Chip, wt as CodeBlock, Ae as Collapsible, je as CollapsibleContent, Me as CollapsibleTrigger, Ie as ColorPicker, Fe as ColorPickerCore, ne as Combobox, Ce as Command, we as CommandInput, Te as CommandItem, Ee as CommandList, Ct as ConfirmDialog, xt as Container, ft as ContextMenu, mt as ContextMenuContent, ht as ContextMenuItem, gt as ContextMenuSeparator, pt as ContextMenuTrigger, Wt as ConversationItem, Ut as ConversationList, $e as DateRangePicker, Qe as DateRangePickerCore, de as Datepicker, ue as DatepickerCore, v as Dialog, Gt as DiffViewer, W as Disclosure, pe as Divider, be as Drawer, st as DropdownMenu, lt as DropdownMenuContent, ut as DropdownMenuItem, dt as DropdownMenuSeparator, ct as DropdownMenuTrigger, he as Empty, X as FileInput, V as Flex, qt as FormItem, ve as Grid, ye as GridItem, z as Icon, B as Image, ot as InlineEdit, l as Input, c as InputCore, ee as List, te as ListItem, Kt as LogViewer, Ft as MarkdownRenderer, G as Menu, q as MenuDivider, K as MenuItem, Ht as ModelPicker, vt as NavLink, _t as NavigationBar, Y as NumberInput, J as NumberInputCore, tt as OTPInput, et as OTPInputCore, f as Option, _e as Pagination, Ve as Paragraph, rt as PasswordInput, nt as PasswordInputCore, b as Popover, ge as Progress, S as Radio, w as RadioGroup, C as RadioGroupCore, Re as Rating, Le as RatingCore, De as ResizableGroup, Oe as ResizableHandle, ke as ResizablePanel, Ye as ScrollArea, qe as Segmented, Ke as SegmentedCore, d as Select, u as SelectCore, R as Skeleton, O as Slider, D as SliderCore, me as Spinner, We as Stat, Ge as StatGroup, Se as Step, Rt as StepTimeline, zt as StepTimelineItem, xe as Stepper, Pt as StreamingText, At as SwipeAction, g as Switch, h as SwitchCore, a as TOKEN_REGISTRY, j as Tab, A as TabList, M as TabPanel, re as Table, ae as TableBody, se as TableCell, ie as TableHead, oe as TableRow, k as Tabs, L as Tag, Dt as TagGroup, Ot as TagGroupItem, at as TagInput, it as TagInputCore, He as Text, E as Textarea, T as TextareaCore, Lt as ThinkingIndicator, Ze as TimePicker, Xe as TimePickerCore, ze as Timeline, Be as TimelineItem, Ue as Title, Z as Toast, Q as ToastContainer, Vt as TokenCounter, It as ToolCallCard, y as Tooltip, Ne as Transfer, fe as Tree, Pe as Upload, Et as VirtualList, e as darkTheme, t as lightTheme, n as spacing, r as typography, Jt as useControl, $ as useToast };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A real `<a>` with the full Button appearance — for navigation that
|
|
4
|
+
* must look like a button. Rendering `as={Button}` puts `href` on a
|
|
5
|
+
* `<button>` (an invalid attribute: no ⌘/middle-click, no crawlable
|
|
6
|
+
* link); ButtonLink keeps the anchor semantics and wears Button's skin
|
|
7
|
+
* (same `variant`/`size`/`square` props, same focus/disabled visual
|
|
8
|
+
* states).
|
|
9
|
+
*
|
|
10
|
+
* Extends the native `<a>` attributes — everything not listed below is
|
|
11
|
+
* spread onto the anchor, so routers composing their own `Link` through
|
|
12
|
+
* an `as` prop can inject `href`, `onClick`, `target`, `rel` and
|
|
13
|
+
* friends (NavLink-style).
|
|
14
|
+
*
|
|
15
|
+
* Anchors have no `disabled` attribute: report the state with
|
|
16
|
+
* `aria-disabled` (and `tabIndex={-1}` to drop it from the focus
|
|
17
|
+
* order) — ButtonLink styles `aria-disabled` exactly like Button's
|
|
18
|
+
* `:disabled`.
|
|
19
|
+
*/
|
|
20
|
+
type ButtonLinkProps = {
|
|
21
|
+
variant?: 'solid' | 'outline' | 'ghost';
|
|
22
|
+
size?: 'sm' | 'md' | 'lg';
|
|
23
|
+
square?: boolean;
|
|
24
|
+
} & ComponentPropsWithoutRef<'a'>;
|
|
25
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
26
|
+
variant?: "solid" | "outline" | "ghost";
|
|
27
|
+
size?: "sm" | "md" | "lg";
|
|
28
|
+
square?: boolean;
|
|
29
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
30
|
+
export default _default;
|
|
31
|
+
export type { ButtonLinkProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Button skin — the base, variant and size classes `Button` and
|
|
3
|
+
* `ButtonLink` both wear. Living in their own module keeps the two
|
|
4
|
+
* components' visual contract in one place (one edit re-skins both) and
|
|
5
|
+
* keeps component files free of style internals; split-css groups the
|
|
6
|
+
* emitted CSS into `haze-ui/css/button.css` with them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const base: import("@linaria/core").LinariaClassName;
|
|
9
|
+
export declare const variants: {
|
|
10
|
+
readonly solid: import("@linaria/core").LinariaClassName;
|
|
11
|
+
readonly outline: import("@linaria/core").LinariaClassName;
|
|
12
|
+
readonly ghost: import("@linaria/core").LinariaClassName;
|
|
13
|
+
};
|
|
14
|
+
export declare const sizeSm: import("@linaria/core").LinariaClassName;
|
|
15
|
+
export declare const sizeMd: import("@linaria/core").LinariaClassName;
|
|
16
|
+
export declare const sizeLg: import("@linaria/core").LinariaClassName;
|
|
17
|
+
export declare const squareSm: import("@linaria/core").LinariaClassName;
|
|
18
|
+
export declare const squareMd: import("@linaria/core").LinariaClassName;
|
|
19
|
+
export declare const squareLg: import("@linaria/core").LinariaClassName;
|
|
20
|
+
export declare const sizes: {
|
|
21
|
+
readonly sm: import("@linaria/core").LinariaClassName;
|
|
22
|
+
readonly md: import("@linaria/core").LinariaClassName;
|
|
23
|
+
readonly lg: import("@linaria/core").LinariaClassName;
|
|
24
|
+
};
|
|
25
|
+
export declare const squareSizes: {
|
|
26
|
+
readonly sm: import("@linaria/core").LinariaClassName;
|
|
27
|
+
readonly md: import("@linaria/core").LinariaClassName;
|
|
28
|
+
readonly lg: import("@linaria/core").LinariaClassName;
|
|
29
|
+
};
|
|
@@ -62,7 +62,10 @@ export type FormItemAsProps = {
|
|
|
62
62
|
* passing `{value}`. */
|
|
63
63
|
valueToProps?: (value: any) => Record<string, any>;
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
/** FormItem's own, non-polymorphic props — everything the item itself
|
|
66
|
+
* consumes regardless of how the control is bound (render-prop, `as`
|
|
67
|
+
* or `input`). */
|
|
68
|
+
export type FormItemOwnProps<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name> = {
|
|
66
69
|
form: FormInstance<TValues>;
|
|
67
70
|
name: P;
|
|
68
71
|
label?: ReactNode;
|
|
@@ -95,14 +98,56 @@ export type FormItemProps<TValues extends Record<string, any> = any, P extends F
|
|
|
95
98
|
/** Custom error renderer: when provided and the field has errors, the
|
|
96
99
|
* built-in error span renders `renderError(errors[0].message, errorId)`
|
|
97
100
|
* instead of the bare message. The span itself — id, `role='alert'`,
|
|
98
|
-
* styling — stays FormItem's, in
|
|
101
|
+
* styling — stays FormItem's, in every control-binding mode. */
|
|
99
102
|
renderError?: (error: string, id: string) => ReactNode;
|
|
100
103
|
className?: string;
|
|
101
|
-
}
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Props FormItem wires itself onto an `input`/`as` control — the bridge's
|
|
107
|
+
* own contract. Used to keep them out of `input`'s forwarded rest props
|
|
108
|
+
* (type level) and to document that they always win (runtime level):
|
|
109
|
+
* passing one anyway is a compile error, never a silent override.
|
|
110
|
+
*/
|
|
111
|
+
type FormItemWiredProps = {
|
|
112
|
+
id?: unknown;
|
|
113
|
+
onBlur?: unknown;
|
|
114
|
+
onChange?: unknown;
|
|
115
|
+
/** the value channel: `value` directly, or the prop `valueToProps`
|
|
116
|
+
* derives (e.g. `checked` for CheckboxCore) — either way FormItem's */
|
|
117
|
+
value?: unknown;
|
|
118
|
+
checked?: unknown;
|
|
119
|
+
'aria-invalid'?: unknown;
|
|
120
|
+
'aria-describedby'?: unknown;
|
|
121
|
+
};
|
|
122
|
+
export type FormItemProps<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name, TInputProps extends Record<string, any> = Record<never, never>> = FormItemOwnProps<TValues, P> & FormItemAsProps & {
|
|
123
|
+
/**
|
|
124
|
+
* Declarative binding for haze-ui cores: pass the component
|
|
125
|
+
* (`InputCore`, `TextareaCore`, `TagInputCore`, `SelectCore`,
|
|
126
|
+
* `CheckboxCore`, …) and FormItem wires `id`, `aria-invalid`,
|
|
127
|
+
* `aria-describedby`, `onBlur`, `onChange` and the value channel
|
|
128
|
+
* itself. Every other prop — and JSX children (a `SelectCore`'s
|
|
129
|
+
* `<option>`s) — is forwarded to the component, fully type-checked
|
|
130
|
+
* against its own props. Cores' `onChange` emits the next plain value
|
|
131
|
+
* (identity `eventToValue`); checkbox-style controls pair with
|
|
132
|
+
* `valueToProps={(checked) => ({checked})}`. Props FormItem owns or
|
|
133
|
+
* wires (label, className, id, aria-*, onBlur, onChange, value,
|
|
134
|
+
* checked, …) are reserved and cannot be forwarded — use the
|
|
135
|
+
* render-prop or `as`/`asProps` for a colliding control prop.
|
|
136
|
+
*/
|
|
137
|
+
input?: ComponentType<TInputProps>;
|
|
138
|
+
} & Omit<TInputProps, keyof FormItemOwnProps<TValues, P> | keyof FormItemAsProps | keyof FormItemWiredProps | 'input'> & ({
|
|
102
139
|
as: ComponentType<any>;
|
|
140
|
+
input?: never;
|
|
103
141
|
children?: never;
|
|
104
142
|
} | {
|
|
105
143
|
as?: undefined;
|
|
144
|
+
input: ComponentType<TInputProps>;
|
|
145
|
+
/** JSX children forward to the control (SelectCore's options);
|
|
146
|
+
* the render-prop form is mutually exclusive with `input`. */
|
|
147
|
+
children?: 'children' extends keyof TInputProps ? TInputProps['children'] : undefined;
|
|
148
|
+
} | {
|
|
149
|
+
as?: undefined;
|
|
150
|
+
input?: undefined;
|
|
106
151
|
children: (binding: FormItemBinding<TValues, P>) => ReactNode;
|
|
107
152
|
});
|
|
108
153
|
/**
|
|
@@ -141,8 +186,29 @@ export type FormItemProps<TValues extends Record<string, any> = any, P extends F
|
|
|
141
186
|
* value lands as `{value}` or, with `valueToProps`, whatever props the
|
|
142
187
|
* control wants (e.g. `{checked}` for CheckboxCore).
|
|
143
188
|
*
|
|
189
|
+
* The ergonomic form for haze-ui cores is `input`: the rest of the JSX
|
|
190
|
+
* props — and JSX children, e.g. a `SelectCore`'s `<option>`s — are
|
|
191
|
+
* forwarded to the component, type-checked against its own props
|
|
192
|
+
* (`input` and the render-prop children are mutually exclusive):
|
|
193
|
+
*
|
|
194
|
+
* ```tsx
|
|
195
|
+
* <FormItem
|
|
196
|
+
* form={form}
|
|
197
|
+
* name='email'
|
|
198
|
+
* input={InputCore}
|
|
199
|
+
* placeholder='Email'
|
|
200
|
+
* mode='onBlur'
|
|
201
|
+
* />
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* The same wiring as `as` applies (id, aria, onBlur, onChange, value);
|
|
205
|
+
* wired and FormItem-owned prop names are reserved — a control prop that
|
|
206
|
+
* collides (CheckboxCore's `label`) needs the render-prop or
|
|
207
|
+
* `as`/`asProps` channel.
|
|
208
|
+
*
|
|
144
209
|
* When the field has errors, the first error's message is rendered into a
|
|
145
210
|
* `<span id={errorId} role='alert'>` next to the control; with no errors
|
|
146
211
|
* no extra element is rendered.
|
|
147
212
|
*/
|
|
148
|
-
export default function FormItem<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name>({ form, name, label, validate, mode, validateDebounce, delayError, rules, className, renderError, as: As, asProps, eventToValue, valueToProps, children }: FormItemProps<TValues, P>): import("react").JSX.Element;
|
|
213
|
+
export default function FormItem<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name, TInputProps extends Record<string, any> = Record<never, never>>({ form, name, label, validate, mode, validateDebounce, delayError, rules, className, renderError, as: As, asProps, input: Input, eventToValue, valueToProps, children, ...inputProps }: FormItemProps<TValues, P, TInputProps>): import("react").JSX.Element;
|
|
214
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as FormItem } from './FormItem';
|
|
2
|
-
export type { FieldValidator, FormItemAsProps, FormItemBinding, FormItemProps } from './FormItem';
|
|
2
|
+
export type { FieldValidator, FormItemAsProps, FormItemBinding, FormItemOwnProps, FormItemProps } from './FormItem';
|
|
3
3
|
export type { FormInstance, PathValueOf } from 'react-f0rm';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { spacing } from './tokens/spacing';
|
|
|
3
3
|
export { typography } from './tokens/typography';
|
|
4
4
|
export { TOKEN_REGISTRY, COMPONENT_TOKENS } from './tokens/registry';
|
|
5
5
|
export type { TokenDef } from './tokens/registry';
|
|
6
|
-
export { Button } from './components/Button';
|
|
7
|
-
export type { ButtonProps } from './components/Button';
|
|
6
|
+
export { Button, ButtonLink } from './components/Button';
|
|
7
|
+
export type { ButtonProps, ButtonLinkProps } from './components/Button';
|
|
8
8
|
export { Input, InputCore } from './components/Input';
|
|
9
9
|
export type { InputProps, InputCoreProps } from './components/Input';
|
|
10
10
|
export { Select, Option, SelectCore } from './components/Select';
|
|
@@ -182,6 +182,6 @@ export type { DiffViewerProps, DiffLine } from './components/DiffViewer';
|
|
|
182
182
|
export { LogViewer } from './components/LogViewer';
|
|
183
183
|
export type { LogViewerProps, LogEntry, LogLevel } from './components/LogViewer';
|
|
184
184
|
export { FormItem } from './form';
|
|
185
|
-
export type { FieldValidator, FormItemAsProps, FormItemBinding, FormItemProps, FormInstance, PathValueOf, } from './form';
|
|
185
|
+
export type { FieldValidator, FormItemAsProps, FormItemBinding, FormItemOwnProps, FormItemProps, FormInstance, PathValueOf, } from './form';
|
|
186
186
|
export { useControl } from 'react-use-control';
|
|
187
187
|
export type { Control, ControlOrValue } from 'react-use-control';
|