@dxc-technology/halstack-react 0.0.0-d618bea → 0.0.0-d80caba

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 (243) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6734 -0
  3. package/dist/index.d.ts +6734 -0
  4. package/dist/index.js +14279 -0
  5. package/dist/index.mjs +14190 -0
  6. package/package.json +69 -68
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -48
  9. package/ThemeContext.d.ts +0 -15
  10. package/ThemeContext.js +0 -243
  11. package/V3Select/V3Select.js +0 -455
  12. package/V3Select/index.d.ts +0 -27
  13. package/V3Textarea/V3Textarea.js +0 -260
  14. package/V3Textarea/index.d.ts +0 -27
  15. package/accordion/Accordion.d.ts +0 -4
  16. package/accordion/Accordion.js +0 -258
  17. package/accordion/types.d.ts +0 -68
  18. package/accordion/types.js +0 -5
  19. package/accordion-group/AccordionGroup.d.ts +0 -7
  20. package/accordion-group/AccordionGroup.js +0 -170
  21. package/accordion-group/AccordionGroup.stories.tsx +0 -225
  22. package/accordion-group/types.d.ts +0 -72
  23. package/accordion-group/types.js +0 -5
  24. package/alert/Alert.d.ts +0 -4
  25. package/alert/Alert.js +0 -290
  26. package/alert/Alert.stories.tsx +0 -170
  27. package/alert/types.d.ts +0 -49
  28. package/alert/types.js +0 -5
  29. package/badge/Badge.js +0 -59
  30. package/box/Box.d.ts +0 -4
  31. package/box/Box.js +0 -126
  32. package/box/Box.stories.tsx +0 -132
  33. package/box/types.d.ts +0 -43
  34. package/box/types.js +0 -5
  35. package/button/Button.d.ts +0 -4
  36. package/button/Button.js +0 -179
  37. package/button/Button.stories.tsx +0 -276
  38. package/button/types.d.ts +0 -57
  39. package/button/types.js +0 -5
  40. package/card/Card.d.ts +0 -4
  41. package/card/Card.js +0 -164
  42. package/card/Card.stories.tsx +0 -201
  43. package/card/ice-cream.jpg +0 -0
  44. package/card/types.d.ts +0 -67
  45. package/card/types.js +0 -5
  46. package/checkbox/Checkbox.d.ts +0 -4
  47. package/checkbox/Checkbox.js +0 -253
  48. package/checkbox/Checkbox.stories.tsx +0 -192
  49. package/checkbox/types.d.ts +0 -60
  50. package/checkbox/types.js +0 -5
  51. package/chip/Chip.d.ts +0 -4
  52. package/chip/Chip.js +0 -199
  53. package/chip/Chip.stories.tsx +0 -121
  54. package/chip/types.d.ts +0 -53
  55. package/chip/types.js +0 -5
  56. package/common/OpenSans.css +0 -81
  57. package/common/RequiredComponent.js +0 -32
  58. package/common/fonts/OpenSans-Bold.ttf +0 -0
  59. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  60. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  61. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  62. package/common/fonts/OpenSans-Italic.ttf +0 -0
  63. package/common/fonts/OpenSans-Light.ttf +0 -0
  64. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  65. package/common/fonts/OpenSans-Regular.ttf +0 -0
  66. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  67. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  68. package/common/utils.js +0 -22
  69. package/common/variables.js +0 -1576
  70. package/date/Date.js +0 -373
  71. package/date/index.d.ts +0 -27
  72. package/date-input/DateInput.d.ts +0 -4
  73. package/date-input/DateInput.js +0 -358
  74. package/date-input/DateInput.stories.tsx +0 -138
  75. package/date-input/types.d.ts +0 -100
  76. package/date-input/types.js +0 -5
  77. package/dialog/Dialog.d.ts +0 -4
  78. package/dialog/Dialog.js +0 -165
  79. package/dialog/Dialog.stories.tsx +0 -212
  80. package/dialog/types.d.ts +0 -43
  81. package/dialog/types.js +0 -5
  82. package/dropdown/Dropdown.d.ts +0 -4
  83. package/dropdown/Dropdown.js +0 -417
  84. package/dropdown/types.d.ts +0 -89
  85. package/dropdown/types.js +0 -5
  86. package/file-input/FileInput.d.ts +0 -4
  87. package/file-input/FileInput.js +0 -521
  88. package/file-input/FileItem.d.ts +0 -14
  89. package/file-input/FileItem.js +0 -184
  90. package/file-input/types.d.ts +0 -112
  91. package/file-input/types.js +0 -5
  92. package/footer/Footer.d.ts +0 -4
  93. package/footer/Footer.js +0 -266
  94. package/footer/Footer.stories.tsx +0 -151
  95. package/footer/Icons.js +0 -77
  96. package/footer/types.d.ts +0 -65
  97. package/footer/types.js +0 -5
  98. package/header/Header.d.ts +0 -7
  99. package/header/Header.js +0 -324
  100. package/header/Header.stories.tsx +0 -162
  101. package/header/Icons.js +0 -34
  102. package/header/types.d.ts +0 -47
  103. package/header/types.js +0 -5
  104. package/heading/Heading.d.ts +0 -4
  105. package/heading/Heading.js +0 -159
  106. package/heading/Heading.stories.tsx +0 -53
  107. package/heading/types.d.ts +0 -33
  108. package/heading/types.js +0 -5
  109. package/input-text/Icons.js +0 -22
  110. package/input-text/InputText.js +0 -611
  111. package/input-text/index.d.ts +0 -36
  112. package/layout/ApplicationLayout.d.ts +0 -10
  113. package/layout/ApplicationLayout.js +0 -225
  114. package/layout/ApplicationLayout.stories.tsx +0 -171
  115. package/layout/Icons.js +0 -55
  116. package/layout/types.d.ts +0 -57
  117. package/layout/types.js +0 -5
  118. package/link/Link.d.ts +0 -3
  119. package/link/Link.js +0 -161
  120. package/link/Link.stories.tsx +0 -146
  121. package/link/types.d.ts +0 -74
  122. package/link/types.js +0 -5
  123. package/list/List.d.ts +0 -7
  124. package/list/List.js +0 -37
  125. package/list/List.stories.tsx +0 -70
  126. package/main.d.ts +0 -48
  127. package/main.js +0 -395
  128. package/number-input/NumberInput.d.ts +0 -4
  129. package/number-input/NumberInput.js +0 -83
  130. package/number-input/NumberInput.stories.tsx +0 -115
  131. package/number-input/NumberInputContext.d.ts +0 -4
  132. package/number-input/NumberInputContext.js +0 -19
  133. package/number-input/numberInputContextTypes.d.ts +0 -19
  134. package/number-input/numberInputContextTypes.js +0 -5
  135. package/number-input/types.d.ts +0 -117
  136. package/number-input/types.js +0 -5
  137. package/paginator/Icons.js +0 -66
  138. package/paginator/Paginator.d.ts +0 -4
  139. package/paginator/Paginator.js +0 -192
  140. package/paginator/Paginator.stories.tsx +0 -63
  141. package/paginator/types.d.ts +0 -38
  142. package/paginator/types.js +0 -5
  143. package/password-input/PasswordInput.d.ts +0 -4
  144. package/password-input/PasswordInput.js +0 -163
  145. package/password-input/PasswordInput.stories.tsx +0 -131
  146. package/password-input/types.d.ts +0 -107
  147. package/password-input/types.js +0 -5
  148. package/progress-bar/ProgressBar.d.ts +0 -4
  149. package/progress-bar/ProgressBar.js +0 -170
  150. package/progress-bar/ProgressBar.stories.jsx +0 -58
  151. package/progress-bar/types.d.ts +0 -37
  152. package/progress-bar/types.js +0 -5
  153. package/radio/Radio.d.ts +0 -4
  154. package/radio/Radio.js +0 -174
  155. package/radio/Radio.stories.tsx +0 -192
  156. package/radio/types.d.ts +0 -54
  157. package/radio/types.js +0 -5
  158. package/resultsetTable/ResultsetTable.d.ts +0 -4
  159. package/resultsetTable/ResultsetTable.js +0 -251
  160. package/resultsetTable/types.d.ts +0 -67
  161. package/resultsetTable/types.js +0 -5
  162. package/row/Row.d.ts +0 -11
  163. package/row/Row.js +0 -124
  164. package/row/Row.stories.tsx +0 -223
  165. package/select/Select.js +0 -863
  166. package/select/Select.stories.tsx +0 -572
  167. package/select/index.d.ts +0 -131
  168. package/sidenav/Sidenav.d.ts +0 -9
  169. package/sidenav/Sidenav.js +0 -136
  170. package/sidenav/Sidenav.stories.tsx +0 -165
  171. package/sidenav/types.d.ts +0 -50
  172. package/sidenav/types.js +0 -5
  173. package/slider/Slider.d.ts +0 -4
  174. package/slider/Slider.js +0 -317
  175. package/slider/Slider.stories.tsx +0 -177
  176. package/slider/types.d.ts +0 -78
  177. package/slider/types.js +0 -5
  178. package/spinner/Spinner.d.ts +0 -4
  179. package/spinner/Spinner.js +0 -250
  180. package/spinner/Spinner.stories.jsx +0 -102
  181. package/spinner/types.d.ts +0 -32
  182. package/spinner/types.js +0 -5
  183. package/stack/Stack.d.ts +0 -10
  184. package/stack/Stack.js +0 -94
  185. package/stack/Stack.stories.tsx +0 -150
  186. package/switch/Switch.d.ts +0 -4
  187. package/switch/Switch.js +0 -179
  188. package/switch/Switch.stories.tsx +0 -160
  189. package/switch/types.d.ts +0 -58
  190. package/switch/types.js +0 -5
  191. package/table/Table.d.ts +0 -4
  192. package/table/Table.js +0 -118
  193. package/table/Table.stories.jsx +0 -276
  194. package/table/types.d.ts +0 -21
  195. package/table/types.js +0 -5
  196. package/tabs/Tabs.d.ts +0 -4
  197. package/tabs/Tabs.js +0 -213
  198. package/tabs/Tabs.stories.tsx +0 -121
  199. package/tabs/types.d.ts +0 -70
  200. package/tabs/types.js +0 -5
  201. package/tag/Tag.d.ts +0 -4
  202. package/tag/Tag.js +0 -193
  203. package/tag/Tag.stories.tsx +0 -145
  204. package/tag/types.d.ts +0 -60
  205. package/tag/types.js +0 -5
  206. package/text/Text.d.ts +0 -7
  207. package/text/Text.js +0 -30
  208. package/text/Text.stories.tsx +0 -19
  209. package/text-input/TextInput.d.ts +0 -4
  210. package/text-input/TextInput.js +0 -786
  211. package/text-input/TextInput.stories.tsx +0 -456
  212. package/text-input/types.d.ts +0 -159
  213. package/text-input/types.js +0 -5
  214. package/textarea/Textarea.js +0 -314
  215. package/textarea/Textarea.stories.jsx +0 -135
  216. package/textarea/index.d.ts +0 -127
  217. package/toggle/Toggle.js +0 -186
  218. package/toggle/index.d.ts +0 -21
  219. package/toggle-group/ToggleGroup.d.ts +0 -4
  220. package/toggle-group/ToggleGroup.js +0 -217
  221. package/toggle-group/ToggleGroup.stories.tsx +0 -178
  222. package/toggle-group/types.d.ts +0 -84
  223. package/toggle-group/types.js +0 -5
  224. package/upload/Upload.js +0 -201
  225. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  226. package/upload/buttons-upload/Icons.js +0 -40
  227. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  228. package/upload/dragAndDropArea/Icons.js +0 -39
  229. package/upload/file-upload/FileToUpload.js +0 -115
  230. package/upload/file-upload/Icons.js +0 -66
  231. package/upload/files-upload/FilesToUpload.js +0 -109
  232. package/upload/index.d.ts +0 -15
  233. package/upload/transaction/Icons.js +0 -160
  234. package/upload/transaction/Transaction.js +0 -104
  235. package/upload/transactions/Transactions.js +0 -94
  236. package/useTheme.d.ts +0 -2
  237. package/useTheme.js +0 -22
  238. package/wizard/Icons.js +0 -65
  239. package/wizard/Wizard.d.ts +0 -4
  240. package/wizard/Wizard.js +0 -231
  241. package/wizard/Wizard.stories.jsx +0 -224
  242. package/wizard/types.d.ts +0 -64
  243. package/wizard/types.js +0 -5
@@ -1,131 +0,0 @@
1
- import React from "react";
2
- import { userEvent, within } from "@storybook/testing-library";
3
- import DxcPasswordInput from "./PasswordInput";
4
- import { BackgroundColorProvider } from "../BackgroundColorContext";
5
- import Title from "../../.storybook/components/Title";
6
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
7
- import DarkContainer from "../../.storybook/components/DarkSection";
8
-
9
- export default {
10
- title: "Password input",
11
- component: DxcPasswordInput,
12
- };
13
-
14
- export const Chromatic = () => (
15
- <>
16
- <ExampleContainer>
17
- <Title title="Without label" theme="light" level={4} />
18
- <DxcPasswordInput />
19
- </ExampleContainer>
20
- <ExampleContainer>
21
- <Title title="With label" theme="light" level={4} />
22
- <DxcPasswordInput label="Password input" clearable />
23
- </ExampleContainer>
24
- <ExampleContainer>
25
- <Title title="Clearable" theme="light" level={4} />
26
- <DxcPasswordInput label="Password input" clearable value="password" />
27
- </ExampleContainer>
28
- <ExampleContainer>
29
- <Title title="Non clearable" theme="light" level={4} />
30
- <DxcPasswordInput label="Non clearable password input" value="password" />
31
- </ExampleContainer>
32
- <ExampleContainer>
33
- <Title title="Helper text" theme="light" level={4} />
34
- <DxcPasswordInput label="Help password input" helperText="Help message" />
35
- </ExampleContainer>
36
- <ExampleContainer>
37
- <Title title="Invalid" theme="light" level={4} />
38
- <DxcPasswordInput label="Error password input" error="Error message." />
39
- </ExampleContainer>
40
- <BackgroundColorProvider color="#333333">
41
- <DarkContainer>
42
- <Title title="Dark" theme="dark" level={2} />
43
- <ExampleContainer>
44
- <Title title="With label, helper text and value" theme="dark" level={4} />
45
- <DxcPasswordInput label="Password input" helperText="Help message" value="Password" />
46
- </ExampleContainer>
47
- <ExampleContainer>
48
- <Title title="With label, helper text, value and error" theme="dark" level={4} />
49
- <DxcPasswordInput label="Password input" helperText="Help message" error="Error message." value="Password" />
50
- </ExampleContainer>
51
- </DarkContainer>
52
- </BackgroundColorProvider>
53
- <Title title="Margins" theme="light" level={2} />
54
- <ExampleContainer>
55
- <Title title="Xxsmall margin" theme="light" level={4} />
56
- <DxcPasswordInput label="Xxsmmall" margin="xxsmall" />
57
- </ExampleContainer>
58
- <ExampleContainer>
59
- <Title title="Xsmall margin" theme="light" level={4} />
60
- <DxcPasswordInput label="Xsmall" margin="xsmall" />
61
- </ExampleContainer>
62
- <ExampleContainer>
63
- <Title title="Small margin" theme="light" level={4} />
64
- <DxcPasswordInput label="Small" margin="small" />
65
- </ExampleContainer>
66
- <ExampleContainer>
67
- <Title title="Medium margin" theme="light" level={4} />
68
- <DxcPasswordInput label="Medium" margin="medium" />
69
- </ExampleContainer>
70
- <ExampleContainer>
71
- <Title title="Large margin" theme="light" level={4} />
72
- <DxcPasswordInput label="Large" margin="large" />
73
- </ExampleContainer>
74
- <ExampleContainer>
75
- <Title title="Xlarge margin" theme="light" level={4} />
76
- <DxcPasswordInput label="Xlarge" margin="xlarge" />
77
- </ExampleContainer>
78
- <ExampleContainer>
79
- <Title title="Xxlarge margin" theme="light" level={4} />
80
- <DxcPasswordInput label="Xxlarge" margin="xxlarge" />
81
- </ExampleContainer>
82
- <Title title="Sizes" theme="light" level={2} />
83
- <ExampleContainer>
84
- <Title title="Small size" theme="light" level={4} />
85
- <DxcPasswordInput label="Small" size="small" />
86
- </ExampleContainer>
87
- <ExampleContainer>
88
- <Title title="Medium size" theme="light" level={4} />
89
- <DxcPasswordInput label="Medium" size="medium" />
90
- </ExampleContainer>
91
- <ExampleContainer>
92
- <Title title="Large size" theme="light" level={4} />
93
- <DxcPasswordInput label="Large" size="large" />
94
- </ExampleContainer>
95
- <ExampleContainer>
96
- <Title title="FillParent size" theme="light" level={4} />
97
- <DxcPasswordInput label="FillParent" size="fillParent" />
98
- </ExampleContainer>
99
- </>
100
- );
101
-
102
- const Password = () => (
103
- <ExampleContainer>
104
- <Title title="Show password" theme="light" level={4} />
105
- <DxcPasswordInput label="Password input" value="Password" />
106
- </ExampleContainer>
107
- );
108
- const PasswordDark = () => (
109
- <BackgroundColorProvider color="#333333">
110
- <DarkContainer>
111
- <ExampleContainer>
112
- <Title title="Show password" theme="dark" level={4} />
113
- <DxcPasswordInput label="Password input" value="Password" />
114
- </ExampleContainer>
115
- </DarkContainer>
116
- </BackgroundColorProvider>
117
- );
118
-
119
- export const ShowPassword = Password.bind({});
120
- ShowPassword.play = async ({ canvasElement }) => {
121
- const canvas = within(canvasElement);
122
- const passwordBtn = canvas.getByRole("button");
123
- await userEvent.click(passwordBtn);
124
- };
125
-
126
- export const ShowPasswordDark = PasswordDark.bind({});
127
- ShowPasswordDark.play = async ({ canvasElement }) => {
128
- const canvas = within(canvasElement);
129
- const passwordBtn = canvas.getByRole("button");
130
- await userEvent.click(passwordBtn);
131
- };
@@ -1,107 +0,0 @@
1
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- declare type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
- declare type Props = {
9
- /**
10
- * Text to be placed above the password.
11
- */
12
- label?: string;
13
- /**
14
- * Name attribute of the input element.
15
- */
16
- name?: string;
17
- /**
18
- * Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
19
- */
20
- value?: string;
21
- /**
22
- * Helper text to be placed above the password.
23
- */
24
- helperText?: string;
25
- /**
26
- * If true, the password input will have an action to clear the entered value.
27
- */
28
- clearable?: boolean;
29
- /**
30
- * This function will be called when the user types within the input
31
- * element of the component. An object including the current value and
32
- * the error (if the value entered is not valid) will be passed to this
33
- * function. If there is no error, error will be null.
34
- * */
35
- onChange?: (val: {
36
- value: string;
37
- error: string | null;
38
- }) => void;
39
- /**
40
- * This function will be called when the input element loses the focus.
41
- * An object including the input value and the error (if the value entered is
42
- * not valid) will be passed to this function. If there is no error, error will be null.
43
- */
44
- onBlur?: (val: {
45
- value: string;
46
- error: string | null;
47
- }) => void;
48
- /**
49
- * If it is defined, the component will change its appearance, showing
50
- * the error below the password input component. If it is not defined, the
51
- * error messages will be managed internally, but never displayed on its own.
52
- */
53
- error?: string;
54
- /**
55
- * Regular expression that defines the valid format allowed by the
56
- * password input. This will be checked both when the input element loses the
57
- * focus and while typing within it. If the string entered does not match
58
- * the pattern, the onBlur and onChange functions will be called with the
59
- * current value and an internal error informing that this value does not
60
- * match the pattern. If the pattern is met, the error parameter of both
61
- * events will be null.
62
- */
63
- pattern?: string;
64
- /**
65
- * Specifies the minimun length allowed by the password input.
66
- * This will be checked both when the input element loses the
67
- * focus and while typing within it. If the string entered does not
68
- * comply the minimum length, the onBlur and onChange functions will be called
69
- * with the current value and an internal error informing that the value
70
- * length does not comply the specified range. If a valid length is
71
- * reached, the error parameter of both events will be null.
72
- */
73
- minLength?: number;
74
- /**
75
- * Specifies the maximum length allowed by the password input.
76
- * This will be checked both when the input element loses the
77
- * focus and while typing within it. If the string entered does not
78
- * comply the maximum length, the onBlur and onChange functions will be called
79
- * with the current value and an internal error informing that the value
80
- * length does not comply the specified range. If a valid length is
81
- * reached, the error parameter of both events will be null.
82
- */
83
- maxLength?: number;
84
- /**
85
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
86
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
87
- */
88
- autocomplete?: string;
89
- /**
90
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
91
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
92
- */
93
- margin?: Space | Margin;
94
- /**
95
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
96
- */
97
- size?: "small" | "medium" | "large" | "fillParent";
98
- /**
99
- * Value of the tabindex attribute.
100
- */
101
- tabIndex?: number;
102
- };
103
- /**
104
- * Reference to the component.
105
- */
106
- export declare type RefType = HTMLDivElement;
107
- export default Props;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import ProgressBarPropsType from "./types";
3
- declare const DxcProgressBar: ({ label, helperText, overlay, value, showValue, margin, }: ProgressBarPropsType) => JSX.Element;
4
- export default DxcProgressBar;
@@ -1,170 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _react = _interopRequireWildcard(require("react"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _LinearProgress = _interopRequireDefault(require("@material-ui/core/LinearProgress"));
21
-
22
- var _variables = require("../common/variables.js");
23
-
24
- var _useTheme = _interopRequireDefault(require("../useTheme"));
25
-
26
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
27
-
28
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
29
-
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
-
34
- var DxcProgressBar = function DxcProgressBar(_ref) {
35
- var _ref$label = _ref.label,
36
- label = _ref$label === void 0 ? "" : _ref$label,
37
- _ref$helperText = _ref.helperText,
38
- helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
39
- _ref$overlay = _ref.overlay,
40
- overlay = _ref$overlay === void 0 ? true : _ref$overlay,
41
- value = _ref.value,
42
- _ref$showValue = _ref.showValue,
43
- showValue = _ref$showValue === void 0 ? false : _ref$showValue,
44
- margin = _ref.margin;
45
- var colorsTheme = (0, _useTheme["default"])();
46
- var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
47
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
48
- theme: colorsTheme.progressBar
49
- }, /*#__PURE__*/_react["default"].createElement(BackgroundProgressBar, {
50
- overlay: overlay
51
- }, /*#__PURE__*/_react["default"].createElement(DXCProgressBar, {
52
- overlay: overlay,
53
- margin: margin,
54
- backgroundType: backgroundType
55
- }, /*#__PURE__*/_react["default"].createElement(InfoProgressBar, null, /*#__PURE__*/_react["default"].createElement(ProgressBarLabel, {
56
- overlay: overlay,
57
- backgroundType: backgroundType
58
- }, label), /*#__PURE__*/_react["default"].createElement(ProgressBarProgress, {
59
- overlay: overlay,
60
- showValue: showValue,
61
- backgroundType: backgroundType
62
- }, value === null ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100, " %")), /*#__PURE__*/_react["default"].createElement(_LinearProgress["default"], {
63
- variant: showValue ? "determinate" : "indeterminate",
64
- value: value === null ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100
65
- }), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
66
- overlay: overlay,
67
- backgroundType: backgroundType
68
- }, helperText))));
69
- };
70
-
71
- var BackgroundProgressBar = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n opacity: ", ";\n width: ", ";\n display: flex;\n flex-wrap: wrap;\n justify-content: ", ";\n height: ", ";\n align-items: ", ";\n min-width: 100px;\n max-width: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n z-index: ", ";\n width: 100%;\n"])), function (props) {
72
- return props.overlay === true ? "".concat(props.theme.overlayColor) : "transparent";
73
- }, function (props) {
74
- return props.overlay === true && "0.8";
75
- }, function (props) {
76
- return props.overlay === true ? "100%" : "";
77
- }, function (props) {
78
- return props.overlay === true ? "center" : "";
79
- }, function (props) {
80
- return props.overlay === true ? "100vh" : "";
81
- }, function (props) {
82
- return props.overlay === true ? "center" : "";
83
- }, function (props) {
84
- return props.overlay === true ? "100%" : "";
85
- }, function (props) {
86
- return props.overlay === true ? "fixed" : "";
87
- }, function (props) {
88
- return props.overlay === true ? "0" : "";
89
- }, function (props) {
90
- return props.overlay === true ? "0" : "";
91
- }, function (props) {
92
- return props.overlay === true ? "0" : "";
93
- }, function (props) {
94
- return props.overlay === true ? "0" : "";
95
- }, function (props) {
96
- return props.overlay ? 1300 : "";
97
- });
98
-
99
- var DXCProgressBar = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n z-index: ", ";\n width: ", ";\n .MuiLinearProgress-root {\n height: ", ";\n background-color: ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n }\n .MuiLinearProgress-bar {\n background-color: ", ";\n }\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
100
- return props.overlay === true && "100" || "0";
101
- }, function (props) {
102
- return props.overlay === true ? "80%" : "100%";
103
- }, function (props) {
104
- return props.theme.thickness;
105
- }, function (props) {
106
- return props.theme.totalLineColor;
107
- }, function (props) {
108
- return props.theme.borderRadius;
109
- }, function (props) {
110
- return props.helperText !== "" && "8px";
111
- }, function (props) {
112
- return props.backgroundType === "dark" ? props.theme.trackLineColorOnDark : props.theme.trackLineColor;
113
- }, function (props) {
114
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
115
- }, function (props) {
116
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
117
- }, function (props) {
118
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
119
- }, function (props) {
120
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
121
- }, function (props) {
122
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
123
- });
124
-
125
- var InfoProgressBar = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n width: 685px;\n flex-wrap: wrap;\n width: 100%;\n margin-bottom: 8px;\n align-items: baseline;\n justify-content: space-between;\n"])));
126
-
127
- var ProgressBarLabel = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-overflow: ellipsis;\n"])), function (props) {
128
- return props.theme.labelFontFamily;
129
- }, function (props) {
130
- return props.theme.labelFontStyle;
131
- }, function (props) {
132
- return props.theme.labelFontSize;
133
- }, function (props) {
134
- return props.theme.labelFontWeight;
135
- }, function (props) {
136
- return props.theme.labelFontTextTransform;
137
- }, function (props) {
138
- return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.overlay === true ? "#FFFFFF" : props.theme.labelFontColor;
139
- });
140
-
141
- var ProgressBarProgress = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n display: ", ";\n flex-shrink: 0;\n"])), function (props) {
142
- return props.theme.valueFontFamily;
143
- }, function (props) {
144
- return props.theme.valueFontStyle;
145
- }, function (props) {
146
- return props.theme.valueFontSize;
147
- }, function (props) {
148
- return props.theme.valueFontWeight;
149
- }, function (props) {
150
- return props.theme.valueFontTextTransform;
151
- }, function (props) {
152
- return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.overlay === true ? "#FFFFFF" : props.theme.valueFontColor;
153
- }, function (props) {
154
- return props.value !== "" && props.showValue === true && "block" || "none";
155
- });
156
-
157
- var HelperText = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"])), function (props) {
158
- return props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.overlay === true ? "#FFFFFF" : props.theme.helperTextFontColor;
159
- }, function (props) {
160
- return props.theme.helperTextFontFamily;
161
- }, function (props) {
162
- return props.theme.helperTextFontSize;
163
- }, function (props) {
164
- return props.theme.helperTextFontStyle;
165
- }, function (props) {
166
- return props.theme.helperTextFontWeight;
167
- });
168
-
169
- var _default = DxcProgressBar;
170
- exports["default"] = _default;
@@ -1,58 +0,0 @@
1
- import React from "react";
2
- import DxcProgressBar from "./ProgressBar";
3
- import Title from "../../.storybook/components/Title";
4
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
-
6
- export default {
7
- title: "ProgressBar",
8
- component: DxcProgressBar,
9
- };
10
-
11
- export const Chromatic = () => (
12
- <>
13
- <ExampleContainer>
14
- <Title title="Without labels" theme="light" level={4} />
15
- <DxcProgressBar overlay={false} value={50} showValue />
16
- <Title title="With helperText" theme="light" level={4} />
17
- <DxcProgressBar helperText="Helper text" value={50} overlay={false} showValue />
18
- <Title title="Without default value" theme="light" level={4} />
19
- <DxcProgressBar label="Loading..." overlay={false} showValue />
20
- </ExampleContainer>
21
- <Title title="Margins" theme="light" level={2} />
22
- <ExampleContainer>
23
- <Title title="Xxsmall margin" theme="light" level={4} />
24
- <DxcProgressBar label="Margin xxsmall" margin="xxsmall" overlay={false} value={50} showValue />
25
- </ExampleContainer>
26
- <ExampleContainer>
27
- <Title title="Xsmall margin" theme="light" level={4} />
28
- <DxcProgressBar label="Margin xsmall" margin="xsmall" overlay={false} value={50} showValue />
29
- </ExampleContainer>
30
- <ExampleContainer>
31
- <Title title="Small margin" theme="light" level={4} />
32
- <DxcProgressBar label="Margin small" margin="small" overlay={false} value={50} showValue />
33
- </ExampleContainer>
34
- <ExampleContainer>
35
- <Title title="Medium margin" theme="light" level={4} />
36
- <DxcProgressBar label="Margin medium" margin="medium" overlay={false} value={50} showValue />
37
- </ExampleContainer>
38
- <ExampleContainer>
39
- <Title title="Large margin" theme="light" level={4} />
40
- <DxcProgressBar label="Margin large" margin="large" overlay={false} value={50} showValue />
41
- </ExampleContainer>
42
- <ExampleContainer>
43
- <Title title="Xlarge margin" theme="light" level={4} />
44
- <DxcProgressBar label="Margin xlarge" margin="xlarge" overlay={false} value={50} showValue />
45
- </ExampleContainer>
46
- <ExampleContainer>
47
- <Title title="XxLarge margin" theme="light" level={4} />
48
- <DxcProgressBar label="Margin xxlarge" margin="xxlarge" overlay={false} value={50} showValue />
49
- </ExampleContainer>
50
- </>
51
- );
52
-
53
- export const ProgressBarOverlay = () => (
54
- <ExampleContainer>
55
- <Title title="Overlay" theme="dark" level={4} />
56
- <DxcProgressBar label="Overlay" helperText="Helper text" showValue value={50} />
57
- </ExampleContainer>
58
- );
@@ -1,37 +0,0 @@
1
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- declare type Size = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
- declare type Props = {
9
- /**
10
- * Text to be placed above the progress bar.
11
- */
12
- label?: string;
13
- /**
14
- * Helper text to be placed under the progress bar.
15
- */
16
- helperText?: string;
17
- /**
18
- * If true, the progress bar will be displayed as a modal.
19
- */
20
- overlay?: boolean;
21
- /**
22
- * The value of the progress indicator. If it's received the component is
23
- * determinate otherwise is indeterminate.
24
- */
25
- value?: number;
26
- /**
27
- * If true, the value is displayed above the progress bar.
28
- */
29
- showValue?: boolean;
30
- /**
31
- * Size of the margin to be applied to the component. You can pass
32
- * an object with 'top', 'bottom', 'left' and 'right' properties
33
- * in order to specify different margin sizes.
34
- */
35
- margin?: Space | Size;
36
- };
37
- export default Props;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/radio/Radio.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import RadioPropsType from "./types";
3
- declare const DxcRadio: ({ checked, value, label, labelPosition, name, disabled, onClick, required, margin, size, }: RadioPropsType) => JSX.Element;
4
- export default DxcRadio;