@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,42 @@
|
|
|
1
|
+
import { PaletteType, RGB, RGBA, Transform } from '../types/colors';
|
|
2
|
+
export declare const PAGE_BACKGROUND_LIGHT: RGBA;
|
|
3
|
+
export declare const PAGE_BACKGROUND_DARK: RGBA;
|
|
4
|
+
export declare const PRIMARY: RGB;
|
|
5
|
+
export declare const PRIMARY_RGBA: RGBA;
|
|
6
|
+
export declare const COLOR_SWATCH_INNER_SIZE = 14;
|
|
7
|
+
export declare const COLOR_SWATCH_SIZE = 16;
|
|
8
|
+
export declare const SELECTION_COLORS_PREVIEW_ITEMS = 3;
|
|
9
|
+
export declare const PRIMARY_COLOR = "#0d99ff";
|
|
10
|
+
export declare const COMPONENT_COLOR = "#8638e5";
|
|
11
|
+
export declare const AI_COLOR = "#14ae5c";
|
|
12
|
+
export declare const MAGENTA_COLOR = "#ff00ff";
|
|
13
|
+
export declare const GRAY_COLOR = "#a3a3a3";
|
|
14
|
+
export declare const SNAP_COLOR = "#ff3100";
|
|
15
|
+
export declare const DEFAULT_COLOR: RGB;
|
|
16
|
+
export declare const DEFAULT_ALPHA = 1;
|
|
17
|
+
export declare const DEFAULT_GRADIENT_TRANSFORM: Transform;
|
|
18
|
+
export declare const WHITE: RGB;
|
|
19
|
+
export declare const WHITE_RGBA: RGBA;
|
|
20
|
+
export declare const GRAY: RGB;
|
|
21
|
+
export declare const GRAY_RGBA: RGBA;
|
|
22
|
+
export declare const BLACK_RGBA: RGBA;
|
|
23
|
+
export declare const BLACK: RGB;
|
|
24
|
+
export declare const SEMI_TRANSPARENT_BLACK: RGBA;
|
|
25
|
+
export declare const SLATE_COLORS: RGB[];
|
|
26
|
+
export declare const RED_COLORS: RGB[];
|
|
27
|
+
export declare const PINK_COLORS: RGB[];
|
|
28
|
+
export declare const PURPLE_COLORS: RGB[];
|
|
29
|
+
export declare const BLUE_COLORS: RGB[];
|
|
30
|
+
export declare const GREEN_COLORS: RGB[];
|
|
31
|
+
export declare const BROWN_COLORS: RGB[];
|
|
32
|
+
export declare const ORANGE_COLORS: RGB[];
|
|
33
|
+
export declare const YELLOW_COLORS: RGB[];
|
|
34
|
+
export declare const SKY_COLORS: RGB[];
|
|
35
|
+
export declare const DEFAULT_COLORS: Array<{
|
|
36
|
+
colors: RGB[];
|
|
37
|
+
id: PaletteType;
|
|
38
|
+
}>;
|
|
39
|
+
/** 网格颜色 */
|
|
40
|
+
export declare const GRID_COLOR = "hsla(0, 0%, 0%, 0.1)";
|
|
41
|
+
/** 默认的边框颜色 */
|
|
42
|
+
export declare const DEFAULT_BORDER_COLOR: RGB;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const DEFAULT_COLOR = { r: 0, g: 85, b: 255 };
|
|
2
|
+
const DEFAULT_ALPHA = 1;
|
|
3
|
+
const DEFAULT_GRADIENT_TRANSFORM = [
|
|
4
|
+
[1, 0, 0],
|
|
5
|
+
[0, 1, 0]
|
|
6
|
+
];
|
|
7
|
+
const BLACK_RGBA = {
|
|
8
|
+
r: 0,
|
|
9
|
+
g: 0,
|
|
10
|
+
b: 0,
|
|
11
|
+
a: 1
|
|
12
|
+
};
|
|
13
|
+
const BLACK = {
|
|
14
|
+
r: 0,
|
|
15
|
+
g: 0,
|
|
16
|
+
b: 0
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
BLACK,
|
|
20
|
+
BLACK_RGBA,
|
|
21
|
+
DEFAULT_ALPHA,
|
|
22
|
+
DEFAULT_COLOR,
|
|
23
|
+
DEFAULT_GRADIENT_TRANSFORM
|
|
24
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export declare const translation: {
|
|
2
|
+
common: {
|
|
3
|
+
SEARCH: string;
|
|
4
|
+
NO_MATCH: string;
|
|
5
|
+
};
|
|
6
|
+
area: {
|
|
7
|
+
ARIA_LABEL: string;
|
|
8
|
+
};
|
|
9
|
+
slider: {
|
|
10
|
+
ARIA_LABEL: string;
|
|
11
|
+
};
|
|
12
|
+
channels: {
|
|
13
|
+
RED: string;
|
|
14
|
+
GREEN: string;
|
|
15
|
+
BLUE: string;
|
|
16
|
+
ALPHA: string;
|
|
17
|
+
HUE: string;
|
|
18
|
+
SATURATION: string;
|
|
19
|
+
LIGHTNESS: string;
|
|
20
|
+
BRIGHTNESS: string;
|
|
21
|
+
};
|
|
22
|
+
channelField: {
|
|
23
|
+
EMPTY: string;
|
|
24
|
+
};
|
|
25
|
+
gradients: {
|
|
26
|
+
STOP: string;
|
|
27
|
+
STOP_POSITION: string;
|
|
28
|
+
ADD_STOP: string;
|
|
29
|
+
DELETE_STOP: string;
|
|
30
|
+
LINEAR: string;
|
|
31
|
+
RADIAL: string;
|
|
32
|
+
CONIC: string;
|
|
33
|
+
ROTATE_GRADIENT: string;
|
|
34
|
+
FLIP_GRADIENT: string;
|
|
35
|
+
};
|
|
36
|
+
type: {
|
|
37
|
+
SOLID: string;
|
|
38
|
+
GRADIENT: string;
|
|
39
|
+
PATTERN: string;
|
|
40
|
+
IMAGE: string;
|
|
41
|
+
};
|
|
42
|
+
colorContrast: {
|
|
43
|
+
LABEL: string;
|
|
44
|
+
BACKGROUND_COLOR: string;
|
|
45
|
+
FOREGROUND_COLOR: string;
|
|
46
|
+
STANDARD: string;
|
|
47
|
+
VIEW_COLOR_VALUES: string;
|
|
48
|
+
NOT_MEET_STANDARD: string;
|
|
49
|
+
CONTRAST_SETTINGS: string;
|
|
50
|
+
category: {
|
|
51
|
+
LABEL: string;
|
|
52
|
+
auto: {
|
|
53
|
+
TEXT: string;
|
|
54
|
+
GRAPHICS: string;
|
|
55
|
+
};
|
|
56
|
+
LARGE_TEXT: string;
|
|
57
|
+
NORMAL_TEXT: string;
|
|
58
|
+
GRAPHICS: string;
|
|
59
|
+
};
|
|
60
|
+
level: {
|
|
61
|
+
LABEL: string;
|
|
62
|
+
AA: {
|
|
63
|
+
TEXT: string;
|
|
64
|
+
GRAPHICS: string;
|
|
65
|
+
};
|
|
66
|
+
AAA: {
|
|
67
|
+
TEXT: string;
|
|
68
|
+
LARGE_TEXT: string;
|
|
69
|
+
GRAPHICS: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
colorNativePicker: {
|
|
74
|
+
PICK_COLOR: string;
|
|
75
|
+
ALERT: string;
|
|
76
|
+
};
|
|
77
|
+
input: {
|
|
78
|
+
SOLID: string;
|
|
79
|
+
ALPHA: string;
|
|
80
|
+
gradient: {
|
|
81
|
+
LINEAR: string;
|
|
82
|
+
RADIAL: string;
|
|
83
|
+
CONIC: string;
|
|
84
|
+
};
|
|
85
|
+
IMAGE: string;
|
|
86
|
+
VARIABLE: string;
|
|
87
|
+
};
|
|
88
|
+
libraries: {
|
|
89
|
+
LABEL: string;
|
|
90
|
+
SWITCH_TO_GRID: string;
|
|
91
|
+
SWITCH_TO_LIST: string;
|
|
92
|
+
ALL: string;
|
|
93
|
+
};
|
|
94
|
+
colorPicker: {
|
|
95
|
+
TITLE: string;
|
|
96
|
+
CUSTOM: string;
|
|
97
|
+
LIBRARIES: string;
|
|
98
|
+
NO_AVAILABLE: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const translation = {
|
|
2
|
+
common: {
|
|
3
|
+
SEARCH: "Search..."
|
|
4
|
+
},
|
|
5
|
+
area: {
|
|
6
|
+
ARIA_LABEL: "Color area navigation"
|
|
7
|
+
},
|
|
8
|
+
slider: {
|
|
9
|
+
ARIA_LABEL: "Color slider navigation"
|
|
10
|
+
},
|
|
11
|
+
channels: {
|
|
12
|
+
RED: "Red",
|
|
13
|
+
GREEN: "Green",
|
|
14
|
+
BLUE: "Blue",
|
|
15
|
+
ALPHA: "Alpha",
|
|
16
|
+
HUE: "Hue",
|
|
17
|
+
SATURATION: "Saturation",
|
|
18
|
+
LIGHTNESS: "Lightness",
|
|
19
|
+
BRIGHTNESS: "Brightness"
|
|
20
|
+
},
|
|
21
|
+
channelField: {
|
|
22
|
+
EMPTY: "No color space available"
|
|
23
|
+
},
|
|
24
|
+
gradients: {
|
|
25
|
+
STOP: "Stop",
|
|
26
|
+
STOP_POSITION: "Gradient stop position",
|
|
27
|
+
ADD_STOP: "Add gradient stop",
|
|
28
|
+
DELETE_STOP: "Delete gradient stop",
|
|
29
|
+
LINEAR: "Linear",
|
|
30
|
+
RADIAL: "Radial",
|
|
31
|
+
CONIC: "Conic",
|
|
32
|
+
ROTATE_GRADIENT: "Rotate gradient",
|
|
33
|
+
FLIP_GRADIENT: "Flip gradient"
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
SOLID: "Solid",
|
|
37
|
+
GRADIENT: "Gradient",
|
|
38
|
+
PATTERN: "Pattern",
|
|
39
|
+
IMAGE: "Image"
|
|
40
|
+
},
|
|
41
|
+
colorContrast: {
|
|
42
|
+
LABEL: "Check color contrast",
|
|
43
|
+
BACKGROUND_COLOR: "Background color",
|
|
44
|
+
FOREGROUND_COLOR: "Foreground color",
|
|
45
|
+
VIEW_COLOR_VALUES: "View color values",
|
|
46
|
+
NOT_MEET_STANDARD: "Contrast standard not met",
|
|
47
|
+
CONTRAST_SETTINGS: "Contrast settings",
|
|
48
|
+
category: {
|
|
49
|
+
LABEL: "Category",
|
|
50
|
+
auto: {
|
|
51
|
+
TEXT: "Auto (normal text)",
|
|
52
|
+
GRAPHICS: "Auto (graphics)"
|
|
53
|
+
},
|
|
54
|
+
LARGE_TEXT: "Large text",
|
|
55
|
+
NORMAL_TEXT: "Normal text",
|
|
56
|
+
GRAPHICS: "Graphics"
|
|
57
|
+
},
|
|
58
|
+
level: {
|
|
59
|
+
LABEL: "Level",
|
|
60
|
+
AA: {
|
|
61
|
+
TEXT: "AA / Essential (4.5:1)",
|
|
62
|
+
GRAPHICS: "AA / Essential (3:1)"
|
|
63
|
+
},
|
|
64
|
+
AAA: {
|
|
65
|
+
TEXT: "AAA / Highest (7:1)",
|
|
66
|
+
LARGE_TEXT: "AAA / Highest (4.5:1)",
|
|
67
|
+
GRAPHICS: "AAA / Only for text"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
colorNativePicker: {
|
|
72
|
+
PICK_COLOR: "Pick color",
|
|
73
|
+
ALERT: "Your browser does not support the EyeDropper API. Please use Chrome, Edge or Opera."
|
|
74
|
+
},
|
|
75
|
+
input: {
|
|
76
|
+
SOLID: "Add...",
|
|
77
|
+
ALPHA: "Alpha",
|
|
78
|
+
VARIABLE: "Select variable..."
|
|
79
|
+
},
|
|
80
|
+
libraries: {
|
|
81
|
+
LABEL: "Library color swatch select",
|
|
82
|
+
SWITCH_TO_GRID: "Switch to grid view",
|
|
83
|
+
SWITCH_TO_LIST: "Switch to list view",
|
|
84
|
+
ALL: "All Libraries"
|
|
85
|
+
},
|
|
86
|
+
colorPicker: {
|
|
87
|
+
TITLE: "Color Picker",
|
|
88
|
+
CUSTOM: "Custom",
|
|
89
|
+
NO_AVAILABLE: "No available paints type"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
translation
|
|
94
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ColorProfile } from '../types';
|
|
3
|
+
interface ColorsContextType {
|
|
4
|
+
colorProfile: ColorProfile;
|
|
5
|
+
isWideGamutSupported: boolean;
|
|
6
|
+
setUserPreference: (profile: ColorProfile | null) => void;
|
|
7
|
+
userPreference: ColorProfile | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColorsContext: import('react').Context<ColorsContextType>;
|
|
10
|
+
export interface ColorsProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** 初始用户偏好设置 */
|
|
13
|
+
defaultUserPreference?: ColorProfile | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 颜色配置 Provider - 提供广色域检测和用户偏好设置
|
|
17
|
+
*/
|
|
18
|
+
export declare function ColorsProvider({ children, defaultUserPreference }: ColorsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* 使用颜色配置的钩子 - 从 Context 中获取颜色配置信息
|
|
21
|
+
* @returns 颜色配置相关信息和操作方法
|
|
22
|
+
*/
|
|
23
|
+
export declare const useColors: () => ColorsContextType;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useState, useEffect, useMemo, useCallback } from "react";
|
|
3
|
+
const defaultContextValue = {
|
|
4
|
+
colorProfile: "srgb",
|
|
5
|
+
isWideGamutSupported: false,
|
|
6
|
+
userPreference: null,
|
|
7
|
+
setUserPreference: () => {
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const ColorsContext = createContext(defaultContextValue);
|
|
11
|
+
const checkDisplayP3Support = () => {
|
|
12
|
+
if (typeof window === "undefined") return false;
|
|
13
|
+
if (!window.CSS || !CSS.supports) return false;
|
|
14
|
+
try {
|
|
15
|
+
if (!CSS.supports("color", "color(display-p3 0 0 0)")) return false;
|
|
16
|
+
const el = document.createElement("div");
|
|
17
|
+
el.style.display = "none";
|
|
18
|
+
document.body.appendChild(el);
|
|
19
|
+
el.style.color = "color(display-p3 1 0 0)";
|
|
20
|
+
const computed = getComputedStyle(el).color;
|
|
21
|
+
document.body.removeChild(el);
|
|
22
|
+
return computed !== "rgb(255, 0, 0)";
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function ColorsProvider({ children, defaultUserPreference = null }) {
|
|
28
|
+
const [isWideGamutSupported, setIsWideGamutSupported] = useState(false);
|
|
29
|
+
const [userPreference, setUserPreference] = useState(defaultUserPreference);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setIsWideGamutSupported(checkDisplayP3Support());
|
|
32
|
+
}, []);
|
|
33
|
+
const colorProfile = useMemo(() => {
|
|
34
|
+
if (userPreference) return userPreference;
|
|
35
|
+
return isWideGamutSupported ? "display-p3" : "srgb";
|
|
36
|
+
}, [userPreference, isWideGamutSupported]);
|
|
37
|
+
const handleSetUserPreference = useCallback((profile) => {
|
|
38
|
+
setUserPreference(profile);
|
|
39
|
+
}, []);
|
|
40
|
+
const value = useMemo(
|
|
41
|
+
() => ({
|
|
42
|
+
colorProfile,
|
|
43
|
+
isWideGamutSupported,
|
|
44
|
+
userPreference,
|
|
45
|
+
setUserPreference: handleSetUserPreference
|
|
46
|
+
}),
|
|
47
|
+
[colorProfile, isWideGamutSupported, userPreference, handleSetUserPreference]
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ jsx(ColorsContext.Provider, { value, children });
|
|
50
|
+
}
|
|
51
|
+
const useColors = () => {
|
|
52
|
+
const context = useContext(ColorsContext);
|
|
53
|
+
if (context === void 0) {
|
|
54
|
+
throw new Error("useColors must be used within a ColorsProvider");
|
|
55
|
+
}
|
|
56
|
+
return context;
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
ColorsContext,
|
|
60
|
+
ColorsProvider,
|
|
61
|
+
useColors
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './colots-context';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PressMoveProps } from '../../../../../../shared/src';
|
|
2
|
+
export interface AlphaInputProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onChange?: (alpha: number) => void;
|
|
7
|
+
onPressEnd?: PressMoveProps["onPressEnd"];
|
|
8
|
+
onPressStart?: PressMoveProps["onPressStart"];
|
|
9
|
+
tooltipLabel?: string;
|
|
10
|
+
value?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const AlphaInput: import('react').ForwardRefExoticComponent<AlphaInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NumericInput } from "../../../numeric-input/dist/index.js";
|
|
3
|
+
import { Relative } from "@choiceform/icons-react";
|
|
4
|
+
import { round } from "es-toolkit";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { useEventCallback } from "usehooks-ts";
|
|
7
|
+
import { alphaInputTv } from "./tv.js";
|
|
8
|
+
import { tcx } from "../../../../shared/utils/tcx/tcx.js";
|
|
9
|
+
import { translation } from "../contents/translation.js";
|
|
10
|
+
const AlphaInput = forwardRef(
|
|
11
|
+
function IfAlphaInput(props, ref) {
|
|
12
|
+
const { value, onChange, disabled, active, className, tooltipLabel, ...rest } = props;
|
|
13
|
+
const handleChange = useEventCallback((value2) => {
|
|
14
|
+
if (typeof value2 === "number") {
|
|
15
|
+
onChange == null ? void 0 : onChange(value2 / 100);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const styles = alphaInputTv({
|
|
19
|
+
active,
|
|
20
|
+
disabled
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
NumericInput,
|
|
24
|
+
{
|
|
25
|
+
tooltip: {
|
|
26
|
+
content: tooltipLabel ?? translation.input.ALPHA
|
|
27
|
+
},
|
|
28
|
+
ref,
|
|
29
|
+
classNames: {
|
|
30
|
+
container: tcx(styles.root(), className),
|
|
31
|
+
input: styles.input()
|
|
32
|
+
},
|
|
33
|
+
disabled,
|
|
34
|
+
max: 100,
|
|
35
|
+
min: 0,
|
|
36
|
+
onChange: handleChange,
|
|
37
|
+
value: round((value ?? 1) * 100, 0),
|
|
38
|
+
variant: "reset",
|
|
39
|
+
...rest,
|
|
40
|
+
children: /* @__PURE__ */ jsx(NumericInput.Suffix, { className: styles.suffix(), children: /* @__PURE__ */ jsx(Relative, {}) })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
AlphaInput.displayName = "AlphaInput";
|
|
46
|
+
export {
|
|
47
|
+
AlphaInput
|
|
48
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PressMoveProps } from '../../../../../../shared/src';
|
|
2
|
+
import { RGB } from '../types/colors';
|
|
3
|
+
export interface ColorInputProps {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
alpha?: number;
|
|
6
|
+
alphaTooltipLabel?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
classNames?: {
|
|
10
|
+
alpha?: string;
|
|
11
|
+
container?: string;
|
|
12
|
+
hex?: string;
|
|
13
|
+
swatch?: string;
|
|
14
|
+
wrapper?: string;
|
|
15
|
+
};
|
|
16
|
+
color?: RGB;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
features?: {
|
|
19
|
+
alpha?: boolean;
|
|
20
|
+
};
|
|
21
|
+
onAlphaChange?: (alpha: number) => void;
|
|
22
|
+
onAlphaChangeEnd?: PressMoveProps["onPressEnd"];
|
|
23
|
+
onAlphaChangeStart?: PressMoveProps["onPressStart"];
|
|
24
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
onColorChange?: (color: RGB) => void;
|
|
26
|
+
onFocus?: () => void;
|
|
27
|
+
onPickerClick?: () => void;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const ColorInput: import('react').ForwardRefExoticComponent<ColorInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useEventCallback } from "usehooks-ts";
|
|
4
|
+
import { AlphaInput } from "./alpha-input.js";
|
|
5
|
+
import { fillInputTv } from "./tv.js";
|
|
6
|
+
import { ColorSwatch } from "../color-swatch/color-swatch.js";
|
|
7
|
+
import { HexInput } from "../hex-input/hex-input.js";
|
|
8
|
+
import { translation } from "../contents/translation.js";
|
|
9
|
+
import { tcx } from "../../../../shared/utils/tcx/tcx.js";
|
|
10
|
+
const ColorInput = forwardRef(
|
|
11
|
+
function ColorInput2(props, ref) {
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
classNames,
|
|
15
|
+
alpha,
|
|
16
|
+
alphaTooltipLabel,
|
|
17
|
+
color,
|
|
18
|
+
active,
|
|
19
|
+
disabled,
|
|
20
|
+
selected,
|
|
21
|
+
onAlphaChange,
|
|
22
|
+
onAlphaChangeEnd,
|
|
23
|
+
onAlphaChangeStart,
|
|
24
|
+
onClick,
|
|
25
|
+
onFocus,
|
|
26
|
+
onColorChange,
|
|
27
|
+
onPickerClick,
|
|
28
|
+
placeholder = translation.input.SOLID,
|
|
29
|
+
features = {
|
|
30
|
+
alpha: true
|
|
31
|
+
}
|
|
32
|
+
} = props;
|
|
33
|
+
const handleClick = useEventCallback((e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
onClick == null ? void 0 : onClick(e);
|
|
36
|
+
});
|
|
37
|
+
const handleSwatchMouseDown = useEventCallback((e) => {
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
onPickerClick == null ? void 0 : onPickerClick();
|
|
40
|
+
});
|
|
41
|
+
const handleLabelMouseDown = useEventCallback((e) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
if (disabled) return;
|
|
44
|
+
onPickerClick == null ? void 0 : onPickerClick();
|
|
45
|
+
onColorChange == null ? void 0 : onColorChange({ r: 250, g: 250, b: 250 });
|
|
46
|
+
});
|
|
47
|
+
const styles = fillInputTv({
|
|
48
|
+
type: "SOLID",
|
|
49
|
+
alpha: features.alpha,
|
|
50
|
+
selected,
|
|
51
|
+
active,
|
|
52
|
+
variantType: "VARIABLE",
|
|
53
|
+
empty: !color
|
|
54
|
+
});
|
|
55
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: tcx(styles.root(), classNames == null ? void 0 : classNames.container, className),
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
onMouseDown: (e) => {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: styles.wrapper(), children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
ColorSwatch,
|
|
68
|
+
{
|
|
69
|
+
className: tcx(styles.swatch(), classNames == null ? void 0 : classNames.swatch),
|
|
70
|
+
color,
|
|
71
|
+
alpha,
|
|
72
|
+
onMouseDown: handleSwatchMouseDown
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
color ? /* @__PURE__ */ jsx(
|
|
76
|
+
HexInput,
|
|
77
|
+
{
|
|
78
|
+
className: tcx(styles.hex(), classNames == null ? void 0 : classNames.hex),
|
|
79
|
+
value: color,
|
|
80
|
+
onChange: onColorChange,
|
|
81
|
+
onAlphaChange,
|
|
82
|
+
disabled,
|
|
83
|
+
onFocus
|
|
84
|
+
}
|
|
85
|
+
) : /* @__PURE__ */ jsx(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
className: tcx(styles.label(), "flex h-full w-full items-center pl-2"),
|
|
89
|
+
onMouseDown: handleLabelMouseDown,
|
|
90
|
+
children: placeholder
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }),
|
|
94
|
+
features.alpha && /* @__PURE__ */ jsx(
|
|
95
|
+
AlphaInput,
|
|
96
|
+
{
|
|
97
|
+
className: tcx(styles.alpha(), classNames == null ? void 0 : classNames.alpha),
|
|
98
|
+
value: alpha,
|
|
99
|
+
onChange: onAlphaChange,
|
|
100
|
+
active,
|
|
101
|
+
disabled,
|
|
102
|
+
onPressEnd: onAlphaChangeEnd,
|
|
103
|
+
onPressStart: onAlphaChangeStart,
|
|
104
|
+
tooltipLabel: alphaTooltipLabel
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
ColorInput.displayName = "ColorInput";
|
|
113
|
+
export {
|
|
114
|
+
ColorInput
|
|
115
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GradientFillLabels, GradientPaint } from '../types/paint';
|
|
2
|
+
export interface GradientItemProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
alpha?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
classNames?: {
|
|
7
|
+
alpha?: string;
|
|
8
|
+
container?: string;
|
|
9
|
+
content?: string;
|
|
10
|
+
swatch?: string;
|
|
11
|
+
wrapper?: string;
|
|
12
|
+
};
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
features?: {
|
|
15
|
+
alpha?: boolean;
|
|
16
|
+
};
|
|
17
|
+
gradient?: GradientPaint;
|
|
18
|
+
labels?: GradientFillLabels;
|
|
19
|
+
onAlphaChange?: (alpha: number) => void;
|
|
20
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
21
|
+
onGradientChange?: (gradient: GradientPaint) => void;
|
|
22
|
+
onPickerClick?: () => void;
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const GradientItem: import('react').ForwardRefExoticComponent<GradientItemProps & import('react').RefAttributes<HTMLDivElement>>;
|