@zendeskgarden/react-theming 9.0.0-next.21 → 9.0.0-next.23
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/esm/index.js +0 -1
- package/dist/esm/utils/arrowStyles.js +8 -7
- package/dist/index.cjs.js +150 -150
- package/dist/typings/index.d.ts +0 -1
- package/dist/typings/utils/arrowStyles.d.ts +3 -0
- package/dist/typings/utils/getColor.d.ts +0 -1
- package/dist/typings/utils/getColorV8.d.ts +0 -1
- package/dist/typings/utils/useText.d.ts +1 -1
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
export { ThemeProvider } from './elements/ThemeProvider.js';
|
|
8
8
|
export { default as DEFAULT_THEME } from './elements/theme/index.js';
|
|
9
9
|
export { default as PALETTE } from './elements/palette/index.js';
|
|
10
|
-
export { default as PALETTE_V8 } from './elements/palette/v8.js';
|
|
11
10
|
export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles.js';
|
|
12
11
|
export { getArrowPosition } from './utils/getArrowPosition.js';
|
|
13
12
|
export { getCheckeredBackground } from './utils/getCheckeredBackground.js';
|
|
@@ -12,27 +12,27 @@ const animationStyles = (position, modifier) => {
|
|
|
12
12
|
const animationName = keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
|
|
13
13
|
return css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
|
|
14
14
|
};
|
|
15
|
-
const positionStyles = (position, size, inset) => {
|
|
15
|
+
const positionStyles = (position, size, inset, shift) => {
|
|
16
16
|
const defaultInset = 0.3;
|
|
17
17
|
const margin = size / -2;
|
|
18
18
|
const placement = Math.round((margin + inset + defaultInset) * 100) / 100;
|
|
19
19
|
const marginPx = `${margin}px`;
|
|
20
20
|
const placementPx = `${placement}px`;
|
|
21
|
-
const
|
|
21
|
+
const offsetPx = `${size + shift}px`;
|
|
22
22
|
let positionCss;
|
|
23
23
|
let transform;
|
|
24
24
|
if (position.startsWith('top')) {
|
|
25
25
|
transform = 'rotate(-135deg)';
|
|
26
|
-
positionCss = css(["top:", ";right:", ";left:", ";margin-left:", ";"], placementPx, position === 'top-right' &&
|
|
26
|
+
positionCss = css(["top:", ";right:", ";left:", ";margin-left:", ";"], placementPx, position === 'top-right' && offsetPx, position === 'top' ? '50%' : position === 'top-left' && offsetPx, position === 'top' && marginPx);
|
|
27
27
|
} else if (position.startsWith('right')) {
|
|
28
28
|
transform = 'rotate(-45deg)';
|
|
29
|
-
positionCss = css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' &&
|
|
29
|
+
positionCss = css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' && offsetPx, placementPx, position === 'right-bottom' && offsetPx, position === 'right' && marginPx);
|
|
30
30
|
} else if (position.startsWith('bottom')) {
|
|
31
31
|
transform = 'rotate(45deg)';
|
|
32
|
-
positionCss = css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' &&
|
|
32
|
+
positionCss = css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' && offsetPx, placementPx, position === 'bottom' ? '50%' : position === 'bottom-left' && offsetPx, position === 'bottom' && marginPx);
|
|
33
33
|
} else if (position.startsWith('left')) {
|
|
34
34
|
transform = 'rotate(135deg)';
|
|
35
|
-
positionCss = css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' &&
|
|
35
|
+
positionCss = css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' && offsetPx, offsetPx, placementPx, position === 'left' && marginPx);
|
|
36
36
|
}
|
|
37
37
|
return css(["&::before,&::after{transform:", ";", ";}"], transform, positionCss);
|
|
38
38
|
};
|
|
@@ -40,13 +40,14 @@ function arrowStyles(position) {
|
|
|
40
40
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
41
41
|
const inset = stripUnit(options.inset || '0');
|
|
42
42
|
const size = stripUnit(options.size || '6');
|
|
43
|
+
const shift = stripUnit(options.shift || '0');
|
|
43
44
|
const sizeOffset = 2;
|
|
44
45
|
const squareSize = size * 2 / Math.sqrt(2) + sizeOffset;
|
|
45
46
|
const squareSizeRounded = Math.round(squareSize * 100) / 100;
|
|
46
47
|
const squareSizePx = `${squareSizeRounded}px`;
|
|
47
48
|
const afterOffset = 0;
|
|
48
49
|
const beforeOffset = afterOffset + 2;
|
|
49
|
-
return css(["position:relative;&::before,&::after{position:absolute;border-width:inherit;border-style:inherit;background-color:inherit;width:", ";height:", ";content:'';box-sizing:inherit;}&::before{border-color:inherit;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}&::after{border-color:transparent;background-clip:content-box;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}", ";", ";"], squareSizePx, squareSizePx, beforeOffset, beforeOffset, afterOffset, afterOffset, positionStyles(position, squareSizeRounded, inset), options.animationModifier && animationStyles(position, options.animationModifier));
|
|
50
|
+
return css(["position:relative;&::before,&::after{position:absolute;border-width:inherit;border-style:inherit;background-color:inherit;width:", ";height:", ";content:'';box-sizing:inherit;}&::before{border-color:inherit;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}&::after{border-color:transparent;background-clip:content-box;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}", ";", ";"], squareSizePx, squareSizePx, beforeOffset, beforeOffset, afterOffset, afterOffset, positionStyles(position, squareSizeRounded, inset, shift), options.animationModifier && animationStyles(position, options.animationModifier));
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export { arrowStyles as default };
|
package/dist/index.cjs.js
CHANGED
|
@@ -516,148 +516,6 @@ ThemeProvider.defaultProps = {
|
|
|
516
516
|
theme: DEFAULT_THEME
|
|
517
517
|
};
|
|
518
518
|
|
|
519
|
-
const PALETTE_V8 = {
|
|
520
|
-
black: '#000',
|
|
521
|
-
white: '#fff',
|
|
522
|
-
product: {
|
|
523
|
-
support: '#00a656',
|
|
524
|
-
message: '#37b8af',
|
|
525
|
-
explore: '#30aabc',
|
|
526
|
-
gather: '#f6c8be',
|
|
527
|
-
guide: '#eb4962',
|
|
528
|
-
connect: '#ff6224',
|
|
529
|
-
chat: '#f79a3e',
|
|
530
|
-
talk: '#efc93d',
|
|
531
|
-
sell: '#c38f00'
|
|
532
|
-
},
|
|
533
|
-
grey: {
|
|
534
|
-
100: '#f8f9f9',
|
|
535
|
-
200: '#e9ebed',
|
|
536
|
-
300: '#d8dcde',
|
|
537
|
-
400: '#c2c8cc',
|
|
538
|
-
500: '#87929d',
|
|
539
|
-
600: '#68737d',
|
|
540
|
-
700: '#49545c',
|
|
541
|
-
800: '#2f3941'
|
|
542
|
-
},
|
|
543
|
-
blue: {
|
|
544
|
-
100: '#edf7ff',
|
|
545
|
-
200: '#cee2f2',
|
|
546
|
-
300: '#adcce4',
|
|
547
|
-
400: '#5293c7',
|
|
548
|
-
500: '#337fbd',
|
|
549
|
-
600: '#1f73b7',
|
|
550
|
-
700: '#144a75',
|
|
551
|
-
800: '#0f3554'
|
|
552
|
-
},
|
|
553
|
-
red: {
|
|
554
|
-
100: '#fff0f1',
|
|
555
|
-
200: '#f5d5d8',
|
|
556
|
-
300: '#f5b5ba',
|
|
557
|
-
400: '#e35b66',
|
|
558
|
-
500: '#d93f4c',
|
|
559
|
-
600: '#cc3340',
|
|
560
|
-
700: '#8c232c',
|
|
561
|
-
800: '#681219'
|
|
562
|
-
},
|
|
563
|
-
yellow: {
|
|
564
|
-
100: '#fff7ed',
|
|
565
|
-
200: '#ffeedb',
|
|
566
|
-
300: '#fed6a8',
|
|
567
|
-
400: '#ffb057',
|
|
568
|
-
500: '#f79a3e',
|
|
569
|
-
600: '#ed8f1c',
|
|
570
|
-
700: '#ad5918',
|
|
571
|
-
800: '#703815'
|
|
572
|
-
},
|
|
573
|
-
green: {
|
|
574
|
-
100: '#edf8f4',
|
|
575
|
-
200: '#d1e8df',
|
|
576
|
-
300: '#aecfc2',
|
|
577
|
-
400: '#5eae91',
|
|
578
|
-
500: '#228f67',
|
|
579
|
-
600: '#038153',
|
|
580
|
-
700: '#186146',
|
|
581
|
-
800: '#0b3b29'
|
|
582
|
-
},
|
|
583
|
-
kale: {
|
|
584
|
-
100: '#f5fcfc',
|
|
585
|
-
200: '#daeded',
|
|
586
|
-
300: '#bdd9d7',
|
|
587
|
-
400: '#90bbbb',
|
|
588
|
-
500: '#498283',
|
|
589
|
-
600: '#17494d',
|
|
590
|
-
700: '#03363d',
|
|
591
|
-
800: '#012b30'
|
|
592
|
-
},
|
|
593
|
-
fuschia: {
|
|
594
|
-
400: '#d653c2',
|
|
595
|
-
600: '#a81897',
|
|
596
|
-
M400: '#cf62a8',
|
|
597
|
-
M600: '#a8458c'
|
|
598
|
-
},
|
|
599
|
-
pink: {
|
|
600
|
-
400: '#ec4d63',
|
|
601
|
-
600: '#d42054',
|
|
602
|
-
M400: '#d57287',
|
|
603
|
-
M600: '#b23a5d'
|
|
604
|
-
},
|
|
605
|
-
crimson: {
|
|
606
|
-
400: '#e34f32',
|
|
607
|
-
600: '#c72a1c',
|
|
608
|
-
M400: '#cc6c5b',
|
|
609
|
-
M600: '#b24a3c'
|
|
610
|
-
},
|
|
611
|
-
orange: {
|
|
612
|
-
400: '#de701d',
|
|
613
|
-
600: '#bf5000',
|
|
614
|
-
M400: '#d4772c',
|
|
615
|
-
M600: '#b35827'
|
|
616
|
-
},
|
|
617
|
-
lemon: {
|
|
618
|
-
400: '#ffd424',
|
|
619
|
-
600: '#ffbb10',
|
|
620
|
-
M400: '#e7a500',
|
|
621
|
-
M600: '#c38f00'
|
|
622
|
-
},
|
|
623
|
-
lime: {
|
|
624
|
-
400: '#43b324',
|
|
625
|
-
600: '#2e8200',
|
|
626
|
-
M400: '#519e2d',
|
|
627
|
-
M600: '#47782c'
|
|
628
|
-
},
|
|
629
|
-
mint: {
|
|
630
|
-
400: '#00a656',
|
|
631
|
-
600: '#058541',
|
|
632
|
-
M400: '#299c66',
|
|
633
|
-
M600: '#2e8057'
|
|
634
|
-
},
|
|
635
|
-
teal: {
|
|
636
|
-
400: '#02a191',
|
|
637
|
-
600: '#028079',
|
|
638
|
-
M400: '#2d9e8f',
|
|
639
|
-
M600: '#3c7873'
|
|
640
|
-
},
|
|
641
|
-
azure: {
|
|
642
|
-
400: '#3091ec',
|
|
643
|
-
600: '#1371d6',
|
|
644
|
-
M400: '#5f8dcf',
|
|
645
|
-
M600: '#3a70b2'
|
|
646
|
-
},
|
|
647
|
-
royal: {
|
|
648
|
-
400: '#5d7df5',
|
|
649
|
-
600: '#3353e2',
|
|
650
|
-
M400: '#7986d8',
|
|
651
|
-
M600: '#4b61c3'
|
|
652
|
-
},
|
|
653
|
-
purple: {
|
|
654
|
-
400: '#b552e2',
|
|
655
|
-
600: '#6a27b8',
|
|
656
|
-
M400: '#b072cc',
|
|
657
|
-
M600: '#9358b0'
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
|
|
661
519
|
function retrieveComponentStyles(componentId, props) {
|
|
662
520
|
const components = props.theme && props.theme.components;
|
|
663
521
|
if (!components) {
|
|
@@ -961,6 +819,148 @@ const getCheckeredBackground = _ref => {
|
|
|
961
819
|
return retVal;
|
|
962
820
|
};
|
|
963
821
|
|
|
822
|
+
const PALETTE_V8 = {
|
|
823
|
+
black: '#000',
|
|
824
|
+
white: '#fff',
|
|
825
|
+
product: {
|
|
826
|
+
support: '#00a656',
|
|
827
|
+
message: '#37b8af',
|
|
828
|
+
explore: '#30aabc',
|
|
829
|
+
gather: '#f6c8be',
|
|
830
|
+
guide: '#eb4962',
|
|
831
|
+
connect: '#ff6224',
|
|
832
|
+
chat: '#f79a3e',
|
|
833
|
+
talk: '#efc93d',
|
|
834
|
+
sell: '#c38f00'
|
|
835
|
+
},
|
|
836
|
+
grey: {
|
|
837
|
+
100: '#f8f9f9',
|
|
838
|
+
200: '#e9ebed',
|
|
839
|
+
300: '#d8dcde',
|
|
840
|
+
400: '#c2c8cc',
|
|
841
|
+
500: '#87929d',
|
|
842
|
+
600: '#68737d',
|
|
843
|
+
700: '#49545c',
|
|
844
|
+
800: '#2f3941'
|
|
845
|
+
},
|
|
846
|
+
blue: {
|
|
847
|
+
100: '#edf7ff',
|
|
848
|
+
200: '#cee2f2',
|
|
849
|
+
300: '#adcce4',
|
|
850
|
+
400: '#5293c7',
|
|
851
|
+
500: '#337fbd',
|
|
852
|
+
600: '#1f73b7',
|
|
853
|
+
700: '#144a75',
|
|
854
|
+
800: '#0f3554'
|
|
855
|
+
},
|
|
856
|
+
red: {
|
|
857
|
+
100: '#fff0f1',
|
|
858
|
+
200: '#f5d5d8',
|
|
859
|
+
300: '#f5b5ba',
|
|
860
|
+
400: '#e35b66',
|
|
861
|
+
500: '#d93f4c',
|
|
862
|
+
600: '#cc3340',
|
|
863
|
+
700: '#8c232c',
|
|
864
|
+
800: '#681219'
|
|
865
|
+
},
|
|
866
|
+
yellow: {
|
|
867
|
+
100: '#fff7ed',
|
|
868
|
+
200: '#ffeedb',
|
|
869
|
+
300: '#fed6a8',
|
|
870
|
+
400: '#ffb057',
|
|
871
|
+
500: '#f79a3e',
|
|
872
|
+
600: '#ed8f1c',
|
|
873
|
+
700: '#ad5918',
|
|
874
|
+
800: '#703815'
|
|
875
|
+
},
|
|
876
|
+
green: {
|
|
877
|
+
100: '#edf8f4',
|
|
878
|
+
200: '#d1e8df',
|
|
879
|
+
300: '#aecfc2',
|
|
880
|
+
400: '#5eae91',
|
|
881
|
+
500: '#228f67',
|
|
882
|
+
600: '#038153',
|
|
883
|
+
700: '#186146',
|
|
884
|
+
800: '#0b3b29'
|
|
885
|
+
},
|
|
886
|
+
kale: {
|
|
887
|
+
100: '#f5fcfc',
|
|
888
|
+
200: '#daeded',
|
|
889
|
+
300: '#bdd9d7',
|
|
890
|
+
400: '#90bbbb',
|
|
891
|
+
500: '#498283',
|
|
892
|
+
600: '#17494d',
|
|
893
|
+
700: '#03363d',
|
|
894
|
+
800: '#012b30'
|
|
895
|
+
},
|
|
896
|
+
fuschia: {
|
|
897
|
+
400: '#d653c2',
|
|
898
|
+
600: '#a81897',
|
|
899
|
+
M400: '#cf62a8',
|
|
900
|
+
M600: '#a8458c'
|
|
901
|
+
},
|
|
902
|
+
pink: {
|
|
903
|
+
400: '#ec4d63',
|
|
904
|
+
600: '#d42054',
|
|
905
|
+
M400: '#d57287',
|
|
906
|
+
M600: '#b23a5d'
|
|
907
|
+
},
|
|
908
|
+
crimson: {
|
|
909
|
+
400: '#e34f32',
|
|
910
|
+
600: '#c72a1c',
|
|
911
|
+
M400: '#cc6c5b',
|
|
912
|
+
M600: '#b24a3c'
|
|
913
|
+
},
|
|
914
|
+
orange: {
|
|
915
|
+
400: '#de701d',
|
|
916
|
+
600: '#bf5000',
|
|
917
|
+
M400: '#d4772c',
|
|
918
|
+
M600: '#b35827'
|
|
919
|
+
},
|
|
920
|
+
lemon: {
|
|
921
|
+
400: '#ffd424',
|
|
922
|
+
600: '#ffbb10',
|
|
923
|
+
M400: '#e7a500',
|
|
924
|
+
M600: '#c38f00'
|
|
925
|
+
},
|
|
926
|
+
lime: {
|
|
927
|
+
400: '#43b324',
|
|
928
|
+
600: '#2e8200',
|
|
929
|
+
M400: '#519e2d',
|
|
930
|
+
M600: '#47782c'
|
|
931
|
+
},
|
|
932
|
+
mint: {
|
|
933
|
+
400: '#00a656',
|
|
934
|
+
600: '#058541',
|
|
935
|
+
M400: '#299c66',
|
|
936
|
+
M600: '#2e8057'
|
|
937
|
+
},
|
|
938
|
+
teal: {
|
|
939
|
+
400: '#02a191',
|
|
940
|
+
600: '#028079',
|
|
941
|
+
M400: '#2d9e8f',
|
|
942
|
+
M600: '#3c7873'
|
|
943
|
+
},
|
|
944
|
+
azure: {
|
|
945
|
+
400: '#3091ec',
|
|
946
|
+
600: '#1371d6',
|
|
947
|
+
M400: '#5f8dcf',
|
|
948
|
+
M600: '#3a70b2'
|
|
949
|
+
},
|
|
950
|
+
royal: {
|
|
951
|
+
400: '#5d7df5',
|
|
952
|
+
600: '#3353e2',
|
|
953
|
+
M400: '#7986d8',
|
|
954
|
+
M600: '#4b61c3'
|
|
955
|
+
},
|
|
956
|
+
purple: {
|
|
957
|
+
400: '#b552e2',
|
|
958
|
+
600: '#6a27b8',
|
|
959
|
+
M400: '#b072cc',
|
|
960
|
+
M600: '#9358b0'
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
|
|
964
964
|
const DEFAULT_SHADE = 600;
|
|
965
965
|
const adjust = (color, expected, actual) => {
|
|
966
966
|
if (expected !== actual) {
|
|
@@ -1174,27 +1174,27 @@ const animationStyles$1 = (position, modifier) => {
|
|
|
1174
1174
|
const animationName = styled.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
|
|
1175
1175
|
return styled.css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
|
|
1176
1176
|
};
|
|
1177
|
-
const positionStyles = (position, size, inset) => {
|
|
1177
|
+
const positionStyles = (position, size, inset, shift) => {
|
|
1178
1178
|
const defaultInset = 0.3;
|
|
1179
1179
|
const margin = size / -2;
|
|
1180
1180
|
const placement = Math.round((margin + inset + defaultInset) * 100) / 100;
|
|
1181
1181
|
const marginPx = `${margin}px`;
|
|
1182
1182
|
const placementPx = `${placement}px`;
|
|
1183
|
-
const
|
|
1183
|
+
const offsetPx = `${size + shift}px`;
|
|
1184
1184
|
let positionCss;
|
|
1185
1185
|
let transform;
|
|
1186
1186
|
if (position.startsWith('top')) {
|
|
1187
1187
|
transform = 'rotate(-135deg)';
|
|
1188
|
-
positionCss = styled.css(["top:", ";right:", ";left:", ";margin-left:", ";"], placementPx, position === 'top-right' &&
|
|
1188
|
+
positionCss = styled.css(["top:", ";right:", ";left:", ";margin-left:", ";"], placementPx, position === 'top-right' && offsetPx, position === 'top' ? '50%' : position === 'top-left' && offsetPx, position === 'top' && marginPx);
|
|
1189
1189
|
} else if (position.startsWith('right')) {
|
|
1190
1190
|
transform = 'rotate(-45deg)';
|
|
1191
|
-
positionCss = styled.css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' &&
|
|
1191
|
+
positionCss = styled.css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' && offsetPx, placementPx, position === 'right-bottom' && offsetPx, position === 'right' && marginPx);
|
|
1192
1192
|
} else if (position.startsWith('bottom')) {
|
|
1193
1193
|
transform = 'rotate(45deg)';
|
|
1194
|
-
positionCss = styled.css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' &&
|
|
1194
|
+
positionCss = styled.css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' && offsetPx, placementPx, position === 'bottom' ? '50%' : position === 'bottom-left' && offsetPx, position === 'bottom' && marginPx);
|
|
1195
1195
|
} else if (position.startsWith('left')) {
|
|
1196
1196
|
transform = 'rotate(135deg)';
|
|
1197
|
-
positionCss = styled.css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' &&
|
|
1197
|
+
positionCss = styled.css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' && offsetPx, offsetPx, placementPx, position === 'left' && marginPx);
|
|
1198
1198
|
}
|
|
1199
1199
|
return styled.css(["&::before,&::after{transform:", ";", ";}"], transform, positionCss);
|
|
1200
1200
|
};
|
|
@@ -1202,13 +1202,14 @@ function arrowStyles(position) {
|
|
|
1202
1202
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1203
1203
|
const inset = polished.stripUnit(options.inset || '0');
|
|
1204
1204
|
const size = polished.stripUnit(options.size || '6');
|
|
1205
|
+
const shift = polished.stripUnit(options.shift || '0');
|
|
1205
1206
|
const sizeOffset = 2;
|
|
1206
1207
|
const squareSize = size * 2 / Math.sqrt(2) + sizeOffset;
|
|
1207
1208
|
const squareSizeRounded = Math.round(squareSize * 100) / 100;
|
|
1208
1209
|
const squareSizePx = `${squareSizeRounded}px`;
|
|
1209
1210
|
const afterOffset = 0;
|
|
1210
1211
|
const beforeOffset = afterOffset + 2;
|
|
1211
|
-
return styled.css(["position:relative;&::before,&::after{position:absolute;border-width:inherit;border-style:inherit;background-color:inherit;width:", ";height:", ";content:'';box-sizing:inherit;}&::before{border-color:inherit;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}&::after{border-color:transparent;background-clip:content-box;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}", ";", ";"], squareSizePx, squareSizePx, beforeOffset, beforeOffset, afterOffset, afterOffset, positionStyles(position, squareSizeRounded, inset), options.animationModifier && animationStyles$1(position, options.animationModifier));
|
|
1212
|
+
return styled.css(["position:relative;&::before,&::after{position:absolute;border-width:inherit;border-style:inherit;background-color:inherit;width:", ";height:", ";content:'';box-sizing:inherit;}&::before{border-color:inherit;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}&::after{border-color:transparent;background-clip:content-box;clip-path:polygon(100% ", "px,", "px 100%,100% 100%);}", ";", ";"], squareSizePx, squareSizePx, beforeOffset, beforeOffset, afterOffset, afterOffset, positionStyles(position, squareSizeRounded, inset, shift), options.animationModifier && animationStyles$1(position, options.animationModifier));
|
|
1212
1213
|
}
|
|
1213
1214
|
|
|
1214
1215
|
const useDocument = theme => {
|
|
@@ -1366,7 +1367,6 @@ exports.ARROW_POSITION = ARROW_POSITION;
|
|
|
1366
1367
|
exports.DEFAULT_THEME = DEFAULT_THEME;
|
|
1367
1368
|
exports.MENU_POSITION = MENU_POSITION;
|
|
1368
1369
|
exports.PALETTE = PALETTE;
|
|
1369
|
-
exports.PALETTE_V8 = PALETTE_V8;
|
|
1370
1370
|
exports.PLACEMENT = PLACEMENT;
|
|
1371
1371
|
exports.SELECTOR_FOCUS_VISIBLE = SELECTOR_FOCUS_VISIBLE;
|
|
1372
1372
|
exports.StyledBaseIcon = StyledBaseIcon;
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
export { ThemeProvider } from './elements/ThemeProvider';
|
|
8
8
|
export { default as DEFAULT_THEME } from './elements/theme';
|
|
9
9
|
export { default as PALETTE } from './elements/palette';
|
|
10
|
-
export { default as PALETTE_V8 } from './elements/palette/v8';
|
|
11
10
|
export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles';
|
|
12
11
|
export { getArrowPosition } from './utils/getArrowPosition';
|
|
13
12
|
export { getCheckeredBackground } from './utils/getCheckeredBackground';
|
|
@@ -8,6 +8,7 @@ import { ArrowPosition } from '../types';
|
|
|
8
8
|
type ArrowOptions = {
|
|
9
9
|
size?: string;
|
|
10
10
|
inset?: string;
|
|
11
|
+
shift?: string;
|
|
11
12
|
animationModifier?: string;
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
@@ -37,6 +38,8 @@ type ArrowOptions = {
|
|
|
37
38
|
* (right angle) of the arrow expressed as a CSS dimension.
|
|
38
39
|
* @param {string} [options.inset='0'] Tweak arrow positioning by adjusting with
|
|
39
40
|
* either a positive (push the arrow in) or negative (pull the arrow out) value.
|
|
41
|
+
* @param {string} [options.shift='0'] Shifts arrow positioning along
|
|
42
|
+
* the edge of the parent container.
|
|
40
43
|
* @param {string} [options.animationModifier] A CSS class or attribute selector
|
|
41
44
|
* which, when applied, animates the arrow's appearance.
|
|
42
45
|
*
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="lodash" />
|
|
8
7
|
import { ColorParameters } from '../types';
|
|
9
8
|
/**
|
|
10
9
|
* Get a color value from the theme. Variable lookup takes precedence, followed
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="lodash" />
|
|
8
7
|
import { Hue } from '../types';
|
|
9
8
|
import { DefaultTheme } from 'styled-components';
|
|
10
9
|
export declare const DEFAULT_SHADE = 600;
|
|
@@ -16,4 +16,4 @@ import { FC } from 'react';
|
|
|
16
16
|
* @param text The default text to apply if the value of `props[name]` is undefined
|
|
17
17
|
* @param condition An optional condition that can be used to prevent evaluation
|
|
18
18
|
*/
|
|
19
|
-
export declare const useText: (component: Pick<FC,
|
|
19
|
+
export declare const useText: (component: Pick<FC, "displayName">, props: Record<string, any>, name: string, text: string, condition?: boolean) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-theming",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.23",
|
|
4
4
|
"description": "Theming utilities and components within the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"prop-types": "^15.5.7"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"react": "
|
|
33
|
-
"react-dom": "
|
|
32
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
33
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
34
34
|
"styled-components": "^4.2.0 || ^5.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "5e7d2ed69a1615e09406a3f9285359346bb90cc7"
|
|
51
51
|
}
|