From ae6b6ba1ab678bff9dfb659ceec16904c4c00cf8 Mon Sep 17 00:00:00 2001 From: Deepankar Date: Wed, 31 Mar 2021 23:52:38 +0530 Subject: [PATCH] feat(slider): add option to hide slider value (#494) * feat(slider): hideValue prop added * test(slider): test added for hideValue prop docs(slider): add hideValue prop docs(slider): add hideValue prop for cn docs feat(slider): ensure the dot stays round when no content test(slider): update snapshots --- .../__snapshots__/index.test.tsx.snap | 53 +++++++++++++++++++ components/slider/__tests__/index.test.tsx | 4 ++ components/slider/slider-dot.tsx | 1 + components/slider/slider.tsx | 5 +- pages/en-us/components/slider.mdx | 1 + pages/zh-cn/components/slider.mdx | 1 + 6 files changed, 64 insertions(+), 1 deletion(-) diff --git a/components/slider/__tests__/__snapshots__/index.test.tsx.snap b/components/slider/__tests__/__snapshots__/index.test.tsx.snap index 4ece39a33..ba772256c 100644 --- a/components/slider/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/slider/__tests__/__snapshots__/index.test.tsx.snap @@ -8,6 +8,57 @@ exports[`Slider should render correctly 1`] = ` top: 50%; transform: translate(-50%, -50%); height: 1.25rem; + min-width: 1.25rem; + line-height: 1.25rem; + border-radius: 0.625rem; + user-select: none; + font-weight: 700; + font-size: 0.75rem; + z-index: 100; + background-color: #0070f3; + color: #fff; + text-align: center; + padding: 0 calc(0.86 * 8pt); + } + + .dot.disabled { + cursor: not-allowed !important; + background-color: #eaeaea; + color: #888; + } + + .dot.click { + transition: all 200ms ease; + } + + .dot:hover { + cursor: grab; + } + + .dot:active { + cursor: grabbing; + } + " +`; + +exports[`Slider should work with hideValue 1`] = ` +"