@rockshin/tao-ui 0.0.41 → 0.0.43
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 +39 -7
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/component-manifest.json +1352 -24
- package/dist/components/affix/affix.css +11 -0
- package/dist/components/affix/affix.d.ts +21 -0
- package/dist/components/affix/affix.js +140 -0
- package/dist/components/alert/alert.css +1 -0
- package/dist/components/app/app-modals.d.ts +2 -0
- package/dist/components/app/app-modals.js +266 -0
- package/dist/components/app/app-notices.d.ts +6 -0
- package/dist/components/app/app-notices.js +334 -0
- package/dist/components/app/app-types.d.ts +154 -0
- package/dist/components/app/app-types.js +0 -0
- package/dist/components/app/app.css +221 -0
- package/dist/components/app/app.d.ts +7 -0
- package/dist/components/app/app.js +69 -0
- package/dist/components/auto-complete/auto-complete.css +35 -0
- package/dist/components/auto-complete/auto-complete.d.ts +47 -0
- package/dist/components/auto-complete/auto-complete.js +106 -0
- package/dist/components/avatar/avatar.css +95 -0
- package/dist/components/avatar/avatar.d.ts +50 -0
- package/dist/components/avatar/avatar.js +159 -0
- package/dist/components/badge/badge.css +165 -0
- package/dist/components/badge/badge.d.ts +48 -0
- package/dist/components/badge/badge.js +412 -0
- package/dist/components/border-beam/border-beam.css +35 -0
- package/dist/components/border-beam/border-beam.d.ts +27 -0
- package/dist/components/border-beam/border-beam.js +215 -0
- package/dist/components/button/button.css +7 -0
- package/dist/components/calendar/calendar.css +126 -0
- package/dist/components/calendar/calendar.d.ts +56 -0
- package/dist/components/calendar/calendar.js +178 -0
- package/dist/components/card/card-tabs.d.ts +43 -0
- package/dist/components/card/card-tabs.js +455 -0
- package/dist/components/card/card.css +401 -0
- package/dist/components/card/card.d.ts +74 -0
- package/dist/components/card/card.js +362 -0
- package/dist/components/carousel/carousel.css +232 -0
- package/dist/components/carousel/carousel.d.ts +35 -0
- package/dist/components/carousel/carousel.js +248 -0
- package/dist/components/cascader/cascader.css +123 -0
- package/dist/components/cascader/cascader.d.ts +58 -0
- package/dist/components/cascader/cascader.js +132 -0
- package/dist/components/checkbox/checkbox.css +7 -0
- 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-types.d.ts +78 -0
- package/dist/components/color-picker/color-picker-types.js +0 -0
- package/dist/components/color-picker/color-picker.css +265 -0
- package/dist/components/color-picker/color-picker.d.ts +5 -0
- package/dist/components/color-picker/color-picker.js +1049 -0
- package/dist/components/color-picker/color.d.ts +35 -0
- package/dist/components/color-picker/color.js +65 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +4 -11
- package/dist/components/date-picker/calendar/calendar-header.js +76 -69
- package/dist/components/date-picker/calendar/month-grid.js +20 -31
- package/dist/components/date-picker/calendar/time-panel.js +46 -41
- package/dist/components/date-picker/date-picker.css +22 -56
- package/dist/components/date-picker/date-picker.d.ts +2 -0
- package/dist/components/date-picker/date-picker.js +14 -9
- 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 +16 -13
- package/dist/components/descriptions/descriptions.css +109 -0
- package/dist/components/descriptions/descriptions.d.ts +49 -0
- package/dist/components/descriptions/descriptions.js +189 -0
- package/dist/components/divider/divider.css +71 -0
- package/dist/components/divider/divider.d.ts +31 -0
- package/dist/components/divider/divider.js +83 -0
- package/dist/components/drawer/drawer.js +199 -184
- package/dist/components/empty/empty.css +35 -0
- package/dist/components/empty/empty.d.ts +25 -0
- package/dist/components/empty/empty.js +278 -0
- package/dist/components/float-button/float-button.css +146 -0
- package/dist/components/float-button/float-button.d.ts +67 -0
- package/dist/components/float-button/float-button.js +347 -0
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +1 -0
- package/dist/components/form/form.css +15 -0
- package/dist/components/form/form.js +4 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +109 -84
- package/dist/components/image/image-icons.d.ts +16 -0
- package/dist/components/image/image-icons.js +63 -0
- package/dist/components/image/image.css +253 -0
- package/dist/components/image/image.d.ts +75 -0
- package/dist/components/image/image.js +818 -0
- 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 +107 -10
- 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 +127 -0
- package/dist/components/list/list-pagination.d.ts +38 -0
- package/dist/components/list/list-pagination.js +322 -0
- package/dist/components/list/list.css +225 -0
- package/dist/components/list/list.d.ts +77 -0
- package/dist/components/list/list.js +660 -0
- package/dist/components/listy/listy.css +55 -0
- package/dist/components/listy/listy.d.ts +20 -0
- package/dist/components/listy/listy.js +158 -0
- package/dist/components/masonry/masonry.css +13 -0
- package/dist/components/masonry/masonry.d.ts +39 -0
- package/dist/components/masonry/masonry.js +287 -0
- package/dist/components/mentions/mentions.css +179 -0
- package/dist/components/mentions/mentions.d.ts +48 -0
- package/dist/components/mentions/mentions.js +115 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/modal/modal.d.ts +30 -4
- package/dist/components/modal/modal.js +534 -241
- package/dist/components/pagination/pagination.css +10 -0
- package/dist/components/progress/progress.css +187 -0
- package/dist/components/progress/progress.d.ts +66 -0
- package/dist/components/progress/progress.js +567 -0
- package/dist/components/qr-code/qr-code.css +39 -0
- package/dist/components/qr-code/qr-code.d.ts +43 -0
- package/dist/components/qr-code/qr-code.js +286 -0
- package/dist/components/radio/radio.css +7 -0
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +78 -73
- package/dist/components/rate/rate.css +97 -0
- package/dist/components/rate/rate.d.ts +17 -0
- package/dist/components/rate/rate.js +172 -0
- package/dist/components/result/result.css +69 -0
- package/dist/components/result/result.d.ts +33 -0
- package/dist/components/result/result.js +320 -0
- package/dist/components/segmented/segmented.css +134 -0
- package/dist/components/segmented/segmented.d.ts +40 -0
- package/dist/components/segmented/segmented.js +169 -0
- package/dist/components/select/mobile-select.css +1 -16
- package/dist/components/select/mobile-select.d.ts +11 -4
- package/dist/components/select/mobile-select.js +172 -59
- package/dist/components/select/select-tags.js +178 -130
- package/dist/components/select/select-types.d.ts +53 -0
- package/dist/components/select/select.css +86 -8
- package/dist/components/select/select.js +59 -31
- package/dist/components/select/use-select-selection.js +44 -43
- package/dist/components/skeleton/skeleton.css +129 -0
- package/dist/components/skeleton/skeleton.d.ts +78 -0
- package/dist/components/skeleton/skeleton.js +457 -0
- package/dist/components/slider/slider.css +191 -0
- package/dist/components/slider/slider.d.ts +47 -0
- package/dist/components/slider/slider.js +310 -0
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/statistic/statistic.css +34 -0
- package/dist/components/statistic/statistic.d.ts +46 -0
- package/dist/components/statistic/statistic.js +491 -0
- package/dist/components/steps/steps.css +53 -3
- package/dist/components/switch/switch-touch.css +20 -0
- package/dist/components/switch/switch.css +24 -13
- package/dist/components/switch/switch.js +8 -5
- package/dist/components/table/table.css +0 -5
- package/dist/components/table/table.js +21 -22
- package/dist/components/textarea/textarea.css +21 -1
- 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 +212 -0
- package/dist/components/time-picker/time-picker.d.ts +63 -0
- package/dist/components/time-picker/time-picker.js +356 -0
- package/dist/components/timeline/timeline.css +259 -0
- package/dist/components/timeline/timeline.d.ts +50 -0
- package/dist/components/timeline/timeline.js +140 -0
- package/dist/components/tour/tour.css +151 -0
- package/dist/components/tour/tour.d.ts +45 -0
- package/dist/components/tour/tour.js +575 -0
- package/dist/components/transfer/transfer-list.d.ts +2 -0
- package/dist/components/transfer/transfer-list.js +513 -0
- package/dist/components/transfer/transfer-parts.d.ts +3 -0
- package/dist/components/transfer/transfer-parts.js +163 -0
- package/dist/components/transfer/transfer-types.d.ts +163 -0
- package/dist/components/transfer/transfer-types.js +0 -0
- package/dist/components/transfer/transfer.css +226 -0
- package/dist/components/transfer/transfer.d.ts +13 -0
- package/dist/components/transfer/transfer.js +204 -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 +245 -0
- package/dist/components/tree/tree.d.ts +46 -0
- package/dist/components/tree/tree.js +388 -0
- package/dist/components/tree-select/select-engine.css +238 -0
- package/dist/components/tree-select/select-engine.d.ts +20 -0
- package/dist/components/tree-select/select-engine.js +46 -0
- package/dist/components/tree-select/tree-select.css +25 -0
- package/dist/components/tree-select/tree-select.d.ts +50 -0
- package/dist/components/tree-select/tree-select.js +130 -0
- package/dist/components/upload/upload-types.d.ts +135 -0
- package/dist/components/upload/upload-types.js +0 -0
- package/dist/components/upload/upload.css +166 -0
- package/dist/components/upload/upload.d.ts +12 -0
- package/dist/components/upload/upload.js +465 -0
- package/dist/components/watermark/watermark-context.d.ts +7 -0
- package/dist/components/watermark/watermark-context.js +20 -0
- package/dist/components/watermark/watermark.css +10 -0
- package/dist/components/watermark/watermark.d.ts +38 -0
- package/dist/components/watermark/watermark.js +436 -0
- package/dist/docs/component-docs.d.ts +35 -29
- package/dist/docs/component-docs.js +75 -3
- package/dist/docs/components/affix.doc.d.ts +14 -0
- package/dist/docs/components/affix.doc.js +22 -0
- package/dist/docs/components/app.doc.d.ts +18 -0
- package/dist/docs/components/app.doc.js +42 -0
- package/dist/docs/components/auto-complete.doc.d.ts +18 -0
- package/dist/docs/components/auto-complete.doc.js +49 -0
- package/dist/docs/components/avatar.doc.d.ts +17 -0
- package/dist/docs/components/avatar.doc.js +36 -0
- package/dist/docs/components/badge.doc.d.ts +17 -0
- package/dist/docs/components/badge.doc.js +34 -0
- package/dist/docs/components/border-beam.doc.d.ts +14 -0
- package/dist/docs/components/border-beam.doc.js +22 -0
- package/dist/docs/components/{collapsible.doc.d.ts → calendar.doc.d.ts} +1 -1
- package/dist/docs/components/calendar.doc.js +45 -0
- package/dist/docs/components/card.doc.d.ts +17 -0
- package/dist/docs/components/card.doc.js +39 -0
- package/dist/docs/components/carousel.doc.d.ts +15 -0
- package/dist/docs/components/carousel.doc.js +26 -0
- package/dist/docs/components/cascader.doc.d.ts +18 -0
- package/dist/docs/components/cascader.doc.js +54 -0
- package/dist/docs/components/collapse.doc.d.ts +18 -0
- package/dist/docs/components/collapse.doc.js +47 -0
- package/dist/docs/components/color-picker.doc.d.ts +18 -0
- package/dist/docs/components/color-picker.doc.js +46 -0
- package/dist/docs/components/descriptions.doc.d.ts +14 -0
- package/dist/docs/components/descriptions.doc.js +26 -0
- package/dist/docs/components/divider.doc.d.ts +17 -0
- package/dist/docs/components/divider.doc.js +34 -0
- package/dist/docs/components/empty.doc.d.ts +18 -0
- package/dist/docs/components/empty.doc.js +40 -0
- package/dist/docs/components/float-button.doc.d.ts +14 -0
- package/dist/docs/components/float-button.doc.js +23 -0
- package/dist/docs/components/form.doc.d.ts +1 -1
- package/dist/docs/components/image.doc.d.ts +15 -0
- package/dist/docs/components/image.doc.js +38 -0
- package/dist/docs/components/input.doc.js +11 -4
- package/dist/docs/components/list.doc.d.ts +18 -0
- package/dist/docs/components/list.doc.js +43 -0
- package/dist/docs/components/listy.doc.d.ts +18 -0
- package/dist/docs/components/listy.doc.js +40 -0
- package/dist/docs/components/masonry.doc.d.ts +14 -0
- package/dist/docs/components/masonry.doc.js +22 -0
- package/dist/docs/components/mentions.doc.d.ts +18 -0
- package/dist/docs/components/mentions.doc.js +43 -0
- package/dist/docs/components/modal.doc.js +3 -0
- package/dist/docs/components/progress.doc.d.ts +18 -0
- package/dist/docs/components/progress.doc.js +41 -0
- package/dist/docs/components/qr-code.doc.d.ts +18 -0
- package/dist/docs/components/qr-code.doc.js +41 -0
- package/dist/docs/components/rate.doc.d.ts +18 -0
- package/dist/docs/components/rate.doc.js +38 -0
- package/dist/docs/components/result.doc.d.ts +18 -0
- package/dist/docs/components/result.doc.js +42 -0
- package/dist/docs/components/segmented.doc.d.ts +14 -0
- package/dist/docs/components/segmented.doc.js +24 -0
- package/dist/docs/components/skeleton.doc.d.ts +18 -0
- package/dist/docs/components/skeleton.doc.js +42 -0
- package/dist/docs/components/slider.doc.d.ts +18 -0
- package/dist/docs/components/slider.doc.js +41 -0
- package/dist/docs/components/statistic.doc.d.ts +14 -0
- package/dist/docs/components/statistic.doc.js +27 -0
- package/dist/docs/components/textarea.doc.js +4 -2
- package/dist/docs/components/time-picker.doc.d.ts +18 -0
- package/dist/docs/components/time-picker.doc.js +45 -0
- package/dist/docs/components/timeline.doc.d.ts +14 -0
- package/dist/docs/components/timeline.doc.js +29 -0
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/docs/components/tour.doc.d.ts +15 -0
- package/dist/docs/components/tour.doc.js +36 -0
- package/dist/docs/components/transfer.doc.d.ts +18 -0
- package/dist/docs/components/transfer.doc.js +48 -0
- package/dist/docs/components/tree-select.doc.d.ts +18 -0
- package/dist/docs/components/tree-select.doc.js +55 -0
- package/dist/docs/components/tree.doc.d.ts +18 -0
- package/dist/docs/components/tree.doc.js +46 -0
- package/dist/docs/components/upload.doc.d.ts +18 -0
- package/dist/docs/components/upload.doc.js +43 -0
- package/dist/docs/components/watermark.doc.d.ts +14 -0
- package/dist/docs/components/watermark.doc.js +22 -0
- package/dist/entries/affix.d.ts +3 -0
- package/dist/entries/{collapsible.js → affix.js} +1 -1
- package/dist/entries/app.d.ts +3 -0
- package/dist/entries/app.js +4 -0
- package/dist/entries/auto-complete.d.ts +4 -0
- package/dist/entries/auto-complete.js +4 -0
- package/dist/entries/avatar.d.ts +3 -0
- package/dist/entries/avatar.js +4 -0
- package/dist/entries/badge.d.ts +3 -0
- package/dist/entries/badge.js +4 -0
- package/dist/entries/border-beam.d.ts +3 -0
- package/dist/entries/border-beam.js +4 -0
- package/dist/entries/calendar.d.ts +3 -0
- package/dist/entries/calendar.js +4 -0
- package/dist/entries/card.d.ts +3 -0
- package/dist/entries/card.js +4 -0
- package/dist/entries/carousel.d.ts +3 -0
- package/dist/entries/carousel.js +4 -0
- package/dist/entries/cascader.d.ts +4 -0
- package/dist/entries/cascader.js +4 -0
- package/dist/entries/collapse.d.ts +3 -0
- package/dist/entries/collapse.js +4 -0
- package/dist/entries/color-picker.d.ts +5 -0
- package/dist/entries/color-picker.js +4 -0
- package/dist/entries/descriptions.d.ts +3 -0
- package/dist/entries/descriptions.js +4 -0
- package/dist/entries/divider.d.ts +3 -0
- package/dist/entries/divider.js +4 -0
- package/dist/entries/empty.d.ts +3 -0
- package/dist/entries/empty.js +4 -0
- package/dist/entries/float-button.d.ts +3 -0
- package/dist/entries/float-button.js +4 -0
- package/dist/entries/image.d.ts +3 -0
- package/dist/entries/image.js +4 -0
- package/dist/entries/input.d.ts +1 -1
- package/dist/entries/list.d.ts +3 -0
- package/dist/entries/list.js +4 -0
- package/dist/entries/listy.d.ts +3 -0
- package/dist/entries/listy.js +4 -0
- package/dist/entries/masonry.d.ts +3 -0
- package/dist/entries/masonry.js +4 -0
- package/dist/entries/mentions.d.ts +4 -0
- package/dist/entries/mentions.js +4 -0
- package/dist/entries/progress.d.ts +3 -0
- package/dist/entries/progress.js +4 -0
- package/dist/entries/provider.d.ts +1 -1
- package/dist/entries/provider.js +1 -1
- package/dist/entries/qr-code.d.ts +4 -0
- package/dist/entries/qr-code.js +4 -0
- package/dist/entries/rate.d.ts +3 -0
- package/dist/entries/rate.js +4 -0
- package/dist/entries/result.d.ts +3 -0
- package/dist/entries/result.js +4 -0
- package/dist/entries/segmented.d.ts +3 -0
- package/dist/entries/segmented.js +4 -0
- package/dist/entries/skeleton.d.ts +3 -0
- package/dist/entries/skeleton.js +4 -0
- package/dist/entries/slider.d.ts +3 -0
- package/dist/entries/slider.js +4 -0
- package/dist/entries/statistic.d.ts +3 -0
- package/dist/entries/statistic.js +4 -0
- package/dist/entries/textarea.d.ts +1 -1
- package/dist/entries/time-picker.d.ts +3 -0
- package/dist/entries/time-picker.js +4 -0
- package/dist/entries/timeline.d.ts +3 -0
- package/dist/entries/timeline.js +4 -0
- package/dist/entries/tour.d.ts +3 -0
- package/dist/entries/tour.js +4 -0
- package/dist/entries/transfer.d.ts +3 -0
- package/dist/entries/transfer.js +4 -0
- package/dist/entries/tree-select.d.ts +4 -0
- package/dist/entries/tree-select.js +4 -0
- package/dist/entries/tree.d.ts +3 -0
- package/dist/entries/tree.js +4 -0
- package/dist/entries/upload.d.ts +4 -0
- package/dist/entries/upload.js +4 -0
- package/dist/entries/util.d.ts +1 -0
- package/dist/entries/util.js +1 -0
- package/dist/entries/watermark.d.ts +3 -0
- package/dist/entries/watermark.js +4 -0
- package/dist/index.d.ts +51 -6
- package/dist/index.js +39 -3
- package/dist/provider/locale.d.ts +65 -0
- package/dist/provider/locale.js +146 -0
- package/dist/provider/tao-provider.d.ts +16 -1
- package/dist/provider/tao-provider.js +105 -87
- package/dist/theme/control.css +12 -2
- package/dist/theme/theme.css +4 -2
- package/dist/theme/tokens.d.ts +2 -2
- package/dist/theme/tokens.js +1 -0
- package/dist/utils/breakpoint.d.ts +2 -2
- package/dist/utils/breakpoint.js +3 -1
- package/dist/utils/field-label.d.ts +4 -0
- package/dist/utils/field-label.js +7 -0
- package/dist/utils/interop-default.d.ts +2 -0
- package/dist/utils/interop-default.js +4 -0
- package/dist/utils/types.d.ts +7 -0
- package/dist/utils/types.js +0 -0
- package/llms.txt +493 -22
- package/package.json +33 -9
- 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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { type TaoTokenName } from '../theme/tokens.js';
|
|
3
|
+
import { type TaoLocale } from './locale.js';
|
|
4
|
+
export { enUS, zhCN, type TaoLocale } from './locale.js';
|
|
3
5
|
export interface TaoSeedToken {
|
|
4
6
|
colorPrimary?: string;
|
|
5
7
|
colorSuccess?: string;
|
|
@@ -93,6 +95,7 @@ export type TaoSize = 'small' | 'medium' | 'large';
|
|
|
93
95
|
export type TaoVariant = 'outlined' | 'filled' | 'borderless';
|
|
94
96
|
export type TaoStatus = 'error' | 'warning';
|
|
95
97
|
export interface TaoConfig {
|
|
98
|
+
locale: TaoLocale;
|
|
96
99
|
size: TaoSize;
|
|
97
100
|
disabled: boolean;
|
|
98
101
|
variant: TaoVariant;
|
|
@@ -101,7 +104,17 @@ export interface TaoConfig {
|
|
|
101
104
|
/** Resolved 紧凑密度,portal 浮层用它重建 data-tao-density。 */
|
|
102
105
|
compact: boolean;
|
|
103
106
|
}
|
|
107
|
+
interface TaoConfigContextValue extends TaoConfig {
|
|
108
|
+
/**
|
|
109
|
+
* Merged CSS custom-property overrides from this provider and all ancestors.
|
|
110
|
+
* Carried through context so portaled layers (Modal/Drawer/Select dropdown…)
|
|
111
|
+
* — which render outside the provider's DOM subtree — can re-apply the theme.
|
|
112
|
+
*/
|
|
113
|
+
tokenStyle: CSSProperties;
|
|
114
|
+
}
|
|
104
115
|
export declare function useTaoConfig(): TaoConfig;
|
|
116
|
+
/** Internal component access for token propagation through third-party portals. */
|
|
117
|
+
export declare function useTaoInternalConfig(): TaoConfigContextValue;
|
|
105
118
|
/**
|
|
106
119
|
* antd `theme.useToken` counterpart, zero-runtime edition: returns every
|
|
107
120
|
* design token as a `var(--tao-*)` reference string, so custom components can
|
|
@@ -135,10 +148,12 @@ export declare function TaoPortalScope({ children, style, asChild, }: {
|
|
|
135
148
|
asChild?: boolean;
|
|
136
149
|
}): import("react").JSX.Element;
|
|
137
150
|
export interface TaoProviderProps {
|
|
151
|
+
/** Select and calendar text; missing keys inherit from the parent (English at the root). */
|
|
152
|
+
locale?: Partial<TaoLocale>;
|
|
138
153
|
children: ReactNode;
|
|
139
154
|
theme?: TaoThemeConfig;
|
|
140
155
|
size?: TaoSize;
|
|
141
156
|
disabled?: boolean;
|
|
142
157
|
variant?: TaoVariant;
|
|
143
158
|
}
|
|
144
|
-
export declare function TaoProvider({ theme, size, disabled, variant, children, }: TaoProviderProps): import("react").JSX.Element;
|
|
159
|
+
export declare function TaoProvider({ locale: localeProp, theme, size, disabled, variant, children, }: TaoProviderProps): import("react").JSX.Element;
|
|
@@ -3,33 +3,37 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { createContext, useContext, useRef } from "react";
|
|
5
5
|
import { taoTokenVars } from "../theme/tokens.js";
|
|
6
|
+
import { enUS, zhCN } from "./locale.js";
|
|
6
7
|
const TaoConfigContext = /*#__PURE__*/ createContext({
|
|
7
8
|
size: 'medium',
|
|
8
9
|
disabled: false,
|
|
9
10
|
variant: 'outlined',
|
|
10
11
|
mode: 'light',
|
|
11
12
|
compact: false,
|
|
12
|
-
tokenStyle: {}
|
|
13
|
+
tokenStyle: {},
|
|
14
|
+
locale: enUS
|
|
13
15
|
});
|
|
14
16
|
function useTaoConfig() {
|
|
15
|
-
const $ = c(
|
|
16
|
-
const { size, disabled, variant, mode, compact } = useContext(TaoConfigContext);
|
|
17
|
+
const $ = c(7);
|
|
18
|
+
const { size, disabled, variant, mode, compact, locale } = useContext(TaoConfigContext);
|
|
17
19
|
let t0;
|
|
18
|
-
if ($[0] !== compact || $[1] !== disabled || $[2] !==
|
|
20
|
+
if ($[0] !== compact || $[1] !== disabled || $[2] !== locale || $[3] !== mode || $[4] !== size || $[5] !== variant) {
|
|
19
21
|
t0 = {
|
|
20
22
|
size,
|
|
21
23
|
disabled,
|
|
22
24
|
variant,
|
|
23
25
|
mode,
|
|
24
|
-
compact
|
|
26
|
+
compact,
|
|
27
|
+
locale
|
|
25
28
|
};
|
|
26
29
|
$[0] = compact;
|
|
27
30
|
$[1] = disabled;
|
|
28
|
-
$[2] =
|
|
29
|
-
$[3] =
|
|
30
|
-
$[4] =
|
|
31
|
-
$[5] =
|
|
32
|
-
|
|
31
|
+
$[2] = locale;
|
|
32
|
+
$[3] = mode;
|
|
33
|
+
$[4] = size;
|
|
34
|
+
$[5] = variant;
|
|
35
|
+
$[6] = t0;
|
|
36
|
+
} else t0 = $[6];
|
|
33
37
|
return t0;
|
|
34
38
|
}
|
|
35
39
|
function useTaoInternalConfig() {
|
|
@@ -147,6 +151,7 @@ const TOKEN_TO_VAR_NUMBER = {
|
|
|
147
151
|
zIndexPopupBase: '--tao-z-index-popup-base'
|
|
148
152
|
};
|
|
149
153
|
const DEFAULT_TOKEN_STYLE = {
|
|
154
|
+
'--tao-border-text-weight': '12%',
|
|
150
155
|
'--tao-color-primary': 'oklch(0.205 0.01 70)',
|
|
151
156
|
'--tao-color-success': 'oklch(0.555 0.14 155)',
|
|
152
157
|
'--tao-color-warning': 'oklch(0.7 0.15 70)',
|
|
@@ -155,7 +160,7 @@ const DEFAULT_TOKEN_STYLE = {
|
|
|
155
160
|
'--tao-color-text-base': 'oklch(0.155 0.01 70)',
|
|
156
161
|
'--tao-color-bg-surface': 'oklch(1 0 0)',
|
|
157
162
|
'--tao-color-text-light-solid': 'oklch(0.985 0.004 70)',
|
|
158
|
-
'--tao-radius': '
|
|
163
|
+
'--tao-radius': '6px',
|
|
159
164
|
'--tao-font-size': '14px',
|
|
160
165
|
'--tao-control-height': '32px',
|
|
161
166
|
'--tao-size-unit': '4px',
|
|
@@ -183,18 +188,29 @@ const UNITLESS_COMPONENT_TOKEN_KEYS = new Set([
|
|
|
183
188
|
'fontWeight'
|
|
184
189
|
]);
|
|
185
190
|
function TaoProvider(t0) {
|
|
186
|
-
const $ = c(
|
|
187
|
-
const { theme, size, disabled, variant, children } = t0;
|
|
191
|
+
const $ = c(30);
|
|
192
|
+
const { locale: localeProp, theme, size, disabled, variant, children } = t0;
|
|
188
193
|
const parentConfig = useContext(TaoConfigContext);
|
|
194
|
+
let t1;
|
|
195
|
+
if ($[0] !== localeProp || $[1] !== parentConfig.locale) {
|
|
196
|
+
t1 = localeProp ? {
|
|
197
|
+
...parentConfig.locale,
|
|
198
|
+
...localeProp
|
|
199
|
+
} : parentConfig.locale;
|
|
200
|
+
$[0] = localeProp;
|
|
201
|
+
$[1] = parentConfig.locale;
|
|
202
|
+
$[2] = t1;
|
|
203
|
+
} else t1 = $[2];
|
|
204
|
+
const locale = t1;
|
|
189
205
|
const inherit = theme?.inherit ?? true;
|
|
190
206
|
const themeKey = useStableThemeKey(theme?.token, theme?.components);
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
207
|
+
let t2;
|
|
208
|
+
if ($[3] !== themeKey) {
|
|
193
209
|
bb0: {
|
|
194
210
|
const parsedTheme = JSON.parse(themeKey);
|
|
195
211
|
const parsedToken = parsedTheme.token;
|
|
196
212
|
if (!parsedToken && !parsedTheme.components) {
|
|
197
|
-
|
|
213
|
+
t2 = void 0;
|
|
198
214
|
break bb0;
|
|
199
215
|
}
|
|
200
216
|
const vars = {};
|
|
@@ -221,49 +237,49 @@ function TaoProvider(t0) {
|
|
|
221
237
|
vars[varName_2] = "number" != typeof value || UNITLESS_COMPONENT_TOKEN_KEYS.has(key_2) ? String(value) : `${value}px`;
|
|
222
238
|
}
|
|
223
239
|
}
|
|
224
|
-
|
|
240
|
+
t2 = vars;
|
|
225
241
|
}
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
} else
|
|
229
|
-
const ownVars =
|
|
230
|
-
let
|
|
231
|
-
if ($[
|
|
232
|
-
|
|
242
|
+
$[3] = themeKey;
|
|
243
|
+
$[4] = t2;
|
|
244
|
+
} else t2 = $[4];
|
|
245
|
+
const ownVars = t2;
|
|
246
|
+
let t3;
|
|
247
|
+
if ($[5] !== inherit || $[6] !== ownVars) {
|
|
248
|
+
t3 = inherit ? {
|
|
233
249
|
...ownVars
|
|
234
250
|
} : {
|
|
235
251
|
...DEFAULT_TOKEN_STYLE,
|
|
236
252
|
...ownVars
|
|
237
253
|
};
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
} else
|
|
242
|
-
const scopedVars =
|
|
243
|
-
let
|
|
244
|
-
if ($[
|
|
245
|
-
|
|
254
|
+
$[5] = inherit;
|
|
255
|
+
$[6] = ownVars;
|
|
256
|
+
$[7] = t3;
|
|
257
|
+
} else t3 = $[7];
|
|
258
|
+
const scopedVars = t3;
|
|
259
|
+
let t4;
|
|
260
|
+
if ($[8] !== inherit || $[9] !== parentConfig.tokenStyle || $[10] !== scopedVars) {
|
|
261
|
+
t4 = inherit ? {
|
|
246
262
|
...parentConfig.tokenStyle,
|
|
247
263
|
...scopedVars
|
|
248
264
|
} : {
|
|
249
265
|
...scopedVars
|
|
250
266
|
};
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
} else
|
|
256
|
-
const tokenStyle =
|
|
257
|
-
let
|
|
258
|
-
if ($[
|
|
259
|
-
|
|
267
|
+
$[8] = inherit;
|
|
268
|
+
$[9] = parentConfig.tokenStyle;
|
|
269
|
+
$[10] = scopedVars;
|
|
270
|
+
$[11] = t4;
|
|
271
|
+
} else t4 = $[11];
|
|
272
|
+
const tokenStyle = t4;
|
|
273
|
+
let t5;
|
|
274
|
+
if ($[12] !== scopedVars) {
|
|
275
|
+
t5 = {
|
|
260
276
|
display: "contents",
|
|
261
277
|
...scopedVars
|
|
262
278
|
};
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
} else
|
|
266
|
-
const divStyle =
|
|
279
|
+
$[12] = scopedVars;
|
|
280
|
+
$[13] = t5;
|
|
281
|
+
} else t5 = $[13];
|
|
282
|
+
const divStyle = t5;
|
|
267
283
|
const parentSize = parentConfig.size;
|
|
268
284
|
const parentDisabled = parentConfig.disabled;
|
|
269
285
|
const parentVariant = parentConfig.variant;
|
|
@@ -271,55 +287,57 @@ function TaoProvider(t0) {
|
|
|
271
287
|
const parentCompact = parentConfig.compact;
|
|
272
288
|
const mode = theme?.mode ?? (inherit ? parentMode : "light");
|
|
273
289
|
const compact = theme?.compact ?? (inherit ? parentCompact : false);
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
let
|
|
278
|
-
if ($[
|
|
279
|
-
|
|
280
|
-
size:
|
|
281
|
-
disabled:
|
|
282
|
-
variant:
|
|
290
|
+
const t6 = size ?? (inherit ? parentSize : "medium");
|
|
291
|
+
const t7 = disabled ?? (inherit ? parentDisabled : false);
|
|
292
|
+
const t8 = variant ?? (inherit ? parentVariant : "outlined");
|
|
293
|
+
let t9;
|
|
294
|
+
if ($[14] !== compact || $[15] !== locale || $[16] !== mode || $[17] !== t6 || $[18] !== t7 || $[19] !== t8 || $[20] !== tokenStyle) {
|
|
295
|
+
t9 = {
|
|
296
|
+
size: t6,
|
|
297
|
+
disabled: t7,
|
|
298
|
+
variant: t8,
|
|
283
299
|
mode,
|
|
284
300
|
compact,
|
|
285
|
-
tokenStyle
|
|
301
|
+
tokenStyle,
|
|
302
|
+
locale
|
|
286
303
|
};
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
const t10 =
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
304
|
+
$[14] = compact;
|
|
305
|
+
$[15] = locale;
|
|
306
|
+
$[16] = mode;
|
|
307
|
+
$[17] = t6;
|
|
308
|
+
$[18] = t7;
|
|
309
|
+
$[19] = t8;
|
|
310
|
+
$[20] = tokenStyle;
|
|
311
|
+
$[21] = t9;
|
|
312
|
+
} else t9 = $[21];
|
|
313
|
+
const config = t9;
|
|
314
|
+
const t10 = "light" === mode ? void 0 : mode;
|
|
315
|
+
const t11 = compact ? "compact" : void 0;
|
|
316
|
+
let t12;
|
|
317
|
+
if ($[22] !== children || $[23] !== divStyle || $[24] !== t10 || $[25] !== t11) {
|
|
318
|
+
t12 = /*#__PURE__*/ jsx("div", {
|
|
301
319
|
style: divStyle,
|
|
302
320
|
"data-tao-provider": "",
|
|
303
|
-
"data-tao-theme":
|
|
304
|
-
"data-tao-density":
|
|
321
|
+
"data-tao-theme": t10,
|
|
322
|
+
"data-tao-density": t11,
|
|
305
323
|
children: children
|
|
306
324
|
});
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
} else
|
|
313
|
-
let
|
|
314
|
-
if ($[
|
|
315
|
-
|
|
325
|
+
$[22] = children;
|
|
326
|
+
$[23] = divStyle;
|
|
327
|
+
$[24] = t10;
|
|
328
|
+
$[25] = t11;
|
|
329
|
+
$[26] = t12;
|
|
330
|
+
} else t12 = $[26];
|
|
331
|
+
let t13;
|
|
332
|
+
if ($[27] !== config || $[28] !== t12) {
|
|
333
|
+
t13 = /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
|
|
316
334
|
value: config,
|
|
317
|
-
children:
|
|
335
|
+
children: t12
|
|
318
336
|
});
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
} else
|
|
323
|
-
return
|
|
337
|
+
$[27] = config;
|
|
338
|
+
$[28] = t12;
|
|
339
|
+
$[29] = t13;
|
|
340
|
+
} else t13 = $[29];
|
|
341
|
+
return t13;
|
|
324
342
|
}
|
|
325
|
-
export { TaoPortalScope, TaoProvider, useTaoConfig, useTaoToken };
|
|
343
|
+
export { TaoPortalScope, TaoProvider, enUS, useTaoConfig, useTaoInternalConfig, useTaoToken, zhCN };
|
package/dist/theme/control.css
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
background: none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
[data-tao-control][data-tao-variant="outlined"]:hover:not([data-disabled]):not(:focus-within):not([data-state="open"]) {
|
|
20
|
+
[data-tao-control][data-tao-variant="outlined"]:hover:not([data-disabled]):not(:has(input:disabled)):not(:focus-within):not([data-state="open"]) {
|
|
21
21
|
border-color: var(--tao-input-hover-border-color, color-mix(in oklch,
|
|
22
|
-
var(--tao-color-text-base)
|
|
22
|
+
var(--tao-color-text-base) calc(var(--tao-border-text-weight) + 8%),
|
|
23
23
|
var(--tao-color-bg-base)));
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -139,3 +139,13 @@
|
|
|
139
139
|
cursor: not-allowed;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
@media (pointer: coarse) {
|
|
143
|
+
[data-tao-control] {
|
|
144
|
+
min-height: 44px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-tao-control] input, input[data-tao-control], textarea[data-tao-control] {
|
|
148
|
+
font-size: max(16px, 1em);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
package/dist/theme/theme.css
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
--tao-color-error: oklch(57% .19 25);
|
|
7
7
|
--tao-color-bg-base: oklch(98.5% .004 70);
|
|
8
8
|
--tao-color-text-base: oklch(15.5% .01 70);
|
|
9
|
+
--tao-border-text-weight: 12%;
|
|
9
10
|
--tao-color-bg-surface: oklch(100% 0 0);
|
|
10
11
|
--tao-color-text-light-solid: oklch(98.5% .004 70);
|
|
11
|
-
--tao-radius:
|
|
12
|
+
--tao-radius: 6px;
|
|
12
13
|
--tao-font-size: 14px;
|
|
13
14
|
--tao-control-height: 32px;
|
|
14
15
|
--tao-control-width: 200px;
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
var(--tao-color-bg-surface) 94%,
|
|
100
101
|
white);
|
|
101
102
|
--tao-color-border: color-mix(in oklch,
|
|
102
|
-
var(--tao-color-text-base)
|
|
103
|
+
var(--tao-color-text-base) var(--tao-border-text-weight),
|
|
103
104
|
var(--tao-color-bg-base));
|
|
104
105
|
--tao-color-border-secondary: color-mix(in oklch,
|
|
105
106
|
var(--tao-color-text-base) 5%,
|
|
@@ -217,6 +218,7 @@
|
|
|
217
218
|
--tao-color-bg-base: oklch(16.5% .005 70);
|
|
218
219
|
--tao-color-text-base: oklch(92.2% .005 70);
|
|
219
220
|
--tao-color-bg-surface: oklch(21% .005 70);
|
|
221
|
+
--tao-border-text-weight: 36%;
|
|
220
222
|
--tao-color-primary: oklch(92.2% .005 70);
|
|
221
223
|
--tao-primary-hover: color-mix(in oklab,
|
|
222
224
|
var(--tao-color-primary) 85%,
|
package/dist/theme/tokens.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TaoTokenName = '--tao-box-shadow' | '--tao-box-shadow-secondary' | '--tao-box-shadow-tertiary' | '--tao-box-shadow-xs' | '--tao-color-bg-base' | '--tao-color-bg-container' | '--tao-color-bg-container-disabled' | '--tao-color-bg-disabled' | '--tao-color-bg-elevated' | '--tao-color-bg-layout' | '--tao-color-bg-mask' | '--tao-color-bg-surface' | '--tao-color-bg-text-active' | '--tao-color-bg-text-hover' | '--tao-color-border' | '--tao-color-border-secondary' | '--tao-color-error' | '--tao-color-error-outline' | '--tao-color-fill' | '--tao-color-fill-quaternary' | '--tao-color-fill-secondary' | '--tao-color-fill-tertiary' | '--tao-color-primary' | '--tao-color-shadow-hint' | '--tao-color-split' | '--tao-color-success' | '--tao-color-text' | '--tao-color-text-base' | '--tao-color-text-description' | '--tao-color-text-disabled' | '--tao-color-text-heading' | '--tao-color-text-label' | '--tao-color-text-light-solid' | '--tao-color-text-placeholder' | '--tao-color-text-quaternary' | '--tao-color-text-secondary' | '--tao-color-text-tertiary' | '--tao-color-warning' | '--tao-color-warning-outline' | '--tao-control-height' | '--tao-control-height-lg' | '--tao-control-height-sm' | '--tao-control-item-bg-active' | '--tao-control-item-bg-active-hover' | '--tao-control-item-bg-hover' | '--tao-control-outline' | '--tao-control-padding-horizontal' | '--tao-control-padding-horizontal-sm' | '--tao-control-range-width' | '--tao-control-width' | '--tao-drop-shadow-popover' | '--tao-error' | '--tao-error-active' | '--tao-error-bg' | '--tao-error-border' | '--tao-error-fg' | '--tao-error-hover' | '--tao-font-family' | '--tao-font-family-code' | '--tao-font-size' | '--tao-font-size-base' | '--tao-font-size-lg' | '--tao-font-size-sm' | '--tao-font-size-xl' | '--tao-font-size-xs' | '--tao-font-weight-medium' | '--tao-font-weight-normal' | '--tao-font-weight-strong' | '--tao-line-height' | '--tao-line-height-lg' | '--tao-line-height-sm' | '--tao-line-width' | '--tao-line-width-bold' | '--tao-margin' | '--tao-margin-lg' | '--tao-margin-md' | '--tao-margin-sm' | '--tao-margin-xl' | '--tao-margin-xs' | '--tao-margin-xxl' | '--tao-margin-xxs' | '--tao-motion-duration-fast' | '--tao-motion-duration-mid' | '--tao-motion-duration-slow' | '--tao-motion-ease-in-out' | '--tao-motion-ease-out' | '--tao-motion-ease-out-expo' | '--tao-motion-ease-out-quint' | '--tao-motion-unit' | '--tao-opacity-loading' | '--tao-padding' | '--tao-padding-lg' | '--tao-padding-md' | '--tao-padding-sm' | '--tao-padding-xl' | '--tao-padding-xs' | '--tao-padding-xxs' | '--tao-primary' | '--tao-primary-active' | '--tao-primary-bg' | '--tao-primary-bg-hover' | '--tao-primary-border' | '--tao-primary-fg' | '--tao-primary-hover' | '--tao-radius' | '--tao-radius-2xl' | '--tao-radius-full' | '--tao-radius-lg' | '--tao-radius-md' | '--tao-radius-sm' | '--tao-radius-xl' | '--tao-radius-xs' | '--tao-ring-width' | '--tao-size' | '--tao-size-lg' | '--tao-size-md' | '--tao-size-ms' | '--tao-size-sm' | '--tao-size-step' | '--tao-size-unit' | '--tao-size-xl' | '--tao-size-xs' | '--tao-size-xxl' | '--tao-size-xxs' | '--tao-success' | '--tao-success-bg' | '--tao-success-border' | '--tao-warning' | '--tao-warning-bg' | '--tao-warning-border' | '--tao-z-index-base' | '--tao-z-index-drawer' | '--tao-z-index-modal' | '--tao-z-index-popup' | '--tao-z-index-popup-base';
|
|
1
|
+
export type TaoTokenName = '--tao-border-text-weight' | '--tao-box-shadow' | '--tao-box-shadow-secondary' | '--tao-box-shadow-tertiary' | '--tao-box-shadow-xs' | '--tao-color-bg-base' | '--tao-color-bg-container' | '--tao-color-bg-container-disabled' | '--tao-color-bg-disabled' | '--tao-color-bg-elevated' | '--tao-color-bg-layout' | '--tao-color-bg-mask' | '--tao-color-bg-surface' | '--tao-color-bg-text-active' | '--tao-color-bg-text-hover' | '--tao-color-border' | '--tao-color-border-secondary' | '--tao-color-error' | '--tao-color-error-outline' | '--tao-color-fill' | '--tao-color-fill-quaternary' | '--tao-color-fill-secondary' | '--tao-color-fill-tertiary' | '--tao-color-primary' | '--tao-color-shadow-hint' | '--tao-color-split' | '--tao-color-success' | '--tao-color-text' | '--tao-color-text-base' | '--tao-color-text-description' | '--tao-color-text-disabled' | '--tao-color-text-heading' | '--tao-color-text-label' | '--tao-color-text-light-solid' | '--tao-color-text-placeholder' | '--tao-color-text-quaternary' | '--tao-color-text-secondary' | '--tao-color-text-tertiary' | '--tao-color-warning' | '--tao-color-warning-outline' | '--tao-control-height' | '--tao-control-height-lg' | '--tao-control-height-sm' | '--tao-control-item-bg-active' | '--tao-control-item-bg-active-hover' | '--tao-control-item-bg-hover' | '--tao-control-outline' | '--tao-control-padding-horizontal' | '--tao-control-padding-horizontal-sm' | '--tao-control-range-width' | '--tao-control-width' | '--tao-drop-shadow-popover' | '--tao-error' | '--tao-error-active' | '--tao-error-bg' | '--tao-error-border' | '--tao-error-fg' | '--tao-error-hover' | '--tao-font-family' | '--tao-font-family-code' | '--tao-font-size' | '--tao-font-size-base' | '--tao-font-size-lg' | '--tao-font-size-sm' | '--tao-font-size-xl' | '--tao-font-size-xs' | '--tao-font-weight-medium' | '--tao-font-weight-normal' | '--tao-font-weight-strong' | '--tao-line-height' | '--tao-line-height-lg' | '--tao-line-height-sm' | '--tao-line-width' | '--tao-line-width-bold' | '--tao-margin' | '--tao-margin-lg' | '--tao-margin-md' | '--tao-margin-sm' | '--tao-margin-xl' | '--tao-margin-xs' | '--tao-margin-xxl' | '--tao-margin-xxs' | '--tao-motion-duration-fast' | '--tao-motion-duration-mid' | '--tao-motion-duration-slow' | '--tao-motion-ease-in-out' | '--tao-motion-ease-out' | '--tao-motion-ease-out-expo' | '--tao-motion-ease-out-quint' | '--tao-motion-unit' | '--tao-opacity-loading' | '--tao-padding' | '--tao-padding-lg' | '--tao-padding-md' | '--tao-padding-sm' | '--tao-padding-xl' | '--tao-padding-xs' | '--tao-padding-xxs' | '--tao-primary' | '--tao-primary-active' | '--tao-primary-bg' | '--tao-primary-bg-hover' | '--tao-primary-border' | '--tao-primary-fg' | '--tao-primary-hover' | '--tao-radius' | '--tao-radius-2xl' | '--tao-radius-full' | '--tao-radius-lg' | '--tao-radius-md' | '--tao-radius-sm' | '--tao-radius-xl' | '--tao-radius-xs' | '--tao-ring-width' | '--tao-size' | '--tao-size-lg' | '--tao-size-md' | '--tao-size-ms' | '--tao-size-sm' | '--tao-size-step' | '--tao-size-unit' | '--tao-size-xl' | '--tao-size-xs' | '--tao-size-xxl' | '--tao-size-xxs' | '--tao-success' | '--tao-success-bg' | '--tao-success-border' | '--tao-warning' | '--tao-warning-bg' | '--tao-warning-border' | '--tao-z-index-base' | '--tao-z-index-drawer' | '--tao-z-index-modal' | '--tao-z-index-popup' | '--tao-z-index-popup-base';
|
|
2
2
|
export declare function tokenVar(name: TaoTokenName | (string & {})): string;
|
|
3
|
-
export declare const taoTokenNames: readonly ["--tao-box-shadow", "--tao-box-shadow-secondary", "--tao-box-shadow-tertiary", "--tao-box-shadow-xs", "--tao-color-bg-base", "--tao-color-bg-container", "--tao-color-bg-container-disabled", "--tao-color-bg-disabled", "--tao-color-bg-elevated", "--tao-color-bg-layout", "--tao-color-bg-mask", "--tao-color-bg-surface", "--tao-color-bg-text-active", "--tao-color-bg-text-hover", "--tao-color-border", "--tao-color-border-secondary", "--tao-color-error", "--tao-color-error-outline", "--tao-color-fill", "--tao-color-fill-quaternary", "--tao-color-fill-secondary", "--tao-color-fill-tertiary", "--tao-color-primary", "--tao-color-shadow-hint", "--tao-color-split", "--tao-color-success", "--tao-color-text", "--tao-color-text-base", "--tao-color-text-description", "--tao-color-text-disabled", "--tao-color-text-heading", "--tao-color-text-label", "--tao-color-text-light-solid", "--tao-color-text-placeholder", "--tao-color-text-quaternary", "--tao-color-text-secondary", "--tao-color-text-tertiary", "--tao-color-warning", "--tao-color-warning-outline", "--tao-control-height", "--tao-control-height-lg", "--tao-control-height-sm", "--tao-control-item-bg-active", "--tao-control-item-bg-active-hover", "--tao-control-item-bg-hover", "--tao-control-outline", "--tao-control-padding-horizontal", "--tao-control-padding-horizontal-sm", "--tao-control-range-width", "--tao-control-width", "--tao-drop-shadow-popover", "--tao-error", "--tao-error-active", "--tao-error-bg", "--tao-error-border", "--tao-error-fg", "--tao-error-hover", "--tao-font-family", "--tao-font-family-code", "--tao-font-size", "--tao-font-size-base", "--tao-font-size-lg", "--tao-font-size-sm", "--tao-font-size-xl", "--tao-font-size-xs", "--tao-font-weight-medium", "--tao-font-weight-normal", "--tao-font-weight-strong", "--tao-line-height", "--tao-line-height-lg", "--tao-line-height-sm", "--tao-line-width", "--tao-line-width-bold", "--tao-margin", "--tao-margin-lg", "--tao-margin-md", "--tao-margin-sm", "--tao-margin-xl", "--tao-margin-xs", "--tao-margin-xxl", "--tao-margin-xxs", "--tao-motion-duration-fast", "--tao-motion-duration-mid", "--tao-motion-duration-slow", "--tao-motion-ease-in-out", "--tao-motion-ease-out", "--tao-motion-ease-out-expo", "--tao-motion-ease-out-quint", "--tao-motion-unit", "--tao-opacity-loading", "--tao-padding", "--tao-padding-lg", "--tao-padding-md", "--tao-padding-sm", "--tao-padding-xl", "--tao-padding-xs", "--tao-padding-xxs", "--tao-primary", "--tao-primary-active", "--tao-primary-bg", "--tao-primary-bg-hover", "--tao-primary-border", "--tao-primary-fg", "--tao-primary-hover", "--tao-radius", "--tao-radius-2xl", "--tao-radius-full", "--tao-radius-lg", "--tao-radius-md", "--tao-radius-sm", "--tao-radius-xl", "--tao-radius-xs", "--tao-ring-width", "--tao-size", "--tao-size-lg", "--tao-size-md", "--tao-size-ms", "--tao-size-sm", "--tao-size-step", "--tao-size-unit", "--tao-size-xl", "--tao-size-xs", "--tao-size-xxl", "--tao-size-xxs", "--tao-success", "--tao-success-bg", "--tao-success-border", "--tao-warning", "--tao-warning-bg", "--tao-warning-border", "--tao-z-index-base", "--tao-z-index-drawer", "--tao-z-index-modal", "--tao-z-index-popup", "--tao-z-index-popup-base"];
|
|
3
|
+
export declare const taoTokenNames: readonly ["--tao-border-text-weight", "--tao-box-shadow", "--tao-box-shadow-secondary", "--tao-box-shadow-tertiary", "--tao-box-shadow-xs", "--tao-color-bg-base", "--tao-color-bg-container", "--tao-color-bg-container-disabled", "--tao-color-bg-disabled", "--tao-color-bg-elevated", "--tao-color-bg-layout", "--tao-color-bg-mask", "--tao-color-bg-surface", "--tao-color-bg-text-active", "--tao-color-bg-text-hover", "--tao-color-border", "--tao-color-border-secondary", "--tao-color-error", "--tao-color-error-outline", "--tao-color-fill", "--tao-color-fill-quaternary", "--tao-color-fill-secondary", "--tao-color-fill-tertiary", "--tao-color-primary", "--tao-color-shadow-hint", "--tao-color-split", "--tao-color-success", "--tao-color-text", "--tao-color-text-base", "--tao-color-text-description", "--tao-color-text-disabled", "--tao-color-text-heading", "--tao-color-text-label", "--tao-color-text-light-solid", "--tao-color-text-placeholder", "--tao-color-text-quaternary", "--tao-color-text-secondary", "--tao-color-text-tertiary", "--tao-color-warning", "--tao-color-warning-outline", "--tao-control-height", "--tao-control-height-lg", "--tao-control-height-sm", "--tao-control-item-bg-active", "--tao-control-item-bg-active-hover", "--tao-control-item-bg-hover", "--tao-control-outline", "--tao-control-padding-horizontal", "--tao-control-padding-horizontal-sm", "--tao-control-range-width", "--tao-control-width", "--tao-drop-shadow-popover", "--tao-error", "--tao-error-active", "--tao-error-bg", "--tao-error-border", "--tao-error-fg", "--tao-error-hover", "--tao-font-family", "--tao-font-family-code", "--tao-font-size", "--tao-font-size-base", "--tao-font-size-lg", "--tao-font-size-sm", "--tao-font-size-xl", "--tao-font-size-xs", "--tao-font-weight-medium", "--tao-font-weight-normal", "--tao-font-weight-strong", "--tao-line-height", "--tao-line-height-lg", "--tao-line-height-sm", "--tao-line-width", "--tao-line-width-bold", "--tao-margin", "--tao-margin-lg", "--tao-margin-md", "--tao-margin-sm", "--tao-margin-xl", "--tao-margin-xs", "--tao-margin-xxl", "--tao-margin-xxs", "--tao-motion-duration-fast", "--tao-motion-duration-mid", "--tao-motion-duration-slow", "--tao-motion-ease-in-out", "--tao-motion-ease-out", "--tao-motion-ease-out-expo", "--tao-motion-ease-out-quint", "--tao-motion-unit", "--tao-opacity-loading", "--tao-padding", "--tao-padding-lg", "--tao-padding-md", "--tao-padding-sm", "--tao-padding-xl", "--tao-padding-xs", "--tao-padding-xxs", "--tao-primary", "--tao-primary-active", "--tao-primary-bg", "--tao-primary-bg-hover", "--tao-primary-border", "--tao-primary-fg", "--tao-primary-hover", "--tao-radius", "--tao-radius-2xl", "--tao-radius-full", "--tao-radius-lg", "--tao-radius-md", "--tao-radius-sm", "--tao-radius-xl", "--tao-radius-xs", "--tao-ring-width", "--tao-size", "--tao-size-lg", "--tao-size-md", "--tao-size-ms", "--tao-size-sm", "--tao-size-step", "--tao-size-unit", "--tao-size-xl", "--tao-size-xs", "--tao-size-xxl", "--tao-size-xxs", "--tao-success", "--tao-success-bg", "--tao-success-border", "--tao-warning", "--tao-warning-bg", "--tao-warning-border", "--tao-z-index-base", "--tao-z-index-drawer", "--tao-z-index-modal", "--tao-z-index-popup", "--tao-z-index-popup-base"];
|
|
4
4
|
export declare const taoTokenVars: Record<TaoTokenName, string>;
|
package/dist/theme/tokens.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Responsive breakpoints — values aligned with antd v6
|
|
3
|
-
* (`xs <576 / sm ≥576 / md ≥768 / lg ≥992 / xl ≥1200 / xxl ≥1600`).
|
|
3
|
+
* (`xs <576 / sm ≥576 / md ≥768 / lg ≥992 / xl ≥1200 / xxl ≥1600 / xxxl ≥1920`).
|
|
4
4
|
*
|
|
5
5
|
* CSS custom properties cannot be referenced from @media queries, so
|
|
6
6
|
* breakpoints live as JS constants only; component CSS keeps its own
|
|
7
7
|
* hardcoded media queries where needed.
|
|
8
8
|
*/
|
|
9
|
-
export type TaoBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
9
|
+
export type TaoBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
|
|
10
10
|
export type TaoBreakpointMap<T = boolean> = Partial<Record<TaoBreakpoint, T>>;
|
|
11
11
|
/**
|
|
12
12
|
* A prop value that can vary per breakpoint: either a plain `T` or a
|
package/dist/utils/breakpoint.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
2
|
const BREAKPOINTS_DESC = [
|
|
3
|
+
'xxxl',
|
|
3
4
|
'xxl',
|
|
4
5
|
'xl',
|
|
5
6
|
'lg',
|
|
@@ -13,7 +14,8 @@ const BREAKPOINT_QUERIES = {
|
|
|
13
14
|
md: '(min-width: 768px)',
|
|
14
15
|
lg: '(min-width: 992px)',
|
|
15
16
|
xl: '(min-width: 1200px)',
|
|
16
|
-
xxl: '(min-width: 1600px)'
|
|
17
|
+
xxl: '(min-width: 1600px)',
|
|
18
|
+
xxxl: '(min-width: 1920px)'
|
|
17
19
|
};
|
|
18
20
|
const EMPTY_SCREENS = {};
|
|
19
21
|
let mqls = null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** The field's label content, without its required mark or help text. */
|
|
3
|
+
export declare const FieldLabelContext: import("react").Context<ReactNode>;
|
|
4
|
+
export declare function useMobileTitle(title: ReactNode, fallback: ReactNode): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const FieldLabelContext = createContext(void 0);
|
|
3
|
+
function useMobileTitle(title, fallback) {
|
|
4
|
+
const label = useContext(FieldLabelContext);
|
|
5
|
+
return title ?? label ?? fallback;
|
|
6
|
+
}
|
|
7
|
+
export { FieldLabelContext, useMobileTitle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Component, Context, JSXElementConstructor, Ref } from 'react';
|
|
2
|
+
/** Infer component props, a context value, or retain a props object. */
|
|
3
|
+
export type GetProps<T extends object> = T extends Context<infer Value> ? Value : T extends JSXElementConstructor<infer Props> ? Props : T;
|
|
4
|
+
/** Read a non-nullable prop, or the return value of a function prop. */
|
|
5
|
+
export type GetProp<T extends object, PropName extends keyof GetProps<T>, Type extends 'Default' | 'Return' = 'Default'> = Type extends 'Return' ? ReturnType<Extract<NonNullable<GetProps<T>[PropName]>, (...args: never[]) => unknown>> : NonNullable<GetProps<T>[PropName]>;
|
|
6
|
+
/** Infer the public instance accepted by a component's ref. */
|
|
7
|
+
export type GetRef<T extends object> = T extends Component ? T : 'ref' extends keyof GetProps<T> ? NonNullable<GetProps<T>['ref']> extends Ref<infer Instance> | string ? Instance : never : never;
|
|
File without changes
|