@rockshin/tao-ui 0.0.24 → 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.
- package/README.md +17 -6
- package/component-manifest.json +534 -6
- package/dist/components/alert/alert.css +120 -0
- package/dist/components/alert/alert.d.ts +20 -0
- package/dist/components/alert/alert.js +185 -0
- package/dist/components/button/button.css +19 -18
- package/dist/components/button/button.d.ts +8 -0
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/range-picker.js +1 -1
- package/dist/components/dropdown/dropdown.css +22 -1
- package/dist/components/dropdown/dropdown.js +4 -3
- package/dist/components/form/form-context.d.ts +7 -0
- package/dist/components/form/form-context.js +8 -0
- package/dist/components/form/form-item.d.ts +55 -0
- package/dist/components/form/form-item.js +131 -0
- package/dist/components/form/form.css +22 -0
- package/dist/components/form/form.d.ts +35 -0
- package/dist/components/form/form.js +125 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form-field/form-field-view.d.ts +30 -0
- package/dist/components/form-field/form-field-view.js +154 -0
- package/dist/components/form-field/form-field.d.ts +2 -2
- package/dist/components/form-field/form-field.js +29 -137
- package/dist/components/form-field/form.css +17 -7
- package/dist/components/input/input.css +18 -8
- package/dist/components/modal/confirm-dialog.js +14 -111
- package/dist/components/modal/modal.d.ts +7 -1
- package/dist/components/modal/modal.js +205 -195
- package/dist/components/popconfirm/popconfirm.css +44 -0
- package/dist/components/popconfirm/popconfirm.d.ts +41 -0
- package/dist/components/popconfirm/popconfirm.js +238 -0
- package/dist/components/popover/popover.css +105 -0
- package/dist/components/popover/popover.d.ts +41 -0
- package/dist/components/popover/popover.js +412 -0
- package/dist/components/select/select.js +1 -1
- package/dist/components/status-icon/status-icon.d.ts +5 -0
- package/dist/components/status-icon/status-icon.js +77 -0
- package/dist/components/table/table-types.d.ts +7 -0
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +296 -283
- package/dist/components/tooltip/tooltip.css +93 -0
- package/dist/components/tooltip/tooltip.d.ts +33 -0
- package/dist/components/tooltip/tooltip.js +226 -0
- package/dist/docs/components/alert.doc.d.ts +29 -0
- package/dist/docs/components/alert.doc.js +93 -0
- package/dist/docs/components/form.doc.d.ts +29 -0
- package/dist/docs/components/form.doc.js +71 -0
- package/dist/docs/components/modal.doc.d.ts +6 -0
- package/dist/docs/components/modal.doc.js +9 -1
- package/dist/docs/components/popconfirm.doc.d.ts +29 -0
- package/dist/docs/components/popconfirm.doc.js +132 -0
- package/dist/docs/components/popover.doc.d.ts +29 -0
- package/dist/docs/components/popover.doc.js +121 -0
- package/dist/docs/components/stack.doc.d.ts +6 -0
- package/dist/docs/components/stack.doc.js +23 -2
- package/dist/docs/components/table.doc.js +2 -1
- package/dist/docs/components/tao-provider.doc.js +11 -1
- package/dist/docs/components/tooltip.doc.d.ts +37 -0
- package/dist/docs/components/tooltip.doc.js +76 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -1
- package/dist/layouts/stack/stack.d.ts +12 -3
- package/dist/layouts/stack/stack.js +60 -34
- package/dist/provider/tao-provider.d.ts +71 -0
- package/dist/provider/tao-provider.js +166 -120
- package/dist/theme/control.css +12 -12
- package/dist/theme/theme.css +23 -0
- package/dist/utils/breakpoint.d.ts +31 -0
- package/dist/utils/breakpoint.js +80 -0
- package/dist/utils/overlay.d.ts +19 -0
- package/dist/utils/overlay.js +41 -0
- package/llms.txt +68 -3
- package/package.json +6 -4
- package/dist/components/select/use-is-mobile.d.ts +0 -1
- package/dist/components/select/use-is-mobile.js +0 -27
package/README.md
CHANGED
|
@@ -78,18 +78,29 @@ import '@fontsource/geist-mono/400.css';
|
|
|
78
78
|
| General | `Button` |
|
|
79
79
|
| Layout | `Stack`, `FormLayout`, `Splitter` |
|
|
80
80
|
| Navigation | `Tabs`, `Pagination`, `Breadcrumb`, `Menu`, `Dropdown`, `ContextMenu` |
|
|
81
|
-
| Data Entry | `Input`, `Textarea`, `InputNumber`, `Select`, `Checkbox`, `Radio`, `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions` |
|
|
82
|
-
| Data Display | `Table`, `Tag`, `ScrollArea`, `Collapsible` |
|
|
83
|
-
| Feedback | `Modal`, `Drawer`, `Sonner`, `Spinner` |
|
|
84
|
-
| Config | `TaoProvider`, `useTaoConfig` |
|
|
81
|
+
| Data Entry | `Form`, `Input`, `Textarea`, `InputNumber`, `Select`, `Checkbox`, `Radio`, `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions` |
|
|
82
|
+
| Data Display | `Table`, `Tag`, `ScrollArea`, `Collapsible`, `Tooltip`, `Popover` |
|
|
83
|
+
| Feedback | `Modal`, `Drawer`, `Sonner`, `Spinner`, `Alert`, `Popconfirm` |
|
|
84
|
+
| Config | `TaoProvider`, `useTaoConfig`, `useTaoToken` |
|
|
85
|
+
|
|
86
|
+
Responsive helpers: `useBreakpoint`, `useIsMobile`, plus breakpoint-map props on
|
|
87
|
+
`Stack` (`direction`/`gap`/`align`), `Modal` (`width`), and `Table` (column
|
|
88
|
+
`responsive`). `Select` / `DatePicker` / `RangePicker` render as bottom drawers
|
|
89
|
+
on phones automatically.
|
|
85
90
|
|
|
86
91
|
Headless utilities: `useNumberInput` / `NumberInput`, and the `cx` semantic-class helper.
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
Token helpers are available from the package root or the dedicated subpath:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
import { tokenVar, taoTokenNames, useTaoToken } from '@rockshin/tao-ui';
|
|
97
|
+
// or: import { taoTokenNames, tokenVar } from '@rockshin/tao-ui/tokens';
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Package metadata uses an explicit subpath import:
|
|
89
101
|
|
|
90
102
|
```ts
|
|
91
103
|
import { componentDocs, getComponentDoc } from '@rockshin/tao-ui/meta';
|
|
92
|
-
import { taoTokenNames, tokenVar } from '@rockshin/tao-ui/tokens';
|
|
93
104
|
```
|
|
94
105
|
|
|
95
106
|
## License
|
package/component-manifest.json
CHANGED
|
@@ -1,8 +1,100 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@rockshin/tao-ui",
|
|
4
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"generatedAt": "2026-08-09T04:37:08.262Z",
|
|
5
5
|
"components": [
|
|
6
|
+
{
|
|
7
|
+
"name": "alert",
|
|
8
|
+
"displayName": "Alert",
|
|
9
|
+
"category": "Feedback",
|
|
10
|
+
"description": "Displays important contextual feedback messages with semantic status types.",
|
|
11
|
+
"exports": [
|
|
12
|
+
"Alert"
|
|
13
|
+
],
|
|
14
|
+
"source": "src/components/alert/alert.tsx",
|
|
15
|
+
"story": "stories/alert.stories.tsx",
|
|
16
|
+
"tests": [
|
|
17
|
+
"tests/alert/alert.test.tsx"
|
|
18
|
+
],
|
|
19
|
+
"semanticParts": [
|
|
20
|
+
"root",
|
|
21
|
+
"icon",
|
|
22
|
+
"title",
|
|
23
|
+
"description",
|
|
24
|
+
"action",
|
|
25
|
+
"close"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"alert",
|
|
29
|
+
"banner",
|
|
30
|
+
"feedback",
|
|
31
|
+
"message",
|
|
32
|
+
"notification",
|
|
33
|
+
"status"
|
|
34
|
+
],
|
|
35
|
+
"related": [
|
|
36
|
+
"Sonner",
|
|
37
|
+
"Modal",
|
|
38
|
+
"Tag"
|
|
39
|
+
],
|
|
40
|
+
"usage": {
|
|
41
|
+
"description": "Use Alert for persistent, page-level feedback about a state or operation. Use Sonner toasts for transient notifications.",
|
|
42
|
+
"bestPractices": [
|
|
43
|
+
"Pick the semantic type that matches the severity of the message.",
|
|
44
|
+
"Keep the title short; put detail in the description.",
|
|
45
|
+
"Enable showIcon when the alert needs to be scannable at a glance."
|
|
46
|
+
],
|
|
47
|
+
"avoid": [
|
|
48
|
+
"Do not stack many alerts in one view; prefer a single summary.",
|
|
49
|
+
"Do not use Alert for transient feedback; use a toast instead."
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"props": [
|
|
53
|
+
{
|
|
54
|
+
"name": "type",
|
|
55
|
+
"type": "'success' | 'info' | 'warning' | 'error'",
|
|
56
|
+
"description": "Semantic status type controlling colors and default icon.",
|
|
57
|
+
"defaultValue": "'info'"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "title",
|
|
61
|
+
"type": "ReactNode",
|
|
62
|
+
"description": "Bold heading line of the alert."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "description",
|
|
66
|
+
"type": "ReactNode",
|
|
67
|
+
"description": "Secondary text rendered below the title."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "showIcon",
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Whether to render the per-type status icon.",
|
|
73
|
+
"defaultValue": "false"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "icon",
|
|
77
|
+
"type": "ReactNode",
|
|
78
|
+
"description": "Custom icon overriding the per-type default."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "closable",
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Whether to show a close button that dismisses the alert.",
|
|
84
|
+
"defaultValue": "false"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "onClose",
|
|
88
|
+
"type": "(e: MouseEvent<HTMLElement>) => void",
|
|
89
|
+
"description": "Called when the close button is clicked."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "action",
|
|
93
|
+
"type": "ReactNode",
|
|
94
|
+
"description": "Right-side action slot, e.g. a button."
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
6
98
|
{
|
|
7
99
|
"name": "breadcrumb",
|
|
8
100
|
"displayName": "Breadcrumb",
|
|
@@ -386,6 +478,76 @@
|
|
|
386
478
|
]
|
|
387
479
|
}
|
|
388
480
|
},
|
|
481
|
+
{
|
|
482
|
+
"name": "form",
|
|
483
|
+
"displayName": "Form",
|
|
484
|
+
"category": "Data Entry",
|
|
485
|
+
"description": "Collects and validates field values with an antd-aligned API (rules, dependencies, Form.List) on top of the rc-form engine.",
|
|
486
|
+
"exports": [
|
|
487
|
+
"Form"
|
|
488
|
+
],
|
|
489
|
+
"source": "src/components/form/form.tsx",
|
|
490
|
+
"story": "stories/form.stories.tsx",
|
|
491
|
+
"tests": [
|
|
492
|
+
"tests/form/form.test.tsx"
|
|
493
|
+
],
|
|
494
|
+
"semanticParts": [
|
|
495
|
+
"root"
|
|
496
|
+
],
|
|
497
|
+
"keywords": [
|
|
498
|
+
"form",
|
|
499
|
+
"validation",
|
|
500
|
+
"rules",
|
|
501
|
+
"submit"
|
|
502
|
+
],
|
|
503
|
+
"related": [
|
|
504
|
+
"FormField",
|
|
505
|
+
"FormSection",
|
|
506
|
+
"FormActions",
|
|
507
|
+
"Input"
|
|
508
|
+
],
|
|
509
|
+
"usage": {
|
|
510
|
+
"description": "Use Form with Form.Item when fields need a value store, rule validation, or submit handling. Use the lighter FormField when you manage state yourself.",
|
|
511
|
+
"bestPractices": [
|
|
512
|
+
"Declare validation as rules on Form.Item; the required mark is inferred from rules.",
|
|
513
|
+
"Use dependencies for cross-field rules such as password confirmation.",
|
|
514
|
+
"Use Form.useForm() for imperative control (setFieldsValue, resetFields, submit).",
|
|
515
|
+
"Set size or disabled on Form to cascade them to every control inside."
|
|
516
|
+
],
|
|
517
|
+
"avoid": [
|
|
518
|
+
"Do not bind the same name in two mounted Form.Items.",
|
|
519
|
+
"Do not mix manual value/onChange props with a bound Form.Item on the same control."
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
"props": [
|
|
523
|
+
{
|
|
524
|
+
"name": "initialValues",
|
|
525
|
+
"type": "Record<string, unknown>",
|
|
526
|
+
"description": "Seed values for the form store."
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"name": "onFinish",
|
|
530
|
+
"type": "(values) => void",
|
|
531
|
+
"description": "Called with collected values after a valid submit."
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "layout",
|
|
535
|
+
"type": "'vertical' | 'horizontal'",
|
|
536
|
+
"description": "Label/control arrangement inherited by Form.Item.",
|
|
537
|
+
"defaultValue": "'vertical'"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"name": "Form.Item rules",
|
|
541
|
+
"type": "Rule[]",
|
|
542
|
+
"description": "Validation rules (required, pattern, min/max, validator, …), same engine as antd."
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "Form.Item help / extra",
|
|
546
|
+
"type": "ReactNode",
|
|
547
|
+
"description": "help overrides the rule message; extra renders a description below the control."
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
},
|
|
389
551
|
{
|
|
390
552
|
"name": "form-actions",
|
|
391
553
|
"displayName": "FormActions",
|
|
@@ -677,7 +839,15 @@
|
|
|
677
839
|
"avoid": [
|
|
678
840
|
"Do not use nested modals for multi-step workflows."
|
|
679
841
|
]
|
|
680
|
-
}
|
|
842
|
+
},
|
|
843
|
+
"props": [
|
|
844
|
+
{
|
|
845
|
+
"name": "width",
|
|
846
|
+
"type": "number | string | TaoBreakpointMap<number | string>",
|
|
847
|
+
"description": "Dialog width; accepts a breakpoint map, largest matching breakpoint wins.",
|
|
848
|
+
"defaultValue": "520"
|
|
849
|
+
}
|
|
850
|
+
]
|
|
681
851
|
},
|
|
682
852
|
{
|
|
683
853
|
"name": "pagination",
|
|
@@ -713,6 +883,257 @@
|
|
|
713
883
|
]
|
|
714
884
|
}
|
|
715
885
|
},
|
|
886
|
+
{
|
|
887
|
+
"name": "popconfirm",
|
|
888
|
+
"displayName": "Popconfirm",
|
|
889
|
+
"category": "Feedback",
|
|
890
|
+
"description": "Shows a compact confirmation popup anchored to a trigger element, with OK and Cancel actions.",
|
|
891
|
+
"exports": [
|
|
892
|
+
"Popconfirm"
|
|
893
|
+
],
|
|
894
|
+
"source": "src/components/popconfirm/popconfirm.tsx",
|
|
895
|
+
"story": "stories/popconfirm.stories.tsx",
|
|
896
|
+
"tests": [
|
|
897
|
+
"tests/popconfirm/popconfirm.test.tsx"
|
|
898
|
+
],
|
|
899
|
+
"semanticParts": [
|
|
900
|
+
"content",
|
|
901
|
+
"title",
|
|
902
|
+
"description",
|
|
903
|
+
"footer",
|
|
904
|
+
"icon"
|
|
905
|
+
],
|
|
906
|
+
"keywords": [
|
|
907
|
+
"popconfirm",
|
|
908
|
+
"confirm",
|
|
909
|
+
"popover",
|
|
910
|
+
"delete",
|
|
911
|
+
"warning"
|
|
912
|
+
],
|
|
913
|
+
"related": [
|
|
914
|
+
"Popover",
|
|
915
|
+
"Modal",
|
|
916
|
+
"Button"
|
|
917
|
+
],
|
|
918
|
+
"usage": {
|
|
919
|
+
"description": "Use Popconfirm for lightweight inline confirmations such as delete actions, where a full Modal would be too heavy. Use Modal.confirm for critical or complex confirmations.",
|
|
920
|
+
"bestPractices": [
|
|
921
|
+
"Keep the title to one short question; put detail in the description.",
|
|
922
|
+
"Use Popconfirm for reversible, low-risk actions anchored to the control that triggers them."
|
|
923
|
+
],
|
|
924
|
+
"avoid": [
|
|
925
|
+
"Do not use Popconfirm for irreversible high-risk operations; use Modal.confirm instead.",
|
|
926
|
+
"Do not put forms or rich interactions inside a Popconfirm."
|
|
927
|
+
]
|
|
928
|
+
},
|
|
929
|
+
"props": [
|
|
930
|
+
{
|
|
931
|
+
"name": "title",
|
|
932
|
+
"type": "ReactNode (required)",
|
|
933
|
+
"description": "Main question text of the confirm popup."
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"name": "description",
|
|
937
|
+
"type": "ReactNode",
|
|
938
|
+
"description": "Secondary text shown under the title."
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"name": "onConfirm",
|
|
942
|
+
"type": "(e?: MouseEvent<HTMLElement>) => void",
|
|
943
|
+
"description": "Called when OK is clicked; the popup also closes."
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"name": "onCancel",
|
|
947
|
+
"type": "(e?: MouseEvent<HTMLElement>) => void",
|
|
948
|
+
"description": "Called when Cancel is clicked; the popup also closes."
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"name": "okText",
|
|
952
|
+
"type": "ReactNode",
|
|
953
|
+
"description": "Text of the OK button.",
|
|
954
|
+
"defaultValue": "'OK'"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"name": "cancelText",
|
|
958
|
+
"type": "ReactNode",
|
|
959
|
+
"description": "Text of the Cancel button.",
|
|
960
|
+
"defaultValue": "'Cancel'"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"name": "okButtonProps",
|
|
964
|
+
"type": "ButtonProps",
|
|
965
|
+
"description": "Extra props forwarded to the OK button."
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"name": "cancelButtonProps",
|
|
969
|
+
"type": "ButtonProps",
|
|
970
|
+
"description": "Extra props forwarded to the Cancel button."
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"name": "icon",
|
|
974
|
+
"type": "ReactNode | null",
|
|
975
|
+
"description": "Icon shown before the title. Pass `null` to hide it. Defaults to a warning triangle."
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"name": "disabled",
|
|
979
|
+
"type": "boolean",
|
|
980
|
+
"description": "When true, the trigger still renders but the popup never opens.",
|
|
981
|
+
"defaultValue": "false"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"name": "open",
|
|
985
|
+
"type": "boolean",
|
|
986
|
+
"description": "Controlled open state."
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"name": "defaultOpen",
|
|
990
|
+
"type": "boolean",
|
|
991
|
+
"description": "Initial open state (uncontrolled).",
|
|
992
|
+
"defaultValue": "false"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"name": "onOpenChange",
|
|
996
|
+
"type": "(open: boolean) => void",
|
|
997
|
+
"description": "Called when the open state changes."
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"name": "placement",
|
|
1001
|
+
"type": "'top' | 'bottom' | 'left' | 'right'",
|
|
1002
|
+
"description": "Popup side relative to the trigger.",
|
|
1003
|
+
"defaultValue": "'top'"
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
"name": "classNames",
|
|
1007
|
+
"type": "SemanticClassNames<'content' | 'title' | 'description' | 'footer' | 'icon'>",
|
|
1008
|
+
"description": "Semantic per-part class name overrides."
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"name": "styles",
|
|
1012
|
+
"type": "SemanticStyles<'content' | 'title' | 'description' | 'footer' | 'icon'>",
|
|
1013
|
+
"description": "Semantic per-part inline style overrides."
|
|
1014
|
+
}
|
|
1015
|
+
]
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"name": "popover",
|
|
1019
|
+
"displayName": "Popover",
|
|
1020
|
+
"category": "Data Display",
|
|
1021
|
+
"description": "Displays a floating card with rich content anchored to a trigger element, opened by click or hover.",
|
|
1022
|
+
"exports": [
|
|
1023
|
+
"Popover"
|
|
1024
|
+
],
|
|
1025
|
+
"source": "src/components/popover/popover.tsx",
|
|
1026
|
+
"story": "stories/popover.stories.tsx",
|
|
1027
|
+
"tests": [
|
|
1028
|
+
"tests/popover/popover.test.tsx"
|
|
1029
|
+
],
|
|
1030
|
+
"semanticParts": [
|
|
1031
|
+
"root",
|
|
1032
|
+
"container",
|
|
1033
|
+
"title",
|
|
1034
|
+
"content",
|
|
1035
|
+
"arrow"
|
|
1036
|
+
],
|
|
1037
|
+
"keywords": [
|
|
1038
|
+
"popover",
|
|
1039
|
+
"popup",
|
|
1040
|
+
"floating",
|
|
1041
|
+
"card",
|
|
1042
|
+
"hover",
|
|
1043
|
+
"click"
|
|
1044
|
+
],
|
|
1045
|
+
"related": [
|
|
1046
|
+
"Tooltip",
|
|
1047
|
+
"Dropdown",
|
|
1048
|
+
"Modal"
|
|
1049
|
+
],
|
|
1050
|
+
"usage": {
|
|
1051
|
+
"description": "Use Popover for rich, non-blocking contextual content behind a click or hover. Use Tooltip for short text-only hints and Modal for blocking interactions.",
|
|
1052
|
+
"bestPractices": [
|
|
1053
|
+
"Keep the title to one short line; put detail in the content.",
|
|
1054
|
+
"Use the default hover trigger for read-only previews and trigger=\"click\" for interactive content.",
|
|
1055
|
+
"Keep popup content compact; link out for long-form detail."
|
|
1056
|
+
],
|
|
1057
|
+
"avoid": [
|
|
1058
|
+
"Do not nest essential workflows inside a hover-only popover.",
|
|
1059
|
+
"Do not chain popovers from inside another popover."
|
|
1060
|
+
]
|
|
1061
|
+
},
|
|
1062
|
+
"props": [
|
|
1063
|
+
{
|
|
1064
|
+
"name": "title",
|
|
1065
|
+
"type": "ReactNode",
|
|
1066
|
+
"description": "Header text of the popup."
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
"name": "content",
|
|
1070
|
+
"type": "ReactNode",
|
|
1071
|
+
"description": "Body content of the popup."
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"name": "trigger",
|
|
1075
|
+
"type": "'hover' | 'focus' | 'click' | 'contextMenu' | PopoverTrigger[]",
|
|
1076
|
+
"description": "How the popup opens.",
|
|
1077
|
+
"defaultValue": "'hover'"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"name": "placement",
|
|
1081
|
+
"type": "'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom'",
|
|
1082
|
+
"description": "Popup side relative to the trigger.",
|
|
1083
|
+
"defaultValue": "'top'"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"name": "open",
|
|
1087
|
+
"type": "boolean",
|
|
1088
|
+
"description": "Controlled open state."
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
"name": "defaultOpen",
|
|
1092
|
+
"type": "boolean",
|
|
1093
|
+
"description": "Initial open state (uncontrolled).",
|
|
1094
|
+
"defaultValue": "false"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"name": "onOpenChange",
|
|
1098
|
+
"type": "(open: boolean) => void",
|
|
1099
|
+
"description": "Called when the open state changes."
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"name": "mouseEnterDelay",
|
|
1103
|
+
"type": "number",
|
|
1104
|
+
"description": "Delay in seconds before a hover opens the popup.",
|
|
1105
|
+
"defaultValue": "0.1"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"name": "mouseLeaveDelay",
|
|
1109
|
+
"type": "number",
|
|
1110
|
+
"description": "Delay in seconds before a hover closes the popup.",
|
|
1111
|
+
"defaultValue": "0.1"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
"name": "arrow",
|
|
1115
|
+
"type": "boolean | { pointAtCenter?: boolean }",
|
|
1116
|
+
"description": "Whether to render a pointing arrow on the popup.",
|
|
1117
|
+
"defaultValue": "true"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
"name": "destroyOnHidden",
|
|
1121
|
+
"type": "boolean",
|
|
1122
|
+
"description": "Unmount the popup content while closed. When false, the content is kept mounted and hidden.",
|
|
1123
|
+
"defaultValue": "false"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"name": "classNames",
|
|
1127
|
+
"type": "SemanticClassNames<'root' | 'container' | 'title' | 'content' | 'arrow'>",
|
|
1128
|
+
"description": "Semantic per-part class name overrides."
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"name": "styles",
|
|
1132
|
+
"type": "SemanticStyles<'root' | 'container' | 'title' | 'content' | 'arrow'>",
|
|
1133
|
+
"description": "Semantic per-part inline style overrides."
|
|
1134
|
+
}
|
|
1135
|
+
]
|
|
1136
|
+
},
|
|
716
1137
|
{
|
|
717
1138
|
"name": "radio",
|
|
718
1139
|
"displayName": "Radio",
|
|
@@ -1028,9 +1449,30 @@
|
|
|
1028
1449
|
"description": "Use Stack for simple one-dimensional layout and spacing.",
|
|
1029
1450
|
"bestPractices": [
|
|
1030
1451
|
"Prefer Stack over one-off margin rules for repeated spacing.",
|
|
1031
|
-
"Use semantic containers when the layout has richer meaning."
|
|
1452
|
+
"Use semantic containers when the layout has richer meaning.",
|
|
1453
|
+
"Pass breakpoint maps (e.g. direction={{ xs: 'vertical', md: 'horizontal' }}) for responsive layouts."
|
|
1032
1454
|
]
|
|
1033
|
-
}
|
|
1455
|
+
},
|
|
1456
|
+
"props": [
|
|
1457
|
+
{
|
|
1458
|
+
"name": "direction",
|
|
1459
|
+
"type": "TaoResponsiveValue<'vertical' | 'horizontal'>",
|
|
1460
|
+
"description": "Flex direction; accepts a breakpoint map resolved via useBreakpoint.",
|
|
1461
|
+
"defaultValue": "'vertical'"
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
"name": "gap",
|
|
1465
|
+
"type": "TaoResponsiveValue<'sm' | 'md' | 'lg'>",
|
|
1466
|
+
"description": "Spacing between children; accepts a breakpoint map.",
|
|
1467
|
+
"defaultValue": "'md'"
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
"name": "align",
|
|
1471
|
+
"type": "TaoResponsiveValue<'start' | 'center' | 'end' | 'stretch'>",
|
|
1472
|
+
"description": "Cross-axis alignment; accepts a breakpoint map.",
|
|
1473
|
+
"defaultValue": "'stretch'"
|
|
1474
|
+
}
|
|
1475
|
+
]
|
|
1034
1476
|
},
|
|
1035
1477
|
{
|
|
1036
1478
|
"name": "switch",
|
|
@@ -1108,7 +1550,8 @@
|
|
|
1108
1550
|
"bestPractices": [
|
|
1109
1551
|
"Keep columns focused on the task.",
|
|
1110
1552
|
"Use stable row keys.",
|
|
1111
|
-
"Control sorting and pagination when data is remote."
|
|
1553
|
+
"Control sorting and pagination when data is remote.",
|
|
1554
|
+
"Gate secondary columns with column.responsive (e.g. ['lg']) instead of hand-rolled media queries."
|
|
1112
1555
|
],
|
|
1113
1556
|
"avoid": [
|
|
1114
1557
|
"Do not use Table for card-like content where comparison is not important."
|
|
@@ -1249,7 +1692,17 @@
|
|
|
1249
1692
|
{
|
|
1250
1693
|
"name": "theme",
|
|
1251
1694
|
"type": "TaoThemeConfig",
|
|
1252
|
-
"description": "Seed token overrides for the provider scope."
|
|
1695
|
+
"description": "Seed token overrides for the provider scope; also carries mode, compact density, and per-component token overrides."
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
"name": "theme.compact",
|
|
1699
|
+
"type": "boolean",
|
|
1700
|
+
"description": "Compact density: control height 32→28 and paddings one notch tighter, cascades like mode."
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
"name": "theme.components",
|
|
1704
|
+
"type": "TaoComponentTokenMap",
|
|
1705
|
+
"description": "Per-component token overrides (Button/Input/FormField), serialized to --tao-{component}-* CSS variables."
|
|
1253
1706
|
}
|
|
1254
1707
|
]
|
|
1255
1708
|
},
|
|
@@ -1286,6 +1739,81 @@
|
|
|
1286
1739
|
"Use maxLength when limits are strict."
|
|
1287
1740
|
]
|
|
1288
1741
|
}
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"name": "tooltip",
|
|
1745
|
+
"displayName": "Tooltip",
|
|
1746
|
+
"category": "Data Display",
|
|
1747
|
+
"description": "Shows a brief informational popup when hovering or focusing an element.",
|
|
1748
|
+
"exports": [
|
|
1749
|
+
"Tooltip"
|
|
1750
|
+
],
|
|
1751
|
+
"source": "src/components/tooltip/tooltip.tsx",
|
|
1752
|
+
"story": "stories/tooltip.stories.tsx",
|
|
1753
|
+
"tests": [
|
|
1754
|
+
"tests/tooltip/tooltip.test.tsx"
|
|
1755
|
+
],
|
|
1756
|
+
"semanticParts": [
|
|
1757
|
+
"content",
|
|
1758
|
+
"arrow"
|
|
1759
|
+
],
|
|
1760
|
+
"keywords": [
|
|
1761
|
+
"hover",
|
|
1762
|
+
"hint",
|
|
1763
|
+
"popup",
|
|
1764
|
+
"infotip"
|
|
1765
|
+
],
|
|
1766
|
+
"related": [
|
|
1767
|
+
"Dropdown",
|
|
1768
|
+
"Modal"
|
|
1769
|
+
],
|
|
1770
|
+
"usage": {
|
|
1771
|
+
"description": "Use Tooltip for short contextual hints on hover or focus. The popup is portaled and inherits the TaoProvider theme.",
|
|
1772
|
+
"bestPractices": [
|
|
1773
|
+
"Keep tooltip text short and supplementary.",
|
|
1774
|
+
"Wrap exactly one focusable trigger element."
|
|
1775
|
+
],
|
|
1776
|
+
"avoid": [
|
|
1777
|
+
"Do not put critical information or interactive content inside a Tooltip."
|
|
1778
|
+
]
|
|
1779
|
+
},
|
|
1780
|
+
"props": [
|
|
1781
|
+
{
|
|
1782
|
+
"name": "title",
|
|
1783
|
+
"type": "ReactNode",
|
|
1784
|
+
"description": "Tooltip content; null, undefined or empty string disables the tooltip.",
|
|
1785
|
+
"required": true
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
"name": "placement",
|
|
1789
|
+
"type": "'top' | 'bottom' | 'left' | 'right'",
|
|
1790
|
+
"description": "Popup side relative to the trigger.",
|
|
1791
|
+
"defaultValue": "'top'"
|
|
1792
|
+
},
|
|
1793
|
+
{
|
|
1794
|
+
"name": "arrow",
|
|
1795
|
+
"type": "boolean",
|
|
1796
|
+
"description": "Show the arrow pointing at the trigger.",
|
|
1797
|
+
"defaultValue": "true"
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
"name": "mouseEnterDelay",
|
|
1801
|
+
"type": "number",
|
|
1802
|
+
"description": "Hover delay in seconds before opening.",
|
|
1803
|
+
"defaultValue": "0.1"
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
"name": "mouseLeaveDelay",
|
|
1807
|
+
"type": "number",
|
|
1808
|
+
"description": "Delay in seconds before a pointer-leave closes the tooltip; re-entering cancels the close. Esc/blur closes stay immediate.",
|
|
1809
|
+
"defaultValue": "0.1"
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
"name": "color",
|
|
1813
|
+
"type": "string",
|
|
1814
|
+
"description": "Custom content background color."
|
|
1815
|
+
}
|
|
1816
|
+
]
|
|
1289
1817
|
}
|
|
1290
1818
|
]
|
|
1291
1819
|
}
|