@rockshin/tao-ui 0.0.25 → 0.0.26

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 (76) hide show
  1. package/README.md +17 -6
  2. package/component-manifest.json +534 -6
  3. package/dist/components/alert/alert.css +120 -0
  4. package/dist/components/alert/alert.d.ts +20 -0
  5. package/dist/components/alert/alert.js +185 -0
  6. package/dist/components/button/button.css +19 -18
  7. package/dist/components/button/button.d.ts +8 -0
  8. package/dist/components/date-picker/date-picker.js +1 -1
  9. package/dist/components/date-picker/range-picker.js +1 -1
  10. package/dist/components/dropdown/dropdown.css +22 -1
  11. package/dist/components/dropdown/dropdown.js +4 -3
  12. package/dist/components/form/form-context.d.ts +7 -0
  13. package/dist/components/form/form-context.js +8 -0
  14. package/dist/components/form/form-item.d.ts +55 -0
  15. package/dist/components/form/form-item.js +131 -0
  16. package/dist/components/form/form.css +22 -0
  17. package/dist/components/form/form.d.ts +35 -0
  18. package/dist/components/form/form.js +125 -0
  19. package/dist/components/form/index.d.ts +2 -0
  20. package/dist/components/form/index.js +1 -0
  21. package/dist/components/form-field/form-field-view.d.ts +30 -0
  22. package/dist/components/form-field/form-field-view.js +154 -0
  23. package/dist/components/form-field/form-field.d.ts +2 -2
  24. package/dist/components/form-field/form-field.js +29 -137
  25. package/dist/components/form-field/form.css +17 -7
  26. package/dist/components/input/input.css +6 -6
  27. package/dist/components/modal/confirm-dialog.js +14 -111
  28. package/dist/components/modal/modal.d.ts +7 -1
  29. package/dist/components/modal/modal.js +205 -195
  30. package/dist/components/popconfirm/popconfirm.css +44 -0
  31. package/dist/components/popconfirm/popconfirm.d.ts +41 -0
  32. package/dist/components/popconfirm/popconfirm.js +238 -0
  33. package/dist/components/popover/popover.css +105 -0
  34. package/dist/components/popover/popover.d.ts +41 -0
  35. package/dist/components/popover/popover.js +412 -0
  36. package/dist/components/select/select.js +1 -1
  37. package/dist/components/status-icon/status-icon.d.ts +5 -0
  38. package/dist/components/status-icon/status-icon.js +77 -0
  39. package/dist/components/table/table-types.d.ts +7 -0
  40. package/dist/components/table/table.d.ts +1 -1
  41. package/dist/components/table/table.js +296 -283
  42. package/dist/components/tooltip/tooltip.css +93 -0
  43. package/dist/components/tooltip/tooltip.d.ts +33 -0
  44. package/dist/components/tooltip/tooltip.js +226 -0
  45. package/dist/docs/components/alert.doc.d.ts +29 -0
  46. package/dist/docs/components/alert.doc.js +93 -0
  47. package/dist/docs/components/form.doc.d.ts +29 -0
  48. package/dist/docs/components/form.doc.js +71 -0
  49. package/dist/docs/components/modal.doc.d.ts +6 -0
  50. package/dist/docs/components/modal.doc.js +9 -1
  51. package/dist/docs/components/popconfirm.doc.d.ts +29 -0
  52. package/dist/docs/components/popconfirm.doc.js +132 -0
  53. package/dist/docs/components/popover.doc.d.ts +29 -0
  54. package/dist/docs/components/popover.doc.js +121 -0
  55. package/dist/docs/components/stack.doc.d.ts +6 -0
  56. package/dist/docs/components/stack.doc.js +23 -2
  57. package/dist/docs/components/table.doc.js +2 -1
  58. package/dist/docs/components/tao-provider.doc.js +11 -1
  59. package/dist/docs/components/tooltip.doc.d.ts +37 -0
  60. package/dist/docs/components/tooltip.doc.js +76 -0
  61. package/dist/index.d.ts +9 -1
  62. package/dist/index.js +8 -1
  63. package/dist/layouts/stack/stack.d.ts +12 -3
  64. package/dist/layouts/stack/stack.js +60 -34
  65. package/dist/provider/tao-provider.d.ts +71 -0
  66. package/dist/provider/tao-provider.js +166 -120
  67. package/dist/theme/control.css +12 -12
  68. package/dist/theme/theme.css +23 -0
  69. package/dist/utils/breakpoint.d.ts +31 -0
  70. package/dist/utils/breakpoint.js +80 -0
  71. package/dist/utils/overlay.d.ts +19 -0
  72. package/dist/utils/overlay.js +41 -0
  73. package/llms.txt +68 -3
  74. package/package.json +6 -4
  75. package/dist/components/select/use-is-mobile.d.ts +0 -1
  76. package/dist/components/select/use-is-mobile.js +0 -27
@@ -0,0 +1,120 @@
1
+ [data-tao-alert] {
2
+ align-items: flex-start;
3
+ gap: var(--tao-padding-xs);
4
+ box-sizing: border-box;
5
+ padding: var(--tao-padding-xs) var(--tao-padding-sm);
6
+ font-family: var(--tao-font-family);
7
+ font-size: var(--tao-font-size-base);
8
+ line-height: var(--tao-line-height);
9
+ color: var(--tao-color-text);
10
+ border-radius: var(--tao-radius-md);
11
+ border: var(--tao-line-width) solid transparent;
12
+ transition: background-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
13
+ border-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
14
+ color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
15
+ opacity var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
16
+ display: flex;
17
+ }
18
+
19
+ [data-tao-alert-icon] {
20
+ font-size: var(--tao-font-size-base);
21
+ line-height: var(--tao-line-height);
22
+ flex: none;
23
+ justify-content: center;
24
+ align-items: center;
25
+ display: inline-flex;
26
+ }
27
+
28
+ [data-tao-alert][data-tao-with-description] [data-tao-alert-icon] {
29
+ font-size: var(--tao-font-size-lg);
30
+ }
31
+
32
+ [data-tao-alert-content] {
33
+ flex: auto;
34
+ min-width: 0;
35
+ }
36
+
37
+ [data-tao-alert-title] {
38
+ color: var(--tao-color-text);
39
+ }
40
+
41
+ [data-tao-alert][data-tao-with-description] [data-tao-alert-title] {
42
+ font-weight: var(--tao-font-weight-strong);
43
+ }
44
+
45
+ [data-tao-alert-description] {
46
+ color: var(--tao-color-text-secondary);
47
+ }
48
+
49
+ [data-tao-alert-action] {
50
+ flex: none;
51
+ align-items: center;
52
+ margin-inline-start: var(--tao-padding-xs);
53
+ display: inline-flex;
54
+ }
55
+
56
+ [data-tao-alert-close] {
57
+ width: calc(var(--tao-font-size-base) * var(--tao-line-height));
58
+ height: calc(var(--tao-font-size-base) * var(--tao-line-height));
59
+ cursor: pointer;
60
+ border-radius: var(--tao-radius-sm);
61
+ color: var(--tao-color-text-secondary);
62
+ font: inherit;
63
+ transition: background-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
64
+ color var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
65
+ background: none;
66
+ border: 0;
67
+ flex: none;
68
+ justify-content: center;
69
+ align-items: center;
70
+ padding: 0;
71
+ line-height: 1;
72
+ display: inline-flex;
73
+ }
74
+
75
+ [data-tao-alert-close]:hover {
76
+ background: var(--tao-color-fill-secondary);
77
+ color: var(--tao-color-text);
78
+ }
79
+
80
+ [data-tao-alert-close]:focus-visible {
81
+ box-shadow: 0 0 0 var(--tao-ring-width) var(--tao-control-outline);
82
+ outline: none;
83
+ }
84
+
85
+ [data-tao-alert][data-tao-type="success"] {
86
+ background: var(--tao-success-bg);
87
+ border-color: var(--tao-success-border);
88
+ }
89
+
90
+ [data-tao-alert][data-tao-type="success"] [data-tao-alert-icon], [data-tao-alert][data-tao-type="success"] [data-tao-alert-title] {
91
+ color: var(--tao-success);
92
+ }
93
+
94
+ [data-tao-alert][data-tao-type="info"] {
95
+ background: var(--tao-primary-bg);
96
+ border-color: var(--tao-primary-border);
97
+ }
98
+
99
+ [data-tao-alert][data-tao-type="info"] [data-tao-alert-icon], [data-tao-alert][data-tao-type="info"] [data-tao-alert-title] {
100
+ color: var(--tao-primary);
101
+ }
102
+
103
+ [data-tao-alert][data-tao-type="warning"] {
104
+ background: var(--tao-warning-bg);
105
+ border-color: var(--tao-warning-border);
106
+ }
107
+
108
+ [data-tao-alert][data-tao-type="warning"] [data-tao-alert-icon], [data-tao-alert][data-tao-type="warning"] [data-tao-alert-title] {
109
+ color: var(--tao-warning);
110
+ }
111
+
112
+ [data-tao-alert][data-tao-type="error"] {
113
+ background: var(--tao-error-bg);
114
+ border-color: var(--tao-error-border);
115
+ }
116
+
117
+ [data-tao-alert][data-tao-type="error"] [data-tao-alert-icon], [data-tao-alert][data-tao-type="error"] [data-tao-alert-title] {
118
+ color: var(--tao-error);
119
+ }
120
+
@@ -0,0 +1,20 @@
1
+ import { type CSSProperties, type MouseEvent, type ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
3
+ import './alert.css';
4
+ export type AlertSemanticPart = 'root' | 'icon' | 'title' | 'description' | 'action' | 'close';
5
+ export type AlertType = 'success' | 'info' | 'warning' | 'error';
6
+ export interface AlertProps {
7
+ type?: AlertType;
8
+ title?: ReactNode;
9
+ description?: ReactNode;
10
+ showIcon?: boolean;
11
+ icon?: ReactNode;
12
+ closable?: boolean;
13
+ onClose?: (e: MouseEvent<HTMLElement>) => void;
14
+ action?: ReactNode;
15
+ className?: string;
16
+ style?: CSSProperties;
17
+ classNames?: SemanticClassNames<AlertSemanticPart>;
18
+ styles?: SemanticStyles<AlertSemanticPart>;
19
+ }
20
+ export declare function Alert({ type, title, description, showIcon, icon, closable, onClose, action, className, style, classNames, styles, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,185 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useState } from "react";
4
+ import { cx } from "../../utils/semantic.js";
5
+ import { StatusIcon } from "../status-icon/status-icon.js";
6
+ import "./alert.css";
7
+ function CloseIcon() {
8
+ const $ = c(1);
9
+ let t0;
10
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
11
+ t0 = /*#__PURE__*/ jsx("svg", {
12
+ width: "12",
13
+ height: "12",
14
+ viewBox: "0 0 12 12",
15
+ fill: "none",
16
+ "aria-hidden": "true",
17
+ focusable: "false",
18
+ role: "presentation",
19
+ children: /*#__PURE__*/ jsx("path", {
20
+ d: "M3 3l6 6M9 3l-6 6",
21
+ stroke: "currentColor",
22
+ strokeWidth: "1.5",
23
+ strokeLinecap: "round"
24
+ })
25
+ });
26
+ $[0] = t0;
27
+ } else t0 = $[0];
28
+ return t0;
29
+ }
30
+ function Alert(t0) {
31
+ const $ = c(44);
32
+ const { type: t1, title, description, showIcon: t2, icon, closable: t3, onClose, action, className, style, classNames, styles } = t0;
33
+ const type = void 0 === t1 ? "info" : t1;
34
+ const showIcon = void 0 === t2 ? false : t2;
35
+ const closable = void 0 === t3 ? false : t3;
36
+ const [visible, setVisible] = useState(true);
37
+ let t4;
38
+ if ($[0] !== onClose) {
39
+ t4 = (e)=>{
40
+ setVisible(false);
41
+ onClose?.(e);
42
+ };
43
+ $[0] = onClose;
44
+ $[1] = t4;
45
+ } else t4 = $[1];
46
+ const handleClose = t4;
47
+ if (!visible) return null;
48
+ const hasDescription = null != description;
49
+ const renderIcon = showIcon || null != icon;
50
+ const t5 = hasDescription || void 0;
51
+ const t6 = classNames?.root;
52
+ let t7;
53
+ if ($[2] !== className || $[3] !== t6) {
54
+ t7 = cx(t6, className);
55
+ $[2] = className;
56
+ $[3] = t6;
57
+ $[4] = t7;
58
+ } else t7 = $[4];
59
+ const t8 = styles?.root;
60
+ let t9;
61
+ if ($[5] !== style || $[6] !== t8) {
62
+ t9 = {
63
+ ...t8,
64
+ ...style
65
+ };
66
+ $[5] = style;
67
+ $[6] = t8;
68
+ $[7] = t9;
69
+ } else t9 = $[7];
70
+ let t10;
71
+ if ($[8] !== classNames?.icon || $[9] !== icon || $[10] !== renderIcon || $[11] !== styles?.icon || $[12] !== type) {
72
+ t10 = renderIcon && /*#__PURE__*/ jsx("span", {
73
+ "data-tao-alert-icon": "",
74
+ className: cx(classNames?.icon),
75
+ style: styles?.icon,
76
+ children: icon ?? /*#__PURE__*/ jsx(StatusIcon, {
77
+ type: type
78
+ })
79
+ });
80
+ $[8] = classNames?.icon;
81
+ $[9] = icon;
82
+ $[10] = renderIcon;
83
+ $[11] = styles?.icon;
84
+ $[12] = type;
85
+ $[13] = t10;
86
+ } else t10 = $[13];
87
+ let t11;
88
+ if ($[14] !== classNames?.title || $[15] !== styles?.title || $[16] !== title) {
89
+ t11 = null != title && /*#__PURE__*/ jsx("div", {
90
+ "data-tao-alert-title": "",
91
+ className: cx(classNames?.title),
92
+ style: styles?.title,
93
+ children: title
94
+ });
95
+ $[14] = classNames?.title;
96
+ $[15] = styles?.title;
97
+ $[16] = title;
98
+ $[17] = t11;
99
+ } else t11 = $[17];
100
+ let t12;
101
+ if ($[18] !== classNames?.description || $[19] !== description || $[20] !== hasDescription || $[21] !== styles?.description) {
102
+ t12 = hasDescription && /*#__PURE__*/ jsx("div", {
103
+ "data-tao-alert-description": "",
104
+ className: cx(classNames?.description),
105
+ style: styles?.description,
106
+ children: description
107
+ });
108
+ $[18] = classNames?.description;
109
+ $[19] = description;
110
+ $[20] = hasDescription;
111
+ $[21] = styles?.description;
112
+ $[22] = t12;
113
+ } else t12 = $[22];
114
+ let t13;
115
+ if ($[23] !== t11 || $[24] !== t12) {
116
+ t13 = /*#__PURE__*/ jsxs("div", {
117
+ "data-tao-alert-content": "",
118
+ children: [
119
+ t11,
120
+ t12
121
+ ]
122
+ });
123
+ $[23] = t11;
124
+ $[24] = t12;
125
+ $[25] = t13;
126
+ } else t13 = $[25];
127
+ let t14;
128
+ if ($[26] !== action || $[27] !== classNames?.action || $[28] !== styles?.action) {
129
+ t14 = null != action && /*#__PURE__*/ jsx("div", {
130
+ "data-tao-alert-action": "",
131
+ className: cx(classNames?.action),
132
+ style: styles?.action,
133
+ children: action
134
+ });
135
+ $[26] = action;
136
+ $[27] = classNames?.action;
137
+ $[28] = styles?.action;
138
+ $[29] = t14;
139
+ } else t14 = $[29];
140
+ let t15;
141
+ if ($[30] !== classNames?.close || $[31] !== closable || $[32] !== handleClose || $[33] !== styles?.close) {
142
+ t15 = closable && /*#__PURE__*/ jsx("button", {
143
+ type: "button",
144
+ "data-tao-alert-close": "",
145
+ "aria-label": "Close",
146
+ onClick: handleClose,
147
+ className: cx(classNames?.close),
148
+ style: styles?.close,
149
+ children: /*#__PURE__*/ jsx(CloseIcon, {})
150
+ });
151
+ $[30] = classNames?.close;
152
+ $[31] = closable;
153
+ $[32] = handleClose;
154
+ $[33] = styles?.close;
155
+ $[34] = t15;
156
+ } else t15 = $[34];
157
+ let t16;
158
+ if ($[35] !== t10 || $[36] !== t13 || $[37] !== t14 || $[38] !== t15 || $[39] !== t5 || $[40] !== t7 || $[41] !== t9 || $[42] !== type) {
159
+ t16 = /*#__PURE__*/ jsxs("div", {
160
+ role: "alert",
161
+ "data-tao-alert": "",
162
+ "data-tao-type": type,
163
+ "data-tao-with-description": t5,
164
+ className: t7,
165
+ style: t9,
166
+ children: [
167
+ t10,
168
+ t13,
169
+ t14,
170
+ t15
171
+ ]
172
+ });
173
+ $[35] = t10;
174
+ $[36] = t13;
175
+ $[37] = t14;
176
+ $[38] = t15;
177
+ $[39] = t5;
178
+ $[40] = t7;
179
+ $[41] = t9;
180
+ $[42] = type;
181
+ $[43] = t16;
182
+ } else t16 = $[43];
183
+ return t16;
184
+ }
185
+ export { Alert };
@@ -3,7 +3,8 @@ button[data-tao-button] {
3
3
  align-items: center;
4
4
  gap: var(--tao-padding-xs);
5
5
  font-family: var(--tao-font-family);
6
- font-weight: var(--tao-font-weight-medium);
6
+ font-weight: var(--tao-button-font-weight, var(--tao-font-weight-medium));
7
+ line-height: var(--tao-line-height);
7
8
  border: var(--tao-line-width) solid transparent;
8
9
  cursor: pointer;
9
10
  -webkit-user-select: none;
@@ -13,29 +14,28 @@ button[data-tao-button] {
13
14
  border-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
14
15
  box-shadow var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
15
16
  outline: none;
16
- line-height: 1;
17
17
  display: inline-flex;
18
18
  }
19
19
 
20
20
  button[data-tao-button][data-tao-size="small"] {
21
21
  height: var(--tao-control-height-sm);
22
- padding-inline: var(--tao-padding-xs);
23
- font-size: var(--tao-font-size-sm);
24
- border-radius: var(--tao-radius-sm);
22
+ padding-inline: var(--tao-button-padding-inline-sm, var(--tao-padding-xs));
23
+ font-size: var(--tao-button-content-font-size-sm, var(--tao-font-size-sm));
24
+ border-radius: var(--tao-button-border-radius, var(--tao-radius-sm));
25
25
  }
26
26
 
27
27
  button[data-tao-button][data-tao-size="medium"] {
28
28
  height: var(--tao-control-height);
29
- padding-inline: var(--tao-padding);
30
- font-size: var(--tao-font-size-base);
31
- border-radius: var(--tao-radius-md);
29
+ padding-inline: var(--tao-button-padding-inline, var(--tao-padding));
30
+ font-size: var(--tao-button-content-font-size, var(--tao-font-size-base));
31
+ border-radius: var(--tao-button-border-radius, var(--tao-radius-md));
32
32
  }
33
33
 
34
34
  button[data-tao-button][data-tao-size="large"] {
35
35
  height: var(--tao-control-height-lg);
36
- padding-inline: var(--tao-padding);
37
- font-size: var(--tao-font-size-base);
38
- border-radius: var(--tao-radius-md);
36
+ padding-inline: var(--tao-button-padding-inline-lg, var(--tao-padding));
37
+ font-size: var(--tao-button-content-font-size-lg, var(--tao-font-size-base));
38
+ border-radius: var(--tao-button-border-radius, var(--tao-radius-md));
39
39
  }
40
40
 
41
41
  button[data-tao-button][data-tao-has-icon][data-tao-size="medium"], button[data-tao-button][data-tao-has-icon][data-tao-size="large"] {
@@ -44,8 +44,8 @@ button[data-tao-button][data-tao-has-icon][data-tao-size="medium"], button[data-
44
44
 
45
45
  button[data-tao-button][data-tao-variant="primary"] {
46
46
  background: var(--tao-primary);
47
- color: var(--tao-primary-fg);
48
- box-shadow: var(--tao-box-shadow-xs);
47
+ color: var(--tao-button-primary-color, var(--tao-primary-fg));
48
+ box-shadow: var(--tao-button-primary-shadow, var(--tao-box-shadow-xs));
49
49
  }
50
50
 
51
51
  button[data-tao-button][data-tao-variant="primary"]:hover:not(:disabled) {
@@ -57,15 +57,16 @@ button[data-tao-button][data-tao-variant="primary"]:active:not(:disabled) {
57
57
  }
58
58
 
59
59
  button[data-tao-button][data-tao-variant="secondary"] {
60
- color: var(--tao-color-text);
61
- border-color: var(--tao-color-border);
60
+ background: var(--tao-button-default-bg, transparent);
61
+ color: var(--tao-button-default-color, var(--tao-color-text));
62
+ border-color: var(--tao-button-default-border-color, var(--tao-color-border));
62
63
  box-shadow: var(--tao-box-shadow-xs);
63
- background: none;
64
64
  }
65
65
 
66
66
  button[data-tao-button][data-tao-variant="secondary"]:hover:not(:disabled) {
67
- background: var(--tao-color-fill-tertiary);
68
- border-color: var(--tao-color-border);
67
+ background: var(--tao-button-default-hover-bg, var(--tao-color-fill-tertiary));
68
+ color: var(--tao-button-default-hover-color, var(--tao-button-default-color, var(--tao-color-text)));
69
+ border-color: var(--tao-button-default-hover-border-color, var(--tao-color-border));
69
70
  }
70
71
 
71
72
  button[data-tao-button][data-tao-variant="secondary"]:active:not(:disabled) {
@@ -4,17 +4,25 @@ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semant
4
4
  import './button.css';
5
5
  export type ButtonSemanticPart = 'root';
6
6
  export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {
7
+ /** Visual emphasis for the action. */
7
8
  variant?: 'primary' | 'secondary' | 'ghost' | 'destructive';
9
+ /** Control height and horizontal spacing. Inherits from TaoProvider. */
8
10
  size?: TaoSize;
11
+ /** Prevents interaction. Inherits from TaoProvider. */
9
12
  disabled?: boolean;
13
+ /** Shows the loading icon, sets aria-busy, and prevents interaction. */
10
14
  loading?: boolean;
11
15
  /** Left-leading decorative icon (non-loading state). */
12
16
  icon?: ReactNode;
13
17
  /** Icon shown while loading. Defaults to a built-in spinner. */
14
18
  loadingIcon?: ReactNode;
19
+ /** Button label or inline content. */
15
20
  children?: ReactNode;
21
+ /** Ref forwarded to the native button element. */
16
22
  ref?: Ref<HTMLButtonElement>;
23
+ /** Semantic class overrides keyed by ButtonSemanticPart. */
17
24
  classNames?: SemanticClassNames<ButtonSemanticPart>;
25
+ /** Semantic style overrides keyed by ButtonSemanticPart. */
18
26
  styles?: SemanticStyles<ButtonSemanticPart>;
19
27
  }
20
28
  export declare function Button({ variant, size, disabled, loading, icon, loadingIcon, children, ref, className, style, classNames, styles, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState
6
6
  import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
7
7
  import { cx } from "../../utils/semantic.js";
8
8
  import { Drawer } from "../drawer/drawer.js";
9
- import { useIsMobile } from "../select/use-is-mobile.js";
9
+ import { useIsMobile } from "../../utils/breakpoint.js";
10
10
  import { CalendarGrid } from "./calendar/calendar-grid.js";
11
11
  import { CalendarHeader } from "./calendar/calendar-header.js";
12
12
  import { MonthGrid } from "./calendar/month-grid.js";
@@ -6,7 +6,7 @@ import { useCallback, useEffect, useImperativeHandle, useRef, useState } from "r
6
6
  import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
7
7
  import { cx } from "../../utils/semantic.js";
8
8
  import { Drawer } from "../drawer/drawer.js";
9
- import { useIsMobile } from "../select/use-is-mobile.js";
9
+ import { useIsMobile } from "../../utils/breakpoint.js";
10
10
  import { CalendarGrid } from "./calendar/calendar-grid.js";
11
11
  import "./date-picker.css";
12
12
  import { Presets } from "./presets.js";
@@ -1,5 +1,26 @@
1
1
  [data-tao-dropdown-arrow] {
2
- fill: var(--tao-color-bg-elevated);
2
+ width: 12px;
3
+ height: 6px;
4
+ display: block;
5
+ position: relative;
6
+ overflow: visible;
7
+ }
8
+
9
+ [data-tao-dropdown-arrow]:before {
10
+ content: "";
11
+ box-sizing: border-box;
12
+ background: var(--tao-color-bg-elevated);
13
+ border: var(--tao-line-width) solid var(--tao-color-border-secondary);
14
+ width: 8px;
15
+ height: 8px;
16
+ box-shadow: 2px 2px 4px var(--tao-color-shadow-hint);
17
+ border-top: none;
18
+ border-left: none;
19
+ border-bottom-right-radius: 2px;
20
+ position: absolute;
21
+ top: -4.5px;
22
+ left: 50%;
23
+ transform: translateX(-50%) rotate(45deg);
3
24
  }
4
25
 
5
26
  [data-tao-dropdown-button-group] {
@@ -230,9 +230,10 @@ function Dropdown(props) {
230
230
  let t18;
231
231
  if ($[45] !== arrow) {
232
232
  t18 = arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Arrow, {
233
- "data-tao-dropdown-arrow": "",
234
- width: 12,
235
- height: 6
233
+ asChild: true,
234
+ children: /*#__PURE__*/ jsx("span", {
235
+ "data-tao-dropdown-arrow": ""
236
+ })
236
237
  });
237
238
  $[45] = arrow;
238
239
  $[46] = t18;
@@ -0,0 +1,7 @@
1
+ import type { FormFieldLayout } from '../form-field/form-field-view';
2
+ export interface FormLayoutContextValue {
3
+ layout: FormFieldLayout;
4
+ }
5
+ /** Internal layout channel: Form → Form.Item. */
6
+ export declare const FormLayoutContext: import("react").Context<FormLayoutContextValue>;
7
+ export declare function useFormLayout(): FormLayoutContextValue;
@@ -0,0 +1,8 @@
1
+ import { createContext, useContext } from "react";
2
+ const FormLayoutContext = createContext({
3
+ layout: 'vertical'
4
+ });
5
+ function useFormLayout() {
6
+ return useContext(FormLayoutContext);
7
+ }
8
+ export { FormLayoutContext, useFormLayout };
@@ -0,0 +1,55 @@
1
+ import { type FormInstance, type Meta, type NamePath, type Rule } from '@rc-component/form';
2
+ import { type CSSProperties, type ReactNode } from 'react';
3
+ import type { TaoStatus } from '../../provider/tao-provider';
4
+ import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic';
5
+ export type FormItemSemanticPart = 'root' | 'label' | 'error' | 'description';
6
+ export type FormItemValidateStatus = TaoStatus;
7
+ export type FormItemChildren<Values = Record<string, unknown>> = ReactNode | ((control: Record<string, unknown>, meta: Meta, form: FormInstance<Values>) => ReactNode);
8
+ export interface FormItemProps<Values = Record<string, unknown>> {
9
+ name?: NamePath<Values>;
10
+ label?: ReactNode;
11
+ /** Required mark; also inferred from `rules` entries with `required: true`. */
12
+ required?: boolean;
13
+ rules?: Rule[];
14
+ /**
15
+ * Manual message. Overrides the rule error when provided; shown in the
16
+ * error slot while a status is active, otherwise in the description slot.
17
+ */
18
+ help?: ReactNode;
19
+ /** Extra description rendered below the control (antd `extra`). */
20
+ extra?: ReactNode;
21
+ /** Manual status override; derived from rule errors when omitted. */
22
+ validateStatus?: FormItemValidateStatus;
23
+ initialValue?: unknown;
24
+ /** Prop carrying the control value, e.g. `checked` for Switch. */
25
+ valuePropName?: string;
26
+ getValueFromEvent?: (...args: unknown[]) => unknown;
27
+ /** Child prop that triggers value collection. Defaults to 'onChange'. */
28
+ trigger?: string;
29
+ validateTrigger?: string | string[] | false;
30
+ /** Render the bound control without the label/message shell. */
31
+ noStyle?: boolean;
32
+ dependencies?: NamePath<Values>[];
33
+ shouldUpdate?: boolean | ((prevValues: Values, nextValues: Values, info: {
34
+ source?: string;
35
+ }) => boolean);
36
+ normalize?: (value: unknown, prevValue: unknown, allValues: Record<string, unknown>) => unknown;
37
+ preserve?: boolean;
38
+ messageVariables?: Record<string, string>;
39
+ validateFirst?: boolean | 'parallel';
40
+ htmlFor?: string;
41
+ className?: string;
42
+ style?: CSSProperties;
43
+ classNames?: SemanticClassNames<FormItemSemanticPart>;
44
+ styles?: SemanticStyles<FormItemSemanticPart>;
45
+ children?: FormItemChildren<Values>;
46
+ }
47
+ /**
48
+ * antd-aligned form field: binds a control to the form store via rc `Field`
49
+ * (value/trigger injection, rules validation, meta), rendered with the same
50
+ * shell as FormField (label / required mark / error / description).
51
+ *
52
+ * With no `name`, `dependencies`, or `shouldUpdate`, it is purely
53
+ * presentational — equivalent to FormField with `help`/`validateStatus`.
54
+ */
55
+ export declare function FormItem<Values = Record<string, unknown>>({ name, label, required, rules, help, extra, validateStatus, initialValue, valuePropName, getValueFromEvent, trigger, validateTrigger, noStyle, dependencies, shouldUpdate, normalize, preserve, messageVariables, validateFirst, htmlFor, className, style, classNames, styles, children, }: FormItemProps<Values>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;