@descope/web-components-ui 1.0.426 → 1.0.428

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 (100) hide show
  1. package/README.md +0 -1
  2. package/dist/cjs/index.cjs.js +2520 -5270
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +2022 -4815
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +7 -15
  7. package/src/components/descope-apps-list/AppsListClass.js +1 -1
  8. package/src/components/descope-apps-list/index.js +2 -2
  9. package/src/components/descope-date-field/descope-calendar/index.js +1 -1
  10. package/src/components/descope-divider/DividerClass.js +1 -1
  11. package/src/components/descope-divider/index.js +1 -1
  12. package/src/components/descope-link/LinkClass.js +1 -1
  13. package/src/components/descope-link/index.js +1 -1
  14. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +1 -1
  15. package/src/components/descope-security-questions-setup/index.js +1 -1
  16. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +1 -1
  17. package/src/components/descope-security-questions-verify/index.js +1 -1
  18. package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
  19. package/src/components/descope-user-attribute/index.js +1 -1
  20. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +1 -1
  21. package/src/components/descope-user-auth-method/index.js +1 -1
  22. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
  23. package/src/components/mapping-fields/descope-mappings-field/index.js +2 -2
  24. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  25. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +1 -1
  26. package/src/components/phone-fields/descope-phone-field/index.js +1 -1
  27. package/src/components/phone-fields/descope-phone-input-box-field/index.js +1 -1
  28. package/src/helpers/themeHelpers/index.js +1 -1
  29. package/src/theme/components/alert.js +1 -1
  30. package/src/theme/components/enrichedText.js +1 -1
  31. package/src/theme/components/index.js +3 -3
  32. package/dist/index.d.ts +0 -72
  33. package/node_modules/common/.eslintrc.json +0 -18
  34. package/node_modules/common/README.md +0 -7
  35. package/node_modules/common/package.json +0 -37
  36. package/node_modules/common/project.json +0 -7
  37. package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +0 -66
  38. package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +0 -14
  39. package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +0 -55
  40. package/node_modules/common/src/baseClasses/index.js +0 -3
  41. package/node_modules/common/src/componentsHelpers/index.js +0 -95
  42. package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +0 -10
  43. package/node_modules/common/src/componentsMixins/index.js +0 -1
  44. package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +0 -14
  45. package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +0 -22
  46. package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +0 -23
  47. package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +0 -12
  48. package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +0 -100
  49. package/node_modules/common/src/componentsMixins/mixins/createProxy.js +0 -58
  50. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +0 -106
  51. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +0 -167
  52. package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +0 -62
  53. package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +0 -93
  54. package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +0 -170
  55. package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +0 -13
  56. package/node_modules/common/src/componentsMixins/mixins/index.js +0 -14
  57. package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +0 -76
  58. package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +0 -210
  59. package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +0 -23
  60. package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +0 -59
  61. package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +0 -112
  62. package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +0 -242
  63. package/node_modules/common/src/constants.js +0 -4
  64. package/node_modules/common/src/icons/errorMessageIconBase64.js +0 -1
  65. package/node_modules/common/src/sbControls.js +0 -302
  66. package/node_modules/common/src/sbHelpers.js +0 -53
  67. package/node_modules/common/src/themeHelpers/colorsHelpers.js +0 -94
  68. package/node_modules/common/src/themeHelpers/componentsThemeManager.js +0 -45
  69. package/node_modules/common/src/themeHelpers/index.js +0 -191
  70. package/node_modules/common/src/themeHelpers/resetHelpers.js +0 -144
  71. package/node_modules/common/src/utils/index.js +0 -68
  72. package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +0 -54
  73. package/node_modules/descope-avatar/package.json +0 -34
  74. package/node_modules/descope-avatar/project.json +0 -7
  75. package/node_modules/descope-avatar/src/component/AvatarClass.js +0 -109
  76. package/node_modules/descope-avatar/src/component/index.js +0 -8
  77. package/node_modules/descope-avatar/src/theme.js +0 -44
  78. package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
  79. package/node_modules/descope-avatar/stories/descope-avatar.stories.js +0 -32
  80. package/node_modules/descope-combo-box/e2e/descope-combo-box.spec.ts +0 -462
  81. package/node_modules/descope-combo-box/package.json +0 -34
  82. package/node_modules/descope-combo-box/project.json +0 -7
  83. package/node_modules/descope-combo-box/src/component/ComboBoxClass.js +0 -619
  84. package/node_modules/descope-combo-box/src/component/index.js +0 -6
  85. package/node_modules/descope-combo-box/src/theme.js +0 -93
  86. package/node_modules/descope-combo-box/stories/descope-combo-box.stories.js +0 -180
  87. package/node_modules/descope-text/e2e/descope-text.spec.ts +0 -35
  88. package/node_modules/descope-text/package.json +0 -31
  89. package/node_modules/descope-text/project.json +0 -7
  90. package/node_modules/descope-text/src/component/TextClass.js +0 -63
  91. package/node_modules/descope-text/src/component/index.js +0 -5
  92. package/node_modules/descope-text/src/theme.js +0 -91
  93. package/node_modules/descope-text/stories/descope-text.stories.js +0 -55
  94. package/node_modules/theme-globals/package.json +0 -16
  95. package/node_modules/theme-globals/project.json +0 -7
  96. package/node_modules/theme-globals/src/index.js +0 -180
  97. package/node_modules/theme-input-wrapper/package.json +0 -17
  98. package/node_modules/theme-input-wrapper/project.json +0 -7
  99. package/node_modules/theme-input-wrapper/src/index.js +0 -130
  100. package/src/index.d.ts +0 -72
@@ -1,112 +0,0 @@
1
- import { kebabCaseJoin } from '../../utils';
2
- import { forwardAttrs } from '../../componentsHelpers';
3
- import { createStyleMixin } from '../mixins/createStyleMixin';
4
- import { createCssVarsList } from './createStyleMixin/helpers';
5
-
6
- // this is needed because we might generate the same css vars names
7
- // e.g. "overlayColor" attribute in style mixin's mapping,
8
- // will generate the same var as "color" attribute in portals's mapping
9
- // when the portal name is "overlay".
10
- // because of that, we are adding this separator that is also used as a differentiator
11
- const DISPLAY_NAME_SEPARATOR = '_';
12
- const PORTAL_THEME_PREFIX = '@';
13
-
14
-
15
- const sanitizeSelector = (selector) => selector.replace(/[^\w\s]/gi, '');
16
-
17
- const withWaitForShadowRoot = (getRootElementFn) => async (that) => {
18
- const ele = await getRootElementFn(that);
19
-
20
- return new Promise((res) => {
21
- const MAX_RETRIES = 20;
22
- let counter = 0;
23
-
24
- const check = () => {
25
- if (counter > MAX_RETRIES) {
26
- // eslint-disable-next-line no-console
27
- console.error('could not get shadow root for element', ele);
28
- res(ele);
29
- return;
30
- }
31
-
32
- counter++;
33
-
34
- if (!ele?.shadowRoot) {
35
- setTimeout(check);
36
- } else {
37
- res(ele.shadowRoot);
38
- }
39
- };
40
- check();
41
- });
42
- };
43
-
44
- export const portalMixin =
45
- ({ name, selector, mappings = {}, forward: { attributes = [], include = true } = {} }) =>
46
- (superclass) => {
47
- const eleDisplayName = name || sanitizeSelector(selector);
48
-
49
- const BaseClass = createStyleMixin({
50
- mappings,
51
- })(superclass);
52
-
53
- return class PortalMixinClass extends BaseClass {
54
- static get cssVarList() {
55
- return {
56
- ...BaseClass.cssVarList,
57
- [eleDisplayName]: createCssVarsList(
58
- kebabCaseJoin(superclass.componentName, DISPLAY_NAME_SEPARATOR + eleDisplayName),
59
- mappings
60
- ),
61
- };
62
- }
63
-
64
- #portalEle;
65
-
66
- constructor() {
67
- // we cannot use "this" before calling "super"
68
- const getRootElement = async (that) => {
69
- const baseEle = (that.shadowRoot || that).querySelector(that.baseSelector);
70
- if (!selector) {
71
- return baseEle;
72
- }
73
-
74
- // in case we have a selector, we should first wait for the base element shadow root
75
- // and then look for the internal element
76
- const baseEleShadowRoot = await withWaitForShadowRoot(() => baseEle)(that);
77
- return baseEleShadowRoot.querySelector(selector);
78
- };
79
-
80
- const getPortalElement = withWaitForShadowRoot(getRootElement);
81
-
82
- super({
83
- getRootElement: getPortalElement,
84
- componentNameSuffix: DISPLAY_NAME_SEPARATOR + eleDisplayName,
85
- themeSection: PORTAL_THEME_PREFIX + eleDisplayName,
86
- baseSelector: ':host',
87
- });
88
-
89
- this.#portalEle = getPortalElement(this).then((ele) => ele.host);
90
- }
91
-
92
- async #handleHoverAttribute() {
93
- const portalEle = await this.#portalEle;
94
- portalEle.onmouseenter = (e) => {
95
- e.target.setAttribute('hover', 'true');
96
- };
97
- portalEle.onmouseleave = (e) => {
98
- e.target.removeAttribute('hover');
99
- };
100
- }
101
-
102
- async init() {
103
- super.init?.();
104
- const portalEle = await this.#portalEle;
105
- forwardAttrs(this, portalEle, {
106
- [include ? 'includeAttrs' : 'excludeAttrs']: attributes,
107
- });
108
-
109
- this.#handleHoverAttribute();
110
- }
111
- };
112
- };
@@ -1,242 +0,0 @@
1
- /* eslint-disable no-param-reassign */
2
- import { compose } from '../../utils';
3
- import { forwardAttrs, getComponentName } from '../../componentsHelpers';
4
- import { createDispatchEvent } from '../helpers/mixinsHelpers';
5
- import { inputValidationMixin } from '../mixins/inputValidationMixin';
6
- import { createStyleMixin } from '../mixins/createStyleMixin';
7
-
8
- const errorAttrs = ['invalid', 'required'];
9
-
10
- const forwardProps = (src, targets, property) => {
11
- const targetArr = Array.isArray(targets) ? targets : [targets];
12
-
13
- Object.defineProperty(src, property, {
14
- set(v) {
15
- targetArr.forEach((target) => {
16
- target[property] = v;
17
- });
18
- },
19
- get() {
20
- return targets[0][property];
21
- },
22
- configurable: true,
23
- });
24
- };
25
-
26
- // recursively take the first slot child until it finds an element which is not a slot
27
- // stops after "nestingLevel" times
28
- const getNestedInput = (ele) => {
29
- if (!ele) return undefined;
30
-
31
- const nestingLevel = 10;
32
-
33
- let nonSlotEle = ele;
34
- for (let i = 0; i < nestingLevel; i++) {
35
- [nonSlotEle] = nonSlotEle.assignedElements();
36
- if (nonSlotEle?.localName !== 'slot') return nonSlotEle;
37
- }
38
- return undefined;
39
- };
40
-
41
- const proxyInputMixin =
42
- ({
43
- proxyProps = [],
44
- // useProxyTargets flag allows to forwardProps to other targets, other than
45
- // `this.inputElement`. It's to be used within `external-input` components,
46
- // if needed
47
- useProxyTargets = false,
48
- // allows us to set the event that should trigger validation
49
- // it can be either a string or an array of strings (for multiple events)
50
- inputEvent = 'input',
51
- triggerValidationEvents = [],
52
- // Proxies all validations from the parent component to the input element
53
- proxyParentValidation = false,
54
- }) =>
55
- (superclass) =>
56
- class ProxyInputMixinClass extends inputValidationMixin(superclass) {
57
- static get observedAttributes() {
58
- return [...(superclass.observedAttributes || []), ...errorAttrs];
59
- }
60
-
61
- #inputElement;
62
-
63
- #dispatchChange = createDispatchEvent.bind(this, 'change');
64
-
65
- constructor() {
66
- super();
67
-
68
- this.#inputElement = super.inputElement;
69
- }
70
-
71
- // the web-component does not loaded immediately, so we want to defer the warning
72
- // and show it only if the input element was not found after the component is loaded
73
- warnIfInputElementIsMissing() {
74
- clearTimeout(this.inputElementTimerId);
75
-
76
- this.inputElementTimerId = setTimeout(() => {
77
- // eslint-disable-next-line no-console
78
- !this.#inputElement && console.warn(this.localName, 'no input was found');
79
- }, 0);
80
- }
81
-
82
- get inputElement() {
83
- if (this.#inputElement) return this.#inputElement;
84
-
85
- this.warnIfInputElementIsMissing();
86
-
87
- const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]');
88
- const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');
89
-
90
- this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);
91
-
92
- return this.#inputElement;
93
- }
94
-
95
- set inputElement(ele) {
96
- this.#inputElement = ele;
97
- }
98
-
99
- getValidity() {
100
- return this.inputElement?.validity || {};
101
- }
102
-
103
- #handleErrorMessage() {
104
- this.setAttribute('error-message', this.validationMessage);
105
- }
106
-
107
- // We do not want to show the default validity report tooltip
108
- // So we are overriding the reportValidity fn to show the input's error message
109
- reportValidity = () => {
110
- // we want to update validity so in case the value was set programmatically, we won't get an error
111
- this.inputElement.setCustomValidity('');
112
- this.setCustomValidity('');
113
- if (!this.checkValidity()) {
114
- this.setAttribute('invalid', 'true');
115
- this.#handleErrorMessage();
116
- this.focus();
117
- }
118
- };
119
-
120
- // we are keeping also the default reportValidity because there are some components that still using it
121
- defaultReportValidity() {
122
- return super.reportValidity();
123
- }
124
-
125
- init() {
126
- super.init?.();
127
-
128
- // vaadin sets invalid indication on blur
129
- // we want invalid indication to appear only when calling reportValidity
130
- // this is why we are overriding vaadin's setInvalid behavior
131
- // to update only when the element is valid (so invalid indication will only be removed)
132
- // and we are adding it in reportValidity
133
- // eslint-disable-next-line func-names
134
- this.baseElement._setInvalid = function (invalid) {
135
- if (!invalid && this._shouldSetInvalid(invalid)) {
136
- this.invalid = invalid;
137
- }
138
- };
139
-
140
- // We want to ensure that `input` events properly cross ShadowDOM boundries
141
- // e.g. When we autofill a component's input with 1Password, for instance,
142
- // the event is fired without `composed: true` and doesn't our component's
143
- // ShadowDOM.
144
- this.baseElement.addEventListener('input', (e) => {
145
- if (!e.composed) {
146
- this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
147
- }
148
- });
149
-
150
- triggerValidationEvents.forEach((e) => {
151
- this.baseElement?.addEventListener(e, () => {
152
- this.inputElement?.setCustomValidity('');
153
- });
154
- });
155
-
156
- // on some cases the base element is not ready so the inputElement is empty
157
- // we are deferring this section to make sure the base element is ready
158
- setTimeout(() => {
159
- const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];
160
-
161
- validationEvents.forEach((e) => {
162
- this.baseElement?.addEventListener(e, () => {
163
- if (!this.baseElement.checkValidity()) {
164
- this.#handleErrorMessage();
165
- } else {
166
- this.removeAttribute('invalid');
167
- }
168
- });
169
- });
170
-
171
- this.baseElement.addEventListener('change', () => {
172
- this.#dispatchChange();
173
- });
174
-
175
- this.addEventListener('invalid', () => {
176
- if (!this.checkValidity()) {
177
- this.setAttribute('invalid', 'true');
178
- }
179
- this.#handleErrorMessage();
180
- });
181
-
182
- // sync properties
183
- proxyProps.forEach((prop) => {
184
- const externalInput = this.querySelector('input[slot="external-input"]') || null;
185
- const proxyTargets = useProxyTargets
186
- ? [this.baseElement, externalInput].filter(Boolean)
187
- : [];
188
- forwardProps(this, [this.inputElement, ...proxyTargets], prop);
189
- });
190
-
191
- this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
192
-
193
- forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });
194
- });
195
-
196
- if (proxyParentValidation) {
197
- // All functions called on the inputElement internals will be applied to the parent
198
- // component internals as well. As a result, there's no need to add outer mechanisms
199
- // to update the parent component's validity state based on the input elements validity.
200
- const inputElementInternals = this.inputElement.internals;
201
- const parentThis = this;
202
- this.inputElement.internals = new Proxy(inputElementInternals, {
203
- get: (target, prop) => {
204
- if (typeof target[prop] === 'function' && prop === 'setValidity') {
205
- return (...args) => {
206
- // If we're calling setValidity with 3 args, then the validationTarget
207
- // needs to be swapped to be the inputElement
208
- if (args.length === 3) {
209
- const newArgs = args.slice(0, args.length - 1);
210
- newArgs.push(parentThis.inputElement);
211
- parentThis.internals[prop](...newArgs);
212
- } else {
213
- parentThis.internals[prop](...args);
214
- }
215
- return target[prop](...args);
216
- };
217
- }
218
-
219
- if (typeof target[prop] === 'function') {
220
- return (...args) => {
221
- parentThis.internals[prop](...args);
222
- return target[prop](...args);
223
- };
224
- }
225
-
226
- return target[prop];
227
- },
228
- });
229
- }
230
- }
231
- };
232
-
233
- const composedProxyInputMixin = (proxyInputMixinConfig) =>
234
- compose(
235
- proxyInputMixin(proxyInputMixinConfig),
236
- // in order to use input-wrapper across all our input components, we need to inject its theme
237
- // to every proxy input mixin, to allow its css vars to be scoped properly and accessible
238
- // in the proxy input component
239
- createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })
240
- );
241
-
242
- export { composedProxyInputMixin as proxyInputMixin };
@@ -1,4 +0,0 @@
1
- export const DESCOPE_PREFIX = 'descope';
2
- export const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3;
3
- export const BASE_THEME_SECTION = 'host';
4
- export const PORTAL_THEME_PREFIX = '@';
@@ -1 +0,0 @@
1
- export default `data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZTIxZDEyIiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAzMC4zMzQgMzAuMzM0Ig0KCSB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0xNS4xNjcsMEM2LjgwNSwwLDAuMDAxLDYuODA0LDAuMDAxLDE1LjE2N2MwLDguMzYyLDYuODA0LDE1LjE2NywxNS4xNjYsMTUuMTY3YzguMzYxLDAsMTUuMTY2LTYuODA1LDE1LjE2Ni0xNS4xNjcNCgkJQzMwLjMzMyw2LjgwNCwyMy41MjgsMCwxNS4xNjcsMHogTTE3LjE2NywyNS42NjdoLTR2LTQuNWg0VjI1LjY2N3ogTTE3LjE2NywxOS41NDJoLTRWNS4xNjdoNFYxOS41NDJ6Ii8+DQo8L2c+DQo8L3N2Zz4=`;
@@ -1,302 +0,0 @@
1
- import errorMessageIconBase64 from './icons/errorMessageIconBase64';
2
-
3
- export const labelControl = {
4
- label: {
5
- name: 'Label',
6
- control: { type: 'text' },
7
- },
8
- };
9
-
10
- export const helperTextControl = {
11
- 'helper-text': {
12
- name: 'Helper Text',
13
- control: { type: 'text' },
14
- },
15
- };
16
-
17
- export const placeholderControl = {
18
- placeholder: {
19
- name: 'Placeholder',
20
- control: { type: 'text' },
21
- },
22
- };
23
-
24
- export const sizeControl = {
25
- size: {
26
- name: 'Size',
27
- options: ['xs', 'sm', 'md', 'lg'],
28
- control: { type: 'select' },
29
- },
30
- };
31
-
32
- export const loadingControl = {
33
- loading: {
34
- name: 'Loading',
35
- control: { type: 'boolean' },
36
- },
37
- };
38
-
39
- export const fullWidthControl = {
40
- 'full-width': {
41
- name: 'Full Width',
42
- control: { type: 'boolean' },
43
- },
44
- };
45
-
46
- export const disabledControl = {
47
- disabled: {
48
- name: 'Disabled',
49
- control: { type: 'boolean' },
50
- },
51
- };
52
-
53
- export const readOnlyControl = {
54
- readonly: {
55
- name: 'Read Only',
56
- control: { type: 'boolean' },
57
- },
58
- };
59
-
60
- export const requiredControl = {
61
- required: {
62
- name: 'Required',
63
- control: { type: 'boolean' },
64
- },
65
- };
66
-
67
- export const directionControl = {
68
- direction: {
69
- name: 'Direction',
70
- options: ['ltr', 'rtl'],
71
- control: { type: 'select' },
72
- },
73
- };
74
-
75
- export const borderedControl = {
76
- bordered: {
77
- name: 'Bordered',
78
- control: { type: 'boolean' },
79
- },
80
- };
81
-
82
- export const minLengthControl = {
83
- minlength: {
84
- name: 'Min. Length',
85
- control: { type: 'text' },
86
- },
87
- };
88
-
89
- export const maxLengthControl = {
90
- maxlength: {
91
- name: 'Max. Length',
92
- control: { type: 'text' },
93
- },
94
- };
95
-
96
- export const textContentControl = {
97
- text: {
98
- name: 'Content',
99
- control: { type: 'text' },
100
- },
101
- };
102
-
103
- export const modeControl = {
104
- mode: {
105
- name: 'Mode',
106
- options: ['none', 'primary', 'secondary', 'success', 'error'],
107
- control: { type: 'select' },
108
- },
109
- };
110
-
111
- export const textAlignControl = {
112
- 'text-align': {
113
- name: 'Text Align',
114
- options: ['left', 'center', 'right'],
115
- control: { type: 'select' },
116
- },
117
- };
118
-
119
- export const errorMissingValueControl = {
120
- 'data-errormessage-value-missing': {
121
- name: 'Custom Error: Mandatory',
122
- control: { type: 'text' },
123
- },
124
- };
125
-
126
- export const errorPatternMismatchControl = {
127
- 'data-errormessage-pattern-mismatch': {
128
- name: 'Custom Error: Pattern Mismatch',
129
- control: { type: 'text' },
130
- },
131
- };
132
-
133
- export const errorTypeMismatchControl = {
134
- 'data-errormessage-type-mismatch': {
135
- name: 'Custom Error: Type Mismatch',
136
- control: { type: 'text' },
137
- },
138
- };
139
-
140
- export const errorBadInputControl = {
141
- 'data-errormessage-bad-input': {
142
- name: 'Custom Error: Bad Input',
143
- control: { type: 'text' },
144
- },
145
- };
146
-
147
- export const errorRangeUnderflowControl = {
148
- 'data-errormessage-range-underflow': {
149
- name: 'Custom Error: Below minimum value',
150
- control: { type: 'text' },
151
- },
152
- };
153
-
154
- export const errorRangeOverflowControl = {
155
- 'data-errormessage-range-overflow': {
156
- name: 'Custom Error: Exceeds maximum value',
157
- control: { type: 'text' },
158
- },
159
- };
160
-
161
- export const fillControl = {
162
- 'st-fill': {
163
- name: 'Fill',
164
- control: { type: 'color' },
165
- },
166
- };
167
-
168
- export const customHeightControl = {
169
- 'st-host-height': {
170
- name: 'Custom Height',
171
- control: { type: 'text' },
172
- },
173
- };
174
-
175
- export const customWidthControl = {
176
- 'st-host-width': {
177
- name: 'Custom Width',
178
- control: { type: 'text' },
179
- },
180
- };
181
-
182
- export const checkboxValueControl = {
183
- checked: {
184
- name: 'Checked',
185
- control: { type: 'boolean' },
186
- },
187
- };
188
-
189
- export const buttonVariantControl = {
190
- variant: {
191
- name: 'Button Variant',
192
- options: ['contained', 'outline', 'link'],
193
- control: { type: 'select' },
194
- },
195
- };
196
-
197
- export const boxShadowControl = {
198
- shadow: {
199
- name: 'Shadow',
200
- options: ['sm', 'md', 'lg', 'xl', '2xl'],
201
- control: { type: 'select' },
202
- },
203
- };
204
-
205
- export const borderRadiusControl = {
206
- 'border-radius': {
207
- name: 'Radius',
208
- options: ['sm', 'md', 'lg', 'xl', '2xl', '3xl'],
209
- control: { type: 'select' },
210
- },
211
- };
212
-
213
- export const imgSrcControl = {
214
- src: {
215
- name: 'Image Source',
216
- control: { type: 'text' },
217
- },
218
- };
219
-
220
- export const typographyVariantControl = {
221
- variant: {
222
- name: 'Variant',
223
- options: ['h1', 'h2', 'h3', 'subtitle1', 'subtitle2', 'body1', 'body2'],
224
- control: { type: 'select' },
225
- },
226
- };
227
-
228
- export const overrideRenderItemControl = {
229
- overrideRenderItem: {
230
- name: 'Override the default item renderer function',
231
- control: { type: 'boolean' },
232
- },
233
- };
234
-
235
- export const itemsSourceControl = {
236
- itemsSource: {
237
- name: 'Where to take the items from',
238
- control: {
239
- type: 'select',
240
- options: {
241
- Children: 'children',
242
- '"data" attribute': 'attr',
243
- '"data" property': 'prop',
244
- },
245
- },
246
- },
247
- };
248
-
249
- export const minItemsSelectionControl = {
250
- minItemsSelection: {
251
- name: 'Min Items Selection',
252
- control: { type: 'number' },
253
- },
254
- };
255
-
256
- export const maxItemsSelectionControl = {
257
- maxItemsSelection: {
258
- name: 'Max Items Selection',
259
- control: { type: 'number' },
260
- },
261
- };
262
-
263
- export const labelSpacingControl = {
264
- 'label-spacing': {
265
- name: 'Label Spacing',
266
- control: { type: 'range', min: 0, max: 200, step: 1 },
267
- },
268
- };
269
-
270
- export const inputLabelTypeControl = {
271
- 'label-type': {
272
- name: 'Label Type',
273
- control: {
274
- type: 'select',
275
- options: ['static', 'floating'],
276
- },
277
- },
278
- };
279
-
280
- export const inputCopyToClipboardControl = {
281
- 'copy-to-clipboard': {
282
- name: 'Copy to clipboard',
283
- control: {
284
- type: 'boolean',
285
- },
286
- },
287
- };
288
-
289
- export const errorMessageIconControl = {
290
- errorMsgIcon: {
291
- name: 'Error Message Icon',
292
- control: {
293
- type: 'boolean',
294
- },
295
- },
296
- };
297
-
298
- export const errorMessageIconAttrs = `
299
- st-error-message-icon="url(${errorMessageIconBase64})"
300
- st-error-message-icon-size="14px"
301
- st-error-message-icon-padding="1.5em"
302
- `;