@appdirect/sfb-toolkit 4.0.22 → 4.0.25

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 (70) hide show
  1. package/bin/index.js +92 -14
  2. package/coverage/clover.xml +32 -32
  3. package/coverage/coverage-final.json +4 -4
  4. package/coverage/lcov-report/constants/customUserAttributesMock.js.html +1 -1
  5. package/coverage/lcov-report/constants/index.html +1 -1
  6. package/coverage/lcov-report/constants/pageUrls.js.html +1 -1
  7. package/coverage/lcov-report/constants/userMock.js.html +1 -1
  8. package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +1 -1
  9. package/coverage/lcov-report/controllers/controllers-utils/index.html +1 -1
  10. package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +1 -1
  11. package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +1 -1
  12. package/coverage/lcov-report/controllers/data-filters/index.html +1 -1
  13. package/coverage/lcov-report/controllers/index.html +1 -1
  14. package/coverage/lcov-report/controllers/index.js.html +1 -1
  15. package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +7 -7
  16. package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +3 -3
  17. package/coverage/lcov-report/front-end-utils/src/components/base/index.html +1 -1
  18. package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +11 -11
  19. package/coverage/lcov-report/front-end-utils/src/components/container.js.html +1 -1
  20. package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +1 -1
  21. package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +1 -1
  22. package/coverage/lcov-report/front-end-utils/src/components/index.html +1 -1
  23. package/coverage/lcov-report/front-end-utils/src/components/search.js.html +13 -13
  24. package/coverage/lcov-report/front-end-utils/src/constants/index.html +1 -1
  25. package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +1 -1
  26. package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +1 -1
  27. package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +1 -1
  28. package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +1 -1
  29. package/coverage/lcov-report/front-end-utils/src/utils/index.html +1 -1
  30. package/coverage/lcov-report/index.html +1 -1
  31. package/coverage/lcov-report/middlewares/config.js.html +1 -1
  32. package/coverage/lcov-report/middlewares/index.html +1 -1
  33. package/coverage/lcov-report/tools/index.html +1 -1
  34. package/coverage/lcov-report/tools/proxy-fetch.js.html +1 -1
  35. package/coverage/lcov.info +81 -81
  36. package/customComponents/index.js +10 -2
  37. package/npm-shrinkwrap.json +144 -20
  38. package/package.json +4 -4
  39. package/readme.md +9 -0
  40. package/src/boilerplates/AddComponent/AddComponent.jsx +234 -0
  41. package/src/boilerplates/AddComponent/styles/AddComponent.scss +47 -0
  42. package/src/tools/prompt-questions.js +109 -14
  43. package/src/tools/toolkit-common-fun.js +30 -15
  44. package/src/tools/toolkit-common-vars-namespace.js +106 -0
  45. package/src/tools/toolkit-common-vars.js +1 -1
  46. package/src/tools/toolkit-components-add.js +334 -0
  47. package/src/tools/toolkit-components-copy.js +78 -46
  48. package/src/tools/toolkit-components-delete.js +370 -0
  49. package/src/tools/toolkit-components-fun.js +126 -7
  50. package/src/tools/toolkit-components-info.js +6 -4
  51. package/src/tools/toolkit-components-vars.js +50 -0
  52. package/src/tools/toolkit-components.js +1 -1
  53. package/src/tools/toolkit-create.js +2 -3
  54. package/src/tools/toolkit-import.js +182 -0
  55. package/src/tools/toolkit-install.js +6 -5
  56. package/src/tools/toolkit-package.js +3 -0
  57. package/src/tools/toolkit-setup.js +1 -1
  58. package/src/tools/toolkit-start.js +4 -1
  59. package/src/tools/toolkit-storybook.js +136 -48
  60. package/src/tools/toolkit-zip-utils.js +35 -0
  61. package/src/tools/zip-theme.js +62 -50
  62. package/themes-config.json +0 -7
  63. package/customComponents/atoms/label/Label.jsx +0 -20
  64. package/customComponents/atoms/label/stories/Label.story.mdx +0 -20
  65. package/customComponents/atoms/label/styles/Label.scss +0 -4
  66. package/customComponents/components/atoms-showcase-custom/AtomsShowcaseCustom.jsx +0 -8
  67. package/customComponents/components/atoms-showcase-custom/stories/AtomsShowcaseCustom.story.mdx +0 -17
  68. package/customComponents/components/atoms-showcase-modules/AtomsShowcaseModules.jsx +0 -223
  69. package/customComponents/components/atoms-showcase-modules/stories/AtomsShowcaseModules.story.mdx +0 -49
  70. package/customComponents/components/index.js +0 -2
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import Label from '../../atoms/label/Label'
3
-
4
- const AtomsShowcase = () => (
5
- <Label label="Custom Component Label" />
6
- );
7
-
8
- export default AtomsShowcase;
@@ -1,17 +0,0 @@
1
- import { Story, Canvas, Meta } from '@storybook/addon-docs/blocks';
2
- import AtomsShowcaseCustom from '../AtomsShowcaseCustom';
3
-
4
- <Meta title="Custom Components/Atoms Showcase Custom" component={AtomsShowcaseCustom} />
5
-
6
- # AtomsShowcaseCustom
7
- <br />
8
-
9
- ## `AtomsShowcaseCustoms` are an example of how to setup a simple custom component.
10
- <br />
11
-
12
- ### Default
13
- <Canvas>
14
- <Story name="Default">
15
- <AtomsShowcaseCustom />
16
- </Story>
17
- </Canvas>
@@ -1,223 +0,0 @@
1
- import React from 'react';
2
- import '@appdirect/sfb-theme-components/src/components/atoms-showcase/styles/AtomsShowcase.scss'
3
- import PropTypes from 'prop-types';
4
- import withListener from '@appdirect/sfb-theme-components/src/components/withListener';
5
- import Button from '@appdirect/sfb-theme-components/src/atoms/button/Button';
6
- import { createNamespace } from '@appdirect/sfb-theme-components/src/tools/namingTools';
7
-
8
- import { INPUT, TOGGLE, TEXTAREA, COLORPICKER, DROPDOWN,
9
- RADIO, CHECKBOX, SLIDER, GROUP_HEADER, SPACER
10
- } from '@appdirect/sfb-theme-components/src/constants/schemaComponentTypes';
11
-
12
-
13
- const n = createNamespace('AtomsShowcase');
14
-
15
- export const AtomsShowcaseComponent = props => {
16
- const { settings = {} } = props;
17
- const { title,
18
- description,
19
- ctaButton,
20
- ctaButtonLabel,
21
- headerType,
22
- descriptionSize,
23
- textStyling,
24
- textOpacity } = settings;
25
- const handleCTAClick = evt => {
26
- evt.preventDefault();
27
- alert('Hello!');
28
- };
29
- const modifiers = [descriptionSize];
30
-
31
- if (textStyling && textStyling.length) {
32
- modifiers.push(...textStyling);
33
- }
34
- const styleProps = Object.assign({},
35
- textOpacity && {
36
- style: { opacity: textOpacity }
37
- });
38
-
39
- return (
40
- <div {...n('container').withTestId().props}>
41
- <div {...n('column').props}>
42
- {headerType === 'header1' && <h1>{title}</h1>}
43
- {headerType === 'header2' && <h2>{title}</h2>}
44
- {headerType === 'header3' && <h3>{title}</h3>}
45
- {headerType === 'header4' && <h4>{title}</h4>}
46
- {headerType === 'header5' && <h5>{title}</h5>}
47
- {!headerType && <span>{title}</span>}
48
- {description && <p {...n('description', modifiers).withTestId().props} {...styleProps}>{description}</p>}
49
- </div>
50
- <div {...n('column').props}>
51
- {(ctaButton === true || ctaButton === 'true') && (
52
- <Button type="primary" onClick={handleCTAClick}>
53
- {ctaButtonLabel}
54
- </Button>
55
- )}
56
- </div>
57
- </div>
58
- );
59
- };
60
-
61
- const HEADER_TYPE_OPTIONS = [
62
- { value: 'header1', label: 'uieditor.sfbComponent.atomsShowcase.headerType.option.header1', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
63
- { value: 'header2', label: 'uieditor.sfbComponent.atomsShowcase.headerType.option.header2', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
64
- { value: 'header3', label: 'uieditor.sfbComponent.atomsShowcase.headerType.option.header3', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
65
- { value: 'header4', label: 'uieditor.sfbComponent.atomsShowcase.headerType.option.header4', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
66
- { value: 'header5', label: 'uieditor.sfbComponent.atomsShowcase.headerType.option.header5', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' }
67
- ];
68
-
69
- const DESCRIPTION_SIZE_OPTIONS = [
70
- { value: 'bigger', label: 'uieditor.sfbComponent.atomsShowcase.descriptionSize.option.bigger', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
71
- { value: 'standard', label: 'uieditor.sfbComponent.atomsShowcase.descriptionSize.option.standard', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' },
72
- { value: 'smaller', label: 'uieditor.sfbComponent.atomsShowcase.descriptionSize.option.smaller', caption: 'uieditor.sfbComponent.atomsShowcase.sampleCaption' }
73
- ];
74
-
75
- const TEXT_STYLING_OPTIONS = [
76
- { value: 'bold', label: 'uieditor.sfbComponent.atomsShowcase.textStyling.option.bold' },
77
- { value: 'italic', label: 'uieditor.sfbComponent.atomsShowcase.textStyling.option.italic' },
78
- { value: 'strikethrough', label: 'uieditor.sfbComponent.atomsShowcase.textStyling.option.strikethrough' },
79
- { value: 'underline', label: 'uieditor.sfbComponent.atomsShowcase.textStyling.option.underline' }
80
- ];
81
-
82
- AtomsShowcaseComponent.schema = () => ({
83
- name: 'AtomsShowcase',
84
- title: 'uieditor.sfbComponent.atomsShowcase.title',
85
- iconName: 'carousel',
86
- form: {
87
- title: {
88
- title: 'uieditor.sfbComponent.atomsShowcase.title.title',
89
- placeholder: 'uieditor.sfbComponent.atomsShowcase.title.placeholder',
90
- defaultValue: 'uieditor.sfbComponent.atomsShowcase.title.defaultValue',
91
- type: INPUT,
92
- required: true,
93
- validation: {
94
- pattern: /^[a-zA-Z0-9 ]+$/gm,
95
- message: 'uieditor.sfbComponent.input.validation.message'
96
- }
97
- },
98
- spacer: {
99
- type: GROUP_HEADER,
100
- title: 'uieditor.sfbComponent.atomsShowcase.spacer.title',
101
- symbol: 'button-settings'
102
- },
103
- ctaButton: {
104
- labelOn: 'uieditor.sfbComponent.atomsShowcase.ctaButton.labelOn',
105
- labelOff: 'uieditor.sfbComponent.atomsShowcase.ctaButton.labelOff',
106
- defaultValue: false,
107
- type: TOGGLE
108
- },
109
- ctaButtonLabel: {
110
- title: 'uieditor.sfbComponent.atomsShowcase.ctaButtonLabel.title',
111
- placeholder: 'uieditor.sfbComponent.atomsShowcase.ctaButtonLabel.placeholder',
112
- defaultValue: 'uieditor.sfbComponent.atomsShowcase.ctaButtonLabel.defaultValue',
113
- type: INPUT,
114
- required: true,
115
- validation: {
116
- pattern: /^[a-zA-Z0-9 ]+$/gm,
117
- message: 'uieditor.sfbComponent.input.validation.message'
118
- }
119
- },
120
- ctaButtonColor: {
121
- title: 'uieditor.sfbComponent.atomsShowcase.ctaButtonColor.title',
122
- defaultValue: '#ffffff',
123
- type: COLORPICKER
124
- },
125
- spacer2: {
126
- type: SPACER
127
- },
128
- description: {
129
- title: 'uieditor.sfbComponent.atomsShowcase.description.title',
130
- defaultValue: 'uieditor.sfbComponent.atomsShowcase.description.defaultValue',
131
- type: TEXTAREA,
132
- required: true,
133
- validation: {
134
- pattern: /^[a-zA-Z0-9 ]+$/gm,
135
- message: 'uieditor.sfbComponent.input.validation.message'
136
- }
137
- },
138
- headerType: {
139
- title: 'uieditor.sfbComponent.atomsShowcase.headerType.title',
140
- type: DROPDOWN,
141
- required: true,
142
- defaultValue: HEADER_TYPE_OPTIONS[1].value,
143
- options: HEADER_TYPE_OPTIONS,
144
- validation: {
145
- availableOptions: HEADER_TYPE_OPTIONS.map(({ value }) => value),
146
- message: 'uieditor.sfbComponent.dropdown.validation.message',
147
- default: 'uieditor.sfbComponent.dropdown.defaultValue'
148
- }
149
- },
150
- descriptionSize: {
151
- title: 'uieditor.sfbComponent.atomsShowcase.descriptionSize.title',
152
- type: RADIO,
153
- required: true,
154
- defaultValue: DESCRIPTION_SIZE_OPTIONS[1].value,
155
- options: DESCRIPTION_SIZE_OPTIONS,
156
- validation: {
157
- availableOptions: DESCRIPTION_SIZE_OPTIONS.map(({ value }) => value),
158
- message: 'uieditor.sfbComponent.radio.validation.message'
159
- }
160
- },
161
- textStyling: {
162
- title: 'uieditor.sfbComponent.atomsShowcase.textStyling.title',
163
- type: CHECKBOX,
164
- required: false,
165
- defaultValue: [],
166
- options: TEXT_STYLING_OPTIONS,
167
- validation: {
168
- availableOptions: TEXT_STYLING_OPTIONS.map(({ value }) => value),
169
- message: 'uieditor.sfbComponent.checkbox.validation.message'
170
- }
171
- },
172
- textOpacity: {
173
- title: 'uieditor.sfbComponent.atomsShowcase.textOpacity.title',
174
- type: SLIDER,
175
- required: false,
176
- defaultValue: 1,
177
- options: {
178
- step: 0.1,
179
- min: 0.1,
180
- max: 1
181
- },
182
- validation: {
183
- availableOptions: {
184
- step: 0.1,
185
- min: 0.1,
186
- max: 1
187
- },
188
- message: 'uieditor.sfbComponent.slider.validation.message'
189
- }
190
- }
191
- }
192
- });
193
-
194
- const SETTINGS = AtomsShowcaseComponent.schema().form;
195
-
196
- AtomsShowcaseComponent.propTypes = {
197
- settings: PropTypes.shape({
198
- title: PropTypes.string,
199
- description: PropTypes.string,
200
- ctaButton: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
201
- ctaButtonLabel: PropTypes.string,
202
- headerType: PropTypes.string,
203
- descriptionSize: PropTypes.string,
204
- textStyling: PropTypes.array,
205
- textOpacity: PropTypes.number
206
- })
207
- };
208
-
209
- AtomsShowcaseComponent.defaultProps = {
210
- settings: {
211
- title: SETTINGS.title.defaultValue,
212
- description: SETTINGS.description.defaultValue,
213
- ctaButton: SETTINGS.ctaButton.defaultValue,
214
- ctaButtonLabel: SETTINGS.ctaButtonLabel.defaultValue,
215
- ctaButtonColor: SETTINGS.ctaButtonColor.defaultValue,
216
- headerType: SETTINGS.headerType.defaultValue,
217
- descriptionSize: SETTINGS.descriptionSize.defaultValue,
218
- textStyling: SETTINGS.textStyling.defaultValue,
219
- textOpacity: SETTINGS.textOpacity.defaultValue
220
- }
221
- };
222
-
223
- export default withListener(AtomsShowcaseComponent);
@@ -1,49 +0,0 @@
1
- import { Story, Canvas, Meta, ArgsTable } from '@storybook/addon-docs/blocks';
2
- import { getKnobs } from '@appdirect/sfb-theme-components/src/tools/knobsHelper';
3
- import { TableContentFromObject, FormOutput, CollapsibleJsonSnippet } from '@appdirect/sfb-theme-components/src/tools/docTools';
4
- import AtomsShowcaseModules from '../AtomsShowcaseModules';
5
-
6
- export const atomShowcaseSettings = {
7
- title: 'The title to display.',
8
- description: 'The description or content of the component.',
9
- ctaButton: 'Show/Hide a CTA button.',
10
- ctaButtonLabel: 'The text for the button label.',
11
- headerType: 'The type of header used by the title h1 to h5.',
12
- descriptionSize: 'The size used in the description (bigger, standard, smaller).',
13
- textStyling: 'The text style used in the description (bold, italic, strikethrough, underline).',
14
- textOpacity: 'The opacity of the description (From 0 to 1).'
15
- };
16
-
17
- <Meta title="Custom Components/Atoms Showcase Modules" component={AtomsShowcaseModules} />
18
-
19
- # AtomsShowcaseModules
20
- <br />
21
-
22
- <h2>
23
- <inlineCode>AtomsShowcaseModules</inlineCode> are an example of how to create a <strong>custom component</strong>&nbsp;
24
- by reusing/modifying components found in the <inlineCode>@appdirect/sfb-theme-components</inlineCode> npm module.
25
- </h2>
26
- <br />
27
-
28
- ### Default
29
- <Canvas>
30
- <Story name="Default">
31
- <AtomsShowcaseModules settings={getKnobs(AtomsShowcaseModules.schema().form)} />
32
- </Story>
33
- </Canvas>
34
-
35
- ## Props
36
- <CollapsibleJsonSnippet
37
- summary="settingsData"
38
- code={getKnobs(AtomsShowcaseModules.schema().form)}
39
- />
40
- <ArgsTable of={AtomsShowcaseModules} />
41
-
42
- ## Schema
43
- ### Form Settings
44
- <table>
45
- <TableContentFromObject obj={atomShowcaseSettings} />
46
- </table>
47
-
48
- ### Form Output
49
- <FormOutput code={AtomsShowcaseModules.schema().form} />
@@ -1,2 +0,0 @@
1
- export { default as AtomsShowcaseModules } from './atoms-showcase-modules/AtomsShowcaseModules';
2
- export { default as AtomsShowcaseCustom } from './atoms-showcase-custom/AtomsShowcaseCustom';