@choice-ui/react 1.7.6 → 1.7.8
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/dist/components/colors/dist/index.d.ts +878 -0
- package/dist/components/colors/scripts/build-worker.d.ts +1 -0
- package/dist/components/colors/src/check-color-contrast/check-color-contrast-boundary.d.ts +14 -0
- package/dist/components/colors/src/check-color-contrast/check-color-contrast-boundary.js +403 -0
- package/dist/components/colors/src/check-color-contrast/check-color-contrast-toolbar.d.ts +12 -0
- package/dist/components/colors/src/check-color-contrast/check-color-contrast-toolbar.js +285 -0
- package/dist/components/colors/src/check-color-contrast/index.d.ts +2 -0
- package/dist/components/colors/src/color-area/color-area.d.ts +24 -0
- package/dist/components/colors/src/color-area/color-area.js +228 -0
- package/dist/components/colors/src/color-area/index.d.ts +1 -0
- package/dist/components/colors/src/color-area/tv.d.ts +34 -0
- package/dist/components/colors/src/color-area/tv.js +22 -0
- package/dist/components/colors/src/color-channel-field/color-channel-field.d.ts +22 -0
- package/dist/components/colors/src/color-channel-field/color-channel-field.js +110 -0
- package/dist/components/colors/src/color-channel-field/color-channel-input.d.ts +20 -0
- package/dist/components/colors/src/color-channel-field/color-channel-input.js +261 -0
- package/dist/components/colors/src/color-channel-field/index.d.ts +1 -0
- package/dist/components/colors/src/color-channel-field/tv.d.ts +101 -0
- package/dist/components/colors/src/color-channel-field/tv.js +85 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-combined.d.ts +16 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-combined.js +54 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-control.d.ts +18 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-control.js +149 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-list.d.ts +20 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-list.js +111 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-slider.d.ts +18 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradient-slider.js +281 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradients-paint.d.ts +17 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradients-paint.js +162 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradients-toolbar.d.ts +10 -0
- package/dist/components/colors/src/color-gradients-paint/color-gradients-toolbar.js +62 -0
- package/dist/components/colors/src/color-gradients-paint/index.d.ts +3 -0
- package/dist/components/colors/src/color-image-paint/color-image-paint.d.ts +13 -0
- package/dist/components/colors/src/color-image-paint/color-image-paint.js +236 -0
- package/dist/components/colors/src/color-image-paint/color-image-toolbar.d.ts +9 -0
- package/dist/components/colors/src/color-image-paint/color-image-toolbar.js +52 -0
- package/dist/components/colors/src/color-image-paint/index.d.ts +1 -0
- package/dist/components/colors/src/color-image-paint/tv.d.ts +89 -0
- package/dist/components/colors/src/color-image-paint/tv.js +45 -0
- package/dist/components/colors/src/color-picker-content/color-picker-content.d.ts +18 -0
- package/dist/components/colors/src/color-picker-content/color-picker-content.js +58 -0
- package/dist/components/colors/src/color-picker-content/color-picker-custom-content.d.ts +16 -0
- package/dist/components/colors/src/color-picker-content/color-picker-custom-content.js +75 -0
- package/dist/components/colors/src/color-picker-content/index.d.ts +1 -0
- package/dist/components/colors/src/color-picker-content/paint-type-selector.d.ts +13 -0
- package/dist/components/colors/src/color-picker-content/paint-type-selector.js +50 -0
- package/dist/components/colors/src/color-picker-content/tv.d.ts +31 -0
- package/dist/components/colors/src/color-picker-content/tv.js +13 -0
- package/dist/components/colors/src/color-picker-popover/color-paints-type.d.ts +15 -0
- package/dist/components/colors/src/color-picker-popover/color-paints-type.js +56 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-popover.d.ts +26 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-popover.js +116 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-tabs.d.ts +14 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-tabs.js +47 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-title.d.ts +14 -0
- package/dist/components/colors/src/color-picker-popover/color-picker-title.js +30 -0
- package/dist/components/colors/src/color-picker-popover/index.d.ts +3 -0
- package/dist/components/colors/src/color-picker-popover/tv.d.ts +37 -0
- package/dist/components/colors/src/color-slider/color-slider.d.ts +19 -0
- package/dist/components/colors/src/color-slider/color-slider.js +185 -0
- package/dist/components/colors/src/color-slider/index.d.ts +1 -0
- package/dist/components/colors/src/color-slider/tv.d.ts +31 -0
- package/dist/components/colors/src/color-slider/tv.js +21 -0
- package/dist/components/colors/src/color-solid-paint/color-native-picker.d.ts +8 -0
- package/dist/components/colors/src/color-solid-paint/color-native-picker.js +63 -0
- package/dist/components/colors/src/color-solid-paint/color-solid-paint.d.ts +25 -0
- package/dist/components/colors/src/color-solid-paint/color-solid-paint.js +295 -0
- package/dist/components/colors/src/color-solid-paint/index.d.ts +3 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-alpha-slider.d.ts +10 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-alpha-slider.js +20 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-area.d.ts +17 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-area.js +131 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-channel-field.d.ts +20 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-channel-field.js +147 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-hue-slider.d.ts +14 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-hue-slider.js +46 -0
- package/dist/components/colors/src/color-solid-paint/solid-paint-library-item.d.ts +8 -0
- package/dist/components/colors/src/color-solid-paint/tv.d.ts +79 -0
- package/dist/components/colors/src/color-solid-paint/tv.js +39 -0
- package/dist/components/colors/src/color-swatch/color-swatch.d.ts +15 -0
- package/dist/components/colors/src/color-swatch/color-swatch.js +111 -0
- package/dist/components/colors/src/color-swatch/index.d.ts +1 -0
- package/dist/components/colors/src/contents/color-space.d.ts +19 -0
- package/dist/components/colors/src/contents/color-space.js +16 -0
- package/dist/components/colors/src/contents/colors.d.ts +42 -0
- package/dist/components/colors/src/contents/colors.js +24 -0
- package/dist/components/colors/src/contents/index.d.ts +3 -0
- package/dist/components/colors/src/contents/translation.d.ts +100 -0
- package/dist/components/colors/src/contents/translation.js +94 -0
- package/dist/components/colors/src/context/colots-context.d.ts +24 -0
- package/dist/components/colors/src/context/colots-context.js +62 -0
- package/dist/components/colors/src/context/index.d.ts +1 -0
- package/dist/components/colors/src/fill-input/alpha-input.d.ts +12 -0
- package/dist/components/colors/src/fill-input/alpha-input.js +48 -0
- package/dist/components/colors/src/fill-input/color-input.d.ts +31 -0
- package/dist/components/colors/src/fill-input/color-input.js +115 -0
- package/dist/components/colors/src/fill-input/gradient-item.d.ts +25 -0
- package/dist/components/colors/src/fill-input/gradient-item.js +103 -0
- package/dist/components/colors/src/fill-input/image-item.d.ts +25 -0
- package/dist/components/colors/src/fill-input/image-item.js +89 -0
- package/dist/components/colors/src/fill-input/index.d.ts +5 -0
- package/dist/components/colors/src/fill-input/tv.d.ts +221 -0
- package/dist/components/colors/src/fill-input/tv.js +205 -0
- package/dist/components/colors/src/fill-input/variable-item.d.ts +22 -0
- package/dist/components/colors/src/fill-input/variable-item.js +105 -0
- package/dist/components/colors/src/hex-input/hex-input.d.ts +10 -0
- package/dist/components/colors/src/hex-input/hex-input.js +182 -0
- package/dist/components/colors/src/hex-input/index.d.ts +1 -0
- package/dist/components/colors/src/hex-input/tv.d.ts +1 -0
- package/dist/components/colors/src/hex-input/tv.js +12 -0
- package/dist/components/colors/src/hooks/index.d.ts +10 -0
- package/dist/components/colors/src/hooks/use-color-contrast-recommendation.d.ts +36 -0
- package/dist/components/colors/src/hooks/use-color-contrast-recommendation.js +502 -0
- package/dist/components/colors/src/hooks/use-color-parser.d.ts +10 -0
- package/dist/components/colors/src/hooks/use-color-parser.js +146 -0
- package/dist/components/colors/src/hooks/use-color-picker.d.ts +45 -0
- package/dist/components/colors/src/hooks/use-color-picker.js +117 -0
- package/dist/components/colors/src/hooks/use-color-profile.d.ts +2 -0
- package/dist/components/colors/src/hooks/use-color-profile.js +27 -0
- package/dist/components/colors/src/hooks/use-cursor.d.ts +1 -0
- package/dist/components/colors/src/hooks/use-cursor.js +25 -0
- package/dist/components/colors/src/hooks/use-features.d.ts +21 -0
- package/dist/components/colors/src/hooks/use-features.js +73 -0
- package/dist/components/colors/src/hooks/use-image-filter-style.d.ts +9 -0
- package/dist/components/colors/src/hooks/use-image-filter-style.js +25 -0
- package/dist/components/colors/src/hooks/use-image-processor.d.ts +10 -0
- package/dist/components/colors/src/hooks/use-image-processor.js +121 -0
- package/dist/components/colors/src/hooks/use-paint-state.d.ts +16 -0
- package/dist/components/colors/src/hooks/use-paint-state.js +37 -0
- package/dist/components/colors/src/hooks/use-rgb-color-handler.d.ts +21 -0
- package/dist/components/colors/src/hooks/use-rgb-color-handler.js +58 -0
- package/dist/components/colors/src/index.d.ts +38 -0
- package/dist/components/colors/src/libraries/components/virtualized-grid-row.d.ts +36 -0
- package/dist/components/colors/src/libraries/components/virtualized-grid-row.js +53 -0
- package/dist/components/colors/src/libraries/components/virtualized-header.d.ts +9 -0
- package/dist/components/colors/src/libraries/components/virtualized-header.js +30 -0
- package/dist/components/colors/src/libraries/hooks/index.d.ts +2 -0
- package/dist/components/colors/src/libraries/hooks/use-category-options.d.ts +11 -0
- package/dist/components/colors/src/libraries/hooks/use-category-options.js +27 -0
- package/dist/components/colors/src/libraries/hooks/use-palette-color.d.ts +19 -0
- package/dist/components/colors/src/libraries/hooks/use-palette-color.js +41 -0
- package/dist/components/colors/src/libraries/index.d.ts +8 -0
- package/dist/components/colors/src/libraries/libraries-content.d.ts +8 -0
- package/dist/components/colors/src/libraries/libraries-empty-content.d.ts +5 -0
- package/dist/components/colors/src/libraries/libraries-header.d.ts +18 -0
- package/dist/components/colors/src/libraries/libraries-header.js +111 -0
- package/dist/components/colors/src/libraries/libraries-search-empty-content.d.ts +1 -0
- package/dist/components/colors/src/libraries/libraries-search-input.d.ts +6 -0
- package/dist/components/colors/src/libraries/libraries.d.ts +42 -0
- package/dist/components/colors/src/libraries/libraries.js +461 -0
- package/dist/components/colors/src/libraries/library-color-swatch.d.ts +21 -0
- package/dist/components/colors/src/libraries/library-item/index.d.ts +4 -0
- package/dist/components/colors/src/libraries/library-item/library-item.d.ts +21 -0
- package/dist/components/colors/src/libraries/library-item/library-item.js +151 -0
- package/dist/components/colors/src/libraries/library-item/library-list-item.d.ts +6 -0
- package/dist/components/colors/src/libraries/library-item/style-items.d.ts +17 -0
- package/dist/components/colors/src/libraries/library-item/style-items.js +63 -0
- package/dist/components/colors/src/libraries/library-item/variable-items.d.ts +19 -0
- package/dist/components/colors/src/libraries/library-item/variable-items.js +47 -0
- package/dist/components/colors/src/libraries/tv.d.ts +198 -0
- package/dist/components/colors/src/libraries/tv.js +141 -0
- package/dist/components/colors/src/simple-color-picker/index.d.ts +1 -0
- package/dist/components/colors/src/simple-color-picker/simple-color-picker.d.ts +17 -0
- package/dist/components/colors/src/simple-color-picker/simple-color-picker.js +153 -0
- package/dist/components/colors/src/types/base.d.ts +5 -0
- package/dist/components/colors/src/types/colors.d.ts +139 -0
- package/dist/components/colors/src/types/effect.d.ts +18 -0
- package/dist/components/colors/src/types/fill.d.ts +15 -0
- package/dist/components/colors/src/types/fonts.d.ts +38 -0
- package/dist/components/colors/src/types/index.d.ts +7 -0
- package/dist/components/colors/src/types/libraries.d.ts +7 -0
- package/dist/components/colors/src/types/paint.d.ts +139 -0
- package/dist/components/colors/src/types/style.d.ts +51 -0
- package/dist/components/colors/src/types/testing-library.d.ts +0 -0
- package/dist/components/colors/src/types/util.d.ts +26 -0
- package/dist/components/colors/src/types/variable.d.ts +27 -0
- package/dist/components/colors/src/utils/background.d.ts +12 -0
- package/dist/components/colors/src/utils/background.js +216 -0
- package/dist/components/colors/src/utils/color-profile-storage.d.ts +29 -0
- package/dist/components/colors/src/utils/color.d.ts +20 -0
- package/dist/components/colors/src/utils/color.js +45 -0
- package/dist/components/colors/src/utils/colors-convert.d.ts +18 -0
- package/dist/components/colors/src/utils/colors-convert.js +138 -0
- package/dist/components/colors/src/utils/contrast-utils.d.ts +27 -0
- package/dist/components/colors/src/utils/contrast-utils.js +25 -0
- package/dist/components/colors/src/utils/cursor.d.ts +1 -0
- package/dist/components/colors/src/utils/index.d.ts +7 -0
- package/dist/components/colors/src/utils/math.d.ts +9 -0
- package/dist/components/colors/src/utils/position.d.ts +33 -0
- package/dist/components/colors/src/utils/position.js +60 -0
- package/dist/components/colors/src/utils/validate.d.ts +10 -0
- package/dist/components/colors/src/workers/boundary-calculator.worker.bundled.d.ts +2 -0
- package/dist/components/colors/src/workers/boundary-calculator.worker.bundled.js +36 -0
- package/dist/components/colors/src/workers/boundary-calculator.worker.d.ts +1 -0
- package/dist/components/colors/src/workers/index.d.ts +1 -0
- package/dist/components/colors/tsup.config.d.ts +2 -0
- package/dist/components/icon-button/src/icon-button.d.ts +1 -1
- package/dist/components/icon-button/src/tv.d.ts +9 -0
- package/dist/components/icon-button/src/tv.js +29 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/textarea/src/tv.d.ts +9 -3
- package/dist/components/textarea/src/tv.js +3 -1
- package/dist/components/toggle-button/dist/index.js +602 -0
- package/dist/index.js +69 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/index.js +119 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/Color.js +42 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/chroma.js +9 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/colors/colorbrewer.js +57 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/colors/w3cx11.js +159 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/average.js +82 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/bezier.js +68 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/blend.js +43 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/cubehelix.js +81 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/mix.js +20 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/random.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/generator/scale.js +325 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/_hsx.js +54 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/hcg.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/hsi.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/hsl.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/hsv.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/index.js +4 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/lab.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/lch.js +11 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/lrgb.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/num.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/oklab.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/oklch.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/interpolator/rgb.js +16 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.js +20 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/cmyk/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.js +18 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/css2rgb.js +169 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/hsl2css.js +20 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/index.js +23 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/lab2css.js +19 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/lch2css.js +19 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/oklab2css.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/oklch2css.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/css/rgb2css.js +53 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/gl/index.js +21 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hcg/hcg2rgb.js +48 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hcg/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hcg/rgb2hcg.js +24 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hex/hex2rgb.js +37 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hex/index.js +23 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hex/rgb2hex.js +31 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsi/hsi2rgb.js +36 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsi/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsi/rgb2hsi.js +28 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsl/hsl2rgb.js +35 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsl/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsl/rgb2hsl.js +29 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsv/hsv2rgb.js +46 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsv/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/hsv/rgb2hsv.js +27 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/input.js +7 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lab/index.js +28 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lab/lab-constants.js +106 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lab/lab2rgb.js +59 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lab/rgb2lab.js +51 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/hcl2rgb.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/index.js +35 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/lab2lch.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/lch2lab.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/lch2rgb.js +14 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/lch/rgb2lch.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/named/index.js +26 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/num/index.js +23 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/num/num2rgb.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/num/rgb2num.js +9 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklab/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklab/oklab2rgb.js +31 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklab/rgb2oklab.js +30 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklch/index.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklch/oklch2rgb.js +14 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/oklch/rgb2oklch.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/rgb/index.js +34 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/temp/index.js +16 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/temp/rgb2temperature.js +25 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/io/temp/temperature2rgb.js +18 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/alpha.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/clipped.js +4 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/darken.js +14 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/get.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/luminance.js +38 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/mix.js +5 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/premultiply.js +11 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/saturate.js +13 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/set.js +42 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/ops/shade.js +9 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/analyze.js +161 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/clip_rgb.js +17 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/contrast.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/contrastAPCA.js +43 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/delta-e.js +48 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/distance.js +16 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/index.js +24 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/last.js +10 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/limit.js +7 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/multiply-matrices.js +29 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/scales.js +16 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/type.js +20 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/unpack.js +11 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/utils/valid.js +12 -0
- package/dist/node_modules/.pnpm/chroma-js@3.2.0/node_modules/chroma-js/src/version.js +4 -0
- package/dist/node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.js +1317 -0
- package/dist/styles/components.css +55 -0
- package/dist/tailwind.css +1 -0
- package/package.json +32 -20
- package/dist/components/virtual-select/dist/index.d.ts +0 -48
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TabItem } from '../color-picker-popover/color-picker-tabs';
|
|
3
|
+
import { ColorContrast, PaintType, PaintTypeLabels, PickerFeatures } from '../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
additionalTabs?: TabItem[];
|
|
6
|
+
checkColorContrast?: ColorContrast;
|
|
7
|
+
features: PickerFeatures;
|
|
8
|
+
gradientPaint?: ReactNode;
|
|
9
|
+
handlePaintsTypeChange?: (type: PaintType) => void;
|
|
10
|
+
imagePaint?: ReactNode;
|
|
11
|
+
labels?: PaintTypeLabels;
|
|
12
|
+
paintsType: PaintType;
|
|
13
|
+
paintsTypeAvailable: boolean;
|
|
14
|
+
pickerType: string;
|
|
15
|
+
solidPaint: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export declare const ColorPickerContent: (props: Props) => string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { match } from "ts-pattern";
|
|
3
|
+
import { ColorPickerCustomContent } from "./color-picker-custom-content.js";
|
|
4
|
+
import { ColorPickerContentTV } from "./tv.js";
|
|
5
|
+
const ColorPickerContent = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
features,
|
|
8
|
+
pickerType,
|
|
9
|
+
paintsType,
|
|
10
|
+
handlePaintsTypeChange,
|
|
11
|
+
paintsTypeAvailable,
|
|
12
|
+
checkColorContrast,
|
|
13
|
+
additionalTabs = [],
|
|
14
|
+
solidPaint,
|
|
15
|
+
gradientPaint,
|
|
16
|
+
imagePaint,
|
|
17
|
+
labels
|
|
18
|
+
} = props;
|
|
19
|
+
const styles = ColorPickerContentTV();
|
|
20
|
+
const renderNoAvailable = () => {
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: styles.noAvailable(),
|
|
25
|
+
style: {
|
|
26
|
+
width: features.containerWidth
|
|
27
|
+
},
|
|
28
|
+
children: "No available picker type"
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
const currentAdditionalTab = additionalTabs.find((tab) => tab.value === pickerType);
|
|
33
|
+
return match(pickerType).with("CUSTOM", () => {
|
|
34
|
+
if (!features.custom) return renderNoAvailable();
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
ColorPickerCustomContent,
|
|
37
|
+
{
|
|
38
|
+
solidPaint,
|
|
39
|
+
gradientPaint,
|
|
40
|
+
imagePaint,
|
|
41
|
+
features,
|
|
42
|
+
paintsType,
|
|
43
|
+
handlePaintsTypeChange,
|
|
44
|
+
paintsTypeAvailable,
|
|
45
|
+
checkColorContrast,
|
|
46
|
+
labels
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}).otherwise(() => {
|
|
50
|
+
if (currentAdditionalTab) {
|
|
51
|
+
return currentAdditionalTab.content;
|
|
52
|
+
}
|
|
53
|
+
return renderNoAvailable();
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
ColorPickerContent
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ColorContrast, PaintType, PaintTypeLabels, PickerFeatures } from '../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
checkColorContrast?: ColorContrast;
|
|
5
|
+
features: PickerFeatures;
|
|
6
|
+
gradientPaint?: ReactNode;
|
|
7
|
+
handlePaintsTypeChange?: (type: PaintType) => void;
|
|
8
|
+
imagePaint?: ReactNode;
|
|
9
|
+
labels?: PaintTypeLabels;
|
|
10
|
+
paintsType: PaintType;
|
|
11
|
+
paintsTypeAvailable: boolean;
|
|
12
|
+
patternPaint?: ReactNode;
|
|
13
|
+
solidPaint: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export declare const ColorPickerCustomContent: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement, cloneElement } from "react";
|
|
3
|
+
import { match } from "ts-pattern";
|
|
4
|
+
import { PaintTypeSelector } from "./paint-type-selector.js";
|
|
5
|
+
import { ColorPickerContentTV } from "./tv.js";
|
|
6
|
+
import { translation } from "../contents/translation.js";
|
|
7
|
+
const injectCheckColorContrast = (element, checkColorContrast) => {
|
|
8
|
+
if (!checkColorContrast || !isValidElement(element)) {
|
|
9
|
+
return element;
|
|
10
|
+
}
|
|
11
|
+
const elementProps = element.props;
|
|
12
|
+
if (elementProps.checkColorContrast) {
|
|
13
|
+
return element;
|
|
14
|
+
}
|
|
15
|
+
return cloneElement(element, { checkColorContrast });
|
|
16
|
+
};
|
|
17
|
+
const ColorPickerCustomContent = (props) => {
|
|
18
|
+
const {
|
|
19
|
+
features,
|
|
20
|
+
paintsTypeAvailable,
|
|
21
|
+
paintsType,
|
|
22
|
+
handlePaintsTypeChange,
|
|
23
|
+
checkColorContrast,
|
|
24
|
+
solidPaint,
|
|
25
|
+
gradientPaint,
|
|
26
|
+
imagePaint,
|
|
27
|
+
labels = {}
|
|
28
|
+
} = props;
|
|
29
|
+
const styles = ColorPickerContentTV();
|
|
30
|
+
const renderNoAvailable = () => {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: styles.noAvailable(),
|
|
35
|
+
style: {
|
|
36
|
+
width: features.containerWidth
|
|
37
|
+
},
|
|
38
|
+
children: translation.colorPicker.NO_AVAILABLE
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
PaintTypeSelector,
|
|
45
|
+
{
|
|
46
|
+
features,
|
|
47
|
+
paintsTypeAvailable,
|
|
48
|
+
className: styles.paintsType(),
|
|
49
|
+
paintsType,
|
|
50
|
+
onPaintsTypeChange: handlePaintsTypeChange,
|
|
51
|
+
showColorContrast: checkColorContrast == null ? void 0 : checkColorContrast.showColorContrast,
|
|
52
|
+
onShowColorContrast: checkColorContrast == null ? void 0 : checkColorContrast.handleShowColorContrast,
|
|
53
|
+
labels
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
match(paintsType).with("SOLID", () => {
|
|
57
|
+
if (!features.solid) return null;
|
|
58
|
+
return injectCheckColorContrast(solidPaint, checkColorContrast);
|
|
59
|
+
}).when(
|
|
60
|
+
(t) => ["GRADIENT_ANGULAR", "GRADIENT_LINEAR", "GRADIENT_RADIAL"].includes(t),
|
|
61
|
+
() => {
|
|
62
|
+
if (!features.gradient || !gradientPaint) return renderNoAvailable();
|
|
63
|
+
return gradientPaint;
|
|
64
|
+
}
|
|
65
|
+
).with("PATTERN", () => renderNoAvailable()).with("IMAGE", () => {
|
|
66
|
+
if (!imagePaint) return renderNoAvailable();
|
|
67
|
+
return imagePaint;
|
|
68
|
+
}).otherwise(() => {
|
|
69
|
+
return renderNoAvailable();
|
|
70
|
+
})
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
ColorPickerCustomContent
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './color-picker-content';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaintType, PaintTypeLabels, PickerFeatures } from '../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
className: string;
|
|
4
|
+
features: PickerFeatures;
|
|
5
|
+
labels?: PaintTypeLabels;
|
|
6
|
+
onPaintsTypeChange?: (type: PaintType) => void;
|
|
7
|
+
onShowColorContrast?: () => void;
|
|
8
|
+
paintsType: PaintType;
|
|
9
|
+
paintsTypeAvailable: boolean;
|
|
10
|
+
showColorContrast?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const PaintTypeSelector: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ToggleButton } from "../../../toggle-button/dist/index.js";
|
|
3
|
+
import { CheckColorContrast } from "@choiceform/icons-react";
|
|
4
|
+
import { ColorPaintsType } from "../color-picker-popover/color-paints-type.js";
|
|
5
|
+
import { tcx } from "../../../../shared/utils/tcx/tcx.js";
|
|
6
|
+
import { translation } from "../contents/translation.js";
|
|
7
|
+
const PaintTypeSelector = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
features,
|
|
10
|
+
paintsTypeAvailable,
|
|
11
|
+
className,
|
|
12
|
+
paintsType,
|
|
13
|
+
onPaintsTypeChange,
|
|
14
|
+
showColorContrast = false,
|
|
15
|
+
onShowColorContrast,
|
|
16
|
+
labels
|
|
17
|
+
} = props;
|
|
18
|
+
if (!features.paintsType || !paintsTypeAvailable) return null;
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: tcx("flex flex-none items-center gap-1", className), children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
ColorPaintsType,
|
|
22
|
+
{
|
|
23
|
+
value: paintsType,
|
|
24
|
+
onChange: onPaintsTypeChange,
|
|
25
|
+
labels: {
|
|
26
|
+
gradient: (labels == null ? void 0 : labels.gradient) ?? translation.type.GRADIENT,
|
|
27
|
+
image: (labels == null ? void 0 : labels.image) ?? translation.type.IMAGE,
|
|
28
|
+
pattern: (labels == null ? void 0 : labels.pattern) ?? translation.type.PATTERN,
|
|
29
|
+
solid: (labels == null ? void 0 : labels.solid) ?? translation.type.SOLID
|
|
30
|
+
},
|
|
31
|
+
features
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
paintsType === "SOLID" && features.checkColorContrast && /* @__PURE__ */ jsx(
|
|
35
|
+
ToggleButton,
|
|
36
|
+
{
|
|
37
|
+
variant: "highlight",
|
|
38
|
+
tooltip: {
|
|
39
|
+
content: (labels == null ? void 0 : labels.colorContrast) ?? translation.colorContrast.LABEL
|
|
40
|
+
},
|
|
41
|
+
value: showColorContrast,
|
|
42
|
+
onChange: onShowColorContrast,
|
|
43
|
+
children: /* @__PURE__ */ jsx(CheckColorContrast, {})
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
PaintTypeSelector
|
|
50
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const ColorPickerContentTV: import('tailwind-variants').TVReturnType<{
|
|
2
|
+
[key: string]: {
|
|
3
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
4
|
+
paintsType?: import('tailwind-merge').ClassNameValue;
|
|
5
|
+
noAvailable?: import('tailwind-merge').ClassNameValue;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
} | {
|
|
9
|
+
[x: string]: {
|
|
10
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
11
|
+
paintsType?: import('tailwind-merge').ClassNameValue;
|
|
12
|
+
noAvailable?: import('tailwind-merge').ClassNameValue;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
} | {}, {
|
|
16
|
+
noAvailable: string[];
|
|
17
|
+
paintsType: string;
|
|
18
|
+
}, undefined, {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
21
|
+
paintsType?: import('tailwind-merge').ClassNameValue;
|
|
22
|
+
noAvailable?: import('tailwind-merge').ClassNameValue;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
} | {}, {
|
|
26
|
+
noAvailable: string[];
|
|
27
|
+
paintsType: string;
|
|
28
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
29
|
+
noAvailable: string[];
|
|
30
|
+
paintsType: string;
|
|
31
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { tcv } from "../../../../shared/utils/tcx/tcx.js";
|
|
2
|
+
const ColorPickerContentTV = tcv({
|
|
3
|
+
slots: {
|
|
4
|
+
noAvailable: [
|
|
5
|
+
"grid place-items-center",
|
|
6
|
+
"bg-secondary-background text-secondary aspect-square rounded-b-xl select-none"
|
|
7
|
+
],
|
|
8
|
+
paintsType: "flex h-10 items-center gap-1 border-b px-2"
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
ColorPickerContentTV
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Paint, PaintTypeLabels } from '../types';
|
|
2
|
+
interface ColorPaintsTypeProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
features: {
|
|
5
|
+
gradient?: boolean;
|
|
6
|
+
image?: boolean;
|
|
7
|
+
pattern?: boolean;
|
|
8
|
+
solid?: boolean;
|
|
9
|
+
};
|
|
10
|
+
labels?: Omit<PaintTypeLabels, "colorContrast">;
|
|
11
|
+
onChange?: (value: Paint["type"]) => void;
|
|
12
|
+
value?: Paint["type"];
|
|
13
|
+
}
|
|
14
|
+
export declare const ColorPaintsType: import('react').MemoExoticComponent<(props: ColorPaintsTypeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton } from "../../../icon-button/dist/index.js";
|
|
3
|
+
import { ColorTypeSolid, ColorTypeGradient, ColorTypePattern, ColorTypeImage } from "@choiceform/icons-react";
|
|
4
|
+
import { memo, useMemo } from "react";
|
|
5
|
+
import { translation } from "../contents/translation.js";
|
|
6
|
+
const ColorPaintsType = memo((props) => {
|
|
7
|
+
const { value, onChange, features, labels } = props;
|
|
8
|
+
const normalizedValue = useMemo(() => {
|
|
9
|
+
return (value == null ? void 0 : value.startsWith("GRADIENT")) ? "GRADIENT_LINEAR" : value;
|
|
10
|
+
}, [value]);
|
|
11
|
+
const paintTypeConfig = useMemo(() => {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
value: "SOLID",
|
|
15
|
+
icon: /* @__PURE__ */ jsx(ColorTypeSolid, {}),
|
|
16
|
+
label: (labels == null ? void 0 : labels.solid) ?? translation.type.SOLID,
|
|
17
|
+
featureKey: "solid"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "GRADIENT_LINEAR",
|
|
21
|
+
icon: /* @__PURE__ */ jsx(ColorTypeGradient, {}),
|
|
22
|
+
label: (labels == null ? void 0 : labels.gradient) ?? translation.type.GRADIENT,
|
|
23
|
+
featureKey: "gradient"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "PATTERN",
|
|
27
|
+
icon: /* @__PURE__ */ jsx(ColorTypePattern, {}),
|
|
28
|
+
label: (labels == null ? void 0 : labels.pattern) ?? translation.type.PATTERN,
|
|
29
|
+
featureKey: "pattern"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "IMAGE",
|
|
33
|
+
icon: /* @__PURE__ */ jsx(ColorTypeImage, {}),
|
|
34
|
+
label: (labels == null ? void 0 : labels.image) ?? translation.type.IMAGE,
|
|
35
|
+
featureKey: "image"
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
}, [labels == null ? void 0 : labels.gradient, labels == null ? void 0 : labels.image, labels == null ? void 0 : labels.pattern, labels == null ? void 0 : labels.solid]);
|
|
39
|
+
const availableTypes = useMemo(() => {
|
|
40
|
+
return paintTypeConfig.filter((type) => features[type.featureKey]);
|
|
41
|
+
}, [features, paintTypeConfig]);
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-1", children: availableTypes.map((type) => /* @__PURE__ */ jsx(
|
|
43
|
+
IconButton,
|
|
44
|
+
{
|
|
45
|
+
tooltip: { content: type.label },
|
|
46
|
+
active: normalizedValue === type.value,
|
|
47
|
+
onClick: () => onChange == null ? void 0 : onChange(type.value),
|
|
48
|
+
children: type.icon
|
|
49
|
+
},
|
|
50
|
+
type.value
|
|
51
|
+
)) });
|
|
52
|
+
});
|
|
53
|
+
ColorPaintsType.displayName = "ColorPaintsType";
|
|
54
|
+
export {
|
|
55
|
+
ColorPaintsType
|
|
56
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PopoverProps } from '../../../popover/src';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
import { default as React, ReactNode } from 'react';
|
|
4
|
+
import { ColorContrast, ColorPickerLabels, Paint, PickerFeatures } from '../types';
|
|
5
|
+
import { TabItem } from './color-picker-tabs';
|
|
6
|
+
export interface ColorPickerPopoverProps extends Omit<PopoverProps, "content"> {
|
|
7
|
+
additionalTabs?: TabItem[];
|
|
8
|
+
autoUpdate?: boolean;
|
|
9
|
+
checkColorContrast?: ColorContrast;
|
|
10
|
+
className?: string;
|
|
11
|
+
features?: PickerFeatures;
|
|
12
|
+
gradientPaint?: ReactNode;
|
|
13
|
+
imagePaint?: ReactNode;
|
|
14
|
+
labels?: ColorPickerLabels;
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
onPaintsTypeChange?: (type: Paint["type"]) => void;
|
|
17
|
+
onPickerTypeChange?: (type: string) => void;
|
|
18
|
+
open: boolean;
|
|
19
|
+
paintsType?: Paint["type"];
|
|
20
|
+
pickerType?: string;
|
|
21
|
+
placement?: Placement;
|
|
22
|
+
solidPaint: ReactNode;
|
|
23
|
+
title?: string;
|
|
24
|
+
triggerRef?: React.RefObject<HTMLDivElement | HTMLFieldSetElement>;
|
|
25
|
+
}
|
|
26
|
+
export declare const ColorPickerPopover: (props: ColorPickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Popover } from "../../../popover/dist/index.js";
|
|
3
|
+
import { useEventCallback } from "usehooks-ts";
|
|
4
|
+
import { ColorPickerTitle } from "./color-picker-title.js";
|
|
5
|
+
import { useColorPickerFeatures } from "../hooks/use-features.js";
|
|
6
|
+
import { ColorPickerContent } from "../color-picker-content/color-picker-content.js";
|
|
7
|
+
const ColorPickerPopover = function ColorPickerPopover2(props) {
|
|
8
|
+
const {
|
|
9
|
+
// Base props
|
|
10
|
+
className,
|
|
11
|
+
title,
|
|
12
|
+
// Popover control
|
|
13
|
+
triggerRef,
|
|
14
|
+
open,
|
|
15
|
+
onOpenChange,
|
|
16
|
+
placement = "bottom-start",
|
|
17
|
+
autoUpdate = false,
|
|
18
|
+
// Picker type control
|
|
19
|
+
pickerType = "CUSTOM",
|
|
20
|
+
onPickerTypeChange,
|
|
21
|
+
// Paint type control
|
|
22
|
+
paintsType = "SOLID",
|
|
23
|
+
onPaintsTypeChange,
|
|
24
|
+
// Check color contrast control
|
|
25
|
+
checkColorContrast,
|
|
26
|
+
// 动态标签页
|
|
27
|
+
additionalTabs = [],
|
|
28
|
+
// Features configuration
|
|
29
|
+
features: userFeatures = {},
|
|
30
|
+
labels,
|
|
31
|
+
solidPaint,
|
|
32
|
+
gradientPaint,
|
|
33
|
+
imagePaint,
|
|
34
|
+
children,
|
|
35
|
+
...rest
|
|
36
|
+
} = props;
|
|
37
|
+
const features = {
|
|
38
|
+
containerWidth: 240,
|
|
39
|
+
spaceDropdown: true,
|
|
40
|
+
alpha: true,
|
|
41
|
+
hex: true,
|
|
42
|
+
rgb: true,
|
|
43
|
+
hsl: true,
|
|
44
|
+
hsb: true,
|
|
45
|
+
nativePicker: true,
|
|
46
|
+
presets: true,
|
|
47
|
+
pickerType: true,
|
|
48
|
+
custom: true,
|
|
49
|
+
paintsType: true,
|
|
50
|
+
solid: true,
|
|
51
|
+
gradient: true,
|
|
52
|
+
pattern: false,
|
|
53
|
+
image: true,
|
|
54
|
+
checkColorContrast: false,
|
|
55
|
+
...userFeatures
|
|
56
|
+
};
|
|
57
|
+
const handlePickerTypeChange = useEventCallback((type) => {
|
|
58
|
+
onPickerTypeChange == null ? void 0 : onPickerTypeChange(type);
|
|
59
|
+
});
|
|
60
|
+
const handlePaintsTypeChange = useEventCallback((type) => {
|
|
61
|
+
onPaintsTypeChange == null ? void 0 : onPaintsTypeChange(type);
|
|
62
|
+
});
|
|
63
|
+
const { paintsTypeAvailable, pickerTypeAvailable } = useColorPickerFeatures({
|
|
64
|
+
features,
|
|
65
|
+
paintsType,
|
|
66
|
+
onChangePaintsType: handlePaintsTypeChange,
|
|
67
|
+
pickerType,
|
|
68
|
+
onChangePickerType: handlePickerTypeChange
|
|
69
|
+
});
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
Popover,
|
|
72
|
+
{
|
|
73
|
+
...rest,
|
|
74
|
+
draggable: true,
|
|
75
|
+
triggerRef,
|
|
76
|
+
open,
|
|
77
|
+
onOpenChange,
|
|
78
|
+
placement,
|
|
79
|
+
autoUpdate,
|
|
80
|
+
children: [
|
|
81
|
+
children,
|
|
82
|
+
/* @__PURE__ */ jsx(Popover.Header, { children: /* @__PURE__ */ jsx(
|
|
83
|
+
ColorPickerTitle,
|
|
84
|
+
{
|
|
85
|
+
title,
|
|
86
|
+
features,
|
|
87
|
+
pickerTypeAvailable,
|
|
88
|
+
pickerType,
|
|
89
|
+
onChangePickerType: handlePickerTypeChange,
|
|
90
|
+
labels,
|
|
91
|
+
additionalTabs
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(
|
|
95
|
+
ColorPickerContent,
|
|
96
|
+
{
|
|
97
|
+
features,
|
|
98
|
+
pickerType,
|
|
99
|
+
paintsType,
|
|
100
|
+
paintsTypeAvailable,
|
|
101
|
+
handlePaintsTypeChange,
|
|
102
|
+
checkColorContrast,
|
|
103
|
+
additionalTabs,
|
|
104
|
+
solidPaint,
|
|
105
|
+
gradientPaint,
|
|
106
|
+
imagePaint,
|
|
107
|
+
labels
|
|
108
|
+
}
|
|
109
|
+
) })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
ColorPickerPopover
|
|
116
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface ColorPickerTabsProps {
|
|
8
|
+
additionalTabs?: TabItem[];
|
|
9
|
+
customTabLabel?: string;
|
|
10
|
+
onPickerTypeChange?: (value: string) => void;
|
|
11
|
+
pickerType: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ColorPickerTabs: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<ColorPickerTabsProps & import('react').RefAttributes<HTMLDivElement>>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as Tabs2 } from "../../../tabs/dist/index.js";
|
|
3
|
+
import { memo, forwardRef, useMemo } from "react";
|
|
4
|
+
import { translation } from "../contents/translation.js";
|
|
5
|
+
const ColorPickerTabs = memo(
|
|
6
|
+
forwardRef(function ColorPickerTabs2(props, ref) {
|
|
7
|
+
const { pickerType, onPickerTypeChange, customTabLabel, additionalTabs = [] } = props;
|
|
8
|
+
const availableTabs = useMemo(() => {
|
|
9
|
+
const tabs = [
|
|
10
|
+
{
|
|
11
|
+
value: "CUSTOM",
|
|
12
|
+
label: customTabLabel ?? translation.colorPicker.CUSTOM
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
if (additionalTabs.length > 0) {
|
|
16
|
+
additionalTabs.forEach((tab) => {
|
|
17
|
+
tabs.push({
|
|
18
|
+
value: tab.value,
|
|
19
|
+
label: tab.label
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return tabs;
|
|
24
|
+
}, [customTabLabel, additionalTabs]);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Tabs2,
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
value: pickerType,
|
|
30
|
+
onChange: (value) => onPickerTypeChange == null ? void 0 : onPickerTypeChange(value),
|
|
31
|
+
className: "ml-2",
|
|
32
|
+
children: availableTabs.map((tab) => /* @__PURE__ */ jsx(
|
|
33
|
+
Tabs2.Item,
|
|
34
|
+
{
|
|
35
|
+
value: tab.value,
|
|
36
|
+
children: tab.label
|
|
37
|
+
},
|
|
38
|
+
tab.value
|
|
39
|
+
))
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
ColorPickerTabs.displayName = "ColorPickerTabs";
|
|
45
|
+
export {
|
|
46
|
+
ColorPickerTabs
|
|
47
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PickerFeatures } from '../types/colors';
|
|
2
|
+
import { ColorPickerLabels } from '../types/paint';
|
|
3
|
+
import { TabItem } from './color-picker-tabs';
|
|
4
|
+
type Props = {
|
|
5
|
+
additionalTabs?: TabItem[];
|
|
6
|
+
features: PickerFeatures;
|
|
7
|
+
labels?: Pick<ColorPickerLabels, "custom">;
|
|
8
|
+
onChangePickerType?: (pickerType: string) => void;
|
|
9
|
+
pickerType: string;
|
|
10
|
+
pickerTypeAvailable: boolean;
|
|
11
|
+
title?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const ColorPickerTitle: (props: Props) => string | import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ColorPickerTabs } from "./color-picker-tabs.js";
|
|
3
|
+
import { translation } from "../contents/translation.js";
|
|
4
|
+
const ColorPickerTitle = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
title,
|
|
7
|
+
features,
|
|
8
|
+
labels,
|
|
9
|
+
pickerTypeAvailable,
|
|
10
|
+
pickerType,
|
|
11
|
+
onChangePickerType,
|
|
12
|
+
additionalTabs = []
|
|
13
|
+
} = props;
|
|
14
|
+
if (title) return title;
|
|
15
|
+
if (features.pickerType && pickerTypeAvailable) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
ColorPickerTabs,
|
|
18
|
+
{
|
|
19
|
+
pickerType,
|
|
20
|
+
onPickerTypeChange: onChangePickerType,
|
|
21
|
+
customTabLabel: labels == null ? void 0 : labels.custom,
|
|
22
|
+
additionalTabs
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx("div", { className: "text-body-medium font-strong ml-2 flex items-center gap-2 p-2", children: (labels == null ? void 0 : labels.custom) ?? translation.colorPicker.TITLE });
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
ColorPickerTitle
|
|
30
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const ColorPickerPopoverTV: import('tailwind-variants').TVReturnType<{
|
|
2
|
+
presets: {
|
|
3
|
+
true: {
|
|
4
|
+
popoverContainer: string;
|
|
5
|
+
};
|
|
6
|
+
false: {
|
|
7
|
+
popoverContainer: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
popoverContainer: string;
|
|
12
|
+
paintsType: string;
|
|
13
|
+
}, undefined, {
|
|
14
|
+
presets: {
|
|
15
|
+
true: {
|
|
16
|
+
popoverContainer: string;
|
|
17
|
+
};
|
|
18
|
+
false: {
|
|
19
|
+
popoverContainer: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
popoverContainer: string;
|
|
24
|
+
paintsType: string;
|
|
25
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
26
|
+
presets: {
|
|
27
|
+
true: {
|
|
28
|
+
popoverContainer: string;
|
|
29
|
+
};
|
|
30
|
+
false: {
|
|
31
|
+
popoverContainer: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
popoverContainer: string;
|
|
36
|
+
paintsType: string;
|
|
37
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { PickerSliderType } from '../types/colors';
|
|
3
|
+
export interface ColorSliderProps {
|
|
4
|
+
backgroundStyle?: CSSProperties;
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
hue?: number;
|
|
8
|
+
onChange?: (position: number) => void;
|
|
9
|
+
onChangeEnd?: () => void;
|
|
10
|
+
onChangeStart?: () => void;
|
|
11
|
+
position: number;
|
|
12
|
+
thumbSize?: number;
|
|
13
|
+
trackSize?: {
|
|
14
|
+
height?: number;
|
|
15
|
+
width?: number;
|
|
16
|
+
};
|
|
17
|
+
type: PickerSliderType;
|
|
18
|
+
}
|
|
19
|
+
export declare const ColorSlider: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<ColorSliderProps & import('react').RefAttributes<HTMLDivElement>>>;
|