@redsift/design-system 11.6.0-muiv5-alpha.5 → 11.6.0-muiv5-alpha.6

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 (269) hide show
  1. package/_internal/Alert.d2.ts +54 -0
  2. package/_internal/Alert2.js +182 -39
  3. package/_internal/AppBar.d.ts +37 -0
  4. package/_internal/AppBar.js +240 -29
  5. package/_internal/AppContainer.d.ts +96 -0
  6. package/_internal/AppContainer.js +132 -86
  7. package/_internal/AppContent.d.ts +25 -0
  8. package/_internal/AppContent.js +84 -17
  9. package/_internal/Badge.d2.ts +9 -0
  10. package/_internal/Badge2.js +137 -4
  11. package/_internal/BreadcrumbItem.d.ts +9 -0
  12. package/_internal/BreadcrumbItem.js +85 -3
  13. package/_internal/Breadcrumbs.d2.ts +29 -0
  14. package/_internal/Breadcrumbs2.js +86 -21
  15. package/_internal/Button.d2.ts +30 -0
  16. package/_internal/Button2.js +81 -20
  17. package/_internal/ButtonGroup.d.ts +41 -0
  18. package/_internal/ButtonGroup.js +165 -25
  19. package/_internal/ButtonLink.d.ts +28 -0
  20. package/_internal/ButtonLink.js +74 -18
  21. package/_internal/Card.d2.ts +35 -0
  22. package/_internal/Card2.js +151 -29
  23. package/_internal/CardActions.d.ts +9 -0
  24. package/_internal/CardActions.js +38 -3
  25. package/_internal/CardBody.d.ts +9 -0
  26. package/_internal/CardBody.js +36 -3
  27. package/_internal/CardHeader.d.ts +9 -0
  28. package/_internal/CardHeader.js +77 -3
  29. package/_internal/Checkbox.d2.ts +68 -0
  30. package/_internal/Checkbox2.js +234 -58
  31. package/_internal/CheckboxGroup.d.ts +10 -0
  32. package/_internal/CheckboxGroup.js +182 -4
  33. package/_internal/ConditionalWrapper.d.ts +14 -0
  34. package/_internal/ConditionalWrapper.js +11 -12
  35. package/_internal/DetailedCard.d.ts +52 -0
  36. package/_internal/DetailedCard.js +6912 -48
  37. package/_internal/DetailedCardCollapsibleSectionItems.d.ts +9 -0
  38. package/_internal/DetailedCardCollapsibleSectionItems.js +58 -3
  39. package/_internal/DetailedCardHeader.d.ts +9 -0
  40. package/_internal/DetailedCardHeader.js +61 -3
  41. package/_internal/DetailedCardSection.d.ts +9 -0
  42. package/_internal/DetailedCardSection.js +166 -3
  43. package/_internal/DetailedCardSectionItem.d.ts +9 -0
  44. package/_internal/DetailedCardSectionItem.js +88 -3
  45. package/_internal/Flexbox.d2.ts +30 -0
  46. package/_internal/Flexbox2.js +85 -22
  47. package/_internal/Grid.d2.ts +32 -0
  48. package/_internal/Grid2.js +87 -24
  49. package/_internal/GridItem.d.ts +9 -0
  50. package/_internal/GridItem.js +34 -3
  51. package/_internal/Heading.d2.ts +9 -0
  52. package/_internal/Heading2.js +107 -3
  53. package/_internal/Icon.d2.ts +10 -0
  54. package/_internal/Icon2.js +206 -5
  55. package/_internal/IconButton.d.ts +12 -0
  56. package/_internal/IconButton.js +71 -3
  57. package/_internal/IconButtonLink.d.ts +28 -0
  58. package/_internal/IconButtonLink.js +65 -18
  59. package/_internal/Item.d2.ts +82 -0
  60. package/_internal/Item2.js +390 -73
  61. package/_internal/Link.d2.ts +26 -0
  62. package/_internal/Link2.js +56 -15
  63. package/_internal/LinkButton.d.ts +23 -0
  64. package/_internal/LinkButton.js +56 -13
  65. package/_internal/Number.d2.ts +69 -0
  66. package/_internal/Number2.js +103 -61
  67. package/_internal/NumberField.d.ts +80 -0
  68. package/_internal/NumberField.js +3959 -65
  69. package/_internal/Pill.d2.ts +9 -0
  70. package/_internal/Pill2.js +400 -4
  71. package/_internal/ProgressBar.d.ts +26 -0
  72. package/_internal/ProgressBar.js +61 -18
  73. package/_internal/Radio.d2.ts +66 -0
  74. package/_internal/Radio2.js +227 -56
  75. package/_internal/RadioGroup.d.ts +10 -0
  76. package/_internal/RadioGroup.js +170 -4
  77. package/_internal/Shield.d2.ts +9 -0
  78. package/_internal/Shield2.js +220 -4
  79. package/_internal/SideNavigationMenu.d.ts +9 -0
  80. package/_internal/SideNavigationMenu.js +586 -4
  81. package/_internal/{SideNavigationMenuBar.js → SideNavigationMenuBar.d.ts} +1 -1
  82. package/_internal/SideNavigationMenuItem.d.ts +9 -0
  83. package/_internal/SideNavigationMenuItem.js +299 -4
  84. package/_internal/Skeleton.d2.ts +15 -0
  85. package/_internal/Skeleton2.js +36 -9
  86. package/_internal/SkeletonCircle.d.ts +9 -0
  87. package/_internal/SkeletonCircle.js +52 -3
  88. package/_internal/SkeletonText.d.ts +9 -0
  89. package/_internal/SkeletonText.js +71 -3
  90. package/_internal/Spinner.d2.ts +43 -0
  91. package/_internal/Spinner2.js +319 -29
  92. package/_internal/Switch.d2.ts +66 -0
  93. package/_internal/Switch2.js +310 -56
  94. package/_internal/SwitchGroup.d.ts +10 -0
  95. package/_internal/SwitchGroup.js +182 -4
  96. package/_internal/Text.d2.ts +9 -0
  97. package/_internal/Text2.js +45 -3
  98. package/_internal/TextArea.d.ts +34 -0
  99. package/_internal/TextArea.js +430 -20
  100. package/_internal/TextField.d.ts +29 -0
  101. package/_internal/TextField.js +463 -19
  102. package/_internal/alert.d.ts +5 -0
  103. package/_internal/alert.js +2 -5
  104. package/_internal/app-bar.d.ts +8 -0
  105. package/_internal/app-bar.js +2 -8
  106. package/_internal/app-container.d.ts +9 -0
  107. package/_internal/app-container.js +3 -9
  108. package/_internal/app-content.d.ts +5 -0
  109. package/_internal/app-content.js +2 -5
  110. package/_internal/app-side-panel.d.ts +11 -0
  111. package/_internal/app-side-panel.js +3 -11
  112. package/_internal/badge.d.ts +6 -0
  113. package/_internal/badge.js +2 -6
  114. package/_internal/breadcrumb-item.d.ts +5 -0
  115. package/_internal/breadcrumb-item.js +1 -4
  116. package/_internal/breadcrumbs.d.ts +6 -0
  117. package/_internal/breadcrumbs.js +2 -6
  118. package/_internal/button-group.d.ts +5 -0
  119. package/_internal/button-group.js +2 -5
  120. package/_internal/button-link.d.ts +8 -0
  121. package/_internal/button-link.js +2 -8
  122. package/_internal/button.d.ts +8 -0
  123. package/_internal/button.js +3 -8
  124. package/_internal/card-actions.d.ts +5 -0
  125. package/_internal/card-actions.js +1 -4
  126. package/_internal/card-body.d.ts +5 -0
  127. package/_internal/card-body.js +1 -4
  128. package/_internal/card-header.d.ts +9 -0
  129. package/_internal/card-header.js +1 -8
  130. package/_internal/card.d.ts +11 -0
  131. package/_internal/card.js +2 -11
  132. package/_internal/checkbox-group.d.ts +6 -0
  133. package/_internal/checkbox-group.js +2 -6
  134. package/_internal/checkbox.d.ts +6 -0
  135. package/_internal/checkbox.js +2 -6
  136. package/_internal/colors.d.ts +102 -0
  137. package/_internal/colors.js +87 -91
  138. package/_internal/conditional-wrapper.d.ts +2 -0
  139. package/_internal/conditional-wrapper.js +2 -2
  140. package/_internal/detailed-card-collapsible-section-items.d.ts +4 -0
  141. package/_internal/detailed-card-collapsible-section-items.js +1 -3
  142. package/_internal/detailed-card-header.d.ts +8 -0
  143. package/_internal/detailed-card-header.js +1 -7
  144. package/_internal/detailed-card-section-item.d.ts +11 -0
  145. package/_internal/detailed-card-section-item.js +1 -10
  146. package/_internal/detailed-card-section.d.ts +7 -0
  147. package/_internal/detailed-card-section.js +1 -6
  148. package/_internal/detailed-card.d.ts +16 -0
  149. package/_internal/detailed-card.js +2 -16
  150. package/_internal/flexbox.d.ts +5 -0
  151. package/_internal/flexbox.js +2 -5
  152. package/_internal/focus-within-group.d.ts +3 -0
  153. package/_internal/focus-within-group.js +3 -3
  154. package/_internal/fonts.d.ts +12 -0
  155. package/_internal/fonts.js +4 -6
  156. package/_internal/gradient-border.d.ts +19 -0
  157. package/_internal/gradient-border.js +35 -16
  158. package/_internal/grid-item.d.ts +5 -0
  159. package/_internal/grid-item.js +1 -4
  160. package/_internal/grid.d.ts +6 -0
  161. package/_internal/grid.js +2 -6
  162. package/_internal/heading.d.ts +7 -0
  163. package/_internal/heading.js +2 -6
  164. package/_internal/icon-button-link.d.ts +8 -0
  165. package/_internal/icon-button-link.js +2 -8
  166. package/_internal/icon-button.d.ts +7 -0
  167. package/_internal/icon-button.js +2 -6
  168. package/_internal/icon.d.ts +6 -0
  169. package/_internal/icon.js +2 -6
  170. package/_internal/item.d.ts +8 -0
  171. package/_internal/item.js +2 -8
  172. package/_internal/link-button.d.ts +8 -0
  173. package/_internal/link-button.js +2 -8
  174. package/_internal/link.d.ts +8 -0
  175. package/_internal/link.js +3 -8
  176. package/_internal/listbox.d.ts +6 -0
  177. package/_internal/listbox.js +3 -6
  178. package/_internal/number-field.d.ts +9 -0
  179. package/_internal/number-field.js +2 -9
  180. package/_internal/number.d.ts +7 -0
  181. package/_internal/number.js +2 -7
  182. package/_internal/pill.d.ts +6 -0
  183. package/_internal/pill.js +2 -6
  184. package/_internal/progress-bar.d.ts +5 -0
  185. package/_internal/progress-bar.js +2 -5
  186. package/_internal/radio-group.d.ts +6 -0
  187. package/_internal/radio-group.js +2 -6
  188. package/_internal/radio.d.ts +6 -0
  189. package/_internal/radio.js +2 -6
  190. package/_internal/shared.d.ts +5 -0
  191. package/_internal/shared.js +2 -5
  192. package/_internal/shield.d.ts +6 -0
  193. package/_internal/shield.js +2 -6
  194. package/_internal/side-navigation-menu-bar.d.ts +9 -0
  195. package/_internal/side-navigation-menu-bar.js +3 -9
  196. package/_internal/side-navigation-menu-item.d.ts +8 -0
  197. package/_internal/side-navigation-menu-item.js +2 -8
  198. package/_internal/side-navigation-menu.d.ts +8 -0
  199. package/_internal/side-navigation-menu.js +2 -8
  200. package/_internal/skeleton-circle.d.ts +7 -0
  201. package/_internal/skeleton-circle.js +1 -6
  202. package/_internal/skeleton-text.d.ts +7 -0
  203. package/_internal/skeleton-text.js +2 -6
  204. package/_internal/skeleton.d.ts +8 -0
  205. package/_internal/skeleton.js +1 -7
  206. package/_internal/spinner.d.ts +5 -0
  207. package/_internal/spinner.js +2 -5
  208. package/_internal/styles.d.ts +17 -0
  209. package/_internal/styles.d2.ts +283 -0
  210. package/_internal/styles.js +235 -17
  211. package/_internal/styles2.js +44 -280
  212. package/_internal/switch-group.d.ts +6 -0
  213. package/_internal/switch-group.js +2 -6
  214. package/_internal/switch.d.ts +6 -0
  215. package/_internal/switch.js +2 -6
  216. package/_internal/text-area.d.ts +9 -0
  217. package/_internal/text-area.js +2 -9
  218. package/_internal/text-field.d.ts +10 -0
  219. package/_internal/text-field.js +2 -10
  220. package/_internal/text.d.ts +7 -0
  221. package/_internal/text.js +2 -6
  222. package/_internal/theme.d.ts +4 -0
  223. package/_internal/theme.js +1 -3
  224. package/_internal/types.d.ts +39 -0
  225. package/_internal/{types10.js → types.d10.ts} +1 -1
  226. package/_internal/{types11.js → types.d11.ts} +1 -1
  227. package/_internal/{types12.js → types.d12.ts} +4 -4
  228. package/_internal/{types14.js → types.d14.ts} +1 -1
  229. package/_internal/{types15.js → types.d15.ts} +1 -1
  230. package/_internal/{types16.js → types.d16.ts} +2 -2
  231. package/_internal/{types17.js → types.d17.ts} +1 -1
  232. package/_internal/{types18.js → types.d18.ts} +2 -2
  233. package/_internal/{types19.js → types.d19.ts} +2 -2
  234. package/_internal/types.d2.ts +37 -0
  235. package/_internal/{types20.js → types.d20.ts} +1 -1
  236. package/_internal/{types21.js → types.d21.ts} +1 -1
  237. package/_internal/{types22.js → types.d22.ts} +1 -1
  238. package/_internal/{types23.js → types.d23.ts} +2 -2
  239. package/_internal/{types24.js → types.d24.ts} +1 -1
  240. package/_internal/{types25.js → types.d25.ts} +1 -1
  241. package/_internal/{types26.js → types.d26.ts} +1 -1
  242. package/_internal/{types27.js → types.d27.ts} +1 -1
  243. package/_internal/{types28.js → types.d28.ts} +1 -1
  244. package/_internal/{types29.js → types.d29.ts} +4 -4
  245. package/_internal/types.d3.ts +23 -0
  246. package/_internal/{types4.js → types.d4.ts} +2 -2
  247. package/_internal/{types5.js → types.d5.ts} +1 -1
  248. package/_internal/{types6.js → types.d6.ts} +1 -1
  249. package/_internal/{types7.js → types.d7.ts} +3 -3
  250. package/_internal/{types8.js → types.d8.ts} +1 -1
  251. package/_internal/types.js +7 -31
  252. package/_internal/types2.js +18 -29
  253. package/_internal/types3.js +15 -18
  254. package/_internal/useAppSidePanel.d.ts +12 -0
  255. package/_internal/useAppSidePanel.js +331 -6
  256. package/_internal/useFocusOnList.d.ts +83 -0
  257. package/_internal/useFocusOnList.js +502 -44
  258. package/_internal/useListboxItem.d.ts +32 -0
  259. package/_internal/useListboxItem.js +120 -23
  260. package/_internal/useSideNavigationMenuBar.d.ts +9 -0
  261. package/_internal/useSideNavigationMenuBar.js +371 -7
  262. package/_internal/useTheme.d.ts +13 -0
  263. package/_internal/useTheme.js +10 -8
  264. package/index.d.ts +1738 -0
  265. package/index.js +523 -1674
  266. package/package.json +2 -2
  267. /package/_internal/{helpers.js → helpers.d.ts} +0 -0
  268. /package/_internal/{types13.js → types.d13.ts} +0 -0
  269. /package/_internal/{types9.js → types.d9.ts} +0 -0
@@ -1,32 +1,95 @@
1
- import { G as GridItemProps } from './types14.js';
2
- import { ComponentProps } from 'react';
3
- import { h as StylingProps, I as InternalSpacingProps, G as GridLayoutProps, B as BorderProps } from './styles2.js';
4
- import { T as Theme } from './colors.js';
5
- import { C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled, { css } from 'styled-components';
5
+ import { i as baseStyling, c as baseInternalSpacing, h as baseGrid, f as baseBorder } from './styles4.js';
6
+ import { G as GridItem } from './GridItem.js';
7
+ import { u as useTheme, a as ThemeProvider } from './useTheme.js';
6
8
 
7
9
  /**
8
- * Component props.
10
+ * Component style.
9
11
  */
10
- interface GridProps extends ComponentProps<'div'>, StylingProps, InternalSpacingProps, GridLayoutProps, BorderProps {
11
- /** Whether the grid has divider or not. The number of pixels defining the gap between columns and rows is mandatory. This replaces the grid gap property. */
12
- divider?: {
13
- colGap: number;
14
- rowGap: number;
15
- };
16
- /** Theme. */
17
- theme?: Theme;
18
- }
19
- type StyledGridProps = GridProps & {
20
- $divider: GridProps['divider'];
21
- $theme: GridProps['theme'];
22
- };
12
+ const StyledGrid = styled.div`
13
+ display: ${_ref => {
14
+ let {
15
+ inline
16
+ } = _ref;
17
+ return inline ? 'inline-grid' : 'grid';
18
+ }};
19
+ flex: 1;
20
+
21
+ ${baseStyling}
22
+ ${baseInternalSpacing}
23
+ ${baseGrid}
24
+ ${baseBorder}
25
+
26
+ ${_ref2 => {
27
+ let {
28
+ $divider
29
+ } = _ref2;
30
+ return $divider ? css`
31
+ overflow: hidden;
32
+ > .redsift-grid-item:not(:empty) {
33
+ position: relative;
34
+
35
+ ::before {
36
+ content: '';
37
+ position: absolute;
38
+ background-color: var(--redsift-color-neutral-light-grey);
39
+ inline-size: 1px;
40
+ block-size: 100%;
41
+ inset-inline-start: calc(${Math.max(1, $divider.colGap / 2)}px * -1);
42
+ }
43
+
44
+ ::after {
45
+ content: '';
46
+ position: absolute;
47
+ background-color: var(--redsift-color-neutral-light-grey);
48
+ inline-size: 200vw;
49
+ block-size: 1px;
50
+ inset-inline-start: -100vw;
51
+ inset-block-start: calc(${Math.max(1, $divider.rowGap / 2)}px * -1);
52
+ z-index: 0;
53
+ }
54
+ }
55
+ ` : '';
56
+ }}
57
+ `;
58
+
59
+ const _excluded = ["children", "className", "divider", "gap", "theme"];
60
+ const COMPONENT_NAME = 'Grid';
61
+ const CLASSNAME = 'redsift-grid';
23
62
 
24
63
  /**
25
64
  * The Grid component.
26
65
  */
27
- declare const BaseGrid: Comp<GridProps, HTMLDivElement>;
28
- declare const Grid: Comp<GridProps, HTMLDivElement> & {
29
- Item: Comp<GridItemProps, HTMLDivElement>;
30
- };
66
+ const BaseGrid = /*#__PURE__*/forwardRef((props, ref) => {
67
+ const {
68
+ children,
69
+ className,
70
+ divider,
71
+ gap,
72
+ theme: propsTheme
73
+ } = props,
74
+ forwardedProps = _objectWithoutProperties(props, _excluded);
75
+ const theme = useTheme(propsTheme);
76
+ return /*#__PURE__*/React__default.createElement(ThemeProvider, {
77
+ value: {
78
+ theme
79
+ }
80
+ }, /*#__PURE__*/React__default.createElement(StyledGrid, _extends({}, forwardedProps, {
81
+ gap: divider ? `${divider.rowGap}px ${divider.colGap}px` : gap,
82
+ className: classNames(BaseGrid.className, className),
83
+ ref: ref,
84
+ $divider: divider,
85
+ $theme: theme
86
+ }), children));
87
+ });
88
+ BaseGrid.className = CLASSNAME;
89
+ BaseGrid.displayName = COMPONENT_NAME;
90
+ const Grid = Object.assign(BaseGrid, {
91
+ Item: GridItem
92
+ });
31
93
 
32
- export { BaseGrid as B, GridProps as G, StyledGridProps as S, Grid as a };
94
+ export { BaseGrid as B, Grid as G };
95
+ //# sourceMappingURL=Grid2.js.map
@@ -0,0 +1,9 @@
1
+ import { G as GridItemProps } from './types.d14.ts';
2
+ import { C as Comp } from './helpers.js';
3
+
4
+ /**
5
+ * The GridItem component.
6
+ */
7
+ declare const GridItem: Comp<GridItemProps, HTMLDivElement>;
8
+
9
+ export { GridItem as G };
@@ -1,9 +1,40 @@
1
- import { G as GridItemProps } from './types14.js';
2
- import { C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled from 'styled-components';
5
+ import { i as baseStyling, c as baseInternalSpacing, f as baseBorder } from './styles4.js';
6
+
7
+ /**
8
+ * Component style.
9
+ */
10
+ const StyledGridItem = styled.div`
11
+ display: inherit;
12
+
13
+ ${baseStyling}
14
+ ${baseInternalSpacing}
15
+ ${baseBorder}
16
+ `;
17
+
18
+ const _excluded = ["children", "className"];
19
+ const COMPONENT_NAME = 'GridItem';
20
+ const CLASSNAME = 'redsift-grid-item';
3
21
 
4
22
  /**
5
23
  * The GridItem component.
6
24
  */
7
- declare const GridItem: Comp<GridItemProps, HTMLDivElement>;
25
+ const GridItem = /*#__PURE__*/forwardRef((props, ref) => {
26
+ const {
27
+ children,
28
+ className
29
+ } = props,
30
+ forwardedProps = _objectWithoutProperties(props, _excluded);
31
+ return /*#__PURE__*/React__default.createElement(StyledGridItem, _extends({}, forwardedProps, {
32
+ className: classNames(GridItem.className, className),
33
+ ref: ref
34
+ }), children);
35
+ });
36
+ GridItem.className = CLASSNAME;
37
+ GridItem.displayName = COMPONENT_NAME;
8
38
 
9
39
  export { GridItem as G };
40
+ //# sourceMappingURL=GridItem.js.map
@@ -0,0 +1,9 @@
1
+ import { b as HeadingProps } from './types.d15.ts';
2
+ import { C as Comp } from './helpers.js';
3
+
4
+ /**
5
+ * The Heading component.
6
+ */
7
+ declare const Heading: Comp<HeadingProps, HTMLDivElement>;
8
+
9
+ export { Heading as H };
@@ -1,9 +1,113 @@
1
- import { b as HeadingProps } from './types15.js';
2
- import { C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled, { css } from 'styled-components';
5
+ import { i as baseStyling } from './styles4.js';
6
+ import { N as NotificationsColorPalette, g as NeutralColorPalette, e as ProductColorPalette } from './colors.js';
7
+ import { F as FontFamily } from './fonts.js';
8
+ import { u as useTheme } from './useTheme.js';
9
+
10
+ /**
11
+ * Component style.
12
+ */
13
+ const StyledHeading = styled.span`
14
+ margin: 0;
15
+ padding: 0;
16
+ border: 0;
17
+ font-size: 100%;
18
+ font: inherit;
19
+ vertical-align: baseline;
20
+
21
+ ${baseStyling}
22
+
23
+ ${_ref => {
24
+ let {
25
+ $color,
26
+ $theme
27
+ } = _ref;
28
+ return $color && $color === 'radar' ? css`
29
+ background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
30
+ background-clip: text;
31
+ color: transparent;
32
+ ` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
33
+ color: var(--redsift-color-notifications-${$color}-primary);
34
+ ` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
35
+ color: var(--redsift-color-neutral-${$color});
36
+ ` : Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
37
+ color: var(--redsift-color-product-${$color});
38
+ ` : css`
39
+ color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};
40
+ `;
41
+ }}
42
+
43
+ ${_ref2 => {
44
+ let {
45
+ $variant,
46
+ $fontFamily,
47
+ $fontSize,
48
+ $fontWeight,
49
+ $lineHeight
50
+ } = _ref2;
51
+ return css`
52
+ font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`var(--redsift-typography-${$variant !== null && $variant !== void 0 ? $variant : 'body'}-font-family)`};
53
+ font-size: ${$fontSize ? $fontSize : css`var(--redsift-typography-${$variant !== null && $variant !== void 0 ? $variant : 'body'}-font-size)`};
54
+ font-weight: ${$fontWeight ? $fontWeight : css`var(--redsift-typography-${$variant !== null && $variant !== void 0 ? $variant : 'body'}-font-weight)`};
55
+ line-height: ${$lineHeight ? $lineHeight : css`var(--redsift-typography-${$variant !== null && $variant !== void 0 ? $variant : 'body'}-line-height)`};
56
+ `;
57
+ }}
58
+
59
+ ${_ref3 => {
60
+ let {
61
+ $noWrap
62
+ } = _ref3;
63
+ return $noWrap ? css`
64
+ overflow: hidden;
65
+ text-overflow: ellipsis;
66
+ white-space: nowrap;
67
+ ` : '';
68
+ }}
69
+ `;
70
+
71
+ const _excluded = ["as", "children", "className", "color", "fontFamily", "fontSize", "fontWeight", "lineHeight", "noWrap", "theme", "variant"];
72
+ const COMPONENT_NAME = 'Heading';
73
+ const CLASSNAME = 'redsift-heading';
3
74
 
4
75
  /**
5
76
  * The Heading component.
6
77
  */
7
- declare const Heading: Comp<HeadingProps, HTMLDivElement>;
78
+ const Heading = /*#__PURE__*/forwardRef((props, ref) => {
79
+ const {
80
+ as,
81
+ children,
82
+ className,
83
+ color,
84
+ fontFamily = FontFamily.poppins,
85
+ fontSize,
86
+ fontWeight,
87
+ lineHeight,
88
+ noWrap,
89
+ theme: propsTheme,
90
+ variant
91
+ } = props,
92
+ forwardedProps = _objectWithoutProperties(props, _excluded);
93
+ const theme = useTheme(propsTheme);
94
+ return /*#__PURE__*/React__default.createElement(StyledHeading, _extends({
95
+ as: as
96
+ }, forwardedProps, {
97
+ className: classNames(Heading.className, className),
98
+ ref: ref,
99
+ $noWrap: noWrap,
100
+ $theme: theme,
101
+ $color: color,
102
+ $fontFamily: fontFamily,
103
+ $fontSize: fontSize,
104
+ $fontWeight: fontWeight,
105
+ $lineHeight: lineHeight,
106
+ $variant: variant ? variant : as === 'span' ? 'body' : as
107
+ }), children);
108
+ });
109
+ Heading.className = CLASSNAME;
110
+ Heading.displayName = COMPONENT_NAME;
8
111
 
9
112
  export { Heading as H };
113
+ //# sourceMappingURL=Heading2.js.map
@@ -0,0 +1,10 @@
1
+ import { I as IconSize, a as IconDimensions, b as IconProps } from './types.d17.ts';
2
+ import { C as Comp } from './helpers.js';
3
+
4
+ declare const sizeToDimension: (size: IconSize | IconDimensions) => IconDimensions;
5
+ /**
6
+ * The Icon component.
7
+ */
8
+ declare const Icon: Comp<IconProps, HTMLSpanElement>;
9
+
10
+ export { Icon as I, sizeToDimension as s };
@@ -1,10 +1,211 @@
1
- import { I as IconSize, a as IconDimensions, b as IconProps } from './types17.js';
2
- import { C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends, _ as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled, { css } from 'styled-components';
5
+ import { i as baseStyling } from './styles4.js';
6
+ import { N as NotificationsColorPalette, e as ProductColorPalette, T as Theme } from './colors.js';
7
+ import { u as useTheme } from './useTheme.js';
8
+
9
+ /**
10
+ * Component size.
11
+ */
12
+ const IconSize = {
13
+ xsmall: 'xsmall',
14
+ small: 'small',
15
+ medium: 'medium',
16
+ large: 'large',
17
+ xlarge: 'xlarge',
18
+ xxlarge: 'xxlarge'
19
+ };
20
+
21
+ /**
22
+ * Component props.
23
+ */
24
+
25
+ /**
26
+ * Component style.
27
+ */
28
+ const StyledIcon = styled.span`
29
+ position: relative;
30
+ display: inline-grid;
31
+ ${baseStyling}
32
+
33
+ font-style: normal;
34
+
35
+ svg {
36
+ vertical-align: -0.125em;
37
+ grid-column: 1;
38
+ grid-row: 1;
39
+ }
40
+
41
+ ${_ref => {
42
+ let {
43
+ $color,
44
+ $theme
45
+ } = _ref;
46
+ return $color && Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
47
+ color: var(--redsift-color-notifications-${$color}-primary);
48
+ ` : $color && Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
49
+ color: var(--redsift-color-product-${$color});
50
+ ` : css`
51
+ color: ${$color || css`var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'})`};
52
+ `;
53
+ }}
54
+
55
+ ${_ref2 => {
56
+ let {
57
+ $width,
58
+ $height,
59
+ $fontSize,
60
+ $lineHeight
61
+ } = _ref2;
62
+ return css`
63
+ ${$width ? css`
64
+ width: ${$width}px;
65
+ ` : ''}
66
+ ${$height ? css`
67
+ height: ${$height}px;
68
+ ` : ''}
69
+ ${$fontSize ? css`
70
+ font-size: ${$fontSize}px;
71
+ ` : ''}
72
+ ${$lineHeight ? css`
73
+ line-height: ${$lineHeight}px;
74
+ ` : ''}
75
+
76
+ & .redsift-badge-standard {
77
+ grid-column: 1;
78
+ grid-row: 1;
79
+ margin-right: unset;
80
+ ${$width ? css`
81
+ margin-left: ${$width * 0.75}px;
82
+ ` : ''}
83
+ ${$height ? css`
84
+ margin-top: ${$height * 0.1 - 4}px;
85
+ ` : ''}
86
+ }
87
+
88
+ & .redsift-badge-dot {
89
+ grid-column: 1;
90
+ grid-row: 1;
91
+ margin-right: unset;
92
+ ${$width ? css`
93
+ margin-left: ${$width * 0.8}px;
94
+ ` : ''}
95
+ ${$height ? css`
96
+ margin-top: ${$height * 0.2 - 3}px;
97
+ ` : ''}
98
+ }
99
+ `;
100
+ }}
101
+ `;
102
+
103
+ const _excluded = ["aria-hidden", "aria-label", "badge", "className", "color", "icon", "size", "svgProps", "theme"];
104
+ const COMPONENT_NAME = 'Icon';
105
+ const CLASSNAME = 'redsift-icon';
106
+ const sizeToDimension = size => {
107
+ if (typeof size !== 'string') {
108
+ return size;
109
+ }
110
+ switch (size) {
111
+ case IconSize.xsmall:
112
+ return {
113
+ width: 16,
114
+ height: 16,
115
+ fontSize: 16,
116
+ lineHeight: 16
117
+ };
118
+ case IconSize.small:
119
+ return {
120
+ width: 20,
121
+ height: 20,
122
+ fontSize: 20,
123
+ lineHeight: 20
124
+ };
125
+ case IconSize.medium:
126
+ default:
127
+ return {
128
+ width: 24,
129
+ height: 24,
130
+ fontSize: 24,
131
+ lineHeight: 24
132
+ };
133
+ case IconSize.large:
134
+ return {
135
+ width: 30,
136
+ height: 30,
137
+ fontSize: 30,
138
+ lineHeight: 30
139
+ };
140
+ case IconSize.xlarge:
141
+ return {
142
+ width: 40,
143
+ height: 40,
144
+ fontSize: 40,
145
+ lineHeight: 40
146
+ };
147
+ case IconSize.xxlarge:
148
+ return {
149
+ width: 55,
150
+ height: 55,
151
+ fontSize: 55,
152
+ lineHeight: 55
153
+ };
154
+ }
155
+ };
3
156
 
4
- declare const sizeToDimension: (size: IconSize | IconDimensions) => IconDimensions;
5
157
  /**
6
158
  * The Icon component.
7
159
  */
8
- declare const Icon: Comp<IconProps, HTMLSpanElement>;
160
+ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
161
+ const {
162
+ 'aria-hidden': ariaHidden,
163
+ 'aria-label': ariaLabel,
164
+ badge,
165
+ className,
166
+ color,
167
+ icon,
168
+ size = IconSize.medium,
169
+ svgProps,
170
+ theme: propsTheme
171
+ } = props,
172
+ forwardedProps = _objectWithoutProperties(props, _excluded);
173
+ const theme = useTheme(propsTheme);
174
+ const {
175
+ width,
176
+ height,
177
+ fontSize,
178
+ lineHeight
179
+ } = sizeToDimension(size);
180
+ return /*#__PURE__*/React__default.createElement(StyledIcon, _extends({}, forwardedProps, {
181
+ $color: color,
182
+ $width: width,
183
+ $height: height,
184
+ $fontSize: fontSize,
185
+ $lineHeight: lineHeight,
186
+ $theme: theme,
187
+ "aria-hidden": ariaLabel ? ariaHidden ? ariaHidden : undefined : true,
188
+ "aria-label": ariaLabel,
189
+ className: classNames(Icon.className, className, color ? 'colored' : undefined),
190
+ ref: ref
191
+ }), /*#__PURE__*/React__default.cloneElement(typeof icon === 'string' || Array.isArray(icon) && icon.every(it => typeof it === 'string') ? /*#__PURE__*/React__default.createElement("svg", {
192
+ viewBox: "0 0 24 24"
193
+ }, (Array.isArray(icon) ? icon : [icon]).map(path => /*#__PURE__*/React__default.createElement("path", {
194
+ key: path,
195
+ d: path,
196
+ fill: "currentColor"
197
+ }))) : /*#__PURE__*/React__default.isValidElement(icon) ? icon : /*#__PURE__*/React__default.createElement(React__default.Fragment, null), _objectSpread2({
198
+ 'aria-hidden': ariaLabel ? ariaHidden ? ariaHidden : undefined : true,
199
+ 'aria-label': ariaLabel,
200
+ focusable: 'false',
201
+ height,
202
+ preserveAspectRatio: 'xMidYMid meet',
203
+ role: 'img',
204
+ width
205
+ }, svgProps)), badge ? badge : null);
206
+ });
207
+ Icon.className = CLASSNAME;
208
+ Icon.displayName = COMPONENT_NAME;
9
209
 
10
- export { Icon as I, sizeToDimension as s };
210
+ export { IconSize as I, Icon as a, sizeToDimension as s };
211
+ //# sourceMappingURL=Icon2.js.map
@@ -0,0 +1,12 @@
1
+ import { b as IconButtonProps } from './types.d16.ts';
2
+ import { C as Comp } from './helpers.js';
3
+
4
+ /**
5
+ * The Icon Button is a component that contains only one icon as a child, without text.
6
+ *
7
+ * This component should use aria-label, aria-labelledby or aria-describedby to make this
8
+ * component usable with a screen reader.
9
+ */
10
+ declare const IconButton: Comp<IconButtonProps, HTMLButtonElement>;
11
+
12
+ export { IconButton as I };
@@ -1,5 +1,18 @@
1
- import { b as IconButtonProps } from './types16.js';
2
- import { C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef, useRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
5
+ import { I as IconButtonVariant, S as StyledIconButton } from './styles2.js';
6
+ import { StyledGradientBorder } from './gradient-border.js';
7
+ import { u as useTheme } from './useTheme.js';
8
+ import { B as ButtonsColorPalette } from './colors.js';
9
+ import { C as ConditionalWrapper } from './ConditionalWrapper.js';
10
+ import { S as Spinner } from './Spinner2.js';
11
+ import { a as Icon } from './Icon2.js';
12
+
13
+ const _excluded = ["className", "color", "disabled", "icon", "iconProps", "isActive", "isDisabled", "isHovered", "isLoading", "theme", "variant"];
14
+ const COMPONENT_NAME = 'IconButton';
15
+ const CLASSNAME = 'redsift-icon-button';
3
16
 
4
17
  /**
5
18
  * The Icon Button is a component that contains only one icon as a child, without text.
@@ -7,6 +20,61 @@ import { C as Comp } from './helpers.js';
7
20
  * This component should use aria-label, aria-labelledby or aria-describedby to make this
8
21
  * component usable with a screen reader.
9
22
  */
10
- declare const IconButton: Comp<IconButtonProps, HTMLButtonElement>;
23
+ const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
24
+ const buttonRef = ref || useRef();
25
+ const {
26
+ className,
27
+ color: propsColor,
28
+ disabled,
29
+ icon,
30
+ iconProps,
31
+ isActive,
32
+ isDisabled: propsIsDisabled,
33
+ isHovered,
34
+ isLoading,
35
+ theme: propsTheme,
36
+ variant: propsVariant
37
+ } = props,
38
+ forwardedProps = _objectWithoutProperties(props, _excluded);
39
+ const isDisabled = props.isLoading || propsIsDisabled || disabled;
40
+ const theme = useTheme(propsTheme);
41
+ const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
42
+ const variant = Object.values(IconButtonVariant).includes(propsVariant) ? propsVariant : 'unstyled';
43
+ warnIfNoAccessibleLabelFound(props, undefined, 'IconButton');
44
+ const isGradient = color === ButtonsColorPalette.radar;
45
+ return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
46
+ condition: isGradient && variant === IconButtonVariant.secondary,
47
+ wrapper: children => /*#__PURE__*/React__default.createElement(StyledGradientBorder, {
48
+ $color: color,
49
+ $isActive: isActive,
50
+ $isDisabled: isDisabled,
51
+ $isHovered: isHovered,
52
+ $theme: theme
53
+ }, children)
54
+ }, /*#__PURE__*/React__default.createElement(StyledIconButton, _extends({
55
+ type: "button"
56
+ }, forwardedProps, {
57
+ $color: color,
58
+ $isActive: isActive,
59
+ $isDisabled: isDisabled,
60
+ $isGradient: isGradient,
61
+ $isHovered: isHovered,
62
+ $isLoading: isLoading,
63
+ $theme: theme,
64
+ $variant: variant,
65
+ "aria-disabled": isDisabled,
66
+ className: classNames(IconButton.className, className),
67
+ disabled: isDisabled,
68
+ ref: buttonRef
69
+ }), isLoading ? /*#__PURE__*/React__default.createElement(Spinner, {
70
+ size: "small",
71
+ color: variant === IconButtonVariant.primary ? 'grey-l1' : 'grey-l2'
72
+ }) : /*#__PURE__*/React__default.createElement(Icon, _extends({}, iconProps, {
73
+ icon: icon
74
+ }))));
75
+ });
76
+ IconButton.className = CLASSNAME;
77
+ IconButton.displayName = COMPONENT_NAME;
11
78
 
12
79
  export { IconButton as I };
80
+ //# sourceMappingURL=IconButton.js.map
@@ -0,0 +1,28 @@
1
+ import { b as IconButtonProps } from './types.d16.ts';
2
+ import { L as LinkProps } from './types.d18.ts';
3
+ import { C as Comp } from './helpers.js';
4
+
5
+ /**
6
+ * Component props.
7
+ */
8
+ interface IconButtonLinkProps extends Omit<LinkProps, 'color'>, Pick<IconButtonProps, 'icon' | 'iconProps' | 'color' | 'isActive' | 'isDisabled' | 'isHovered' | 'variant' | 'theme'> {
9
+ }
10
+ type StyledIconButtonLinkProps = Omit<IconButtonLinkProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size'> & {
11
+ $isActive: IconButtonLinkProps['isActive'];
12
+ $isDisabled: IconButtonLinkProps['isDisabled'];
13
+ $isHovered: IconButtonLinkProps['isHovered'];
14
+ $variant: IconButtonLinkProps['variant'];
15
+ $theme: IconButtonLinkProps['theme'];
16
+ $color: IconButtonLinkProps['color'];
17
+ };
18
+
19
+ /**
20
+ * The IconButtonLink is a semantic link that looks like an icon button.
21
+ *
22
+ * For a semantic button that looks like an icon button, please use the IconButton component.
23
+ * For a semantic link that looks like a link, please use the Link component.
24
+ * For a semantic button that looks like a link, please use the LinkButton component.
25
+ */
26
+ declare const IconButtonLink: Comp<IconButtonLinkProps, HTMLAnchorElement>;
27
+
28
+ export { IconButtonLinkProps as I, StyledIconButtonLinkProps as S, IconButtonLink as a };