@innovaccer/design-system 2.13.0 → 2.13.2

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 (57) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/core/components/atoms/dropdown/DropdownList.tsx +3 -11
  3. package/core/components/atoms/dropdown/option/CheckboxOption.tsx +3 -10
  4. package/core/components/atoms/dropdown/option/index.tsx +3 -3
  5. package/core/components/atoms/metricInput/__stories__/DefaultMetric.story.jsx +1 -1
  6. package/core/components/molecules/inputMask/InputMask.tsx +6 -1
  7. package/core/components/molecules/popover/__stories__/variants/boundaryElement.story.jsx +2 -2
  8. package/core/components/organisms/datePicker/__tests__/DatePicker.test.tsx +1 -1
  9. package/core/components/organisms/dateRangePicker/SingleInputTrigger.tsx +22 -1
  10. package/core/components/organisms/dateRangePicker/Trigger.tsx +19 -2
  11. package/core/components/organisms/timePicker/TimePicker.tsx +1 -0
  12. package/core/utils/masks.ts +3 -3
  13. package/css/dist/index.css +0 -20
  14. package/css/dist/index.css.map +1 -1
  15. package/css/src/components/dropdown.css +0 -20
  16. package/dist/core/components/atoms/dropdown/option/index.d.ts +1 -1
  17. package/dist/index.esm.js +83 -48
  18. package/dist/index.js +69 -29
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.umd.js +1 -1
  21. package/dist/index.umd.js.br +0 -0
  22. package/dist/index.umd.js.gz +0 -0
  23. package/docs/package.json +1 -1
  24. package/docs/src/data/components/index.js +12 -0
  25. package/docs/src/data/components/mobile.js +12 -0
  26. package/docs/src/data/nav/components.yaml +0 -1
  27. package/docs/src/pages/components/chips/images/chips-1.png +0 -0
  28. package/docs/src/pages/components/chips/usage.mdx +7 -1
  29. package/docs/src/pages/components/helpText/images/helpText-1.png +0 -0
  30. package/docs/src/pages/components/helpText/images/helpText-2.png +0 -0
  31. package/docs/src/pages/components/helpText/images/helpText-3.png +0 -0
  32. package/docs/src/pages/components/helpText/images/helpText-4.png +0 -0
  33. package/docs/src/pages/components/helpText/images/helpText-5.png +0 -0
  34. package/docs/src/pages/components/helpText/usage.mdx +74 -0
  35. package/docs/src/pages/components/pills/images/pills-1.png +0 -0
  36. package/docs/src/pages/components/pills/usage.mdx +7 -1
  37. package/docs/src/pages/components/radio/images/radio-1.png +0 -0
  38. package/docs/src/pages/components/radio/usage.mdx +7 -1
  39. package/docs/src/pages/components/switch/images/switch-4.png +0 -0
  40. package/docs/src/pages/components/switch/images/switch-5.png +0 -0
  41. package/docs/src/pages/components/switch/images/switch-6.png +0 -0
  42. package/docs/src/pages/components/switch/usage.mdx +10 -3
  43. package/docs/src/pages/mobile/components/bottomSheet/images/bottomsheet-8.png +0 -0
  44. package/docs/src/pages/mobile/components/bottomSheet/usage.mdx +4 -1
  45. package/docs/src/pages/mobile/components/checkbox/images/checkbox-1.png +0 -0
  46. package/docs/src/pages/mobile/components/checkbox/images/checkbox-10.png +0 -0
  47. package/docs/src/pages/mobile/components/checkbox/images/checkbox-11.png +0 -0
  48. package/docs/src/pages/mobile/components/checkbox/images/checkbox-2.png +0 -0
  49. package/docs/src/pages/mobile/components/checkbox/images/checkbox-3.png +0 -0
  50. package/docs/src/pages/mobile/components/checkbox/images/checkbox-4.png +0 -0
  51. package/docs/src/pages/mobile/components/checkbox/images/checkbox-5.png +0 -0
  52. package/docs/src/pages/mobile/components/checkbox/images/checkbox-6.png +0 -0
  53. package/docs/src/pages/mobile/components/checkbox/images/checkbox-7.png +0 -0
  54. package/docs/src/pages/mobile/components/checkbox/images/checkbox-8.png +0 -0
  55. package/docs/src/pages/mobile/components/checkbox/images/checkbox-9.png +0 -0
  56. package/docs/src/pages/mobile/components/checkbox/usage.mdx +122 -0
  57. package/package.json +1 -1
Binary file
Binary file
package/docs/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "dev": "./tools/develop.sh",
9
9
  "build": "./tools/build.sh",
10
10
  "serve": "gatsby serve",
11
- "deploy": "gatsby-plugin-s3 deploy --yes && aws cloudfront create-invalidation --distribution-id d2p21c4y3psve4 --paths \"/*\"",
11
+ "deploy": "gatsby-plugin-s3 deploy --yes && aws cloudfront create-invalidation --distribution-id E2FYU8KR1XGDBZ --paths \"/*\"",
12
12
  "clean": "gatsby clean",
13
13
  "extract:dev": "export STORYBOOK_HOST='http://localhost:5000/iframe.html?id=components-avatargroup-all--all&args=&viewMode=story' && node ./tools/extract.js",
14
14
  "extract": "node ./tools/extract.js"
@@ -128,6 +128,18 @@ export const data = [
128
128
  imgStyle={imgStyle}
129
129
  />)
130
130
  },
131
+ {
132
+ link: 'helpText/usage',
133
+ name: 'Help text',
134
+ design: "Available",
135
+ code: "Unavailable",
136
+ image: () => (
137
+ <StaticImage
138
+ src="./images/Helptext2.png"
139
+ alt="Help text"
140
+ imgStyle={imgStyle}
141
+ />)
142
+ },
131
143
  {
132
144
  link: 'icons/usage',
133
145
  name: 'Icons',
@@ -68,6 +68,18 @@ export const data = [
68
68
  imgStyle={imgStyle}
69
69
  />)
70
70
  },
71
+ {
72
+ link: 'checkbox/usage',
73
+ design: 'Available',
74
+ name: 'Checkbox',
75
+ code: 'Available',
76
+ image: () => (
77
+ <StaticImage
78
+ src="./images/mobile/Checkbox.png"
79
+ alt="Checkbox"
80
+ imgStyle={imgStyle}
81
+ />)
82
+ },
71
83
  {
72
84
  link: 'chips/usage',
73
85
  design: 'Available',
@@ -39,7 +39,6 @@ menus:
39
39
 
40
40
  - label: Checkbox
41
41
  link: /components/checkbox/usage/
42
- hideInMobile: true
43
42
 
44
43
  - label: Chips
45
44
  link: /components/chips/usage/
@@ -56,5 +56,11 @@ Input chips are used inside inputs to behave as removable entries or tags.
56
56
  ### Usage
57
57
  <br/>
58
58
 
59
- ##### Selection chip vs radio/checkbox
59
+ #### Selection chip vs radio/checkbox
60
60
  Selection chips should be used when an immediate change/result is expected on selection. Radio/checkbox should be used when an explicit action is needed to submit the selection, e.g. in a form.
61
+
62
+
63
+ ![Selection chip vs radio/checkbox](./images/chips-1.png)
64
+
65
+ <br/>
66
+ <br/>
@@ -0,0 +1,74 @@
1
+ ---
2
+ title: Help text
3
+ description: Help text provides a brief description accompanying a component.
4
+ tabs: ['Usage']
5
+ showMobile: true
6
+ ---
7
+
8
+ Help text is used to provide additional information accompanying a component such as checkbox, dropdown, input, etc.
9
+
10
+ ### Structure
11
+
12
+ <br/>
13
+
14
+ ![Structure of Help text](./images/helpText-1.png)
15
+ <br/>
16
+ <br/>
17
+
18
+ ### Properties
19
+
20
+ <br/>
21
+
22
+ <table style="width: 100%">
23
+ <tbody>
24
+ <tr>
25
+ <th style="width:33%; text-align: left;">Property</th>
26
+ <th style="width:33%; text-align: left;">Value(s)</th>
27
+ <th style="width:33%; text-align: left;">Default value</th>
28
+ </tr>
29
+ <tr style="vertical-align: top">
30
+ <td>Width</td>
31
+ <td>Spans the width of the related component</td>
32
+ <td>-</td>
33
+ </tr>
34
+ <tr style="vertical-align: top">
35
+ <td>Spacing between help text and the component</td>
36
+ <td>4px</td>
37
+ <td>4px</td>
38
+ </tr>
39
+ </tbody>
40
+ </table>
41
+
42
+ <br/>
43
+
44
+ <br/>
45
+
46
+ ### Usage
47
+
48
+ #### When to use help text
49
+
50
+ Help text should only be used to provide a brief description related to the component. It should not be used for headings, main content, or long paragraphs.
51
+
52
+ ![When to use help text](./images/helpText-2.png)
53
+ <br/>
54
+
55
+ ![When to use help text](./images/helpText-3.png)
56
+ <br/>
57
+ <br/>
58
+
59
+ #### Help text vs Inline message
60
+
61
+ Inline message is used to provide inline feedback regarding a state or action and hence it is reactive (only appears after something has happened, to provide feedback). Whereas help text is used to provide additional information typically appearing just below a component e.g. inputs, dropdowns, etc.
62
+
63
+ ![Help text vs Inline message](./images/helpText-4.png)
64
+ <br/>
65
+ <br/>
66
+
67
+ #### Position and width of the help text component
68
+
69
+ Help text always appears just below the accompanying component and spans across its width.
70
+
71
+ ![Position and width of the help text component](./images/helpText-5.png)
72
+ <br/>
73
+ <br/>
74
+ <br/>
@@ -30,6 +30,9 @@ A pill comes in 9 appearances.
30
30
  <Preview name='components-pills-variants-appearance--appearance'/>
31
31
 
32
32
  ### Properties
33
+
34
+ <br/>
35
+
33
36
  <table style="width: 100%">
34
37
  <tbody>
35
38
  <tr>
@@ -91,4 +94,7 @@ A pill comes in 9 appearances.
91
94
 
92
95
  Pills are used to display count of entities while badges are used for tagging entities.
93
96
 
94
- *image pending*
97
+ ![Pills vs Badges](./images/pills-1.png)
98
+
99
+ <br/>
100
+ <br/>
@@ -105,5 +105,11 @@ Radio buttons are recommended to use when there are fewer than 5 options as it i
105
105
 
106
106
  However, if the number of options exceeds 5 or if the space is limited then it is recommended to use dropdowns to better utilize the space.
107
107
 
108
- *image to be made later*
108
+
109
+ ![Radio vs Dropdown](./images/radio-1.png)
110
+
111
+ <br/>
112
+ <br/>
113
+
114
+
109
115
 
@@ -61,16 +61,23 @@ The size of the switch depends on the other components appearing around it. If o
61
61
 
62
62
  The options that require an instant response are best selected using a switch.
63
63
 
64
- *image pending*
64
+ ![Instant response](./images/switch-4.png)
65
+
66
+ <br/>
65
67
 
66
68
  ##### Multiple choices
67
69
 
68
70
  Checkboxes are preferred over switches when multiple options are available and the user has to select one or more options from them. Clicking multiple switches one by one and waiting to see results after each click takes extra time.
69
- *image pending*
71
+
72
+ ![Multiple choices](./images/switch-5.png)
73
+
74
+ <br/>
70
75
 
71
76
  ##### Confirmation
72
77
 
73
78
  Checkboxes are preferred when an explicit action is required to confirm settings.
74
- *image pending*
75
79
 
80
+ ![Confirmation](./images/switch-6.png)
76
81
 
82
+ <br/>
83
+ <br/>
@@ -259,4 +259,7 @@ A page takes people to a whole new space detaching them from the parent flow, wh
259
259
 
260
260
  Bottom sheets should not have complex flows in them. For complex and multi-step flows consider using pages.
261
261
 
262
- *Do Don't iamge*
262
+ ![Bottom Sheet vs Page](./images/bottomsheet-8.png)
263
+
264
+ <br/>
265
+ <br/>
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: Checkbox
3
+ description: A checkbox lets users select one or more values from a list of options.
4
+ tabs: ['Usage']
5
+ showMobile: true
6
+ ---
7
+
8
+ A checkbox lets users select one or more values from a list of options. Options are not mutually exclusive here so the selection of any option won’t affect the other.
9
+
10
+ ### Variants
11
+
12
+ #### Default
13
+
14
+ The default variant comes with a label along with the checkbox control. This entire combination of checkbox control and label is tappable to change the checkbox selection.
15
+
16
+ ![Default checkbox](./images/checkbox-1.png)
17
+
18
+ <br/>
19
+
20
+ #### With help text
21
+
22
+ The checkbox can have a help text below the label to provide additional information about that particular option. The help text will always be aligned with the label.
23
+
24
+ Tapping over the help text does not change the state of the checkbox.
25
+
26
+ ![Checkbox with help text](./images/checkbox-2.png)
27
+
28
+ <br/>
29
+ <br/>
30
+
31
+ ### States
32
+
33
+ Checkboxes can be checked, unchecked, or indeterminate. Each of the selections has default, active and disabled states.
34
+
35
+ ![Checkbox states](./images/checkbox-3.png)
36
+
37
+ <br/>
38
+
39
+ ### Properties
40
+
41
+
42
+
43
+ ### Usage
44
+
45
+ #### Checkbox group
46
+
47
+ The checkbox group consists of a list of multiple options, with a label on the top. The label should clearly state the grouping category or the action to perform.
48
+
49
+ > Note: Minimum spacing between multiple options as well as the 1st option and group label should be 0px.
50
+
51
+ <br/>
52
+
53
+ ![Checkbox group](./images/checkbox-4.png)
54
+
55
+ <br/>
56
+
57
+ #### Options alignment
58
+
59
+ The options in a radio group can be aligned either vertically or horizontally.
60
+
61
+ ##### Vertical
62
+
63
+ For vertical alignment, all the options of the checkbox group align vertically with one option in a line. This type of arrangement should be preferred over the horizontal arrangement for easier reading and scanning.
64
+
65
+ ![Vertical alignment of checkboxes](./images/checkbox-5.png)
66
+
67
+ <br/>
68
+
69
+ ##### Horizontal
70
+
71
+ For horizontal alignment, all the options of the checkbox group align horizontally in a single line. Make sure to space the options appropriately so that it is clear which control goes with which label.
72
+
73
+ If there are too many options it is not advisable to go for this type of arrangement because of less horizontal space available.
74
+
75
+ ![Horizontal alignment of checkboxes](./images/checkbox-6.png)
76
+
77
+ <br/>
78
+
79
+ #### Nesting
80
+
81
+ Checkboxes can be nested in case of a list having sub-sections. The parent remains unchecked if no child is checked.
82
+
83
+ The indeterminate state of the parent shows a partially checked state when there is a nested relationship. The parent checkbox will remain indeterminate until all of its child checkboxes are checked.
84
+
85
+ ![Nesting of checkboxes](./images/checkbox-7.png)
86
+
87
+ <br/>
88
+
89
+ #### Overflow behavior
90
+
91
+ If the label or the help text with the checkbox component overflows, wrap it to the next line but make sure that the control and the label are top aligned.
92
+
93
+ ![Overflow behavior](./images/checkbox-8.png)
94
+
95
+ <br/>
96
+
97
+ #### Checkbox vs radio
98
+
99
+ Checkboxes allow users to select multiple options whereas radio allows only one selection from a list of mutually exclusive options.
100
+
101
+ ![Checkbox vs radio](./images/checkbox-9.png)
102
+
103
+ <br/>
104
+
105
+ #### Checkbox vs Switch
106
+
107
+ Consider using a checkbox instead of a switch when a confirmation action is required to apply the changes. For example in forms etc.
108
+
109
+ ![Checkbox vs Switch](./images/checkbox-10.png)
110
+
111
+ <br/>
112
+
113
+ #### Checkbox vs dropdown
114
+
115
+ The checkbox is recommended to use when there are fewer than 5-7 options as it is easier for users to compare and select the appropriate option and save an additional tap.
116
+
117
+ However, if the number of options exceeds 5-7 or if the space is limited and the options can be collapsed then it is recommended to use dropdowns to utilize the space.
118
+
119
+ ![Checkbox vs dropdown](./images/checkbox-11.png)
120
+
121
+ <br/>
122
+ <br/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovaccer/design-system",
3
- "version": "2.13.0",
3
+ "version": "2.13.2",
4
4
  "description": "React components library project for Innovaccer Design System",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",