@dxc-technology/halstack-react 0.0.0-39dd536 → 0.0.0-3a65d35

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 (82) hide show
  1. package/accordion/Accordion.js +122 -103
  2. package/accordion/Accordion.stories.tsx +1 -2
  3. package/accordion/Accordion.test.js +9 -10
  4. package/accordion/types.d.ts +4 -3
  5. package/accordion-group/AccordionGroup.js +1 -21
  6. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  7. package/accordion-group/AccordionGroup.test.js +20 -45
  8. package/accordion-group/types.d.ts +9 -2
  9. package/alert/Alert.js +1 -1
  10. package/box/Box.js +1 -1
  11. package/box/types.d.ts +1 -0
  12. package/card/types.d.ts +1 -0
  13. package/checkbox/Checkbox.js +87 -95
  14. package/checkbox/Checkbox.test.js +93 -16
  15. package/checkbox/types.d.ts +2 -2
  16. package/common/variables.js +20 -12
  17. package/dialog/Dialog.js +4 -4
  18. package/dialog/Dialog.stories.tsx +56 -0
  19. package/dialog/types.d.ts +1 -0
  20. package/dropdown/Dropdown.d.ts +1 -1
  21. package/dropdown/Dropdown.js +244 -247
  22. package/dropdown/Dropdown.stories.tsx +126 -63
  23. package/dropdown/Dropdown.test.js +509 -108
  24. package/dropdown/DropdownMenu.d.ts +4 -0
  25. package/dropdown/DropdownMenu.js +80 -0
  26. package/dropdown/DropdownMenuItem.d.ts +4 -0
  27. package/dropdown/DropdownMenuItem.js +92 -0
  28. package/dropdown/types.d.ts +24 -4
  29. package/flex/Flex.d.ts +1 -1
  30. package/flex/Flex.js +31 -19
  31. package/flex/types.d.ts +14 -3
  32. package/footer/Footer.stories.tsx +8 -1
  33. package/footer/types.d.ts +1 -0
  34. package/header/Header.js +74 -72
  35. package/header/Header.stories.tsx +4 -4
  36. package/header/Icons.js +2 -2
  37. package/header/types.d.ts +3 -2
  38. package/layout/ApplicationLayout.stories.tsx +1 -0
  39. package/number-input/NumberInput.test.js +38 -1
  40. package/package.json +8 -8
  41. package/paginator/Paginator.js +2 -2
  42. package/paginator/Paginator.test.js +1 -1
  43. package/password-input/PasswordInput.test.js +13 -12
  44. package/quick-nav/QuickNav.js +11 -12
  45. package/quick-nav/QuickNav.stories.tsx +97 -19
  46. package/radio-group/Radio.d.ts +1 -1
  47. package/radio-group/Radio.js +43 -28
  48. package/radio-group/RadioGroup.js +15 -13
  49. package/radio-group/RadioGroup.stories.tsx +1 -0
  50. package/radio-group/RadioGroup.test.js +123 -96
  51. package/radio-group/types.d.ts +2 -2
  52. package/resultsetTable/ResultsetTable.js +1 -3
  53. package/select/Listbox.js +0 -1
  54. package/select/Select.js +3 -1
  55. package/select/Select.test.js +267 -209
  56. package/slider/Slider.js +116 -92
  57. package/slider/Slider.stories.tsx +7 -1
  58. package/slider/Slider.test.js +121 -21
  59. package/slider/types.d.ts +2 -2
  60. package/switch/Switch.d.ts +1 -1
  61. package/switch/Switch.js +132 -66
  62. package/switch/Switch.stories.tsx +8 -30
  63. package/switch/Switch.test.js +144 -17
  64. package/switch/types.d.ts +3 -4
  65. package/table/Table.js +1 -1
  66. package/tabs/Tab.d.ts +4 -0
  67. package/tabs/Tab.js +135 -0
  68. package/tabs/Tabs.js +360 -104
  69. package/tabs/Tabs.stories.tsx +74 -0
  70. package/tabs/Tabs.test.js +217 -6
  71. package/tabs/types.d.ts +14 -4
  72. package/tabs-nav/Tab.js +1 -1
  73. package/tag/Tag.js +1 -1
  74. package/text-input/Icons.d.ts +8 -0
  75. package/text-input/Icons.js +60 -0
  76. package/text-input/Suggestion.js +7 -5
  77. package/text-input/Suggestions.d.ts +4 -0
  78. package/text-input/Suggestions.js +134 -0
  79. package/text-input/TextInput.js +179 -263
  80. package/text-input/TextInput.stories.tsx +189 -181
  81. package/text-input/TextInput.test.js +222 -163
  82. package/text-input/types.d.ts +21 -2
@@ -1,5 +1,9 @@
1
1
  import React from "react";
2
2
  import DxcDialog from "./Dialog";
3
+ import DxcTextInput from "../text-input/TextInput";
4
+ import DxcButton from "../button/Button";
5
+ import DxcFlex from "../flex/Flex";
6
+ import DxcInset from "../inset/Inset";
3
7
  import Title from "../../.storybook/components/Title";
4
8
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
9
 
@@ -30,6 +34,50 @@ export const DefaultDialog = () => (
30
34
  </>
31
35
  );
32
36
 
37
+ export const DialogWithInputs = () => (
38
+ <>
39
+ <ExampleContainer expanded={true}>
40
+ <Title title="Dialog with inputs" theme="light" level={4} />
41
+ <DxcDialog>
42
+ <DxcInset bottom="1rem">
43
+ <DxcFlex gap="2rem" direction="column">
44
+ <DxcFlex gap="1rem" direction="column">
45
+ <DxcTextInput size="fillParent" label="Name"></DxcTextInput>
46
+ <DxcTextInput size="fillParent" label="Surname"></DxcTextInput>
47
+ </DxcFlex>
48
+ <DxcFlex justifyContent="flex-end" gap="1rem">
49
+ <DxcButton label="Save"></DxcButton>
50
+ <DxcButton label="Cancel" mode="secondary"></DxcButton>
51
+ </DxcFlex>
52
+ </DxcFlex>
53
+ </DxcInset>
54
+ </DxcDialog>
55
+ </ExampleContainer>
56
+ </>
57
+ );
58
+
59
+ const RespDialog = () => (
60
+ <>
61
+ <ExampleContainer expanded={true}>
62
+ <Title title="Responsive dialog" theme="light" level={4} />
63
+ <DxcDialog>
64
+ <DxcInset bottom="1rem">
65
+ <DxcFlex gap="2rem" direction="column">
66
+ <DxcFlex gap="1rem" direction="column">
67
+ <DxcTextInput size="fillParent" label="Name"></DxcTextInput>
68
+ <DxcTextInput size="fillParent" label="Surname"></DxcTextInput>
69
+ </DxcFlex>
70
+ <DxcFlex justifyContent="flex-end" gap="1rem">
71
+ <DxcButton label="Save"></DxcButton>
72
+ <DxcButton label="Cancel" mode="secondary"></DxcButton>
73
+ </DxcFlex>
74
+ </DxcFlex>
75
+ </DxcInset>
76
+ </DxcDialog>
77
+ </ExampleContainer>
78
+ </>
79
+ );
80
+
33
81
  export const DialogWithoutOverlay = () => (
34
82
  <ExampleContainer expanded={true}>
35
83
  <Title title="Dialog Without Overlay" theme="light" level={4} />
@@ -209,3 +257,11 @@ export const DialogWithXxlargePadding = () => (
209
257
  </DxcDialog>
210
258
  </ExampleContainer>
211
259
  );
260
+
261
+ export const ResponsiveDialog = RespDialog.bind({});
262
+ ResponsiveDialog.parameters = {
263
+ viewport: {
264
+ defaultViewport: "iphonex",
265
+ },
266
+ chromatic: { viewports: [375] },
267
+ };
package/dialog/types.d.ts CHANGED
@@ -26,6 +26,7 @@ declare type Props = {
26
26
  */
27
27
  onBackgroundClick?: () => void;
28
28
  /**
29
+ * @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
29
30
  * Size of the padding to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
30
31
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
31
32
  */
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import DropdownPropsType from "./types";
3
- declare const DxcDropdown: ({ options, optionsIconPosition, icon, iconPosition, label, caretHidden, onSelectOption, expandOnHover, margin, size, tabIndex, disabled, }: DropdownPropsType) => JSX.Element;
3
+ declare const DxcDropdown: ({ options, optionsIconPosition, icon, iconPosition, label, caretHidden, disabled, expandOnHover, onSelectOption, margin, size, tabIndex, }: DropdownPropsType) => JSX.Element;
4
4
  export default DxcDropdown;