@dxc-technology/halstack-react 0.0.0-adde6ce → 0.0.0-adfc848

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 (259) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +4011 -0
  3. package/dist/index.d.ts +4011 -0
  4. package/dist/index.js +14933 -0
  5. package/dist/index.mjs +14844 -0
  6. package/package.json +86 -71
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  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/Accordion.stories.tsx +0 -307
  18. package/accordion/types.d.ts +0 -68
  19. package/accordion/types.js +0 -5
  20. package/accordion-group/AccordionGroup.d.ts +0 -7
  21. package/accordion-group/AccordionGroup.js +0 -170
  22. package/accordion-group/AccordionGroup.stories.tsx +0 -225
  23. package/accordion-group/types.d.ts +0 -72
  24. package/accordion-group/types.js +0 -5
  25. package/alert/Alert.d.ts +0 -4
  26. package/alert/Alert.js +0 -290
  27. package/alert/Alert.stories.tsx +0 -170
  28. package/alert/types.d.ts +0 -49
  29. package/alert/types.js +0 -5
  30. package/badge/Badge.js +0 -59
  31. package/box/Box.d.ts +0 -4
  32. package/box/Box.js +0 -126
  33. package/box/Box.stories.tsx +0 -132
  34. package/box/types.d.ts +0 -43
  35. package/box/types.js +0 -5
  36. package/button/Button.d.ts +0 -4
  37. package/button/Button.js +0 -179
  38. package/button/Button.stories.tsx +0 -276
  39. package/button/types.d.ts +0 -57
  40. package/button/types.js +0 -5
  41. package/card/Card.d.ts +0 -4
  42. package/card/Card.js +0 -164
  43. package/card/Card.stories.tsx +0 -201
  44. package/card/ice-cream.jpg +0 -0
  45. package/card/types.d.ts +0 -67
  46. package/card/types.js +0 -5
  47. package/checkbox/Checkbox.d.ts +0 -4
  48. package/checkbox/Checkbox.js +0 -253
  49. package/checkbox/Checkbox.stories.tsx +0 -192
  50. package/checkbox/types.d.ts +0 -60
  51. package/checkbox/types.js +0 -5
  52. package/chip/Chip.d.ts +0 -4
  53. package/chip/Chip.js +0 -199
  54. package/chip/Chip.stories.tsx +0 -121
  55. package/chip/types.d.ts +0 -53
  56. package/chip/types.js +0 -5
  57. package/common/OpenSans.css +0 -81
  58. package/common/RequiredComponent.js +0 -32
  59. package/common/fonts/OpenSans-Bold.ttf +0 -0
  60. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  61. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  62. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  63. package/common/fonts/OpenSans-Italic.ttf +0 -0
  64. package/common/fonts/OpenSans-Light.ttf +0 -0
  65. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  66. package/common/fonts/OpenSans-Regular.ttf +0 -0
  67. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  68. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  69. package/common/utils.js +0 -22
  70. package/common/variables.js +0 -1612
  71. package/date/Date.js +0 -373
  72. package/date/index.d.ts +0 -27
  73. package/date-input/DateInput.d.ts +0 -4
  74. package/date-input/DateInput.js +0 -358
  75. package/date-input/DateInput.stories.tsx +0 -138
  76. package/date-input/types.d.ts +0 -100
  77. package/date-input/types.js +0 -5
  78. package/dialog/Dialog.d.ts +0 -4
  79. package/dialog/Dialog.js +0 -166
  80. package/dialog/Dialog.stories.tsx +0 -212
  81. package/dialog/types.d.ts +0 -43
  82. package/dialog/types.js +0 -5
  83. package/dropdown/Dropdown.d.ts +0 -4
  84. package/dropdown/Dropdown.js +0 -417
  85. package/dropdown/Dropdown.stories.tsx +0 -247
  86. package/dropdown/types.d.ts +0 -89
  87. package/dropdown/types.js +0 -5
  88. package/file-input/FileInput.d.ts +0 -4
  89. package/file-input/FileInput.js +0 -590
  90. package/file-input/FileInput.stories.tsx +0 -507
  91. package/file-input/FileItem.d.ts +0 -14
  92. package/file-input/FileItem.js +0 -184
  93. package/file-input/types.d.ts +0 -112
  94. package/file-input/types.js +0 -5
  95. package/footer/Footer.d.ts +0 -4
  96. package/footer/Footer.js +0 -260
  97. package/footer/Footer.stories.tsx +0 -130
  98. package/footer/Icons.d.ts +0 -2
  99. package/footer/Icons.js +0 -77
  100. package/footer/types.d.ts +0 -65
  101. package/footer/types.js +0 -5
  102. package/header/Header.d.ts +0 -7
  103. package/header/Header.js +0 -324
  104. package/header/Header.stories.tsx +0 -162
  105. package/header/Icons.d.ts +0 -2
  106. package/header/Icons.js +0 -34
  107. package/header/types.d.ts +0 -47
  108. package/header/types.js +0 -5
  109. package/heading/Heading.d.ts +0 -4
  110. package/heading/Heading.js +0 -159
  111. package/heading/Heading.stories.tsx +0 -54
  112. package/heading/types.d.ts +0 -33
  113. package/heading/types.js +0 -5
  114. package/input-text/Icons.js +0 -22
  115. package/input-text/InputText.js +0 -611
  116. package/input-text/index.d.ts +0 -36
  117. package/layout/ApplicationLayout.d.ts +0 -10
  118. package/layout/ApplicationLayout.js +0 -225
  119. package/layout/ApplicationLayout.stories.tsx +0 -171
  120. package/layout/Icons.js +0 -55
  121. package/layout/types.d.ts +0 -57
  122. package/layout/types.js +0 -5
  123. package/link/Link.d.ts +0 -3
  124. package/link/Link.js +0 -161
  125. package/link/Link.stories.tsx +0 -146
  126. package/link/types.d.ts +0 -74
  127. package/link/types.js +0 -5
  128. package/list/List.d.ts +0 -8
  129. package/list/List.js +0 -47
  130. package/list/List.stories.tsx +0 -95
  131. package/main.d.ts +0 -48
  132. package/main.js +0 -395
  133. package/number-input/NumberInput.d.ts +0 -4
  134. package/number-input/NumberInput.js +0 -83
  135. package/number-input/NumberInput.stories.tsx +0 -115
  136. package/number-input/NumberInputContext.d.ts +0 -4
  137. package/number-input/NumberInputContext.js +0 -19
  138. package/number-input/numberInputContextTypes.d.ts +0 -19
  139. package/number-input/numberInputContextTypes.js +0 -5
  140. package/number-input/types.d.ts +0 -117
  141. package/number-input/types.js +0 -5
  142. package/paginator/Icons.js +0 -66
  143. package/paginator/Paginator.d.ts +0 -4
  144. package/paginator/Paginator.js +0 -192
  145. package/paginator/Paginator.stories.tsx +0 -63
  146. package/paginator/types.d.ts +0 -38
  147. package/paginator/types.js +0 -5
  148. package/password-input/PasswordInput.d.ts +0 -4
  149. package/password-input/PasswordInput.js +0 -163
  150. package/password-input/PasswordInput.stories.tsx +0 -131
  151. package/password-input/types.d.ts +0 -107
  152. package/password-input/types.js +0 -5
  153. package/progress-bar/ProgressBar.d.ts +0 -4
  154. package/progress-bar/ProgressBar.js +0 -170
  155. package/progress-bar/ProgressBar.stories.jsx +0 -58
  156. package/progress-bar/types.d.ts +0 -37
  157. package/progress-bar/types.js +0 -5
  158. package/radio/Radio.d.ts +0 -4
  159. package/radio/Radio.js +0 -174
  160. package/radio/Radio.stories.tsx +0 -192
  161. package/radio/types.d.ts +0 -54
  162. package/radio/types.js +0 -5
  163. package/radio-group/Radio.d.ts +0 -4
  164. package/radio-group/Radio.js +0 -130
  165. package/radio-group/RadioGroup.d.ts +0 -4
  166. package/radio-group/RadioGroup.js +0 -268
  167. package/radio-group/RadioGroup.stories.tsx +0 -79
  168. package/radio-group/types.d.ts +0 -36
  169. package/radio-group/types.js +0 -5
  170. package/resultsetTable/ResultsetTable.d.ts +0 -4
  171. package/resultsetTable/ResultsetTable.js +0 -251
  172. package/resultsetTable/ResultsetTable.stories.tsx +0 -277
  173. package/resultsetTable/types.d.ts +0 -67
  174. package/resultsetTable/types.js +0 -5
  175. package/row/Row.d.ts +0 -11
  176. package/row/Row.js +0 -127
  177. package/row/Row.stories.tsx +0 -239
  178. package/select/Select.d.ts +0 -4
  179. package/select/Select.js +0 -863
  180. package/select/Select.stories.tsx +0 -572
  181. package/select/types.d.ts +0 -170
  182. package/select/types.js +0 -5
  183. package/sidenav/Sidenav.d.ts +0 -9
  184. package/sidenav/Sidenav.js +0 -136
  185. package/sidenav/Sidenav.stories.tsx +0 -182
  186. package/sidenav/types.d.ts +0 -50
  187. package/sidenav/types.js +0 -5
  188. package/slider/Slider.d.ts +0 -4
  189. package/slider/Slider.js +0 -317
  190. package/slider/Slider.stories.tsx +0 -177
  191. package/slider/types.d.ts +0 -78
  192. package/slider/types.js +0 -5
  193. package/spinner/Spinner.d.ts +0 -4
  194. package/spinner/Spinner.js +0 -250
  195. package/spinner/Spinner.stories.jsx +0 -103
  196. package/spinner/types.d.ts +0 -32
  197. package/spinner/types.js +0 -5
  198. package/stack/Stack.d.ts +0 -10
  199. package/stack/Stack.js +0 -97
  200. package/stack/Stack.stories.tsx +0 -166
  201. package/switch/Switch.d.ts +0 -4
  202. package/switch/Switch.js +0 -179
  203. package/switch/Switch.stories.tsx +0 -160
  204. package/switch/types.d.ts +0 -58
  205. package/switch/types.js +0 -5
  206. package/table/Table.d.ts +0 -4
  207. package/table/Table.js +0 -118
  208. package/table/Table.stories.jsx +0 -277
  209. package/table/types.d.ts +0 -21
  210. package/table/types.js +0 -5
  211. package/tabs/Tabs.d.ts +0 -4
  212. package/tabs/Tabs.js +0 -213
  213. package/tabs/Tabs.stories.tsx +0 -122
  214. package/tabs/types.d.ts +0 -70
  215. package/tabs/types.js +0 -5
  216. package/tag/Tag.d.ts +0 -4
  217. package/tag/Tag.js +0 -193
  218. package/tag/Tag.stories.tsx +0 -145
  219. package/tag/types.d.ts +0 -60
  220. package/tag/types.js +0 -5
  221. package/text/Text.d.ts +0 -7
  222. package/text/Text.js +0 -30
  223. package/text/Text.stories.tsx +0 -19
  224. package/text-input/TextInput.d.ts +0 -4
  225. package/text-input/TextInput.js +0 -786
  226. package/text-input/TextInput.stories.tsx +0 -456
  227. package/text-input/types.d.ts +0 -159
  228. package/text-input/types.js +0 -5
  229. package/textarea/Textarea.d.ts +0 -4
  230. package/textarea/Textarea.js +0 -284
  231. package/textarea/Textarea.stories.jsx +0 -136
  232. package/textarea/types.d.ts +0 -130
  233. package/textarea/types.js +0 -5
  234. package/toggle/Toggle.js +0 -186
  235. package/toggle/index.d.ts +0 -21
  236. package/toggle-group/ToggleGroup.d.ts +0 -4
  237. package/toggle-group/ToggleGroup.js +0 -214
  238. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  239. package/toggle-group/types.d.ts +0 -97
  240. package/toggle-group/types.js +0 -5
  241. package/upload/Upload.js +0 -201
  242. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  243. package/upload/buttons-upload/Icons.js +0 -40
  244. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  245. package/upload/dragAndDropArea/Icons.js +0 -39
  246. package/upload/file-upload/FileToUpload.js +0 -115
  247. package/upload/file-upload/Icons.js +0 -66
  248. package/upload/files-upload/FilesToUpload.js +0 -109
  249. package/upload/index.d.ts +0 -15
  250. package/upload/transaction/Icons.js +0 -160
  251. package/upload/transaction/Transaction.js +0 -104
  252. package/upload/transactions/Transactions.js +0 -94
  253. package/useTheme.d.ts +0 -2
  254. package/useTheme.js +0 -22
  255. package/wizard/Wizard.d.ts +0 -4
  256. package/wizard/Wizard.js +0 -281
  257. package/wizard/Wizard.stories.tsx +0 -224
  258. package/wizard/types.d.ts +0 -60
  259. 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="Xxsmall" 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 expanded>
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 expanded>
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;