@chayns-components/core 5.0.0-beta.535 → 5.0.0-beta.536

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.
@@ -7,10 +7,14 @@ type StyledSliderInputProps = WithTheme<{
7
7
  $value: number;
8
8
  $isInterval: boolean;
9
9
  }>;
10
- export declare const StyledSliderInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, StyledSliderInputProps>>;
10
+ export declare const StyledSliderInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
11
+ ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
12
+ }>, StyledSliderInputProps>, never>>;
11
13
  type StyledSliderThumbProps = WithTheme<{
12
14
  $position: number;
13
15
  }>;
14
- export declare const StyledSliderThumb: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderThumbProps>>;
16
+ export declare const StyledSliderThumb: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
18
+ }>, StyledSliderThumbProps>, never>>;
15
19
  export declare const StyledSliderThumbLabel: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>;
16
20
  export {};
@@ -1,4 +1,4 @@
1
- import styled, { css } from 'styled-components';
1
+ import styled from 'styled-components';
2
2
  export const StyledSlider = styled.div`
3
3
  width: 100%;
4
4
  height: 30px;
@@ -7,33 +7,18 @@ export const StyledSlider = styled.div`
7
7
  display: flex;
8
8
  align-items: center;
9
9
  `;
10
- export const StyledSliderInput = styled.input`
11
- position: absolute;
12
- width: 100%;
13
- border-radius: 100px;
14
- -webkit-appearance: none;
15
- height: 10px;
16
- outline: none;
17
- cursor: pointer !important;
18
- z-index: 2;
19
- appearance: none;
20
- pointer-events: ${_ref => {
21
- let {
22
- $isInterval
23
- } = _ref;
24
- return $isInterval ? 'none' : 'all';
25
- }};
26
-
27
- ${_ref2 => {
10
+ export const StyledSliderInput = styled.input.attrs(_ref => {
28
11
  let {
29
12
  $isInterval,
30
- theme,
13
+ $value,
31
14
  $min,
32
15
  $max,
33
- $value
34
- } = _ref2;
35
- return !$isInterval && css`
36
- background: ${`linear-gradient(
16
+ theme
17
+ } = _ref;
18
+ return {
19
+ style: {
20
+ pointerEvents: $isInterval ? 'none' : 'all',
21
+ background: !$isInterval ? `linear-gradient(
37
22
  to right,
38
23
  ${theme['409'] ?? ''} 0%,
39
24
  ${theme['409'] ?? ''}
@@ -41,9 +26,19 @@ export const StyledSliderInput = styled.input`
41
26
  ${theme['403'] ?? ''}
42
27
  ${($value - $min) / ($max - $min) * 100}%,
43
28
  ${theme['403'] ?? ''}
44
- )`};
45
- `;
46
- }}
29
+ )` : undefined
30
+ }
31
+ };
32
+ })`
33
+ position: absolute;
34
+ width: 100%;
35
+ border-radius: 100px;
36
+ -webkit-appearance: none;
37
+ height: 10px;
38
+ outline: none;
39
+ cursor: pointer !important;
40
+ z-index: 2;
41
+ appearance: none;
47
42
 
48
43
  // Slider thumb for chrome
49
44
  &::-webkit-slider-thumb {
@@ -58,6 +53,7 @@ export const StyledSliderInput = styled.input`
58
53
  }
59
54
 
60
55
  // slider thumb for firefox
56
+
61
57
  &::-moz-range-thumb {
62
58
  width: 20px;
63
59
  height: 20px;
@@ -67,26 +63,25 @@ export const StyledSliderInput = styled.input`
67
63
  position: relative;
68
64
  }
69
65
  `;
70
- export const StyledSliderThumb = styled.div`
71
- min-width: 20px;
72
- height: 20px;
73
- background-color: ${_ref3 => {
66
+ export const StyledSliderThumb = styled.div.attrs(_ref2 => {
74
67
  let {
68
+ $position,
75
69
  theme
76
- } = _ref3;
77
- return theme['100'];
78
- }};
70
+ } = _ref2;
71
+ return {
72
+ style: {
73
+ left: `${$position}px`,
74
+ backgroundColor: theme['100']
75
+ }
76
+ };
77
+ })`
78
+ min-width: 20px;
79
+ height: 20px;
79
80
  cursor: pointer;
80
81
  border-radius: 100px;
81
82
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
82
83
  pointer-events: none;
83
84
  z-index: 3;
84
- left: ${_ref4 => {
85
- let {
86
- $position
87
- } = _ref4;
88
- return $position;
89
- }}px;
90
85
  position: absolute;
91
86
  display: flex;
92
87
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.styles.js","names":["styled","css","StyledSlider","div","StyledSliderInput","input","_ref","$isInterval","_ref2","theme","$min","$max","$value","StyledSliderThumb","_ref3","_ref4","$position","StyledSliderThumbLabel","span"],"sources":["../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSlider = styled.div`\n width: 100%;\n height: 30px;\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n`;\n\ntype StyledSliderInputProps = WithTheme<{\n $min: number;\n $max: number;\n $value: number;\n $isInterval: boolean;\n}>;\n\nexport const StyledSliderInput = styled.input<StyledSliderInputProps>`\n position: absolute;\n width: 100%;\n border-radius: 100px;\n -webkit-appearance: none;\n height: 10px;\n outline: none;\n cursor: pointer !important;\n z-index: 2;\n appearance: none;\n pointer-events: ${({ $isInterval }) => ($isInterval ? 'none' : 'all')};\n\n ${({ $isInterval, theme, $min, $max, $value }: StyledSliderInputProps) =>\n !$isInterval &&\n css`\n background: ${`linear-gradient(\n to right,\n ${theme['409'] ?? ''} 0%,\n ${theme['409'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${theme['403'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${theme['403'] ?? ''}\n )`};\n `}\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n\n // slider thumb for firefox\n &::-moz-range-thumb {\n width: 20px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n`;\n\ntype StyledSliderThumbProps = WithTheme<{ $position: number }>;\n\nexport const StyledSliderThumb = styled.div<StyledSliderThumbProps>`\n min-width: 20px;\n height: 20px;\n background-color: ${({ theme }: StyledSliderThumbProps) => theme['100']};\n cursor: pointer;\n border-radius: 100px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n pointer-events: none;\n z-index: 3;\n left: ${({ $position }) => $position}px;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 8px;\n white-space: nowrap;\n`;\n\nexport const StyledSliderThumbLabel = styled.span`\n pointer-events: none;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,OAAO,MAAMC,YAAY,GAAGF,MAAM,CAACG,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AASD,OAAO,MAAMC,iBAAiB,GAAGJ,MAAM,CAACK,KAA8B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBC,IAAA;EAAA,IAAC;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yledSlider","div","StyledSliderInput","input","attrs","_ref","$isInterval","$value","$min","$max","theme","style","pointerEvents","background","undefined","StyledSliderThumb","_ref2","$position","left","backgroundColor","StyledSliderThumbLabel","span"],"sources":["../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { Theme, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSlider = styled.div`\n width: 100%;\n height: 30px;\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n`;\n\ntype StyledSliderInputProps = WithTheme<{\n $min: number;\n $max: number;\n $value: number;\n $isInterval: boolean;\n}>;\n\nexport const StyledSliderInput = styled.input.attrs<StyledSliderInputProps>(\n ({ $isInterval, $value, $min, $max, theme }) => ({\n style: {\n pointerEvents: $isInterval ? 'none' : 'all',\n background: !$isInterval\n ? `linear-gradient(\n to right,\n ${(theme as Theme)['409'] ?? ''} 0%,\n ${(theme as Theme)['409'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n )`\n : undefined,\n },\n }),\n)`\n position: absolute;\n width: 100%;\n border-radius: 100px;\n -webkit-appearance: none;\n height: 10px;\n outline: none;\n cursor: pointer !important;\n z-index: 2;\n appearance: none;\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n\n // slider thumb for firefox\n\n &::-moz-range-thumb {\n width: 20px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n`;\n\ntype StyledSliderThumbProps = WithTheme<{ $position: number }>;\n\nexport const StyledSliderThumb = styled.div.attrs<StyledSliderThumbProps>(\n ({ $position, theme }) => ({\n style: {\n left: `${$position}px`,\n backgroundColor: (theme as Theme)['100'],\n },\n }),\n)`\n min-width: 20px;\n height: 20px;\n cursor: pointer;\n border-radius: 100px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n pointer-events: none;\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 8px;\n white-space: nowrap;\n`;\n\nexport const StyledSliderThumbLabel = styled.span`\n pointer-events: none;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAGtC,OAAO,MAAMC,YAAY,GAAGD,MAAM,CAACE,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AASD,OAAO,MAAMC,iBAAiB,GAAGH,MAAM,CAACI,KAAK,CAACC,KAAK,CAC/CC,IAAA;EAAA,IAAC;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAAL,IAAA;EAAA,OAAM;IAC7CM,KAAK,EAAE;MACHC,aAAa,EAAEN,WAAW,GAAG,MAAM,GAAG,KAAK;MAC3CO,UAAU,EAAE,CAACP,WAAW,GACjB;AACnB;AACA,cAAeI,KAAK,CAAW,KAAK,CAAC,IAAI,EAAG;AAC5C,cAAeA,KAAK,CAAW,KAAK,CAAC,IAAI,EAAG;AAC5C,cAAe,CAACH,MAAM,GAAGC,IAAI,KAAKC,IAAI,GAAGD,IAAI,CAAC,GAAI,GAAI;AACtD,cAAeE,KAAK,CAAW,KAAK,CAAC,IAAI,EAAG;AAC5C,cAAe,CAACH,MAAM,GAAGC,IAAI,KAAKC,IAAI,GAAGD,IAAI,CAAC,GAAI,GAAI;AACtD,cAAeE,KAAK,CAAW,KAAK,CAAC,IAAI,EAAG;AAC5C,UAAU,GACQI;IACV;EACJ,CAAC;AAAA,CACL,CAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,OAAO,MAAMC,iBAAiB,GAAGhB,MAAM,CAACE,GAAG,CAACG,KAAK,CAC7CY,KAAA;EAAA,IAAC;IAAEC,SAAS;IAAEP;EAAM,CAAC,GAAAM,KAAA;EAAA,OAAM;IACvBL,KAAK,EAAE;MACHO,IAAI,EAAG,GAAED,SAAU,IAAG;MACtBE,eAAe,EAAGT,KAAK,CAAW,KAAK;IAC3C;EACJ,CAAC;AAAA,CACL,CAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMU,sBAAsB,GAAGrB,MAAM,CAACsB,IAAK;AAClD;AACA,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.535",
3
+ "version": "5.0.0-beta.536",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "17114c29c47125aeb38926f3626521c626223e0b"
76
+ "gitHead": "9b8371849d73afa113a30aece6e8872e9af56dd1"
77
77
  }