@rockshin/tao-ui 0.0.42 → 0.0.44
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 +8 -2
- package/component-manifest.json +37 -18
- package/dist/components/alert/alert.css +1 -0
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/calendar/calendar.css +10 -60
- package/dist/components/calendar/calendar.js +46 -43
- package/dist/components/card/card.css +1 -1
- package/dist/components/carousel/carousel.css +1 -0
- package/dist/components/carousel/carousel.js +62 -7
- package/dist/components/collapse/collapse-panels.d.ts +4 -0
- package/dist/components/collapse/collapse-panels.js +413 -0
- package/dist/components/collapse/collapse.css +199 -0
- package/dist/components/collapse/collapse.d.ts +77 -0
- package/dist/components/{collapsible/collapsible.js → collapse/collapse.js} +26 -10
- package/dist/components/color-picker/color-picker.css +8 -42
- package/dist/components/color-picker/color-picker.js +220 -145
- package/dist/components/date-picker/date-picker.css +18 -56
- package/dist/components/date-picker/date-picker.d.ts +2 -0
- package/dist/components/date-picker/date-picker.js +11 -6
- package/dist/components/date-picker/presets.js +5 -2
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +3 -1
- package/dist/components/form/field-control.d.ts +6 -0
- package/dist/components/form/field-control.js +42 -0
- package/dist/components/form/form-context.d.ts +3 -0
- package/dist/components/form/form-item.d.ts +2 -1
- package/dist/components/form/form-item.js +56 -42
- package/dist/components/form/form.css +15 -0
- package/dist/components/form/form.d.ts +5 -5
- package/dist/components/form/form.js +87 -68
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/use-form.d.ts +16 -0
- package/dist/components/form/use-form.js +69 -0
- package/dist/components/form-field/form-field-view.d.ts +6 -2
- package/dist/components/form-field/form-field-view.js +116 -84
- package/dist/components/input/base-input.d.ts +25 -0
- package/dist/components/input/base-input.js +104 -0
- package/dist/components/input/input-shared.css +75 -0
- package/dist/components/input/input-shared.d.ts +59 -0
- package/dist/components/input/input-shared.js +152 -0
- package/dist/components/input/input.css +99 -4
- package/dist/components/input/input.d.ts +12 -16
- package/dist/components/input/input.js +11 -154
- package/dist/components/input/otp.d.ts +29 -0
- package/dist/components/input/otp.js +335 -0
- package/dist/components/input/password.d.ts +12 -0
- package/dist/components/input/password.js +117 -0
- package/dist/components/input/search.d.ts +16 -0
- package/dist/components/input/search.js +99 -0
- package/dist/components/input-number/input-number.d.ts +2 -2
- package/dist/components/input-number/input-number.js +2 -2
- package/dist/components/list/list-pagination.css +5 -5
- package/dist/components/list/list-pagination.js +1 -0
- package/dist/components/mentions/mentions.css +7 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +78 -73
- package/dist/components/select/mobile-select.css +1 -16
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +68 -63
- package/dist/components/select/select-types.d.ts +2 -0
- package/dist/components/select/select.css +19 -0
- package/dist/components/select/select.js +31 -17
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/steps/steps.css +53 -3
- package/dist/components/table/table.css +0 -5
- package/dist/components/table/table.js +21 -22
- package/dist/components/textarea/textarea.css +20 -0
- package/dist/components/textarea/textarea.d.ts +12 -6
- package/dist/components/textarea/textarea.js +120 -219
- package/dist/components/time-picker/time-picker.css +7 -0
- package/dist/components/tree/tree-check.d.ts +1 -0
- package/dist/components/tree/tree-check.js +36 -0
- package/dist/components/tree/tree.css +13 -18
- package/dist/components/tree/tree.js +2 -3
- package/dist/components/tree-select/select-engine.css +7 -0
- package/dist/components/tree-select/tree-select.js +2 -3
- package/dist/components/upload/upload.css +0 -11
- package/dist/components/upload/upload.js +13 -3
- package/dist/docs/component-docs.js +2 -2
- package/dist/docs/components/{collapsible.doc.d.ts → collapse.doc.d.ts} +1 -1
- package/dist/docs/components/collapse.doc.js +47 -0
- package/dist/docs/components/form.doc.js +3 -1
- package/dist/docs/components/input.doc.js +11 -4
- package/dist/docs/components/textarea.doc.js +4 -2
- package/dist/entries/collapse.d.ts +3 -0
- package/dist/entries/{collapsible.js → collapse.js} +1 -1
- package/dist/entries/form.d.ts +2 -2
- package/dist/entries/input.d.ts +1 -1
- package/dist/entries/textarea.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/provider/locale.d.ts +6 -0
- package/dist/provider/locale.js +10 -0
- package/dist/provider/tao-provider.js +1 -0
- package/dist/theme/control.css +2 -2
- package/dist/theme/theme.css +3 -1
- package/dist/theme/tokens.d.ts +2 -2
- package/dist/theme/tokens.js +1 -0
- package/dist/utils/field-label.d.ts +4 -0
- package/dist/utils/field-label.js +7 -0
- package/llms.txt +19 -16
- package/package.json +10 -5
- package/dist/components/collapsible/collapsible.css +0 -49
- package/dist/components/collapsible/collapsible.d.ts +0 -39
- package/dist/docs/components/collapsible.doc.js +0 -39
- package/dist/entries/collapsible.d.ts +0 -3
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ A component library for React 18.2 and 19 with semantic DOM customization and OK
|
|
|
4
4
|
|
|
5
5
|
Documentation: [English](https://rickyshin93.github.io/tao-ui/) · [简体中文](https://rickyshin93.github.io/tao-ui/zh/).
|
|
6
6
|
|
|
7
|
+
Agent access: [guide](https://rickyshin93.github.io/tao-ui/guide/agents) · [JSON discovery index](https://rickyshin93.github.io/tao-ui/agent-manifest.json) · [Markdown index](https://rickyshin93.github.io/tao-ui/llms.txt). The website exposes versioned package facts and bilingual API/example links; the npm package exports `@rockshin/tao-ui/component-manifest.json` and `@rockshin/tao-ui/meta`.
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- **React 18.2 and 19** — supports React 18.2 as the minimum version and React 19, with React Compiler optimizations.
|
|
@@ -41,7 +43,7 @@ export default function App() {
|
|
|
41
43
|
|
|
42
44
|
### Accessibility
|
|
43
45
|
|
|
44
|
-
Use `FormField` or `Form.Item` to label controls and associate help/validation messages. Input, Textarea, InputNumber, Select, Checkbox, Radio, Switch and the date pickers forward field ARIA attributes to their interactive elements; CheckboxGroup and RadioGroup expose group labels and validation messages. Placeholders are not a substitute for a label.
|
|
46
|
+
Use `FormField` or `Form.Item` to label controls and associate help/validation messages. Input, Textarea, InputNumber, Select, Checkbox, Radio, Switch and the date pickers forward field ARIA attributes to their interactive elements; CheckboxGroup and RadioGroup expose group labels and validation messages. Placeholders are not a substitute for a label. For long forms, call `form.scrollToField(name, { focus: true })` using `Form.useForm()`, the Form ref or `Form.useFormInstance()`; nested and full `Form.List` paths are supported. Custom controls must forward `ref` or `id`, and the target field must be mounted.
|
|
45
47
|
|
|
46
48
|
Radio maps `aria-required` to native `required`; an explicit `required` prop takes precedence. Group options retain their native disabled state, including explicit `disabled={false}` overrides.
|
|
47
49
|
|
|
@@ -76,6 +78,8 @@ import { TaoProvider } from '@rockshin/tao-ui/provider';
|
|
|
76
78
|
|
|
77
79
|
Entry names use kebab-case, such as `/input-number`, `/range-picker`, and `/form-layout`. Related exports share an entry: `CheckboxGroup` uses `/checkbox`, and `HeadlessInputNumber` uses `/number-input`.
|
|
78
80
|
|
|
81
|
+
The `/input` entry includes `Input.Password`, `Input.Search`, `Input.TextArea`, and `Input.OTP`. Input and Textarea support `allowClear`, `showCount`, custom `count`, and `onPressEnter`; existing native DOM refs and standalone `Textarea` remain supported. See the [Input examples and API](docs/en/components/input.mdx).
|
|
82
|
+
|
|
79
83
|
### Dark mode
|
|
80
84
|
|
|
81
85
|
Pure-CSS dark algorithm — no JS runtime. One prop flips every component, including portaled popups (Modal, Drawer, Select dropdowns):
|
|
@@ -118,12 +122,14 @@ import '@fontsource/geist-mono/400.css';
|
|
|
118
122
|
| Layout | `Stack`, `FormLayout`, `Splitter`, `Divider`, `Masonry` |
|
|
119
123
|
| Navigation | `Tabs`, `Pagination`, `Breadcrumb`, `Menu`, `Dropdown`, `ContextMenu`, `Affix` |
|
|
120
124
|
| Data Entry | `Form`, `Input`, `Textarea`, `InputNumber`, `Select`, `Checkbox`, `Radio`, `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions`, `AutoComplete`, `Cascader`, `ColorPicker`, `Mentions`, `Rate`, `Slider`, `TimePicker`, `Transfer`, `TreeSelect`, `Upload` |
|
|
121
|
-
| Data Display | `Table`, `Tag`, `ScrollArea`, `
|
|
125
|
+
| Data Display | `Table`, `Tag`, `ScrollArea`, `Collapse`, `Tooltip`, `Popover`, `Avatar`, `Badge`, `BorderBeam`, `Calendar`, `Card`, `Carousel`, `Descriptions`, `Empty`, `Image`, `List`, `Listy`, `QRCode`, `Segmented`, `Statistic`, `Timeline`, `Tour`, `Tree`, `Watermark` |
|
|
122
126
|
| Feedback | `Modal`, `Drawer`, `Sonner`, `Spinner`, `Alert`, `Popconfirm`, `Progress`, `Result`, `Skeleton` |
|
|
123
127
|
| Config | `TaoProvider`, `App`, `useTaoConfig`, `useTaoToken` |
|
|
124
128
|
|
|
125
129
|
The 0.0.42 catalog adds 36 visual entries and the `GetProps`, `GetProp` and `GetRef` type utilities. New entries follow Ant Design 6.7.0 public APIs with tao-ui themes, Semantic DOM and component styles. Complex controls reuse low-level rc engines; `antd` is not a runtime dependency. Existing tao-ui APIs are unchanged. See the [compatibility scope](./ANTD-COMPATIBILITY.md) for the included APIs and boundaries.
|
|
126
130
|
|
|
131
|
+
The current workspace replaces `Collapsible` with `Collapse` (subpath `@rockshin/tao-ui/collapse`). Pass `items` with `key`, `label` and `children` for built-in panels; use `accordion` for a single open panel and `activeKey` / `onChange` for controlled expansion. Update imports from the old name/subpath.
|
|
132
|
+
|
|
127
133
|
Import types from the root or `@rockshin/tao-ui/util`. Compound APIs share their component entry, including `TimePicker.RangePicker`, `Tree.DirectoryTree`, `Image.PreviewGroup`, `Upload.Dragger`, `FloatButton.BackTop` and `App.useApp()`.
|
|
128
134
|
|
|
129
135
|
Responsive helpers: `useBreakpoint`, `useIsMobile`, plus breakpoint-map props on
|
package/component-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@rockshin/tao-ui",
|
|
4
|
-
"generatedAt": "2026-11-
|
|
4
|
+
"generatedAt": "2026-11-05T15:23:43.221Z",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "affix",
|
|
@@ -626,22 +626,29 @@
|
|
|
626
626
|
]
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
|
-
"name": "
|
|
630
|
-
"displayName": "
|
|
629
|
+
"name": "collapse",
|
|
630
|
+
"displayName": "Collapse",
|
|
631
631
|
"category": "Data Display",
|
|
632
|
-
"description": "
|
|
632
|
+
"description": "Groups content into accessible item-based panels with built-in headers, expand icons and accordion behavior.",
|
|
633
633
|
"exports": [
|
|
634
|
-
"
|
|
634
|
+
"Collapse"
|
|
635
635
|
],
|
|
636
|
-
"source": "src/components/
|
|
637
|
-
"story": "stories/
|
|
636
|
+
"source": "src/components/collapse/collapse.tsx",
|
|
637
|
+
"story": "stories/collapse.stories.tsx",
|
|
638
638
|
"tests": [
|
|
639
|
-
"tests/
|
|
639
|
+
"tests/collapse/collapse.test.tsx",
|
|
640
|
+
"tests/collapse/panels.test.tsx"
|
|
640
641
|
],
|
|
641
642
|
"semanticParts": [
|
|
642
643
|
"root",
|
|
644
|
+
"item",
|
|
645
|
+
"header",
|
|
643
646
|
"trigger",
|
|
644
|
-
"
|
|
647
|
+
"title",
|
|
648
|
+
"icon",
|
|
649
|
+
"extra",
|
|
650
|
+
"content",
|
|
651
|
+
"body"
|
|
645
652
|
],
|
|
646
653
|
"keywords": [
|
|
647
654
|
"accordion",
|
|
@@ -653,10 +660,11 @@
|
|
|
653
660
|
"Tabs"
|
|
654
661
|
],
|
|
655
662
|
"usage": {
|
|
656
|
-
"description": "
|
|
663
|
+
"description": "Pass items with key, label and children for ready-to-use panels; use accordion to allow one open panel and activeKey/onChange for controlled state.",
|
|
657
664
|
"bestPractices": [
|
|
658
665
|
"Make the trigger label describe the hidden content.",
|
|
659
|
-
"Use
|
|
666
|
+
"Use activeKey/onChange when expansion must coordinate with other UI.",
|
|
667
|
+
"Keep independent header actions in extra; reserve collapsible=\"icon\" for icon-only activation."
|
|
660
668
|
],
|
|
661
669
|
"avoid": [
|
|
662
670
|
"Do not hide required form inputs in a collapsed region without a clear cue."
|
|
@@ -1012,7 +1020,8 @@
|
|
|
1012
1020
|
"source": "src/components/form/form.tsx",
|
|
1013
1021
|
"story": "stories/form.stories.tsx",
|
|
1014
1022
|
"tests": [
|
|
1015
|
-
"tests/form/form.test.tsx"
|
|
1023
|
+
"tests/form/form.test.tsx",
|
|
1024
|
+
"tests/form/form-scroll.test.tsx"
|
|
1016
1025
|
],
|
|
1017
1026
|
"semanticParts": [
|
|
1018
1027
|
"root"
|
|
@@ -1035,6 +1044,7 @@
|
|
|
1035
1044
|
"Declare validation as rules on Form.Item; the required mark is inferred from rules.",
|
|
1036
1045
|
"Use dependencies for cross-field rules such as password confirmation.",
|
|
1037
1046
|
"Use Form.useForm() for imperative control (setFieldsValue, resetFields, submit).",
|
|
1047
|
+
"Call form.scrollToField(name, { focus: true }) to reveal a mounted field, including full Form.List paths; custom controls must forward ref or id.",
|
|
1038
1048
|
"Set size or disabled on Form to cascade them to every control inside."
|
|
1039
1049
|
],
|
|
1040
1050
|
"avoid": [
|
|
@@ -1288,20 +1298,25 @@
|
|
|
1288
1298
|
"name": "input",
|
|
1289
1299
|
"displayName": "Input",
|
|
1290
1300
|
"category": "Data Entry",
|
|
1291
|
-
"description": "
|
|
1301
|
+
"description": "Text inputs with clearing, counting, password visibility, search, text areas and OTP.",
|
|
1292
1302
|
"exports": [
|
|
1293
1303
|
"Input"
|
|
1294
1304
|
],
|
|
1295
1305
|
"source": "src/components/input/input.tsx",
|
|
1296
1306
|
"story": "stories/input.stories.tsx",
|
|
1297
1307
|
"tests": [
|
|
1298
|
-
"tests/input/input.test.tsx"
|
|
1308
|
+
"tests/input/input.test.tsx",
|
|
1309
|
+
"tests/input/family.test.tsx"
|
|
1299
1310
|
],
|
|
1300
1311
|
"semanticParts": [
|
|
1301
1312
|
"root",
|
|
1302
1313
|
"input",
|
|
1303
1314
|
"prefix",
|
|
1304
|
-
"suffix"
|
|
1315
|
+
"suffix",
|
|
1316
|
+
"clear",
|
|
1317
|
+
"count",
|
|
1318
|
+
"addonBefore",
|
|
1319
|
+
"addonAfter"
|
|
1305
1320
|
],
|
|
1306
1321
|
"keywords": [
|
|
1307
1322
|
"text field",
|
|
@@ -1316,7 +1331,9 @@
|
|
|
1316
1331
|
"description": "Use Input for short text values such as names, filters, search terms, and identifiers.",
|
|
1317
1332
|
"bestPractices": [
|
|
1318
1333
|
"Pair with FormField for labels and validation.",
|
|
1319
|
-
"Use type, inputMode, and autoComplete when applicable."
|
|
1334
|
+
"Use type, inputMode, and autoComplete when applicable.",
|
|
1335
|
+
"Use Input.Password, Input.Search, Input.TextArea and Input.OTP for specialized input.",
|
|
1336
|
+
"Use count.max for a soft limit; add exceedFormatter for custom clipping."
|
|
1320
1337
|
]
|
|
1321
1338
|
}
|
|
1322
1339
|
},
|
|
@@ -2761,7 +2778,7 @@
|
|
|
2761
2778
|
"name": "textarea",
|
|
2762
2779
|
"displayName": "Textarea",
|
|
2763
2780
|
"category": "Data Entry",
|
|
2764
|
-
"description": "Multi-line text input with
|
|
2781
|
+
"description": "Multi-line text input with auto sizing, clearing and custom character counts; also available as Input.TextArea.",
|
|
2765
2782
|
"exports": [
|
|
2766
2783
|
"Textarea"
|
|
2767
2784
|
],
|
|
@@ -2772,7 +2789,9 @@
|
|
|
2772
2789
|
],
|
|
2773
2790
|
"semanticParts": [
|
|
2774
2791
|
"root",
|
|
2775
|
-
"textarea"
|
|
2792
|
+
"textarea",
|
|
2793
|
+
"clear",
|
|
2794
|
+
"count"
|
|
2776
2795
|
],
|
|
2777
2796
|
"keywords": [
|
|
2778
2797
|
"textarea",
|
|
@@ -51,7 +51,7 @@ const AvatarRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
51
51
|
"data-tao-avatar": "",
|
|
52
52
|
"data-tao-shape": shape,
|
|
53
53
|
"data-tao-size": 'string' == typeof dimensions ? 'middle' === dimensions || 'default' === dimensions ? 'medium' : dimensions : void 0,
|
|
54
|
-
"data-tao-image": hasImage || void 0,
|
|
54
|
+
"data-tao-avatar-image": hasImage || void 0,
|
|
55
55
|
"data-tao-icon": hasIcon || void 0,
|
|
56
56
|
className: cx(prefixCls, classNames?.root, className, rootClassName),
|
|
57
57
|
style: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
font: var(--tao-font-size) / var(--tao-line-height) var(--tao-font-family);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
[data-tao-calendar-
|
|
11
|
+
[data-tao-calendar-toolbar] {
|
|
12
12
|
justify-content: flex-end;
|
|
13
13
|
align-items: center;
|
|
14
14
|
gap: var(--tao-margin-xs);
|
|
@@ -17,57 +17,7 @@
|
|
|
17
17
|
display: flex;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
[data-tao-calendar
|
|
21
|
-
height: var(--tao-control-height);
|
|
22
|
-
padding-inline: var(--tao-padding-sm);
|
|
23
|
-
border: 1px solid var(--tao-color-border);
|
|
24
|
-
border-radius: var(--tao-radius-sm);
|
|
25
|
-
background: var(--tao-color-bg-container);
|
|
26
|
-
color: inherit;
|
|
27
|
-
font: inherit;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[data-tao-calendar-modes] {
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[data-tao-calendar-modes] label {
|
|
36
|
-
border-radius: 0;
|
|
37
|
-
align-items: center;
|
|
38
|
-
display: inline-flex;
|
|
39
|
-
position: relative;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[data-tao-calendar-modes] label:first-child {
|
|
43
|
-
border-start-start-radius: var(--tao-radius-sm);
|
|
44
|
-
border-end-start-radius: var(--tao-radius-sm);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
[data-tao-calendar-modes] label:last-child {
|
|
48
|
-
border-start-end-radius: var(--tao-radius-sm);
|
|
49
|
-
border-end-end-radius: var(--tao-radius-sm);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
[data-tao-calendar-modes] label[data-selected] {
|
|
53
|
-
color: var(--tao-color-primary);
|
|
54
|
-
border-color: var(--tao-color-primary);
|
|
55
|
-
background: var(--tao-primary-bg);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[data-tao-calendar] :is(select, button):focus-visible {
|
|
59
|
-
outline: 2px solid var(--tao-color-primary);
|
|
60
|
-
outline-offset: 2px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
[data-tao-calendar-modes] input {
|
|
64
|
-
opacity: 0;
|
|
65
|
-
width: 1px;
|
|
66
|
-
height: 1px;
|
|
67
|
-
position: absolute;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
[data-tao-calendar-modes] label:has(input:focus-visible) {
|
|
20
|
+
[data-tao-calendar] button:not([data-tao-select]):focus-visible {
|
|
71
21
|
outline: 2px solid var(--tao-color-primary);
|
|
72
22
|
outline-offset: 2px;
|
|
73
23
|
}
|
|
@@ -96,7 +46,7 @@
|
|
|
96
46
|
color: var(--tao-color-text);
|
|
97
47
|
}
|
|
98
48
|
|
|
99
|
-
[data-tao-calendar-
|
|
49
|
+
[data-tao-calendar-item] {
|
|
100
50
|
min-width: 0;
|
|
101
51
|
min-height: 100px;
|
|
102
52
|
padding: var(--tao-padding-xs);
|
|
@@ -114,16 +64,16 @@
|
|
|
114
64
|
min-width: 0;
|
|
115
65
|
}
|
|
116
66
|
|
|
117
|
-
[data-tao-calendar] td:not([class*="-cell-disabled"]):hover [data-tao-calendar-
|
|
67
|
+
[data-tao-calendar] td:not([class*="-cell-disabled"]):hover [data-tao-calendar-item] {
|
|
118
68
|
background: var(--tao-color-bg-text-hover);
|
|
119
69
|
}
|
|
120
70
|
|
|
121
|
-
[data-tao-calendar] td[class*="-cell-selected"] [data-tao-calendar-
|
|
71
|
+
[data-tao-calendar] td[class*="-cell-selected"] [data-tao-calendar-item] {
|
|
122
72
|
background: var(--tao-primary-bg);
|
|
123
73
|
color: var(--tao-color-primary);
|
|
124
74
|
}
|
|
125
75
|
|
|
126
|
-
[data-tao-calendar-
|
|
76
|
+
[data-tao-calendar-item][data-today] {
|
|
127
77
|
border-top-color: var(--tao-color-primary);
|
|
128
78
|
}
|
|
129
79
|
|
|
@@ -141,7 +91,7 @@
|
|
|
141
91
|
text-align: center;
|
|
142
92
|
}
|
|
143
93
|
|
|
144
|
-
[data-tao-calendar][data-fullscreen="false"] [data-tao-calendar-
|
|
94
|
+
[data-tao-calendar][data-fullscreen="false"] [data-tao-calendar-item] {
|
|
145
95
|
border-radius: var(--tao-radius-sm);
|
|
146
96
|
border-top: 0;
|
|
147
97
|
min-height: 32px;
|
|
@@ -157,18 +107,18 @@
|
|
|
157
107
|
}
|
|
158
108
|
|
|
159
109
|
@media (width <= 575px) {
|
|
160
|
-
[data-tao-calendar-
|
|
110
|
+
[data-tao-calendar-item] {
|
|
161
111
|
min-height: 64px;
|
|
162
112
|
padding: 4px;
|
|
163
113
|
}
|
|
164
114
|
|
|
165
|
-
[data-tao-calendar-
|
|
115
|
+
[data-tao-calendar-toolbar] {
|
|
166
116
|
justify-content: center;
|
|
167
117
|
}
|
|
168
118
|
}
|
|
169
119
|
|
|
170
120
|
@media (prefers-reduced-motion: reduce) {
|
|
171
|
-
[data-tao-calendar-
|
|
121
|
+
[data-tao-calendar-item] {
|
|
172
122
|
transition: none;
|
|
173
123
|
}
|
|
174
124
|
}
|
|
@@ -5,13 +5,14 @@ import en_US from "@rc-component/picker/locale/en_US";
|
|
|
5
5
|
import zh_CN from "@rc-component/picker/locale/zh_CN";
|
|
6
6
|
import dayjs_0 from "dayjs";
|
|
7
7
|
import "dayjs/locale/zh-cn";
|
|
8
|
-
import { forwardRef,
|
|
8
|
+
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
9
9
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
10
|
+
import { Segmented } from "../segmented/segmented.js";
|
|
11
|
+
import { Select } from "../select/select.js";
|
|
10
12
|
import { cx } from "../../utils/semantic.js";
|
|
11
13
|
import "./calendar.css";
|
|
12
14
|
const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
13
15
|
const config = useTaoConfig();
|
|
14
|
-
const modeName = useId();
|
|
15
16
|
const root = useRef(null);
|
|
16
17
|
useImperativeHandle(ref, ()=>({
|
|
17
18
|
get nativeElement () {
|
|
@@ -61,7 +62,7 @@ const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
61
62
|
if (legacyFull) return legacyFull(date_2);
|
|
62
63
|
const extra = props.cellRender ? props.cellRender(date_2, info) : 'month' === info.type ? props.monthCellRender?.(date_2) : props.dateCellRender?.(date_2);
|
|
63
64
|
return /*#__PURE__*/ jsxs("div", {
|
|
64
|
-
"data-tao-calendar-
|
|
65
|
+
"data-tao-calendar-item": "",
|
|
65
66
|
"data-today": date_2.isSame(dayjs_0(), 'month' === info.type ? 'month' : 'day') || void 0,
|
|
66
67
|
children: [
|
|
67
68
|
/*#__PURE__*/ jsx("span", {
|
|
@@ -93,55 +94,57 @@ const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
93
94
|
onChange: (date_3)=>select(date_3, 'customize'),
|
|
94
95
|
onTypeChange: changeMode
|
|
95
96
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
96
|
-
"data-tao-calendar-
|
|
97
|
+
"data-tao-calendar-toolbar": "",
|
|
97
98
|
className: names?.header,
|
|
98
99
|
style: styles?.header,
|
|
99
100
|
children: [
|
|
100
|
-
/*#__PURE__*/ jsx(
|
|
101
|
+
/*#__PURE__*/ jsx(Select, {
|
|
101
102
|
"aria-label": chinese ? '年' : 'Year',
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
mobileTitle: chinese ? '年' : 'Year',
|
|
104
|
+
size: "medium",
|
|
105
|
+
style: {
|
|
106
|
+
width: 'auto',
|
|
107
|
+
minWidth: '6em'
|
|
108
|
+
},
|
|
109
|
+
value: String(value.year()),
|
|
110
|
+
onChange: (year)=>select(clamp(value.year(Number(year))), 'year'),
|
|
111
|
+
options: Array.from({
|
|
105
112
|
length: lastYear - firstYear + 1
|
|
106
|
-
}, (_, index)=>
|
|
107
|
-
value:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
chinese ? '年' : ''
|
|
111
|
-
]
|
|
112
|
-
}, year))
|
|
113
|
+
}, (_, index)=>({
|
|
114
|
+
value: String(firstYear + index),
|
|
115
|
+
label: `${firstYear + index}${chinese ? '年' : ''}`
|
|
116
|
+
}))
|
|
113
117
|
}),
|
|
114
|
-
'month' === mode && /*#__PURE__*/ jsx(
|
|
118
|
+
'month' === mode && /*#__PURE__*/ jsx(Select, {
|
|
115
119
|
"aria-label": chinese ? '月' : 'Month',
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
mobileTitle: chinese ? '月' : 'Month',
|
|
121
|
+
size: "medium",
|
|
122
|
+
style: {
|
|
123
|
+
width: 'auto',
|
|
124
|
+
minWidth: '6em'
|
|
125
|
+
},
|
|
126
|
+
value: String(value.month()),
|
|
127
|
+
onChange: (month)=>select(value.month(Number(month)), 'month'),
|
|
128
|
+
options: months.map((month_0, index_0)=>({
|
|
129
|
+
label: month_0,
|
|
130
|
+
value: String(index_0)
|
|
131
|
+
})).slice(minMonth, maxMonth + 1)
|
|
122
132
|
}),
|
|
123
|
-
/*#__PURE__*/ jsx(
|
|
124
|
-
"data-tao-calendar-modes": "",
|
|
125
|
-
role: "radiogroup",
|
|
133
|
+
/*#__PURE__*/ jsx(Segmented, {
|
|
126
134
|
"aria-label": chinese ? '日历视图' : 'Calendar view',
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/*#__PURE__*/ jsx("span", {
|
|
141
|
-
children: 'month' === type ? chinese ? '月' : 'Month' : chinese ? '年' : 'Year'
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
}, type))
|
|
135
|
+
size: "medium",
|
|
136
|
+
value: mode,
|
|
137
|
+
onChange: changeMode,
|
|
138
|
+
options: [
|
|
139
|
+
{
|
|
140
|
+
value: 'month',
|
|
141
|
+
label: chinese ? '月' : 'Month'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
value: 'year',
|
|
145
|
+
label: chinese ? '年' : 'Year'
|
|
146
|
+
}
|
|
147
|
+
]
|
|
145
148
|
})
|
|
146
149
|
]
|
|
147
150
|
}),
|
|
@@ -1,12 +1,56 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import react_slick from "@ant-design/react-slick";
|
|
4
|
-
import { Children, forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
4
|
+
import { Children, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
5
5
|
import { useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
6
6
|
import { interopDefault } from "../../utils/interop-default.js";
|
|
7
7
|
import { cx } from "../../utils/semantic.js";
|
|
8
8
|
import "./carousel.css";
|
|
9
9
|
const SlickCarouselComponent = /*#__PURE__*/ interopDefault(react_slick);
|
|
10
|
+
function useResponsiveSettings(responsive) {
|
|
11
|
+
const $ = c(3);
|
|
12
|
+
const [settings, setSettings] = useState();
|
|
13
|
+
let t0;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== responsive) {
|
|
16
|
+
t0 = ()=>{
|
|
17
|
+
const queries = [
|
|
18
|
+
...responsive ?? []
|
|
19
|
+
].sort(_temp).map(_temp2);
|
|
20
|
+
const update = ()=>setSettings(queries.find(_temp3)?.settings);
|
|
21
|
+
update();
|
|
22
|
+
for (const { media: media_0 } of queries)media_0.addEventListener("change", update);
|
|
23
|
+
return ()=>{
|
|
24
|
+
for (const { media: media_1 } of queries)media_1.removeEventListener("change", update);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
t1 = [
|
|
28
|
+
responsive
|
|
29
|
+
];
|
|
30
|
+
$[0] = responsive;
|
|
31
|
+
$[1] = t0;
|
|
32
|
+
$[2] = t1;
|
|
33
|
+
} else {
|
|
34
|
+
t0 = $[1];
|
|
35
|
+
t1 = $[2];
|
|
36
|
+
}
|
|
37
|
+
useEffect(t0, t1);
|
|
38
|
+
return settings;
|
|
39
|
+
}
|
|
40
|
+
function _temp3(t0) {
|
|
41
|
+
const { media } = t0;
|
|
42
|
+
return media.matches;
|
|
43
|
+
}
|
|
44
|
+
function _temp2(t0) {
|
|
45
|
+
const { breakpoint, settings: settings_0 } = t0;
|
|
46
|
+
return {
|
|
47
|
+
media: window.matchMedia(`(max-width: ${breakpoint}px)`),
|
|
48
|
+
settings: settings_0
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function _temp(a, b) {
|
|
52
|
+
return a.breakpoint - b.breakpoint;
|
|
53
|
+
}
|
|
10
54
|
function Arrow(t0) {
|
|
11
55
|
const $ = c(32);
|
|
12
56
|
let t1;
|
|
@@ -118,7 +162,13 @@ function Arrow(t0) {
|
|
|
118
162
|
}
|
|
119
163
|
const carousel_Carousel = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
120
164
|
const { locale, tokenStyle } = useTaoInternalConfig();
|
|
121
|
-
const {
|
|
165
|
+
const { responsive, ...baseProps } = props;
|
|
166
|
+
const responsiveSettings = useResponsiveSettings(responsive);
|
|
167
|
+
const unslick = 'unslick' === responsiveSettings;
|
|
168
|
+
const { dots = true, arrows = false, prevArrow, nextArrow, draggable = false, waitForAnimate = false, dotPosition, dotPlacement, vertical, rootClassName, className, style, id, autoplay = false, autoplaySpeed = 3000, initialSlide = 0, rtl = false, children, effect = 'scrollx', slickGoTo, prefixCls, classNames, styles, appendDots, ...rest } = {
|
|
169
|
+
...baseProps,
|
|
170
|
+
...unslick ? {} : responsiveSettings
|
|
171
|
+
};
|
|
122
172
|
const placement = dotPlacement ?? ('left' === dotPosition ? 'start' : 'right' === dotPosition ? 'end' : dotPosition) ?? 'bottom';
|
|
123
173
|
const isVertical = vertical ?? ('start' === placement || 'end' === placement);
|
|
124
174
|
const isRtl = rtl && !isVertical;
|
|
@@ -136,16 +186,18 @@ const carousel_Carousel = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
136
186
|
}
|
|
137
187
|
}), []);
|
|
138
188
|
useEffect(()=>{
|
|
139
|
-
if (count > 0) sliderRef.current.slickGoTo(isRtl ? count - initialSlide - 1 : initialSlide, true);
|
|
189
|
+
if (count > 0 && !unslick) sliderRef.current.slickGoTo(isRtl ? count - initialSlide - 1 : initialSlide, true);
|
|
140
190
|
}, [
|
|
141
191
|
count,
|
|
142
192
|
initialSlide,
|
|
143
|
-
isRtl
|
|
193
|
+
isRtl,
|
|
194
|
+
unslick
|
|
144
195
|
]);
|
|
145
196
|
useEffect(()=>{
|
|
146
|
-
if (void 0 !== slickGoTo) sliderRef.current.slickGoTo(slickGoTo);
|
|
197
|
+
if (void 0 !== slickGoTo && !unslick) sliderRef.current.slickGoTo(slickGoTo);
|
|
147
198
|
}, [
|
|
148
|
-
slickGoTo
|
|
199
|
+
slickGoTo,
|
|
200
|
+
unslick
|
|
149
201
|
]);
|
|
150
202
|
return /*#__PURE__*/ jsx("div", {
|
|
151
203
|
ref: rootRef,
|
|
@@ -161,7 +213,10 @@ const carousel_Carousel = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
161
213
|
...styles?.root,
|
|
162
214
|
...style
|
|
163
215
|
},
|
|
164
|
-
children: /*#__PURE__*/ jsx(
|
|
216
|
+
children: unslick ? /*#__PURE__*/ jsx("div", {
|
|
217
|
+
className: "regular slider",
|
|
218
|
+
children: children
|
|
219
|
+
}) : /*#__PURE__*/ jsx(SlickCarouselComponent, {
|
|
165
220
|
...rest,
|
|
166
221
|
ref: sliderRef,
|
|
167
222
|
initialSlide: initialSlide,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CollapseItem, CollapseProps } from './collapse.js';
|
|
2
|
+
export declare function CollapsePanels({ items, activeKey, defaultActiveKey, onChange, accordion, bordered, ghost, size, disabled, collapsible, expandIconPlacement, expandIcon, destroyOnHidden, className, style, classNames, styles, }: CollapseProps & {
|
|
3
|
+
items: CollapseItem[];
|
|
4
|
+
}): import("react").JSX.Element;
|