@pega/cosmos-react-core 4.0.0-dev.1.2 → 4.0.0-dev.3.0

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.
Files changed (77) hide show
  1. package/lib/components/AppShell/AppShell.styles.js +4 -4
  2. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  3. package/lib/components/AppShell/AppShellList.styles.js +2 -2
  4. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  5. package/lib/components/AppShell/AppShellSearch.styles.js +1 -1
  6. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  7. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  8. package/lib/components/AppShell/Drawer.js +0 -3
  9. package/lib/components/AppShell/Drawer.js.map +1 -1
  10. package/lib/components/AppShell/Drawer.styles.js +2 -2
  11. package/lib/components/AppShell/Drawer.styles.js.map +1 -1
  12. package/lib/components/Badges/Count.d.ts.map +1 -1
  13. package/lib/components/Badges/Count.js +23 -22
  14. package/lib/components/Badges/Count.js.map +1 -1
  15. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  16. package/lib/components/DateTime/Input/usePickerButton.js +19 -27
  17. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  18. package/lib/components/DateTime/Input/utils.js +1 -1
  19. package/lib/components/DateTime/Input/utils.js.map +1 -1
  20. package/lib/components/DateTime/Picker/TimePicker.js +1 -1
  21. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  22. package/lib/components/Lightbox/Lightbox.styles.js +2 -2
  23. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
  24. package/lib/components/Menu/Menu.styles.js +1 -1
  25. package/lib/components/Menu/Menu.styles.js.map +1 -1
  26. package/lib/components/Progress/Bar.d.ts +0 -3
  27. package/lib/components/Progress/Bar.d.ts.map +1 -1
  28. package/lib/components/Progress/Bar.js +1 -54
  29. package/lib/components/Progress/Bar.js.map +1 -1
  30. package/lib/components/Progress/Ellipsis.d.ts +0 -1
  31. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  32. package/lib/components/Progress/Ellipsis.js +1 -72
  33. package/lib/components/Progress/Ellipsis.js.map +1 -1
  34. package/lib/components/Progress/Progress.d.ts.map +1 -1
  35. package/lib/components/Progress/Progress.js +2 -17
  36. package/lib/components/Progress/Progress.js.map +1 -1
  37. package/lib/components/Progress/Progress.styles.d.ts +10 -0
  38. package/lib/components/Progress/Progress.styles.d.ts.map +1 -0
  39. package/lib/components/Progress/Progress.styles.js +207 -0
  40. package/lib/components/Progress/Progress.styles.js.map +1 -0
  41. package/lib/components/Progress/Progress.types.d.ts +1 -1
  42. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  43. package/lib/components/Progress/Progress.types.js.map +1 -1
  44. package/lib/components/Progress/Ring.d.ts +0 -3
  45. package/lib/components/Progress/Ring.d.ts.map +1 -1
  46. package/lib/components/Progress/Ring.js +1 -58
  47. package/lib/components/Progress/Ring.js.map +1 -1
  48. package/lib/components/Progress/index.d.ts +1 -3
  49. package/lib/components/Progress/index.d.ts.map +1 -1
  50. package/lib/components/Progress/index.js +1 -3
  51. package/lib/components/Progress/index.js.map +1 -1
  52. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
  53. package/lib/components/SkipLinks/SkipLinks.js +3 -26
  54. package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
  55. package/lib/components/Tabs/Tab.js +1 -1
  56. package/lib/components/Tabs/Tab.js.map +1 -1
  57. package/lib/components/Toaster/Toaster.js +1 -1
  58. package/lib/components/Toaster/Toaster.js.map +1 -1
  59. package/lib/hooks/useI18n.d.ts +7 -6
  60. package/lib/hooks/useI18n.d.ts.map +1 -1
  61. package/lib/i18n/default.d.ts +7 -6
  62. package/lib/i18n/default.d.ts.map +1 -1
  63. package/lib/i18n/default.js +8 -7
  64. package/lib/i18n/default.js.map +1 -1
  65. package/lib/i18n/i18n.d.ts +7 -6
  66. package/lib/i18n/i18n.d.ts.map +1 -1
  67. package/lib/theme/theme.d.ts +3 -9
  68. package/lib/theme/theme.d.ts.map +1 -1
  69. package/lib/theme/themeDefinition.json +5 -9
  70. package/lib/theme/themeOverrides.schema.json +1 -4
  71. package/lib/theme/themes/darkTheme.json +2 -1
  72. package/lib/theme/themes/legacyBuildTheme.json +2 -3
  73. package/lib/utils/utils.d.ts +6 -0
  74. package/lib/utils/utils.d.ts.map +1 -1
  75. package/lib/utils/utils.js +27 -0
  76. package/lib/utils/utils.js.map +1 -1
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC1B,OAAO,IAAI,CACT,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC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,CACX,KAAC,IAAI,OACC,SAAS,EACb,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,oBACI,OAAO,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,EACxF,GAAG,EAAE,GAAG,GACR,CACH,CAAC;IAEF,MAAM,OAAO,GACX,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CACvB,IAAI,CACL,CAAC,CAAC,CAAC,CACF,MAAC,QAAQ,IACP,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,QAAQ,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EACvD,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,GAAG,EACV,mBAAmB,EAAE,iBAAiB,EACtC,oBAAoB,EAAE,uBAAuB,aAE5C,IAAI,EACJ,CAAC,CAAC,OAAO,IAAI,CACZ,KAAC,IAAI,IAAC,EAAE,EAAE,aAAa,EAAE,OAAO,EAAC,WAAW,iBAAa,MAAM,YAC5D,OAAO,GACH,CACR,IACQ,CACZ,CAAC;IAEJ,OAAO,SAAS,KAAK,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChG,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, useState, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport styled, { css } from 'styled-components';\nimport { readableColor, rgba } from 'polished';\n\nimport { ForwardProps } from '../../types';\nimport Backdrop from '../Backdrop';\nimport Text from '../Text';\nimport { calculateFontSize, FontSize } from '../../styles';\nimport { tryCatch } from '../../utils';\nimport { useConfiguration } from '../../hooks';\n\nimport { ProgressProps } from './Progress.types';\nimport Bar from './Bar';\nimport Ellipsis from './Ellipsis';\nimport Ring from './Ring';\n\nconst StyledMessage = styled.span(({ theme }) => {\n const color = tryCatch(() => {\n return rgba(\n readableColor(theme.base.palette['primary-background']),\n theme.base.transparency['transparent-3']\n );\n });\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n margin-top: 0.5rem;\n font-size: ${fontSize[theme.components.label['font-size'] as FontSize]};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${color};\n `;\n});\n\nconst Progress: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n variant = 'ring',\n placement = 'global',\n visible = true,\n onTransitionEndIn,\n onTransitionEndOut,\n value,\n message,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n const [isVisible, setIsVisible] = useState(visible);\n const [isNull, setIsNull] = useState(!visible);\n const { portalTarget } = useConfiguration();\n const showTime = useRef<number>();\n const showTimeout = useRef<number>();\n const hideTimeout = useRef<number>();\n\n let Comp = Ring;\n if (variant === 'bar') Comp = Bar;\n else if (variant === 'ellipsis') Comp = Ellipsis;\n\n const onBackdropTransitionEnd = () => {\n setIsNull(true);\n onTransitionEndOut?.();\n };\n\n useEffect(() => {\n if (visible) {\n clearTimeout(hideTimeout.current);\n showTime.current = Date.now();\n showTimeout.current = window.setTimeout(() => {\n setIsVisible(true);\n setIsNull(false);\n }, 100);\n } else {\n clearTimeout(showTimeout.current);\n\n if (typeof showTime.current === 'number') {\n const minimumDuration = 1000;\n const timeElapsed = Date.now() - showTime.current;\n\n if (timeElapsed > minimumDuration) setIsVisible(false);\n else {\n hideTimeout.current = window.setTimeout(() => {\n setIsVisible(false);\n }, minimumDuration - timeElapsed);\n }\n } else setIsVisible(false);\n }\n }, [visible]);\n\n useEffect(() => {\n return () => {\n clearTimeout(showTimeout.current);\n clearTimeout(hideTimeout.current);\n };\n }, []);\n\n if (isNull) return null;\n\n const comp = (\n <Comp\n {...restProps}\n placement={placement}\n value={value}\n aria-valuetext={message && typeof value === 'number' ? `${message} - ${value}` : message}\n ref={ref}\n />\n );\n\n const content =\n placement === 'inline' ? (\n comp\n ) : (\n <Backdrop\n open={isVisible}\n container={{ direction: 'column' }}\n position={placement === 'global' ? 'fixed' : 'absolute'}\n variant='light'\n alpha={0.5}\n onAfterTransitionIn={onTransitionEndIn}\n onAfterTransitionOut={onBackdropTransitionEnd}\n >\n {comp}\n {!!message && (\n <Text as={StyledMessage} variant='secondary' aria-hidden='true'>\n {message}\n </Text>\n )}\n </Backdrop>\n );\n\n return placement === 'global' && portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default Progress;\n"]}
1
+ {"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,QAAQ,GAAqC,UAAU,CAC3D,CACE,EACE,OAAO,GAAG,MAAM,EAChB,SAAS,GAAG,QAAQ,EACpB,OAAO,GAAG,IAAI,EACd,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,OAAO,EACP,GAAG,SAAS,EACmB,EACjC,GAAyB,EACzB,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,C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,MAAM,YAC5D,OAAO,GACH,CACR,IACQ,CACZ,CAAC;IAEJ,OAAO,SAAS,KAAK,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChG,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, useState, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { ForwardProps } from '../../types';\nimport Backdrop from '../Backdrop';\nimport Text from '../Text';\nimport { useConfiguration } from '../../hooks';\n\nimport { ProgressProps } from './Progress.types';\nimport Bar from './Bar';\nimport Ellipsis from './Ellipsis';\nimport Ring from './Ring';\nimport { StyledMessage } from './Progress.styles';\n\nconst Progress: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n variant = 'ring',\n placement = 'global',\n visible = true,\n onTransitionEndIn,\n onTransitionEndOut,\n value,\n message,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n const [isVisible, setIsVisible] = useState(visible);\n const [isNull, setIsNull] = useState(!visible);\n const { portalTarget } = useConfiguration();\n const showTime = useRef<number>();\n const showTimeout = useRef<number>();\n const hideTimeout = useRef<number>();\n\n let Comp = Ring;\n if (variant === 'bar') Comp = Bar;\n else if (variant === 'ellipsis') Comp = Ellipsis;\n\n const onBackdropTransitionEnd = () => {\n setIsNull(true);\n onTransitionEndOut?.();\n };\n\n useEffect(() => {\n if (visible) {\n clearTimeout(hideTimeout.current);\n showTime.current = Date.now();\n showTimeout.current = window.setTimeout(() => {\n setIsVisible(true);\n setIsNull(false);\n }, 100);\n } else {\n clearTimeout(showTimeout.current);\n\n if (typeof showTime.current === 'number') {\n const minimumDuration = 1000;\n const timeElapsed = Date.now() - showTime.current;\n\n if (timeElapsed > minimumDuration) setIsVisible(false);\n else {\n hideTimeout.current = window.setTimeout(() => {\n setIsVisible(false);\n }, minimumDuration - timeElapsed);\n }\n } else setIsVisible(false);\n }\n }, [visible]);\n\n useEffect(() => {\n return () => {\n clearTimeout(showTimeout.current);\n clearTimeout(hideTimeout.current);\n };\n }, []);\n\n if (isNull) return null;\n\n const comp = (\n <Comp\n {...restProps}\n placement={placement}\n value={value}\n aria-valuetext={message && typeof value === 'number' ? `${message} - ${value}` : message}\n ref={ref}\n />\n );\n\n const content =\n placement === 'block' || placement === 'inline' ? (\n comp\n ) : (\n <Backdrop\n open={isVisible}\n container={{ direction: 'column' }}\n position={placement === 'global' ? 'fixed' : 'absolute'}\n variant='light'\n alpha={0.5}\n onAfterTransitionIn={onTransitionEndIn}\n onAfterTransitionOut={onBackdropTransitionEnd}\n >\n {comp}\n {!!message && (\n <Text as={StyledMessage} variant='secondary' aria-hidden='true'>\n {message}\n </Text>\n )}\n </Backdrop>\n );\n\n return placement === 'global' && portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default Progress;\n"]}
@@ -0,0 +1,10 @@
1
+ import { ProgressProps } from './Progress.types';
2
+ export declare const StyledMessage: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledProgressRing: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<ProgressProps, "placement"> & {
4
+ determinate: boolean;
5
+ }, never>;
6
+ export declare const StyledProgressBar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ProgressProps & {
7
+ determinate: boolean;
8
+ }, never>;
9
+ export declare const StyledProgressEllipsis: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<ProgressProps, "placement">, never>;
10
+ //# sourceMappingURL=Progress.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/Progress.styles.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,aAAa,0GAgBxB,CAAC;AAIH,eAAO,MAAM,kBAAkB;iBACqB,OAAO;SAuDzD,CAAC;AAIH,eAAO,MAAM,iBAAiB;iBAA6C,OAAO;SAyDjF,CAAC;AAIF,eAAO,MAAM,sBAAsB,uIA4ElC,CAAC"}
@@ -0,0 +1,207 @@
1
+ import { rgba, readableColor } from 'polished';
2
+ import styled, { css } from 'styled-components';
3
+ import { calculateFontSize } from '../../styles';
4
+ import { defaultThemeProp } from '../../theme';
5
+ import { tryCatch } from '../../utils';
6
+ export const StyledMessage = styled.span(({ theme }) => {
7
+ const color = tryCatch(() => {
8
+ return rgba(readableColor(theme.base.palette['primary-background']), theme.base.transparency['transparent-3']);
9
+ });
10
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
11
+ return css `
12
+ margin-top: 0.5rem;
13
+ font-size: ${fontSize[theme.components.label['font-size']]};
14
+ font-weight: ${theme.base['font-weight']['semi-bold']};
15
+ color: ${color};
16
+ `;
17
+ });
18
+ StyledMessage.defaultProps = defaultThemeProp;
19
+ export const StyledProgressRing = styled.div(({ theme, placement, determinate }) => {
20
+ const size = placement === 'inline' ? '1em' : '2rem';
21
+ return css `
22
+ @keyframes LoadingRing {
23
+ 0% {
24
+ transform: rotate(0deg);
25
+ }
26
+
27
+ 100% {
28
+ transform: rotate(360deg);
29
+ }
30
+ }
31
+ position: relative;
32
+
33
+ svg {
34
+ display: block;
35
+ width: ${size};
36
+ height: ${size};
37
+
38
+ circle {
39
+ fill: transparent;
40
+ stroke: ${theme.base.colors.gray['extra-light']};
41
+ stroke-width: 2;
42
+ r: 45%;
43
+ cx: 50%;
44
+ cy: 50%;
45
+ transform: rotate(-90deg);
46
+ transform-origin: 50% 50%;
47
+
48
+ &:nth-child(2) {
49
+ stroke: ${theme.components.progress['progress-color']};
50
+ transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})
51
+ ${theme.base.animation.timing.ease};
52
+
53
+ ${!determinate &&
54
+ css `
55
+ animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;
56
+ `}
57
+ }
58
+ }
59
+
60
+ ${placement === 'block' &&
61
+ css `
62
+ margin: calc(2 * ${theme.base.spacing}) auto;
63
+ `}
64
+ }
65
+
66
+ ${placement === 'inline' &&
67
+ css `
68
+ display: inline-flex;
69
+ vertical-align: top;
70
+ `}
71
+ `;
72
+ });
73
+ StyledProgressRing.defaultProps = defaultThemeProp;
74
+ export const StyledProgressBar = styled.div(({ theme, placement, determinate }) => {
75
+ return css `
76
+ background-color: ${theme.base.colors.gray['extra-light']};
77
+ border-radius: ${theme.base['border-radius']};
78
+ width: calc(100% - ${placement === 'local' ? css `4 * ${theme.base.spacing}` : '0rem'});
79
+ height: 0.375rem;
80
+ min-width: 2rem;
81
+ max-width: min(calc(100vw - 4 * ${theme.base.spacing}), ${theme.base['content-width'].lg});
82
+ overflow: hidden;
83
+
84
+ @keyframes LoadingBar {
85
+ 0% {
86
+ transform: translateX(-100%);
87
+ }
88
+
89
+ 100% {
90
+ transform: translateX(200%);
91
+ }
92
+ }
93
+
94
+ ::before {
95
+ content: '';
96
+ display: block;
97
+ height: 100%;
98
+ width: 100%;
99
+ left: 0;
100
+ border-radius: ${theme.base['border-radius']};
101
+ background-color: ${theme.components.progress['progress-color']};
102
+ ${determinate &&
103
+ css `
104
+ transform: translateX(var(--progress, 0));
105
+ transform-origin: 0 50%;
106
+ transition: transform calc(0.5 * ${theme.base.animation.speed})
107
+ ${theme.base.animation.timing.ease};
108
+ `}
109
+
110
+ ${!determinate &&
111
+ css `
112
+ animation: LoadingBar calc(8 * ${theme.base.animation.speed}) linear infinite;
113
+ width: 50%;
114
+ `}
115
+ }
116
+
117
+ ${placement === 'block' &&
118
+ css `
119
+ margin-block: calc(2 * ${theme.base.spacing});
120
+ `}
121
+
122
+ ${placement === 'inline' &&
123
+ css `
124
+ width: 3rem;
125
+ display: inline-block;
126
+ position: relative;
127
+ `}
128
+ `;
129
+ });
130
+ StyledProgressBar.defaultProps = defaultThemeProp;
131
+ export const StyledProgressEllipsis = styled.div(({ theme, placement }) => {
132
+ return css `
133
+ line-height: 1;
134
+ display: ${placement === 'inline' ? 'inline-flex' : 'block'};
135
+
136
+ @keyframes LoadingEllipsis {
137
+ 0% {
138
+ transform: scale(0);
139
+ opacity: 0;
140
+ }
141
+
142
+ 50% {
143
+ transform: scale(1);
144
+ opacity: 1;
145
+ }
146
+
147
+ 100% {
148
+ transform: scale(0);
149
+ opacity: 0;
150
+ }
151
+ }
152
+
153
+ ${placement === 'block' &&
154
+ css `
155
+ margin-block: calc(2 * ${theme.base.spacing});
156
+ `}
157
+
158
+ > span {
159
+ display: flex;
160
+ justify-content: center;
161
+ mix-blend-mode: multiply;
162
+
163
+ ${placement === 'inline' &&
164
+ css `
165
+ display: inline-flex;
166
+ margin-left: 0.1875rem;
167
+ `}
168
+ }
169
+
170
+ > span span {
171
+ margin: 0 0.3125rem;
172
+ background: ${theme.components.progress['progress-color']};
173
+ border-radius: 50%;
174
+ animation: LoadingEllipsis calc(4 * ${theme.base.animation.speed}) infinite;
175
+
176
+ ${placement === 'global' &&
177
+ css `
178
+ width: 1.25rem;
179
+ height: 1.25rem;
180
+ `}
181
+
182
+ ${(placement === 'local' || placement === 'block') &&
183
+ css `
184
+ width: 0.625rem;
185
+ height: 0.625rem;
186
+ `}
187
+
188
+ ${placement === 'inline' &&
189
+ css `
190
+ width: 0.1875rem;
191
+ height: 0.1875rem;
192
+ margin: 0 0.1875rem;
193
+ animation-duration: calc(4 * ${theme.base.animation.speed});
194
+ `}
195
+
196
+ &:nth-child(2) {
197
+ animation-delay: 0.1667s;
198
+ }
199
+
200
+ &:nth-child(3) {
201
+ animation-delay: ${0.1667 * 2}s;
202
+ }
203
+ }
204
+ `;
205
+ });
206
+ StyledProgressEllipsis.defaultProps = defaultThemeProp;
207
+ //# sourceMappingURL=Progress.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.styles.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.styles.ts"],"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AAC;;;KAGlC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { rgba, readableColor } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { calculateFontSize, FontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\n\nimport { ProgressProps } from './Progress.types';\n\nexport const StyledMessage = styled.span(({ theme }) => {\n const color = tryCatch(() => {\n return rgba(\n readableColor(theme.base.palette['primary-background']),\n theme.base.transparency['transparent-3']\n );\n });\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n margin-top: 0.5rem;\n font-size: ${fontSize[theme.components.label['font-size'] as FontSize]};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${color};\n `;\n});\n\nStyledMessage.defaultProps = defaultThemeProp;\n\nexport const StyledProgressRing = styled.div<\n Pick<ProgressProps, 'placement'> & { determinate: boolean }\n>(({ theme, placement, determinate }) => {\n const size = placement === 'inline' ? '1em' : '2rem';\n\n return css`\n @keyframes LoadingRing {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n }\n position: relative;\n\n svg {\n display: block;\n width: ${size};\n height: ${size};\n\n circle {\n fill: transparent;\n stroke: ${theme.base.colors.gray['extra-light']};\n stroke-width: 2;\n r: 45%;\n cx: 50%;\n cy: 50%;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n\n &:nth-child(2) {\n stroke: ${theme.components.progress['progress-color']};\n transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n\n ${!determinate &&\n css`\n animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;\n `}\n }\n }\n\n ${placement === 'block' &&\n css`\n margin: calc(2 * ${theme.base.spacing}) auto;\n `}\n }\n\n ${placement === 'inline' &&\n css`\n display: inline-flex;\n vertical-align: top;\n `}\n `;\n});\n\nStyledProgressRing.defaultProps = defaultThemeProp;\n\nexport const StyledProgressBar = styled.div<ProgressProps & { determinate: boolean }>(\n ({ theme, placement, determinate }) => {\n return css`\n background-color: ${theme.base.colors.gray['extra-light']};\n border-radius: ${theme.base['border-radius']};\n width: calc(100% - ${placement === 'local' ? css`4 * ${theme.base.spacing}` : '0rem'});\n height: 0.375rem;\n min-width: 2rem;\n max-width: min(calc(100vw - 4 * ${theme.base.spacing}), ${theme.base['content-width'].lg});\n overflow: hidden;\n\n @keyframes LoadingBar {\n 0% {\n transform: translateX(-100%);\n }\n\n 100% {\n transform: translateX(200%);\n }\n }\n\n ::before {\n content: '';\n display: block;\n height: 100%;\n width: 100%;\n left: 0;\n border-radius: ${theme.base['border-radius']};\n background-color: ${theme.components.progress['progress-color']};\n ${determinate &&\n css`\n transform: translateX(var(--progress, 0));\n transform-origin: 0 50%;\n transition: transform calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n `}\n\n ${!determinate &&\n css`\n animation: LoadingBar calc(8 * ${theme.base.animation.speed}) linear infinite;\n width: 50%;\n `}\n }\n\n ${placement === 'block' &&\n css`\n margin-block: calc(2 * ${theme.base.spacing});\n `}\n\n ${placement === 'inline' &&\n css`\n width: 3rem;\n display: inline-block;\n position: relative;\n `}\n `;\n }\n);\n\nStyledProgressBar.defaultProps = defaultThemeProp;\n\nexport const StyledProgressEllipsis = styled.div<Pick<ProgressProps, 'placement'>>(\n ({ theme, placement }) => {\n return css`\n line-height: 1;\n display: ${placement === 'inline' ? 'inline-flex' : 'block'};\n\n @keyframes LoadingEllipsis {\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n\n 50% {\n transform: scale(1);\n opacity: 1;\n }\n\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n ${placement === 'block' &&\n css`\n margin-block: calc(2 * ${theme.base.spacing});\n `}\n\n > span {\n display: flex;\n justify-content: center;\n mix-blend-mode: multiply;\n\n ${placement === 'inline' &&\n css`\n display: inline-flex;\n margin-left: 0.1875rem;\n `}\n }\n\n > span span {\n margin: 0 0.3125rem;\n background: ${theme.components.progress['progress-color']};\n border-radius: 50%;\n animation: LoadingEllipsis calc(4 * ${theme.base.animation.speed}) infinite;\n\n ${placement === 'global' &&\n css`\n width: 1.25rem;\n height: 1.25rem;\n `}\n\n ${(placement === 'local' || placement === 'block') &&\n css`\n width: 0.625rem;\n height: 0.625rem;\n `}\n\n ${placement === 'inline' &&\n css`\n width: 0.1875rem;\n height: 0.1875rem;\n margin: 0 0.1875rem;\n animation-duration: calc(4 * ${theme.base.animation.speed});\n `}\n\n &:nth-child(2) {\n animation-delay: 0.1667s;\n }\n\n &:nth-child(3) {\n animation-delay: ${0.1667 * 2}s;\n }\n }\n `;\n }\n);\n\nStyledProgressEllipsis.defaultProps = defaultThemeProp;\n"]}
@@ -25,7 +25,7 @@ export interface ProgressProps extends BaseProps, NoChildrenProp {
25
25
  * Determines the placement of the component.
26
26
  * @default "global"
27
27
  */
28
- placement?: 'global' | 'local' | 'inline';
28
+ placement?: 'global' | 'local' | 'block' | 'inline';
29
29
  /**
30
30
  * When true, fade in occurs when component mounts.
31
31
  * When false, mounted component fades out then re-renders self and returns null, removing itself from the DOM.
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.types.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/Progress.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC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C,CAAC;IACzD,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAC3D,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.types.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '../../types';\nimport { BackdropProps } from '../Backdrop/Backdrop';\n\nexport interface ProgressProps extends BaseProps, NoChildrenProp {\n /**\n * Determines which variant should be rendered.\n * @default \"ring\"\n */\n variant?: 'ring' | 'bar' | 'ellipsis';\n /**\n * Minimum possible value.\n * @default 0\n */\n minValue?: number;\n /**\n * Maximum possible value.\n * @default 100\n */\n maxValue?: number;\n /** Current progress value within the range specified, or the default range of 0-100. */\n value?: number;\n /** Provides a message to the user along with the component. */\n message?: string;\n /**\n * Determines the placement of the component.\n * @default \"global\"\n */\n placement?: 'global' | 'local' | 'inline';\n /**\n * When true, fade in occurs when component mounts.\n * When false, mounted component fades out then re-renders self and returns null, removing itself from the DOM.\n * This is technically not the same as unmounting via parent.\n * @default true\n */\n visible?: boolean;\n /** Called when the css transition ends on the way in. */\n onTransitionEndIn?: BackdropProps['onAfterTransitionIn'];\n /** Called when the css transition ends on the way out...A good time to unmount! */\n onTransitionEndOut?: BackdropProps['onAfterTransitionOut'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"Progress.types.js","sourceRoot":"","sources":["../../../src/components/Progress/Progress.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '../../types';\nimport { BackdropProps } from '../Backdrop/Backdrop';\n\nexport interface ProgressProps extends BaseProps, NoChildrenProp {\n /**\n * Determines which variant should be rendered.\n * @default \"ring\"\n */\n variant?: 'ring' | 'bar' | 'ellipsis';\n /**\n * Minimum possible value.\n * @default 0\n */\n minValue?: number;\n /**\n * Maximum possible value.\n * @default 100\n */\n maxValue?: number;\n /** Current progress value within the range specified, or the default range of 0-100. */\n value?: number;\n /** Provides a message to the user along with the component. */\n message?: string;\n /**\n * Determines the placement of the component.\n * @default \"global\"\n */\n placement?: 'global' | 'local' | 'block' | 'inline';\n /**\n * When true, fade in occurs when component mounts.\n * When false, mounted component fades out then re-renders self and returns null, removing itself from the DOM.\n * This is technically not the same as unmounting via parent.\n * @default true\n */\n visible?: boolean;\n /** Called when the css transition ends on the way in. */\n onTransitionEndIn?: BackdropProps['onAfterTransitionIn'];\n /** Called when the css transition ends on the way out...A good time to unmount! */\n onTransitionEndOut?: BackdropProps['onAfterTransitionOut'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -1,9 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ForwardProps } from '../../types';
3
3
  import { ProgressProps } from './Progress.types';
4
- export declare const StyledProgressRing: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<ProgressProps, "placement"> & {
5
- determinate: boolean;
6
- }, never>;
7
4
  declare const Ring: FC<ProgressProps & ForwardProps>;
8
5
  export default Ring;
9
6
  //# sourceMappingURL=Ring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ring.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,kBAAkB;iBACqB,OAAO;SAuDzD,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAqC1C,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Ring.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAqC1C,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,63 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { defaultThemeProp } from '../../theme';
5
- export const StyledProgressRing = styled.div(({ theme, placement, determinate }) => {
6
- return css `
7
- position: relative;
8
- min-width: 1em;
9
- min-height: 1em;
10
-
11
- @keyframes LoadingRing {
12
- 0% {
13
- transform: rotate(0deg);
14
- }
15
-
16
- 100% {
17
- transform: rotate(360deg);
18
- }
19
- }
20
-
21
- svg {
22
- display: block;
23
- position: absolute;
24
- height: 100%;
25
-
26
- circle {
27
- fill: transparent;
28
- stroke: ${theme.base.colors.gray['extra-light']};
29
- stroke-width: 2;
30
- r: 45%;
31
- cx: 50%;
32
- cy: 50%;
33
- transform: rotate(-90deg);
34
- transform-origin: 50% 50%;
35
-
36
- &:nth-child(2) {
37
- stroke: ${theme.components.progress['progress-color']};
38
- transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})
39
- ${theme.base.animation.timing.ease};
40
-
41
- ${!determinate &&
42
- css `
43
- animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;
44
- `}
45
- }
46
- }
47
- }
48
-
49
- ${placement === 'inline'
50
- ? css `
51
- display: inline-flex;
52
- vertical-align: top;
53
- `
54
- : css `
55
- width: 2rem;
56
- height: 2rem;
57
- `}
58
- `;
59
- });
60
- StyledProgressRing.defaultProps = defaultThemeProp;
3
+ import { StyledProgressRing } from './Progress.styles';
61
4
  const Ring = forwardRef(({ value, minValue = 0, maxValue = 100, placement, ...restProps }, ref) => {
62
5
  let strokeDashoffset;
63
6
  const circumference = 18 * Math.PI;
@@ -1 +1 @@
1
- {"version":3,"file":"Ring.js","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmB,MAAM,OAAO,CAAC;AACxD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAE1C,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACtC,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;kBAsBM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;;;;oBASnC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;qDACV,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;cACjE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;YAElC,CAAC,WAAW;QACd,GAAG,CAAA;8CACiC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;WAC7D;;;;;MAKL,SAAS,KAAK,QAAQ;QACtB,CAAC,CAAC,GAAG,CAAA;;;SAGF;QACH,CAAC,CAAC,GAAG,CAAA;;;SAGF;GACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,IAAI,GAAqC,UAAU,CACvD,CACE,EACE,KAAK,EACL,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,GAAG,EACd,SAAS,EACT,GAAG,SAAS,EACmB,EACjC,GAAyB,EACzB,EAAE;IACF,IAAI,gBAAgB,CAAC;IACrB,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,aAAa,CAAC;SAC5E,IAAI,KAAK,GAAG,QAAQ,IAAI,QAAQ,GAAG,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC;SAClE,IAAI,KAAK,GAAG,QAAQ;QAAE,gBAAgB,GAAG,aAAa,CAAC;;QACvD,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG,aAAa,CAAC;IAEzF,OAAO,CACL,KAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,aAAa,mBACH,QAAQ,mBACR,QAAQ,mBACR,KAAK,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,KAClC,SAAS,YAEb,eAAK,OAAO,EAAC,WAAW,aACtB,kBAAU,EACV,iBAAQ,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,GAAI,IACnE,GACa,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { ForwardProps } from '../../types';\n\nimport { ProgressProps } from './Progress.types';\n\nexport const StyledProgressRing = styled.div<\n Pick<ProgressProps, 'placement'> & { determinate: boolean }\n>(({ theme, placement, determinate }) => {\n return css`\n position: relative;\n min-width: 1em;\n min-height: 1em;\n\n @keyframes LoadingRing {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n }\n\n svg {\n display: block;\n position: absolute;\n height: 100%;\n\n circle {\n fill: transparent;\n stroke: ${theme.base.colors.gray['extra-light']};\n stroke-width: 2;\n r: 45%;\n cx: 50%;\n cy: 50%;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n\n &:nth-child(2) {\n stroke: ${theme.components.progress['progress-color']};\n transition: stroke-dashoffset calc(0.5 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n\n ${!determinate &&\n css`\n animation: LoadingRing calc(4 * ${theme.base.animation.speed}) linear infinite;\n `}\n }\n }\n }\n\n ${placement === 'inline'\n ? css`\n display: inline-flex;\n vertical-align: top;\n `\n : css`\n width: 2rem;\n height: 2rem;\n `}\n `;\n});\n\nStyledProgressRing.defaultProps = defaultThemeProp;\n\nconst Ring: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n placement,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n let strokeDashoffset;\n const circumference = 18 * Math.PI;\n\n if (typeof value !== 'number') strokeDashoffset = (1 - 33 / 100) * circumference;\n else if (value > maxValue || minValue > maxValue) strokeDashoffset = 0;\n else if (value < minValue) strokeDashoffset = circumference;\n else strokeDashoffset = (1 - (value - minValue) / (maxValue - minValue)) * circumference;\n\n return (\n <StyledProgressRing\n ref={ref}\n role='progressbar'\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n aria-valuenow={value}\n placement={placement}\n determinate={typeof value === 'number'}\n {...restProps}\n >\n <svg viewBox='0 0 20 20'>\n <circle />\n <circle strokeDasharray={circumference} style={{ strokeDashoffset }} />\n </svg>\n </StyledProgressRing>\n );\n }\n);\n\nexport default Ring;\n"]}
1
+ {"version":3,"file":"Ring.js","sourceRoot":"","sources":["../../../src/components/Progress/Ring.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmB,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,MAAM,IAAI,GAAqC,UAAU,CACvD,CACE,EACE,KAAK,EACL,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,GAAG,EACd,SAAS,EACT,GAAG,SAAS,EACmB,EACjC,GAAyB,EACzB,EAAE;IACF,IAAI,gBAAgB,CAAC;IACrB,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,aAAa,CAAC;SAC5E,IAAI,KAAK,GAAG,QAAQ,IAAI,QAAQ,GAAG,QAAQ;QAAE,gBAAgB,GAAG,CAAC,CAAC;SAClE,IAAI,KAAK,GAAG,QAAQ;QAAE,gBAAgB,GAAG,aAAa,CAAC;;QACvD,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG,aAAa,CAAC;IAEzF,OAAO,CACL,KAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,aAAa,mBACH,QAAQ,mBACR,QAAQ,mBACR,KAAK,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,KAClC,SAAS,YAEb,eAAK,OAAO,EAAC,WAAW,aACtB,kBAAU,EACV,iBAAQ,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,GAAI,IACnE,GACa,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef } from 'react';\n\nimport { ForwardProps } from '../../types';\n\nimport { StyledProgressRing } from './Progress.styles';\nimport { ProgressProps } from './Progress.types';\n\nconst Ring: FC<ProgressProps & ForwardProps> = forwardRef(\n (\n {\n value,\n minValue = 0,\n maxValue = 100,\n placement,\n ...restProps\n }: PropsWithoutRef<ProgressProps>,\n ref: ProgressProps['ref']\n ) => {\n let strokeDashoffset;\n const circumference = 18 * Math.PI;\n\n if (typeof value !== 'number') strokeDashoffset = (1 - 33 / 100) * circumference;\n else if (value > maxValue || minValue > maxValue) strokeDashoffset = 0;\n else if (value < minValue) strokeDashoffset = circumference;\n else strokeDashoffset = (1 - (value - minValue) / (maxValue - minValue)) * circumference;\n\n return (\n <StyledProgressRing\n ref={ref}\n role='progressbar'\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n aria-valuenow={value}\n placement={placement}\n determinate={typeof value === 'number'}\n {...restProps}\n >\n <svg viewBox='0 0 20 20'>\n <circle />\n <circle strokeDasharray={circumference} style={{ strokeDashoffset }} />\n </svg>\n </StyledProgressRing>\n );\n }\n);\n\nexport default Ring;\n"]}
@@ -1,6 +1,4 @@
1
1
  export { default } from './Progress';
2
2
  export { ProgressProps } from './Progress.types';
3
- export { StyledProgressBar } from './Bar';
4
- export { StyledProgressRing } from './Ring';
5
- export { StyledProgressEllipsis } from './Ellipsis';
3
+ export { StyledProgressBar, StyledProgressRing, StyledProgressEllipsis } from './Progress.styles';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,5 +1,3 @@
1
1
  export { default } from './Progress';
2
- export { StyledProgressBar } from './Bar';
3
- export { StyledProgressRing } from './Ring';
4
- export { StyledProgressEllipsis } from './Ellipsis';
2
+ export { StyledProgressBar, StyledProgressRing, StyledProgressEllipsis } from './Progress.styles';
5
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './Progress';\nexport { ProgressProps } from './Progress.types';\nexport { StyledProgressBar } from './Bar';\nexport { StyledProgressRing } from './Ring';\nexport { StyledProgressEllipsis } from './Ellipsis';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './Progress';\nexport { ProgressProps } from './Progress.types';\nexport { StyledProgressBar, StyledProgressRing, StyledProgressEllipsis } from './Progress.styles';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SkipLinks.d.ts","sourceRoot":"","sources":["../../../src/components/SkipLinks/SkipLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAS9C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,8TAuB1B,CAAC;AAIH,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAgEhC,CAAC;AAEH,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SkipLinks.d.ts","sourceRoot":"","sources":["../../../src/components/SkipLinks/SkipLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AAUjC,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,8TAuB1B,CAAC;AAIH,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAoChC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo, useCallback } from 'react';
2
+ import { memo } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { hideVisually } from 'polished';
5
5
  import { defaultThemeProp } from '../../theme';
6
+ import { focusHeadingOrContainer } from '../../utils';
6
7
  import Button, { StyledButton } from '../Button';
7
8
  import Popover from '../Popover';
8
9
  import Flex from '../Flex';
@@ -26,30 +27,6 @@ export const StyledSkipLinks = styled(Popover)(props => {
26
27
  });
27
28
  StyledSkipLinks.defaultProps = defaultThemeProp;
28
29
  const SkipLinks = memo(({ items }) => {
29
- const onClick = useCallback((item) => {
30
- const selectedEl = document.querySelector(item.target.selector);
31
- const container = selectedEl ?? document;
32
- const heading = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].reduce((el, tag) => el ?? container.querySelector(tag), null);
33
- const target = heading ?? selectedEl;
34
- if (!target)
35
- return;
36
- if (target === selectedEl && !selectedEl.hasAttribute('aria-label')) {
37
- selectedEl.setAttribute('aria-label', item.target.ariaLabel);
38
- selectedEl.addEventListener('focusout', () => {
39
- selectedEl.removeAttribute('aria-label');
40
- }, { once: true });
41
- }
42
- if (target.hasAttribute('tabindex')) {
43
- target.focus();
44
- }
45
- else {
46
- target.setAttribute('tabindex', '-1');
47
- target.focus();
48
- target.addEventListener('focusout', () => {
49
- target.removeAttribute('tabindex');
50
- }, { once: true });
51
- }
52
- }, []);
53
30
  return (_jsx(Flex, { as: StyledSkipLinks, container: { gap: 0.5, direction: 'column' }, show: true, placement: 'bottom-end', target: {
54
31
  getBoundingClientRect: () => ({
55
32
  height: 0,
@@ -61,7 +38,7 @@ const SkipLinks = memo(({ items }) => {
61
38
  left: 24,
62
39
  right: 24
63
40
  })
64
- }, children: items.map(item => (_jsx(Button, { variant: 'link', onClick: () => onClick(item), children: item.label }, item.label))) }));
41
+ }, children: items.map(item => (_jsx(Button, { variant: 'link', onClick: () => focusHeadingOrContainer(document.querySelector(item.target.selector) ?? document, item.target.ariaLabel), children: item.label }, item.label))) }));
65
42
  });
66
43
  export default SkipLinks;
67
44
  //# sourceMappingURL=SkipLinks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkipLinks.js","sourceRoot":"","sources":["../../../src/components/SkipLinks/SkipLinks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,M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B,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAkB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YACjE,IAAI,CAAC,KAAK,IADe,IAAI,CAAC,KAAK,CAE7B,CACV,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC","sourcesContent":["import { FC, memo, useCallback } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport Button, { StyledButton } from '../Button';\nimport Popover from '../Popover';\nimport Flex from '../Flex';\n\ninterface SkipLink {\n label: string;\n target: { ariaLabel: string; selector: string };\n}\n\nexport interface SkipLinksProps {\n items: SkipLink[];\n}\n\nexport const StyledSkipLinks = styled(Popover)(props => {\n const {\n theme: {\n base: { 'z-index': zIndices, spacing }\n }\n } = props;\n\n const z = Math.max(...Object.values(zIndices)) + 1;\n\n return css`\n position: fixed;\n z-index: ${z};\n padding: ${spacing};\n\n & > ${StyledButton} {\n margin: 0;\n display: block;\n }\n\n &:not(:focus-within) {\n ${hideVisually}\n }\n `;\n});\n\nStyledSkipLinks.defaultProps = defaultThemeProp;\n\nconst SkipLinks: FC<SkipLinksProps> = memo(({ items }: SkipLinksProps) => {\n const onClick = useCallback((item: SkipLink) => {\n const selectedEl = document.querySelector(item.target.selector) as HTMLElement;\n const container = selectedEl ?? document;\n\n const heading = (\n ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const\n ).reduce<HTMLHeadingElement | null>((el, tag) => el ?? container.querySelector(tag), null);\n\n const target = heading ?? selectedEl;\n if (!target) return;\n\n if (target === selectedEl && !selectedEl.hasAttribute('aria-label')) {\n selectedEl.setAttribute('aria-label', item.target.ariaLabel);\n selectedEl.addEventListener(\n 'focusout',\n () => {\n selectedEl.removeAttribute('aria-label');\n },\n { once: true }\n );\n }\n\n if (target.hasAttribute('tabindex')) {\n target.focus();\n } else {\n target.setAttribute('tabindex', '-1');\n target.focus();\n target.addEventListener(\n 'focusout',\n () => {\n target.removeAttribute('tabindex');\n },\n { once: true }\n );\n }\n }, []);\n\n return (\n <Flex\n as={StyledSkipLinks}\n container={{ gap: 0.5, direction: 'column' }}\n show\n placement='bottom-end'\n target={{\n getBoundingClientRect: () => ({\n height: 0,\n width: 0,\n x: 24,\n y: 24,\n top: 24,\n bottom: 24,\n left: 24,\n right: 24\n })\n }}\n >\n {items.map(item => (\n <Button variant='link' key={item.label} onClick={() => onClick(item)}>\n {item.label}\n </Button>\n ))}\n </Flex>\n );\n});\n\nexport default SkipLinks;\n"]}
1
+ {"version":3,"file":"SkipLinks.js","sourceRoot":"","sources":["../../../src/components/SkipLinks/SkipLinks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,IAAI,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAW3B,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE;IACrD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EACvC,EACF,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;IAEnD,OAAO,GAAG,CAAA;;eAEG,CAAC;eACD,OAAO;;UAEZ,YAAY;;;;;;QAMd,YAAY;;GAEjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,SAAS,GAAuB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE;IACvE,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAC5C,IAAI,QACJ,SAAS,EAAC,YAAY,EACtB,MAAM,EAAE;YACN,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC5B,MAAM,EAAE,CAAC;gBACT,KAAK,EAAE,CAAC;gBACR,CAAC,EAAE,EAAE;gBACL,CAAC,EAAE,EAAE;gBACL,GAAG,EAAE,EAAE;gBACP,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,KAAK,EAAE,EAAE;aACV,CAAC;SACH,YAEA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EAEd,OAAO,EAAE,GAAG,EAAE,CACZ,uBAAuB,CACrB,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,EACxD,IAAI,CAAC,MAAM,CAAC,SAAS,CACtB,YAGF,IAAI,CAAC,KAAK,IARN,IAAI,CAAC,KAAK,CASR,CACV,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC","sourcesContent":["import { FC, memo } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { focusHeadingOrContainer } from '../../utils';\nimport Button, { StyledButton } from '../Button';\nimport Popover from '../Popover';\nimport Flex from '../Flex';\n\ninterface SkipLink {\n label: string;\n target: { ariaLabel: string; selector: string };\n}\n\nexport interface SkipLinksProps {\n items: SkipLink[];\n}\n\nexport const StyledSkipLinks = styled(Popover)(props => {\n const {\n theme: {\n base: { 'z-index': zIndices, spacing }\n }\n } = props;\n\n const z = Math.max(...Object.values(zIndices)) + 1;\n\n return css`\n position: fixed;\n z-index: ${z};\n padding: ${spacing};\n\n & > ${StyledButton} {\n margin: 0;\n display: block;\n }\n\n &:not(:focus-within) {\n ${hideVisually}\n }\n `;\n});\n\nStyledSkipLinks.defaultProps = defaultThemeProp;\n\nconst SkipLinks: FC<SkipLinksProps> = memo(({ items }: SkipLinksProps) => {\n return (\n <Flex\n as={StyledSkipLinks}\n container={{ gap: 0.5, direction: 'column' }}\n show\n placement='bottom-end'\n target={{\n getBoundingClientRect: () => ({\n height: 0,\n width: 0,\n x: 24,\n y: 24,\n top: 24,\n bottom: 24,\n left: 24,\n right: 24\n })\n }}\n >\n {items.map(item => (\n <Button\n variant='link'\n key={item.label}\n onClick={() =>\n focusHeadingOrContainer(\n document.querySelector(item.target.selector) ?? document,\n item.target.ariaLabel\n )\n }\n >\n {item.label}\n </Button>\n ))}\n </Flex>\n );\n});\n\nexport default SkipLinks;\n"]}
@@ -64,7 +64,7 @@ const getHorizontalStyles = ({ selected, theme, inverted }) => {
64
64
  &:focus,
65
65
  &:not([disabled]):focus {
66
66
  ${activeStyle(lightenedColor)}
67
- box-shadow: inset ${theme.base.shadow.focus};
67
+ box-shadow: ${theme.base.shadow['focus-inset']};
68
68
  text-decoration: none;
69
69
  }
70
70
 
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,UAAU,EAAwB,MAAM,OAAO,CAAC;AACxE,OAAO,MAAM,EAAE,EAAe,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE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jD,CACE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,EAA6B,EAC/F,GAA2B,EAC3B,EAAE;IACF,OAAO,CACL,MAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,KACT,SAAS,aAEb,+BAAoB,OAAO,YAAG,OAAO,GAAQ,EAC5C,KAAK,IACI,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { FC, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { StyledProps, css } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport { StyledCount } from '../Badges/Count';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\n\nimport { TabsProps } from './Tabs.types';\n\ninterface TabProps {\n /** Indicates if this Tab is active. */\n selected: boolean;\n /**\n * Indicates if the styling of this Tab is inverted.\n * @deprecated\n */\n inverted: boolean;\n /** The text to display as the name of the Tab. */\n content: string;\n /** A number to associate with the Tab. */\n count?: ReactNode;\n /** Determines the direction in which the Tab will render. */\n type: TabsProps['type'];\n /** Disables the tab if true */\n disabled?: boolean;\n}\n\nexport interface StyledTabProps {\n selected: TabProps['selected'];\n inverted: TabProps['inverted'];\n tabType: TabProps['type'];\n}\n\nconst activeStyle = (color: string) => css`\n ::after {\n display: block;\n background-color: ${color};\n }\n`;\n\nconst getHorizontalStyles = ({ selected, theme, inverted }: StyledProps<StyledTabProps>) => {\n const primaryColor = inverted\n ? theme.components.tabs.inverted.foreground\n : theme.components.tabs.base.foreground;\n const lightenedColor = tryCatch(() => transparentize(0.3, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n align-items: center;\n display: flex;\n flex-direction: row;\n height: calc(4 * ${spacing});\n padding: 0 calc(2 * ${spacing});\n border: none;\n text-decoration: none;\n\n span:first-of-type {\n color: ${selected ? primaryColor : theme.base.palette['foreground-color']};\n display: inline-block;\n\n ::before {\n content: attr(data-content);\n display: block;\n font-weight: bold;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n ::after {\n background: ${selected ? primaryColor : lightenedColor};\n display: ${selected ? 'block' : 'none'};\n content: '';\n position: absolute;\n height: 0.125rem;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(lightenedColor)}\n box-shadow: inset ${theme.base.shadow.focus};\n text-decoration: none;\n }\n\n ${StyledCount} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n `;\n};\n\nconst getVerticalStyles = ({ selected, theme }: StyledProps<StyledTabProps>) => {\n const borderColor = theme.base.palette['border-line'];\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.5, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-style: solid;\n color: ${theme.base.palette['foreground-color']};\n border-width: 0.0625rem 0;\n border-color: ${borderColor};\n height: calc(5.5 * ${spacing});\n margin-top: -0.0625rem;\n padding: 0 calc(2 * ${spacing});\n text-decoration: none;\n\n &:first-child {\n border-top: 0.0625rem solid ${borderColor};\n }\n\n ::after {\n content: '';\n position: absolute;\n display: ${selected ? 'block' : 'none'};\n top: 0;\n bottom: 0;\n right: 0;\n width: 0.25rem;\n background: ${primaryColor};\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(primaryColor)}\n box-shadow: inset 0 0 0 0.0625rem ${primaryColor};\n text-decoration: none;\n }\n `;\n};\n\nexport const StyledTab = styled(BareButton)<StyledTabProps>`\n position: relative;\n background: none;\n cursor: pointer;\n\n ${props =>\n props.tabType === 'horizontal' ? getHorizontalStyles(props) : getVerticalStyles(props)}\n ${props =>\n props.selected &&\n css`\n font-weight: bold;\n `}\n white-space: nowrap;\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: ${props => props.theme.base['disabled-opacity']};\n }\n`;\n\nStyledTab.defaultProps = defaultThemeProp;\n\nconst Tab: FC<TabProps & ForwardProps> = forwardRef(\n (\n { selected, inverted, content, count, type, disabled, ...restProps }: PropsWithoutRef<TabProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n return (\n <StyledTab\n ref={ref}\n selected={selected}\n inverted={inverted}\n tabType={type}\n disabled={disabled}\n type='button'\n {...restProps}\n >\n <span data-content={content}>{content}</span>\n {count}\n </StyledTab>\n );\n }\n);\n\nexport default Tab;\n"]}
1
+ {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,UAAU,EAAwB,MAAM,OAAO,CAAC;AACxE,OAAO,MAAM,EAAE,EAAe,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AA4B9C,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAA;;;wBAGlB,KAAK;;CAE5B,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,EA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B,IAAI,EAAC,QAAQ,KACT,SAAS,aAEb,+BAAoB,OAAO,YAAG,OAAO,GAAQ,EAC5C,KAAK,IACI,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { FC, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { StyledProps, css } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport { StyledCount } from '../Badges/Count';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\n\nimport { TabsProps } from './Tabs.types';\n\ninterface TabProps {\n /** Indicates if this Tab is active. */\n selected: boolean;\n /**\n * Indicates if the styling of this Tab is inverted.\n * @deprecated\n */\n inverted: boolean;\n /** The text to display as the name of the Tab. */\n content: string;\n /** A number to associate with the Tab. */\n count?: ReactNode;\n /** Determines the direction in which the Tab will render. */\n type: TabsProps['type'];\n /** Disables the tab if true */\n disabled?: boolean;\n}\n\nexport interface StyledTabProps {\n selected: TabProps['selected'];\n inverted: TabProps['inverted'];\n tabType: TabProps['type'];\n}\n\nconst activeStyle = (color: string) => css`\n ::after {\n display: block;\n background-color: ${color};\n }\n`;\n\nconst getHorizontalStyles = ({ selected, theme, inverted }: StyledProps<StyledTabProps>) => {\n const primaryColor = inverted\n ? theme.components.tabs.inverted.foreground\n : theme.components.tabs.base.foreground;\n const lightenedColor = tryCatch(() => transparentize(0.3, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n align-items: center;\n display: flex;\n flex-direction: row;\n height: calc(4 * ${spacing});\n padding: 0 calc(2 * ${spacing});\n border: none;\n text-decoration: none;\n\n span:first-of-type {\n color: ${selected ? primaryColor : theme.base.palette['foreground-color']};\n display: inline-block;\n\n ::before {\n content: attr(data-content);\n display: block;\n font-weight: bold;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n ::after {\n background: ${selected ? primaryColor : lightenedColor};\n display: ${selected ? 'block' : 'none'};\n content: '';\n position: absolute;\n height: 0.125rem;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(lightenedColor)}\n box-shadow: ${theme.base.shadow['focus-inset']};\n text-decoration: none;\n }\n\n ${StyledCount} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n `;\n};\n\nconst getVerticalStyles = ({ selected, theme }: StyledProps<StyledTabProps>) => {\n const borderColor = theme.base.palette['border-line'];\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.5, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-style: solid;\n color: ${theme.base.palette['foreground-color']};\n border-width: 0.0625rem 0;\n border-color: ${borderColor};\n height: calc(5.5 * ${spacing});\n margin-top: -0.0625rem;\n padding: 0 calc(2 * ${spacing});\n text-decoration: none;\n\n &:first-child {\n border-top: 0.0625rem solid ${borderColor};\n }\n\n ::after {\n content: '';\n position: absolute;\n display: ${selected ? 'block' : 'none'};\n top: 0;\n bottom: 0;\n right: 0;\n width: 0.25rem;\n background: ${primaryColor};\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(primaryColor)}\n box-shadow: inset 0 0 0 0.0625rem ${primaryColor};\n text-decoration: none;\n }\n `;\n};\n\nexport const StyledTab = styled(BareButton)<StyledTabProps>`\n position: relative;\n background: none;\n cursor: pointer;\n\n ${props =>\n props.tabType === 'horizontal' ? getHorizontalStyles(props) : getVerticalStyles(props)}\n ${props =>\n props.selected &&\n css`\n font-weight: bold;\n `}\n white-space: nowrap;\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: ${props => props.theme.base['disabled-opacity']};\n }\n`;\n\nStyledTab.defaultProps = defaultThemeProp;\n\nconst Tab: FC<TabProps & ForwardProps> = forwardRef(\n (\n { selected, inverted, content, count, type, disabled, ...restProps }: PropsWithoutRef<TabProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n return (\n <StyledTab\n ref={ref}\n selected={selected}\n inverted={inverted}\n tabType={type}\n disabled={disabled}\n type='button'\n {...restProps}\n >\n <span data-content={content}>{content}</span>\n {count}\n </StyledTab>\n );\n }\n);\n\nexport default Tab;\n"]}
@@ -24,7 +24,7 @@ const StyledToastButton = styled.button(({ theme }) => css `
24
24
  }
25
25
 
26
26
  &:enabled:focus {
27
- box-shadow: ${theme.base.shadow['focus-inverted']};
27
+ box-shadow: ${theme.base.shadow.focus};
28
28
  }
29
29
  `);
30
30
  StyledToastButton.defaultProps = defaultThemeProp;