@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
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import color_picker, { Color } from "@rc-component/color-picker";
|
|
4
|
+
import { createContext, isValidElement, useContext, useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
6
|
+
import { cx } from "../../utils/semantic.js";
|
|
7
|
+
import { Button } from "../button/button.js";
|
|
8
|
+
import { Collapse } from "../collapse/collapse.js";
|
|
9
|
+
import { BaseInput } from "../input/base-input.js";
|
|
10
|
+
import { Segmented } from "../segmented/segmented.js";
|
|
11
|
+
import { Select } from "../select/select.js";
|
|
12
|
+
import { Slider } from "../slider/slider.js";
|
|
13
|
+
import { Color as external_color_js_Color } from "./color.js";
|
|
14
|
+
import "./color-picker.css";
|
|
15
|
+
import { interopDefault } from "../../utils/interop-default.js";
|
|
16
|
+
import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
|
|
17
|
+
const RcColorPickerComponent = /*#__PURE__*/ interopDefault(color_picker);
|
|
18
|
+
const PanelContext = /*#__PURE__*/ createContext(null);
|
|
19
|
+
const clamp = (value, max)=>Math.max(0, Math.min(max, value));
|
|
20
|
+
function colorKeys() {
|
|
21
|
+
const counts = new Map();
|
|
22
|
+
return (value)=>{
|
|
23
|
+
const occurrence = counts.get(value) ?? 0;
|
|
24
|
+
counts.set(value, occurrence + 1);
|
|
25
|
+
return `${value}:${occurrence}`;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function PickerPanel() {
|
|
29
|
+
const $ = c(28);
|
|
30
|
+
const fieldId = useId();
|
|
31
|
+
const keyForColor = colorKeys();
|
|
32
|
+
const panel = useContext(PanelContext);
|
|
33
|
+
const { value, active, props, mode, modes, setMode, format, setFormat, chinese } = panel;
|
|
34
|
+
const stops = value.getColors();
|
|
35
|
+
const activeIndex = Math.min(active, stops.length - 1);
|
|
36
|
+
const selected = "gradient" === mode ? stops[activeIndex].color : value;
|
|
37
|
+
const hex = selected.toHexString();
|
|
38
|
+
const [draft, setDraft] = useState(hex);
|
|
39
|
+
let t0;
|
|
40
|
+
if ($[0] !== hex) {
|
|
41
|
+
t0 = [
|
|
42
|
+
hex
|
|
43
|
+
];
|
|
44
|
+
$[0] = hex;
|
|
45
|
+
$[1] = t0;
|
|
46
|
+
} else t0 = $[1];
|
|
47
|
+
useEffect(()=>setDraft(hex), t0);
|
|
48
|
+
const replace = (next)=>"gradient" === mode ? new external_color_js_Color(stops.map((stop, index)=>({
|
|
49
|
+
...stop,
|
|
50
|
+
color: index === activeIndex ? next : stop.color
|
|
51
|
+
}))) : next;
|
|
52
|
+
const changeSelected = (next_0, t1)=>{
|
|
53
|
+
const complete = void 0 === t1 ? true : t1;
|
|
54
|
+
return panel.change(replace(next_0), complete);
|
|
55
|
+
};
|
|
56
|
+
let t2;
|
|
57
|
+
if ($[2] !== fieldId) {
|
|
58
|
+
t2 = (label, number, max, change, t3)=>{
|
|
59
|
+
const step = void 0 === t3 ? 1 : t3;
|
|
60
|
+
return /*#__PURE__*/ jsxs("label", {
|
|
61
|
+
"data-tao-color-field": "",
|
|
62
|
+
htmlFor: `${fieldId}-${label}`,
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx("span", {
|
|
65
|
+
children: label
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ jsx(BaseInput, {
|
|
68
|
+
id: `${fieldId}-${label}`,
|
|
69
|
+
size: "small",
|
|
70
|
+
disabled: false,
|
|
71
|
+
type: "number",
|
|
72
|
+
"aria-label": label,
|
|
73
|
+
min: 0,
|
|
74
|
+
max: max,
|
|
75
|
+
step: step,
|
|
76
|
+
value: number,
|
|
77
|
+
onChange: (event)=>{
|
|
78
|
+
if ("" !== event.target.value) change(clamp(Number(event.target.value), max));
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
$[2] = fieldId;
|
|
85
|
+
$[3] = t2;
|
|
86
|
+
} else t2 = $[3];
|
|
87
|
+
const numberInput = t2;
|
|
88
|
+
const rgb = selected.toRgb();
|
|
89
|
+
const hsb = selected.toHsb();
|
|
90
|
+
const prefix = props.prefixCls ?? "tao-color-engine";
|
|
91
|
+
let t3;
|
|
92
|
+
if ($[4] !== chinese || $[5] !== mode || $[6] !== modes.length || $[7] !== setMode) {
|
|
93
|
+
t3 = modes.length > 1 && /*#__PURE__*/ jsx(Segmented, {
|
|
94
|
+
"aria-label": chinese ? "\u989C\u8272\u6A21\u5F0F" : "Color mode",
|
|
95
|
+
size: "small",
|
|
96
|
+
disabled: false,
|
|
97
|
+
value: mode,
|
|
98
|
+
onChange: setMode,
|
|
99
|
+
options: [
|
|
100
|
+
{
|
|
101
|
+
value: "single",
|
|
102
|
+
label: chinese ? "\u5355\u8272" : "Single"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
value: "gradient",
|
|
106
|
+
label: chinese ? "\u6E10\u53D8" : "Gradient"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
$[4] = chinese;
|
|
111
|
+
$[5] = mode;
|
|
112
|
+
$[6] = modes.length;
|
|
113
|
+
$[7] = setMode;
|
|
114
|
+
$[8] = t3;
|
|
115
|
+
} else t3 = $[8];
|
|
116
|
+
const t4 = "";
|
|
117
|
+
const t5 = chinese ? "\u989C\u8272\u683C\u5F0F" : "Color format";
|
|
118
|
+
const t6 = chinese ? "\u989C\u8272\u683C\u5F0F" : "Color format";
|
|
119
|
+
let t7;
|
|
120
|
+
let t8;
|
|
121
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
122
|
+
t7 = {
|
|
123
|
+
width: "5.5em",
|
|
124
|
+
flexShrink: 0
|
|
125
|
+
};
|
|
126
|
+
t8 = {
|
|
127
|
+
popup: {
|
|
128
|
+
zIndex: "calc(var(--tao-z-index-popup-base) + 60)"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
$[9] = t7;
|
|
132
|
+
$[10] = t8;
|
|
133
|
+
} else {
|
|
134
|
+
t7 = $[9];
|
|
135
|
+
t8 = $[10];
|
|
136
|
+
}
|
|
137
|
+
const t9 = props.disabledFormat ?? false;
|
|
138
|
+
let t10;
|
|
139
|
+
if ($[11] !== setFormat) {
|
|
140
|
+
t10 = (next_5)=>setFormat(next_5);
|
|
141
|
+
$[11] = setFormat;
|
|
142
|
+
$[12] = t10;
|
|
143
|
+
} else t10 = $[12];
|
|
144
|
+
let t11;
|
|
145
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
146
|
+
t11 = [
|
|
147
|
+
"hex",
|
|
148
|
+
"rgb",
|
|
149
|
+
"hsb"
|
|
150
|
+
].map(_temp3);
|
|
151
|
+
$[13] = t11;
|
|
152
|
+
} else t11 = $[13];
|
|
153
|
+
let t12;
|
|
154
|
+
if ($[14] !== format || $[15] !== t10 || $[16] !== t5 || $[17] !== t6 || $[18] !== t9) {
|
|
155
|
+
t12 = /*#__PURE__*/ jsx(Select, {
|
|
156
|
+
"aria-label": t5,
|
|
157
|
+
mobileTitle: t6,
|
|
158
|
+
size: "small",
|
|
159
|
+
style: t7,
|
|
160
|
+
styles: t8,
|
|
161
|
+
value: format,
|
|
162
|
+
disabled: t9,
|
|
163
|
+
onChange: t10,
|
|
164
|
+
options: t11
|
|
165
|
+
});
|
|
166
|
+
$[14] = format;
|
|
167
|
+
$[15] = t10;
|
|
168
|
+
$[16] = t5;
|
|
169
|
+
$[17] = t6;
|
|
170
|
+
$[18] = t9;
|
|
171
|
+
$[19] = t12;
|
|
172
|
+
} else t12 = $[19];
|
|
173
|
+
const t13 = "hex" === format ? /*#__PURE__*/ jsx(BaseInput, {
|
|
174
|
+
size: "small",
|
|
175
|
+
disabled: false,
|
|
176
|
+
"aria-label": chinese ? "\u5341\u516D\u8FDB\u5236\u989C\u8272" : "Hex color",
|
|
177
|
+
value: draft,
|
|
178
|
+
"aria-invalid": !/^#?(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(draft),
|
|
179
|
+
onChange: (event_0)=>{
|
|
180
|
+
setDraft(event_0.target.value);
|
|
181
|
+
if (/^#?(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(event_0.target.value)) changeSelected(new external_color_js_Color(`#${event_0.target.value.replace(/^#/, "")}`));
|
|
182
|
+
}
|
|
183
|
+
}) : "rgb" === format ? /*#__PURE__*/ jsxs(Fragment, {
|
|
184
|
+
children: [
|
|
185
|
+
numberInput("Red", rgb.r, 255, (r)=>changeSelected(new external_color_js_Color({
|
|
186
|
+
...rgb,
|
|
187
|
+
r
|
|
188
|
+
}))),
|
|
189
|
+
numberInput("Green", rgb.g, 255, (g)=>changeSelected(new external_color_js_Color({
|
|
190
|
+
...rgb,
|
|
191
|
+
g
|
|
192
|
+
}))),
|
|
193
|
+
numberInput("Blue", rgb.b, 255, (b_1)=>changeSelected(new external_color_js_Color({
|
|
194
|
+
...rgb,
|
|
195
|
+
b: b_1
|
|
196
|
+
})))
|
|
197
|
+
]
|
|
198
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
199
|
+
children: [
|
|
200
|
+
numberInput("Hue", Math.round(hsb.h), 360, (h)=>changeSelected(new external_color_js_Color({
|
|
201
|
+
...hsb,
|
|
202
|
+
h
|
|
203
|
+
}))),
|
|
204
|
+
numberInput("Saturation", Math.round(100 * hsb.s), 100, (s)=>changeSelected(new external_color_js_Color({
|
|
205
|
+
...hsb,
|
|
206
|
+
s: s / 100
|
|
207
|
+
}))),
|
|
208
|
+
numberInput("Brightness", Math.round(100 * hsb.b), 100, (b_2)=>changeSelected(new external_color_js_Color({
|
|
209
|
+
...hsb,
|
|
210
|
+
b: b_2 / 100
|
|
211
|
+
})))
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
const t14 = !props.disabledAlpha && numberInput("Alpha", Math.round(100 * rgb.a), 100, (alpha)=>changeSelected(new external_color_js_Color({
|
|
215
|
+
...rgb,
|
|
216
|
+
a: alpha / 100
|
|
217
|
+
})));
|
|
218
|
+
let t15;
|
|
219
|
+
if ($[20] !== t12 || $[21] !== t13 || $[22] !== t14) {
|
|
220
|
+
t15 = /*#__PURE__*/ jsxs("div", {
|
|
221
|
+
"data-tao-color-inputs": t4,
|
|
222
|
+
children: [
|
|
223
|
+
t12,
|
|
224
|
+
t13,
|
|
225
|
+
t14
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
$[20] = t12;
|
|
229
|
+
$[21] = t13;
|
|
230
|
+
$[22] = t14;
|
|
231
|
+
$[23] = t15;
|
|
232
|
+
} else t15 = $[23];
|
|
233
|
+
let t16;
|
|
234
|
+
if ($[24] !== chinese || $[25] !== panel.clear || $[26] !== props.allowClear) {
|
|
235
|
+
t16 = props.allowClear && /*#__PURE__*/ jsx(Button, {
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
size: "small",
|
|
238
|
+
disabled: false,
|
|
239
|
+
"data-tao-color-clear": "",
|
|
240
|
+
onClick: panel.clear,
|
|
241
|
+
children: chinese ? "\u6E05\u9664\u989C\u8272" : "Clear color"
|
|
242
|
+
});
|
|
243
|
+
$[24] = chinese;
|
|
244
|
+
$[25] = panel.clear;
|
|
245
|
+
$[26] = props.allowClear;
|
|
246
|
+
$[27] = t16;
|
|
247
|
+
} else t16 = $[27];
|
|
248
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
249
|
+
"data-tao-color-picker-controls": "",
|
|
250
|
+
children: [
|
|
251
|
+
t3,
|
|
252
|
+
"gradient" === mode && /*#__PURE__*/ jsxs("div", {
|
|
253
|
+
"data-tao-color-stops": "",
|
|
254
|
+
children: [
|
|
255
|
+
/*#__PURE__*/ jsx("div", {
|
|
256
|
+
"data-tao-color-gradient": "",
|
|
257
|
+
style: {
|
|
258
|
+
background: value.toCssString()
|
|
259
|
+
}
|
|
260
|
+
}),
|
|
261
|
+
/*#__PURE__*/ jsxs("div", {
|
|
262
|
+
"data-tao-color-stop-list": "",
|
|
263
|
+
children: [
|
|
264
|
+
stops.map((stop_0, index_0)=>/*#__PURE__*/ jsx("button", {
|
|
265
|
+
type: "button",
|
|
266
|
+
"aria-label": `${chinese ? "\u8272\u6807" : "Color stop"} ${index_0 + 1}`,
|
|
267
|
+
"aria-pressed": index_0 === activeIndex,
|
|
268
|
+
onClick: ()=>panel.setActive(index_0),
|
|
269
|
+
style: {
|
|
270
|
+
background: stop_0.color.toCssString()
|
|
271
|
+
}
|
|
272
|
+
}, keyForColor(`${stop_0.percent}:${stop_0.color.toCssString()}`))),
|
|
273
|
+
/*#__PURE__*/ jsx(Button, {
|
|
274
|
+
variant: "bare",
|
|
275
|
+
disabled: false,
|
|
276
|
+
type: "button",
|
|
277
|
+
"aria-label": chinese ? "\u6DFB\u52A0\u8272\u6807" : "Add color stop",
|
|
278
|
+
onClick: ()=>{
|
|
279
|
+
const added = {
|
|
280
|
+
color: selected,
|
|
281
|
+
percent: 50
|
|
282
|
+
};
|
|
283
|
+
const next_1 = [
|
|
284
|
+
...stops,
|
|
285
|
+
added
|
|
286
|
+
].sort(_temp);
|
|
287
|
+
panel.setActive(next_1.indexOf(added));
|
|
288
|
+
panel.change(new external_color_js_Color(next_1));
|
|
289
|
+
},
|
|
290
|
+
children: "+"
|
|
291
|
+
}),
|
|
292
|
+
stops.length > 2 && /*#__PURE__*/ jsx(Button, {
|
|
293
|
+
variant: "bare",
|
|
294
|
+
disabled: false,
|
|
295
|
+
type: "button",
|
|
296
|
+
"aria-label": chinese ? "\u5220\u9664\u8272\u6807" : "Remove color stop",
|
|
297
|
+
onClick: ()=>{
|
|
298
|
+
panel.setActive(Math.max(0, activeIndex - 1));
|
|
299
|
+
panel.change(new external_color_js_Color(stops.filter((_, index_1)=>index_1 !== activeIndex)));
|
|
300
|
+
},
|
|
301
|
+
children: "−"
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
}),
|
|
305
|
+
/*#__PURE__*/ jsxs("div", {
|
|
306
|
+
"data-tao-color-stop-position": "",
|
|
307
|
+
children: [
|
|
308
|
+
/*#__PURE__*/ jsx("span", {
|
|
309
|
+
children: chinese ? "\u4F4D\u7F6E" : "Position"
|
|
310
|
+
}),
|
|
311
|
+
/*#__PURE__*/ jsx(Slider, {
|
|
312
|
+
ariaLabelForHandle: chinese ? "\u8272\u6807\u4F4D\u7F6E" : "Stop position",
|
|
313
|
+
disabled: false,
|
|
314
|
+
min: 0,
|
|
315
|
+
max: 100,
|
|
316
|
+
value: stops[activeIndex].percent,
|
|
317
|
+
tooltip: {
|
|
318
|
+
open: false
|
|
319
|
+
},
|
|
320
|
+
onChange: (percent)=>{
|
|
321
|
+
const moved = {
|
|
322
|
+
...stops[activeIndex],
|
|
323
|
+
percent
|
|
324
|
+
};
|
|
325
|
+
const next_2 = stops.map((stop_1, index_2)=>index_2 === activeIndex ? moved : stop_1).sort(_temp2);
|
|
326
|
+
panel.setActive(next_2.indexOf(moved));
|
|
327
|
+
panel.change(new external_color_js_Color(next_2), false);
|
|
328
|
+
},
|
|
329
|
+
onChangeComplete: ()=>panel.complete(value)
|
|
330
|
+
}),
|
|
331
|
+
/*#__PURE__*/ jsxs("span", {
|
|
332
|
+
children: [
|
|
333
|
+
stops[activeIndex].percent,
|
|
334
|
+
"%"
|
|
335
|
+
]
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
}),
|
|
341
|
+
/*#__PURE__*/ jsx(RcColorPickerComponent, {
|
|
342
|
+
prefixCls: prefix,
|
|
343
|
+
value: new Color(selected.toRgb()),
|
|
344
|
+
disabledAlpha: props.disabledAlpha,
|
|
345
|
+
onChange: (next_3)=>changeSelected(new external_color_js_Color(next_3.toRgb()), false),
|
|
346
|
+
onChangeComplete: (next_4)=>panel.complete(replace(new external_color_js_Color(next_4.toRgb())))
|
|
347
|
+
}),
|
|
348
|
+
t15,
|
|
349
|
+
t16
|
|
350
|
+
]
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function _temp3(item) {
|
|
354
|
+
return {
|
|
355
|
+
value: item,
|
|
356
|
+
label: item.toUpperCase()
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function _temp2(a_0, b_0) {
|
|
360
|
+
return a_0.percent - b_0.percent;
|
|
361
|
+
}
|
|
362
|
+
function _temp(a, b) {
|
|
363
|
+
return a.percent - b.percent;
|
|
364
|
+
}
|
|
365
|
+
function PresetsPanel() {
|
|
366
|
+
const $ = c(6);
|
|
367
|
+
const keyForColor = colorKeys();
|
|
368
|
+
const { props, change, chinese } = useContext(PanelContext);
|
|
369
|
+
if (!props.presets?.length) return null;
|
|
370
|
+
const t0 = "";
|
|
371
|
+
const T0 = Collapse;
|
|
372
|
+
const t1 = true;
|
|
373
|
+
const t2 = false;
|
|
374
|
+
const t3 = "small";
|
|
375
|
+
let t4;
|
|
376
|
+
if ($[0] !== props.presets) {
|
|
377
|
+
t4 = props.presets.flatMap(_temp4);
|
|
378
|
+
$[0] = props.presets;
|
|
379
|
+
$[1] = t4;
|
|
380
|
+
} else t4 = $[1];
|
|
381
|
+
const t5 = props.presets.map((preset_0, index_0)=>({
|
|
382
|
+
key: String(preset_0.key ?? index_0),
|
|
383
|
+
label: preset_0.label,
|
|
384
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
385
|
+
"data-tao-color-swatches": "",
|
|
386
|
+
children: preset_0.colors.map((value)=>{
|
|
387
|
+
const color = new external_color_js_Color(value);
|
|
388
|
+
return /*#__PURE__*/ jsx("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
"aria-label": `${chinese ? "\u9884\u8BBE" : "Preset"} ${color.isGradient() ? color.toCssString() : color.toHexString()}`,
|
|
391
|
+
style: {
|
|
392
|
+
background: color.toCssString()
|
|
393
|
+
},
|
|
394
|
+
onClick: ()=>change(color)
|
|
395
|
+
}, keyForColor(color.toCssString()));
|
|
396
|
+
})
|
|
397
|
+
})
|
|
398
|
+
}));
|
|
399
|
+
let t6;
|
|
400
|
+
if ($[2] !== T0 || $[3] !== t4 || $[4] !== t5) {
|
|
401
|
+
t6 = /*#__PURE__*/ jsx("div", {
|
|
402
|
+
"data-tao-color-presets": t0,
|
|
403
|
+
children: /*#__PURE__*/ jsx(T0, {
|
|
404
|
+
ghost: t1,
|
|
405
|
+
disabled: t2,
|
|
406
|
+
size: t3,
|
|
407
|
+
defaultActiveKey: t4,
|
|
408
|
+
items: t5
|
|
409
|
+
})
|
|
410
|
+
});
|
|
411
|
+
$[2] = T0;
|
|
412
|
+
$[3] = t4;
|
|
413
|
+
$[4] = t5;
|
|
414
|
+
$[5] = t6;
|
|
415
|
+
} else t6 = $[5];
|
|
416
|
+
return t6;
|
|
417
|
+
}
|
|
418
|
+
function _temp4(preset, index) {
|
|
419
|
+
return preset.defaultOpen ?? true ? [
|
|
420
|
+
String(preset.key ?? index)
|
|
421
|
+
] : [];
|
|
422
|
+
}
|
|
423
|
+
function opaque(value) {
|
|
424
|
+
return value.isGradient() ? new external_color_js_Color(value.getColors().map((stop)=>({
|
|
425
|
+
...stop,
|
|
426
|
+
color: new external_color_js_Color({
|
|
427
|
+
...stop.color.toRgb(),
|
|
428
|
+
a: 1
|
|
429
|
+
})
|
|
430
|
+
}))) : new external_color_js_Color({
|
|
431
|
+
...value.toRgb(),
|
|
432
|
+
a: 1
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function ColorPicker(props) {
|
|
436
|
+
const $ = c(165);
|
|
437
|
+
const config = useTaoConfig();
|
|
438
|
+
let t0;
|
|
439
|
+
if ($[0] !== props.defaultValue) {
|
|
440
|
+
t0 = ()=>new external_color_js_Color(void 0 === props.defaultValue ? "#1677ff" : props.defaultValue);
|
|
441
|
+
$[0] = props.defaultValue;
|
|
442
|
+
$[1] = t0;
|
|
443
|
+
} else t0 = $[1];
|
|
444
|
+
const [innerValue, setValue] = useState(t0);
|
|
445
|
+
const [innerOpen, setOpen] = useState(false);
|
|
446
|
+
const [innerFormat, setFormat] = useState(props.defaultFormat ?? "hex");
|
|
447
|
+
const [active, setActive] = useState(0);
|
|
448
|
+
const [triggerElement, setTriggerElement] = useState(null);
|
|
449
|
+
let t1;
|
|
450
|
+
if ($[2] !== props.defaultValue || $[3] !== props.mode || $[4] !== props.value) {
|
|
451
|
+
t1 = ()=>new external_color_js_Color(props.value ?? props.defaultValue).isGradient() ? "gradient" : (Array.isArray(props.mode) ? props.mode[0] : props.mode) ?? "single";
|
|
452
|
+
$[2] = props.defaultValue;
|
|
453
|
+
$[3] = props.mode;
|
|
454
|
+
$[4] = props.value;
|
|
455
|
+
$[5] = t1;
|
|
456
|
+
} else t1 = $[5];
|
|
457
|
+
const [innerMode, setMode] = useState(t1);
|
|
458
|
+
const cachedGradient = useRef(null);
|
|
459
|
+
const hoverTimer = useRef(void 0);
|
|
460
|
+
let t2;
|
|
461
|
+
let t3;
|
|
462
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
463
|
+
t2 = ()=>()=>clearTimeout(hoverTimer.current);
|
|
464
|
+
t3 = [];
|
|
465
|
+
$[6] = t2;
|
|
466
|
+
$[7] = t3;
|
|
467
|
+
} else {
|
|
468
|
+
t2 = $[6];
|
|
469
|
+
t3 = $[7];
|
|
470
|
+
}
|
|
471
|
+
useEffect(t2, t3);
|
|
472
|
+
let t4;
|
|
473
|
+
if ($[8] !== props.mode) {
|
|
474
|
+
t4 = props.mode ? Array.isArray(props.mode) ? props.mode : [
|
|
475
|
+
props.mode
|
|
476
|
+
] : [
|
|
477
|
+
"single"
|
|
478
|
+
];
|
|
479
|
+
$[8] = props.mode;
|
|
480
|
+
$[9] = t4;
|
|
481
|
+
} else t4 = $[9];
|
|
482
|
+
const configuredModes = t4;
|
|
483
|
+
let t5;
|
|
484
|
+
if ($[10] !== configuredModes) {
|
|
485
|
+
t5 = configuredModes.length ? configuredModes : [
|
|
486
|
+
"single"
|
|
487
|
+
];
|
|
488
|
+
$[10] = configuredModes;
|
|
489
|
+
$[11] = t5;
|
|
490
|
+
} else t5 = $[11];
|
|
491
|
+
const modes = t5;
|
|
492
|
+
let t6;
|
|
493
|
+
if ($[12] !== innerMode || $[13] !== modes) {
|
|
494
|
+
t6 = modes.includes(innerMode) ? innerMode : modes[0];
|
|
495
|
+
$[12] = innerMode;
|
|
496
|
+
$[13] = modes;
|
|
497
|
+
$[14] = t6;
|
|
498
|
+
} else t6 = $[14];
|
|
499
|
+
const mode = t6;
|
|
500
|
+
const rawColor = void 0 === props.value ? innerValue : new external_color_js_Color(props.value);
|
|
501
|
+
const isGradient = rawColor.isGradient();
|
|
502
|
+
useEffect(()=>{
|
|
503
|
+
setMode(isGradient ? "gradient" : "single");
|
|
504
|
+
}, [
|
|
505
|
+
isGradient
|
|
506
|
+
]);
|
|
507
|
+
const value = "gradient" !== mode || rawColor.isGradient() || rawColor.cleared ? rawColor : new external_color_js_Color([
|
|
508
|
+
{
|
|
509
|
+
color: rawColor,
|
|
510
|
+
percent: 0
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
color: rawColor,
|
|
514
|
+
percent: 100
|
|
515
|
+
}
|
|
516
|
+
]);
|
|
517
|
+
let t7;
|
|
518
|
+
if ($[15] !== mode || $[16] !== value) {
|
|
519
|
+
t7 = "gradient" === mode && value.cleared ? new external_color_js_Color([
|
|
520
|
+
{
|
|
521
|
+
color: "transparent",
|
|
522
|
+
percent: 0
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
color: "transparent",
|
|
526
|
+
percent: 100
|
|
527
|
+
}
|
|
528
|
+
]) : value;
|
|
529
|
+
$[15] = mode;
|
|
530
|
+
$[16] = value;
|
|
531
|
+
$[17] = t7;
|
|
532
|
+
} else t7 = $[17];
|
|
533
|
+
const panelValue = t7;
|
|
534
|
+
const format = props.format ?? innerFormat;
|
|
535
|
+
const disabled = props.disabled ?? config.disabled;
|
|
536
|
+
const open = !disabled && (props.open ?? innerOpen);
|
|
537
|
+
let t8;
|
|
538
|
+
if ($[18] !== props) {
|
|
539
|
+
t8 = "function" == typeof props.classNames ? props.classNames({
|
|
540
|
+
props
|
|
541
|
+
}) : props.classNames;
|
|
542
|
+
$[18] = props;
|
|
543
|
+
$[19] = t8;
|
|
544
|
+
} else t8 = $[19];
|
|
545
|
+
const names = t8;
|
|
546
|
+
let t9;
|
|
547
|
+
if ($[20] !== props) {
|
|
548
|
+
t9 = "function" == typeof props.styles ? props.styles({
|
|
549
|
+
props
|
|
550
|
+
}) : props.styles;
|
|
551
|
+
$[20] = props;
|
|
552
|
+
$[21] = t9;
|
|
553
|
+
} else t9 = $[21];
|
|
554
|
+
const styles = t9;
|
|
555
|
+
const chinese = "zh_CN" === config.locale.locale;
|
|
556
|
+
let t10;
|
|
557
|
+
if ($[22] !== props.disabledAlpha) {
|
|
558
|
+
t10 = (next)=>props.disabledAlpha && !next.cleared ? opaque(next) : next;
|
|
559
|
+
$[22] = props.disabledAlpha;
|
|
560
|
+
$[23] = t10;
|
|
561
|
+
} else t10 = $[23];
|
|
562
|
+
const normalize = t10;
|
|
563
|
+
let t11;
|
|
564
|
+
if ($[24] !== normalize || $[25] !== props) {
|
|
565
|
+
t11 = (next_0)=>props.onChangeComplete?.(normalize(next_0));
|
|
566
|
+
$[24] = normalize;
|
|
567
|
+
$[25] = props;
|
|
568
|
+
$[26] = t11;
|
|
569
|
+
} else t11 = $[26];
|
|
570
|
+
const complete = t11;
|
|
571
|
+
let t12;
|
|
572
|
+
if ($[27] !== complete || $[28] !== normalize || $[29] !== props) {
|
|
573
|
+
t12 = (next_1, t13)=>{
|
|
574
|
+
const finished = void 0 === t13 ? true : t13;
|
|
575
|
+
const color = normalize(next_1);
|
|
576
|
+
if (void 0 === props.value) setValue(color);
|
|
577
|
+
cachedGradient.current = null;
|
|
578
|
+
props.onChange?.(color, color.toCssString());
|
|
579
|
+
if (finished) complete(color);
|
|
580
|
+
};
|
|
581
|
+
$[27] = complete;
|
|
582
|
+
$[28] = normalize;
|
|
583
|
+
$[29] = props;
|
|
584
|
+
$[30] = t12;
|
|
585
|
+
} else t12 = $[30];
|
|
586
|
+
const change = t12;
|
|
587
|
+
let t13;
|
|
588
|
+
if ($[31] !== disabled || $[32] !== props) {
|
|
589
|
+
t13 = (next_2)=>{
|
|
590
|
+
if (next_2 && disabled) return;
|
|
591
|
+
if (void 0 === props.open) setOpen(next_2);
|
|
592
|
+
props.onOpenChange?.(next_2);
|
|
593
|
+
};
|
|
594
|
+
$[31] = disabled;
|
|
595
|
+
$[32] = props;
|
|
596
|
+
$[33] = t13;
|
|
597
|
+
} else t13 = $[33];
|
|
598
|
+
const openChange = t13;
|
|
599
|
+
let t14;
|
|
600
|
+
if ($[34] !== openChange || $[35] !== props.trigger) {
|
|
601
|
+
t14 = ()=>{
|
|
602
|
+
clearTimeout(hoverTimer.current);
|
|
603
|
+
if ("hover" === props.trigger) openChange(true);
|
|
604
|
+
};
|
|
605
|
+
$[34] = openChange;
|
|
606
|
+
$[35] = props.trigger;
|
|
607
|
+
$[36] = t14;
|
|
608
|
+
} else t14 = $[36];
|
|
609
|
+
const enter = t14;
|
|
610
|
+
let t15;
|
|
611
|
+
if ($[37] !== openChange || $[38] !== props.trigger) {
|
|
612
|
+
t15 = ()=>{
|
|
613
|
+
if ("hover" === props.trigger) hoverTimer.current = setTimeout(()=>openChange(false), 100);
|
|
614
|
+
};
|
|
615
|
+
$[37] = openChange;
|
|
616
|
+
$[38] = props.trigger;
|
|
617
|
+
$[39] = t15;
|
|
618
|
+
} else t15 = $[39];
|
|
619
|
+
const leave = t15;
|
|
620
|
+
let t16;
|
|
621
|
+
if ($[40] !== format || $[41] !== props) {
|
|
622
|
+
t16 = (next_3)=>{
|
|
623
|
+
if (void 0 === props.format) setFormat(next_3);
|
|
624
|
+
if (format !== next_3) props.onFormatChange?.(next_3);
|
|
625
|
+
};
|
|
626
|
+
$[40] = format;
|
|
627
|
+
$[41] = props;
|
|
628
|
+
$[42] = t16;
|
|
629
|
+
} else t16 = $[42];
|
|
630
|
+
let t17;
|
|
631
|
+
if ($[43] !== change || $[44] !== value) {
|
|
632
|
+
t17 = (next_4)=>{
|
|
633
|
+
setMode(next_4);
|
|
634
|
+
setActive(0);
|
|
635
|
+
const cached = value.isGradient() ? value : cachedGradient.current;
|
|
636
|
+
change("single" === next_4 ? value.getColors()[0].color : cached ?? new external_color_js_Color([
|
|
637
|
+
{
|
|
638
|
+
color: value,
|
|
639
|
+
percent: 0
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
color: value,
|
|
643
|
+
percent: 100
|
|
644
|
+
}
|
|
645
|
+
]));
|
|
646
|
+
cachedGradient.current = cached;
|
|
647
|
+
};
|
|
648
|
+
$[43] = change;
|
|
649
|
+
$[44] = value;
|
|
650
|
+
$[45] = t17;
|
|
651
|
+
} else t17 = $[45];
|
|
652
|
+
let t18;
|
|
653
|
+
if ($[46] !== change || $[47] !== props) {
|
|
654
|
+
t18 = ()=>{
|
|
655
|
+
change(new external_color_js_Color(null));
|
|
656
|
+
props.onClear?.();
|
|
657
|
+
};
|
|
658
|
+
$[46] = change;
|
|
659
|
+
$[47] = props;
|
|
660
|
+
$[48] = t18;
|
|
661
|
+
} else t18 = $[48];
|
|
662
|
+
let t19;
|
|
663
|
+
if ($[49] !== active || $[50] !== change || $[51] !== chinese || $[52] !== complete || $[53] !== format || $[54] !== mode || $[55] !== modes || $[56] !== panelValue || $[57] !== props || $[58] !== t16 || $[59] !== t17 || $[60] !== t18) {
|
|
664
|
+
t19 = {
|
|
665
|
+
props,
|
|
666
|
+
value: panelValue,
|
|
667
|
+
active,
|
|
668
|
+
setActive,
|
|
669
|
+
format,
|
|
670
|
+
setFormat: t16,
|
|
671
|
+
mode,
|
|
672
|
+
modes,
|
|
673
|
+
setMode: t17,
|
|
674
|
+
change,
|
|
675
|
+
complete,
|
|
676
|
+
clear: t18,
|
|
677
|
+
chinese
|
|
678
|
+
};
|
|
679
|
+
$[49] = active;
|
|
680
|
+
$[50] = change;
|
|
681
|
+
$[51] = chinese;
|
|
682
|
+
$[52] = complete;
|
|
683
|
+
$[53] = format;
|
|
684
|
+
$[54] = mode;
|
|
685
|
+
$[55] = modes;
|
|
686
|
+
$[56] = panelValue;
|
|
687
|
+
$[57] = props;
|
|
688
|
+
$[58] = t16;
|
|
689
|
+
$[59] = t17;
|
|
690
|
+
$[60] = t18;
|
|
691
|
+
$[61] = t19;
|
|
692
|
+
} else t19 = $[61];
|
|
693
|
+
const panelState = t19;
|
|
694
|
+
let t20;
|
|
695
|
+
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
696
|
+
t20 = /*#__PURE__*/ jsxs(Fragment, {
|
|
697
|
+
children: [
|
|
698
|
+
/*#__PURE__*/ jsx(PickerPanel, {}),
|
|
699
|
+
/*#__PURE__*/ jsx(PresetsPanel, {})
|
|
700
|
+
]
|
|
701
|
+
});
|
|
702
|
+
$[62] = t20;
|
|
703
|
+
} else t20 = $[62];
|
|
704
|
+
const basicPanel = t20;
|
|
705
|
+
const placement = props.placement ?? "bottomLeft";
|
|
706
|
+
const side = placement.startsWith("top") ? "top" : placement.startsWith("left") ? "left" : placement.startsWith("right") ? "right" : "bottom";
|
|
707
|
+
const align = "object" == typeof props.arrow && props.arrow.pointAtCenter ? "center" : /Left|Top/.test(placement) ? "start" : /Right|Bottom/.test(placement) ? "end" : "center";
|
|
708
|
+
let t21;
|
|
709
|
+
if ($[63] !== chinese || $[64] !== format || $[65] !== props.showText || $[66] !== value) {
|
|
710
|
+
t21 = "function" == typeof props.showText ? props.showText(value) : value.cleared ? chinese ? "\u900F\u660E" : "Transparent" : value.isGradient() ? chinese ? "\u6E10\u53D8" : "Gradient" : "rgb" === format ? value.toRgbString() : "hsb" === format ? value.toHsbString() : value.toHexString();
|
|
711
|
+
$[63] = chinese;
|
|
712
|
+
$[64] = format;
|
|
713
|
+
$[65] = props.showText;
|
|
714
|
+
$[66] = value;
|
|
715
|
+
$[67] = t21;
|
|
716
|
+
} else t21 = $[67];
|
|
717
|
+
const text = t21;
|
|
718
|
+
let t22;
|
|
719
|
+
if ($[68] !== props) {
|
|
720
|
+
t22 = Object.fromEntries(Object.entries(props).filter(_temp5));
|
|
721
|
+
$[68] = props;
|
|
722
|
+
$[69] = t22;
|
|
723
|
+
} else t22 = $[69];
|
|
724
|
+
const dataProps = t22;
|
|
725
|
+
let t23;
|
|
726
|
+
if ($[70] !== value) {
|
|
727
|
+
t23 = value.toHexString();
|
|
728
|
+
$[70] = value;
|
|
729
|
+
$[71] = t23;
|
|
730
|
+
} else t23 = $[71];
|
|
731
|
+
const t24 = `${chinese ? "\u9009\u62E9\u989C\u8272" : "Choose color"} ${t23}`;
|
|
732
|
+
const t25 = names?.body;
|
|
733
|
+
const t26 = styles?.body;
|
|
734
|
+
const t27 = names?.content;
|
|
735
|
+
let t28;
|
|
736
|
+
if ($[72] !== value) {
|
|
737
|
+
t28 = value.toCssString();
|
|
738
|
+
$[72] = value;
|
|
739
|
+
$[73] = t28;
|
|
740
|
+
} else t28 = $[73];
|
|
741
|
+
const t29 = styles?.content;
|
|
742
|
+
let t30;
|
|
743
|
+
if ($[74] !== t28 || $[75] !== t29) {
|
|
744
|
+
t30 = {
|
|
745
|
+
background: t28,
|
|
746
|
+
...t29
|
|
747
|
+
};
|
|
748
|
+
$[74] = t28;
|
|
749
|
+
$[75] = t29;
|
|
750
|
+
$[76] = t30;
|
|
751
|
+
} else t30 = $[76];
|
|
752
|
+
let t31;
|
|
753
|
+
if ($[77] !== t27 || $[78] !== t30) {
|
|
754
|
+
t31 = /*#__PURE__*/ jsx("span", {
|
|
755
|
+
"data-tao-color-content": "",
|
|
756
|
+
className: t27,
|
|
757
|
+
style: t30
|
|
758
|
+
});
|
|
759
|
+
$[77] = t27;
|
|
760
|
+
$[78] = t30;
|
|
761
|
+
$[79] = t31;
|
|
762
|
+
} else t31 = $[79];
|
|
763
|
+
let t32;
|
|
764
|
+
if ($[80] !== t25 || $[81] !== t26 || $[82] !== t31) {
|
|
765
|
+
t32 = /*#__PURE__*/ jsx("span", {
|
|
766
|
+
"data-tao-color-body": "",
|
|
767
|
+
className: t25,
|
|
768
|
+
style: t26,
|
|
769
|
+
children: t31
|
|
770
|
+
});
|
|
771
|
+
$[80] = t25;
|
|
772
|
+
$[81] = t26;
|
|
773
|
+
$[82] = t31;
|
|
774
|
+
$[83] = t32;
|
|
775
|
+
} else t32 = $[83];
|
|
776
|
+
let t33;
|
|
777
|
+
if ($[84] !== names?.description || $[85] !== props.showText || $[86] !== styles?.description || $[87] !== text) {
|
|
778
|
+
t33 = props.showText && /*#__PURE__*/ jsx("span", {
|
|
779
|
+
"data-tao-color-description": "",
|
|
780
|
+
className: names?.description,
|
|
781
|
+
style: styles?.description,
|
|
782
|
+
children: text
|
|
783
|
+
});
|
|
784
|
+
$[84] = names?.description;
|
|
785
|
+
$[85] = props.showText;
|
|
786
|
+
$[86] = styles?.description;
|
|
787
|
+
$[87] = text;
|
|
788
|
+
$[88] = t33;
|
|
789
|
+
} else t33 = $[88];
|
|
790
|
+
let t34;
|
|
791
|
+
if ($[89] !== disabled || $[90] !== t24 || $[91] !== t32 || $[92] !== t33) {
|
|
792
|
+
t34 = /*#__PURE__*/ jsxs("button", {
|
|
793
|
+
type: "button",
|
|
794
|
+
disabled: disabled,
|
|
795
|
+
"aria-label": t24,
|
|
796
|
+
children: [
|
|
797
|
+
t32,
|
|
798
|
+
t33
|
|
799
|
+
]
|
|
800
|
+
});
|
|
801
|
+
$[89] = disabled;
|
|
802
|
+
$[90] = t24;
|
|
803
|
+
$[91] = t32;
|
|
804
|
+
$[92] = t33;
|
|
805
|
+
$[93] = t34;
|
|
806
|
+
} else t34 = $[93];
|
|
807
|
+
const defaultTrigger = t34;
|
|
808
|
+
const t35 = "middle" === props.size ? "medium" : props.size ?? config.size;
|
|
809
|
+
const t36 = disabled || void 0;
|
|
810
|
+
const t37 = names?.root;
|
|
811
|
+
let t38;
|
|
812
|
+
if ($[94] !== props.className || $[95] !== props.rootClassName || $[96] !== t37) {
|
|
813
|
+
t38 = cx(t37, props.className, props.rootClassName);
|
|
814
|
+
$[94] = props.className;
|
|
815
|
+
$[95] = props.rootClassName;
|
|
816
|
+
$[96] = t37;
|
|
817
|
+
$[97] = t38;
|
|
818
|
+
} else t38 = $[97];
|
|
819
|
+
const t39 = styles?.root;
|
|
820
|
+
let t40;
|
|
821
|
+
if ($[98] !== props.style || $[99] !== t39) {
|
|
822
|
+
t40 = {
|
|
823
|
+
...t39,
|
|
824
|
+
...props.style
|
|
825
|
+
};
|
|
826
|
+
$[98] = props.style;
|
|
827
|
+
$[99] = t39;
|
|
828
|
+
$[100] = t40;
|
|
829
|
+
} else t40 = $[100];
|
|
830
|
+
let t41;
|
|
831
|
+
if ($[101] !== disabled || $[102] !== props.trigger) {
|
|
832
|
+
t41 = (event)=>{
|
|
833
|
+
if ("hover" === props.trigger || disabled) event.preventDefault();
|
|
834
|
+
};
|
|
835
|
+
$[101] = disabled;
|
|
836
|
+
$[102] = props.trigger;
|
|
837
|
+
$[103] = t41;
|
|
838
|
+
} else t41 = $[103];
|
|
839
|
+
let t42;
|
|
840
|
+
if ($[104] !== defaultTrigger || $[105] !== disabled || $[106] !== props.children) {
|
|
841
|
+
t42 = /*#__PURE__*/ isValidElement(props.children) ? props.children : props.children ? /*#__PURE__*/ jsx("button", {
|
|
842
|
+
type: "button",
|
|
843
|
+
disabled: disabled,
|
|
844
|
+
children: props.children
|
|
845
|
+
}) : defaultTrigger;
|
|
846
|
+
$[104] = defaultTrigger;
|
|
847
|
+
$[105] = disabled;
|
|
848
|
+
$[106] = props.children;
|
|
849
|
+
$[107] = t42;
|
|
850
|
+
} else t42 = $[107];
|
|
851
|
+
let t43;
|
|
852
|
+
if ($[108] !== enter || $[109] !== leave || $[110] !== t41 || $[111] !== t42) {
|
|
853
|
+
t43 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
|
|
854
|
+
asChild: true,
|
|
855
|
+
onPointerEnter: enter,
|
|
856
|
+
onPointerLeave: leave,
|
|
857
|
+
onClick: t41,
|
|
858
|
+
children: t42
|
|
859
|
+
});
|
|
860
|
+
$[108] = enter;
|
|
861
|
+
$[109] = leave;
|
|
862
|
+
$[110] = t41;
|
|
863
|
+
$[111] = t42;
|
|
864
|
+
$[112] = t43;
|
|
865
|
+
} else t43 = $[112];
|
|
866
|
+
let t44;
|
|
867
|
+
if ($[113] !== props.getPopupContainer || $[114] !== triggerElement) {
|
|
868
|
+
t44 = triggerElement ? props.getPopupContainer?.(triggerElement) : void 0;
|
|
869
|
+
$[113] = props.getPopupContainer;
|
|
870
|
+
$[114] = triggerElement;
|
|
871
|
+
$[115] = t44;
|
|
872
|
+
} else t44 = $[115];
|
|
873
|
+
const t45 = props.destroyOnHidden || props.destroyTooltipOnHide ? void 0 : true;
|
|
874
|
+
const t46 = chinese ? "\u989C\u8272\u9009\u62E9\u5668" : "Color picker";
|
|
875
|
+
const t47 = props.autoAdjustOverflow ?? true;
|
|
876
|
+
const t48 = names?.popup?.root;
|
|
877
|
+
const t49 = styles?.popup?.root;
|
|
878
|
+
let t50;
|
|
879
|
+
if ($[116] !== open) {
|
|
880
|
+
t50 = open ? {} : {
|
|
881
|
+
display: "none"
|
|
882
|
+
};
|
|
883
|
+
$[116] = open;
|
|
884
|
+
$[117] = t50;
|
|
885
|
+
} else t50 = $[117];
|
|
886
|
+
let t51;
|
|
887
|
+
if ($[118] !== t49 || $[119] !== t50) {
|
|
888
|
+
t51 = {
|
|
889
|
+
...t49,
|
|
890
|
+
...t50
|
|
891
|
+
};
|
|
892
|
+
$[118] = t49;
|
|
893
|
+
$[119] = t50;
|
|
894
|
+
$[120] = t51;
|
|
895
|
+
} else t51 = $[120];
|
|
896
|
+
let t52;
|
|
897
|
+
if ($[121] !== props.trigger) {
|
|
898
|
+
t52 = (event_0)=>{
|
|
899
|
+
if ("hover" === props.trigger) event_0.preventDefault();
|
|
900
|
+
};
|
|
901
|
+
$[121] = props.trigger;
|
|
902
|
+
$[122] = t52;
|
|
903
|
+
} else t52 = $[122];
|
|
904
|
+
const t53 = names?.popup?.container;
|
|
905
|
+
const t54 = styles?.popupOverlayInner;
|
|
906
|
+
const t55 = styles?.popup?.container;
|
|
907
|
+
let t56;
|
|
908
|
+
if ($[123] !== t54 || $[124] !== t55) {
|
|
909
|
+
t56 = {
|
|
910
|
+
...t54,
|
|
911
|
+
...t55
|
|
912
|
+
};
|
|
913
|
+
$[123] = t54;
|
|
914
|
+
$[124] = t55;
|
|
915
|
+
$[125] = t56;
|
|
916
|
+
} else t56 = $[125];
|
|
917
|
+
let t57;
|
|
918
|
+
if ($[126] !== props.panelRender) {
|
|
919
|
+
t57 = props.panelRender ? props.panelRender(basicPanel, {
|
|
920
|
+
components: {
|
|
921
|
+
Picker: PickerPanel,
|
|
922
|
+
Presets: PresetsPanel
|
|
923
|
+
}
|
|
924
|
+
}) : basicPanel;
|
|
925
|
+
$[126] = props.panelRender;
|
|
926
|
+
$[127] = t57;
|
|
927
|
+
} else t57 = $[127];
|
|
928
|
+
let t58;
|
|
929
|
+
if ($[128] !== panelState || $[129] !== t57) {
|
|
930
|
+
t58 = /*#__PURE__*/ jsx(PanelContext.Provider, {
|
|
931
|
+
value: panelState,
|
|
932
|
+
children: t57
|
|
933
|
+
});
|
|
934
|
+
$[128] = panelState;
|
|
935
|
+
$[129] = t57;
|
|
936
|
+
$[130] = t58;
|
|
937
|
+
} else t58 = $[130];
|
|
938
|
+
let t59;
|
|
939
|
+
if ($[131] !== t53 || $[132] !== t56 || $[133] !== t58) {
|
|
940
|
+
t59 = /*#__PURE__*/ jsx("div", {
|
|
941
|
+
"data-tao-color-container": "",
|
|
942
|
+
className: t53,
|
|
943
|
+
style: t56,
|
|
944
|
+
children: t58
|
|
945
|
+
});
|
|
946
|
+
$[131] = t53;
|
|
947
|
+
$[132] = t56;
|
|
948
|
+
$[133] = t58;
|
|
949
|
+
$[134] = t59;
|
|
950
|
+
} else t59 = $[134];
|
|
951
|
+
let t60;
|
|
952
|
+
if ($[135] !== props.arrow) {
|
|
953
|
+
t60 = false !== props.arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Arrow, {
|
|
954
|
+
"data-tao-color-arrow": ""
|
|
955
|
+
});
|
|
956
|
+
$[135] = props.arrow;
|
|
957
|
+
$[136] = t60;
|
|
958
|
+
} else t60 = $[136];
|
|
959
|
+
let t61;
|
|
960
|
+
if ($[137] !== align || $[138] !== enter || $[139] !== leave || $[140] !== side || $[141] !== t46 || $[142] !== t47 || $[143] !== t48 || $[144] !== t51 || $[145] !== t52 || $[146] !== t59 || $[147] !== t60) {
|
|
961
|
+
t61 = /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
962
|
+
asChild: true,
|
|
963
|
+
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Content, {
|
|
964
|
+
"data-tao-color-popup": "",
|
|
965
|
+
"aria-label": t46,
|
|
966
|
+
side: side,
|
|
967
|
+
align: align,
|
|
968
|
+
sideOffset: 6,
|
|
969
|
+
collisionPadding: 12,
|
|
970
|
+
avoidCollisions: t47,
|
|
971
|
+
onPointerEnter: enter,
|
|
972
|
+
onPointerLeave: leave,
|
|
973
|
+
className: t48,
|
|
974
|
+
style: t51,
|
|
975
|
+
onOpenAutoFocus: t52,
|
|
976
|
+
children: [
|
|
977
|
+
t59,
|
|
978
|
+
t60
|
|
979
|
+
]
|
|
980
|
+
})
|
|
981
|
+
});
|
|
982
|
+
$[137] = align;
|
|
983
|
+
$[138] = enter;
|
|
984
|
+
$[139] = leave;
|
|
985
|
+
$[140] = side;
|
|
986
|
+
$[141] = t46;
|
|
987
|
+
$[142] = t47;
|
|
988
|
+
$[143] = t48;
|
|
989
|
+
$[144] = t51;
|
|
990
|
+
$[145] = t52;
|
|
991
|
+
$[146] = t59;
|
|
992
|
+
$[147] = t60;
|
|
993
|
+
$[148] = t61;
|
|
994
|
+
} else t61 = $[148];
|
|
995
|
+
let t62;
|
|
996
|
+
if ($[149] !== t44 || $[150] !== t45 || $[151] !== t61) {
|
|
997
|
+
t62 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
|
|
998
|
+
container: t44,
|
|
999
|
+
forceMount: t45,
|
|
1000
|
+
children: t61
|
|
1001
|
+
});
|
|
1002
|
+
$[149] = t44;
|
|
1003
|
+
$[150] = t45;
|
|
1004
|
+
$[151] = t61;
|
|
1005
|
+
$[152] = t62;
|
|
1006
|
+
} else t62 = $[152];
|
|
1007
|
+
let t63;
|
|
1008
|
+
if ($[153] !== open || $[154] !== openChange || $[155] !== t43 || $[156] !== t62) {
|
|
1009
|
+
t63 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Root, {
|
|
1010
|
+
open: open,
|
|
1011
|
+
onOpenChange: openChange,
|
|
1012
|
+
children: [
|
|
1013
|
+
t43,
|
|
1014
|
+
t62
|
|
1015
|
+
]
|
|
1016
|
+
});
|
|
1017
|
+
$[153] = open;
|
|
1018
|
+
$[154] = openChange;
|
|
1019
|
+
$[155] = t43;
|
|
1020
|
+
$[156] = t62;
|
|
1021
|
+
$[157] = t63;
|
|
1022
|
+
} else t63 = $[157];
|
|
1023
|
+
let t64;
|
|
1024
|
+
if ($[158] !== dataProps || $[159] !== t35 || $[160] !== t36 || $[161] !== t38 || $[162] !== t40 || $[163] !== t63) {
|
|
1025
|
+
t64 = /*#__PURE__*/ jsx("span", {
|
|
1026
|
+
ref: setTriggerElement,
|
|
1027
|
+
"data-tao-color-picker": "",
|
|
1028
|
+
"data-tao-size": t35,
|
|
1029
|
+
"data-disabled": t36,
|
|
1030
|
+
className: t38,
|
|
1031
|
+
style: t40,
|
|
1032
|
+
...dataProps,
|
|
1033
|
+
children: t63
|
|
1034
|
+
});
|
|
1035
|
+
$[158] = dataProps;
|
|
1036
|
+
$[159] = t35;
|
|
1037
|
+
$[160] = t36;
|
|
1038
|
+
$[161] = t38;
|
|
1039
|
+
$[162] = t40;
|
|
1040
|
+
$[163] = t63;
|
|
1041
|
+
$[164] = t64;
|
|
1042
|
+
} else t64 = $[164];
|
|
1043
|
+
return t64;
|
|
1044
|
+
}
|
|
1045
|
+
function _temp5(t0) {
|
|
1046
|
+
const [key] = t0;
|
|
1047
|
+
return key.startsWith("data-");
|
|
1048
|
+
}
|
|
1049
|
+
export { ColorPicker };
|