@descope/web-components-ui 3.5.1 → 3.7.0

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/dist/cjs/index.cjs.js +58 -7
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +58 -7
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/descope-user-attribute-index-js.js +4 -4
  8. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  9. package/dist/umd/index.js +1 -1
  10. package/package.json +34 -33
  11. package/src/components/descope-user-attribute/UserAttributeClass.js +58 -7
  12. package/src/theme/components/userAttribute.js +1 -0
  13. package/stories/commonControls.js +359 -0
  14. package/stories/descope-alert.stories.js +102 -0
  15. package/stories/descope-button-multi-selection-group.stories.js +130 -0
  16. package/stories/descope-button-selection-group.stories.js +131 -0
  17. package/stories/descope-calendar.stories.js +115 -0
  18. package/stories/descope-checkbox.stories.js +74 -0
  19. package/stories/descope-code-snippet.stories.js +118 -0
  20. package/stories/descope-container.stories.js +96 -0
  21. package/stories/descope-date-field.stories.js +169 -0
  22. package/stories/descope-divider.stories.js +43 -0
  23. package/stories/descope-email-field.stories.js +109 -0
  24. package/stories/descope-grid.stories.js +218 -0
  25. package/stories/descope-hcaptcha.stories.js +29 -0
  26. package/stories/descope-hybrid-field.stories.js +151 -0
  27. package/stories/descope-loader-linear.stories.js +29 -0
  28. package/stories/descope-loader-radial.stories.js +29 -0
  29. package/stories/descope-logo.stories.js +40 -0
  30. package/stories/descope-mappings-field.stories.js +108 -0
  31. package/stories/descope-modal.stories.js +48 -0
  32. package/stories/descope-multi-select-combo-box.stories.js +183 -0
  33. package/stories/descope-new-password.stories.js +206 -0
  34. package/stories/descope-notification.stories.js +81 -0
  35. package/stories/descope-notp-image.stories.js +29 -0
  36. package/stories/descope-number-field.stories.js +83 -0
  37. package/stories/descope-passcode.stories.js +89 -0
  38. package/stories/descope-password.stories.js +89 -0
  39. package/stories/descope-phone-field.stories.js +137 -0
  40. package/stories/descope-phone-input-box-field.stories.js +128 -0
  41. package/stories/descope-policy-validation.stories.js +92 -0
  42. package/stories/descope-radio-group.stories.js +142 -0
  43. package/stories/descope-recaptcha.stories.js +38 -0
  44. package/stories/descope-saml-group-mappings.stories.js +109 -0
  45. package/stories/descope-scopes-list.stories.js +81 -0
  46. package/stories/descope-security-questions-setup.stories.js +125 -0
  47. package/stories/descope-security-questions-verify.stories.js +111 -0
  48. package/stories/descope-switch-toggle.stories.js +74 -0
  49. package/stories/descope-text-area.stories.js +77 -0
  50. package/stories/descope-text-field.stories.js +98 -0
  51. package/stories/descope-third-party-app-logo.stories.js +42 -0
  52. package/stories/descope-totp-image.stories.js +29 -0
  53. package/stories/descope-upload-file.stories.js +113 -0
  54. package/stories/descope-user-attribute.stories.js +103 -0
  55. package/stories/descope-user-auth-method.stories.js +77 -0
  56. package/stories/helpers.js +86 -0
  57. package/stories/icons/alert.svg +9 -0
  58. package/stories/icons/apple.svg +10 -0
  59. package/stories/icons/base64png.js +1 -0
  60. package/stories/icons/base64svg.js +1 -0
  61. package/stories/icons/button-icon.svg +3 -0
  62. package/stories/icons/errorMessageIconBase64.js +1 -0
  63. package/stories/icons/fulfilled-button-icon.svg +3 -0
  64. package/stories/icons/google.svg +25 -0
  65. package/stories/icons/method-icon.svg +3 -0
  66. package/stories/images/150x200.jpg +0 -0
  67. package/stories/images/800x150.jpg +0 -0
  68. package/stories/images/avatar.jpeg +0 -0
  69. package/stories/images/demo.jpg +0 -0
  70. package/stories/images/game.png +0 -0
@@ -0,0 +1,130 @@
1
+ import { componentName } from '../src/components/button-selection-group-fields/descope-button-multi-selection-group';
2
+ import {
3
+ sizeControl,
4
+ labelControl,
5
+ requiredControl,
6
+ readOnlyControl,
7
+ helperTextControl,
8
+ disabledControl,
9
+ minItemsSelectionControl,
10
+ maxItemsSelectionControl,
11
+ errorMissingValueControl,
12
+ fullWidthControl,
13
+ directionControl,
14
+ overrideRenderItemControl,
15
+ itemsSourceControl,
16
+ errorMessageIconControl,
17
+ errorMessageIconAttrs,
18
+ defaultValueMissingControl,
19
+ } from './commonControls';
20
+ import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
21
+
22
+ const altRenderItem = ({ label, value }) => `<span value="${value}">${label}</span>`;
23
+
24
+ const Template = ({
25
+ size,
26
+ label,
27
+ required,
28
+ readonly,
29
+ 'full-width': fullWidth,
30
+ direction,
31
+ disabled,
32
+ minItemsSelection,
33
+ maxItemsSelection,
34
+ 'helper-text': helperText,
35
+ 'default-values': defaultValues,
36
+ 'data-errormessage-value-missing': customErrorMissingValue,
37
+ data,
38
+ itemsSource,
39
+ errorMsgIcon,
40
+ }) => {
41
+ let serializedData;
42
+ let serializedDefaultValues;
43
+
44
+ try {
45
+ serializedData = JSON.stringify(data);
46
+ serializedDefaultValues = JSON.stringify(defaultValues);
47
+ } catch (e) {
48
+ // do nothing
49
+ }
50
+
51
+ return `
52
+ <descope-button-multi-selection-group
53
+ data='${(itemsSource === 'attr' && serializedData) || ''}'
54
+ full-width="${fullWidth || false}"
55
+ size="${size || ''}"
56
+ label="${label || ''}"
57
+ helper-text="${helperText || ''}"
58
+ default-values='${serializedDefaultValues || ''}'
59
+ required="${required || false}"
60
+ readonly="${readonly || false}"
61
+ disabled="${disabled || false}"
62
+ data-errormessage-value-missing="${customErrorMissingValue || ''}"
63
+ st-host-direction="${direction ?? ''}"
64
+ min-items-selection="${minItemsSelection || ''}"
65
+ max-items-selection="${maxItemsSelection || ''}"
66
+ ${errorMsgIcon ? errorMessageIconAttrs : ''}
67
+ >
68
+ <descope-button-selection-group-item value="1">item1</descope-button-selection-group-item>
69
+ <descope-button-selection-group-item value="2">test test test test test test test test</descope-button-selection-group-item>
70
+ <descope-button-selection-group-item value="3">item2</descope-button-selection-group-item>
71
+ <descope-button-selection-group-item value="4">another item</descope-button-selection-group-item>
72
+ </descope-button-multi-selection-group>
73
+ `;
74
+ };
75
+
76
+ export default {
77
+ component: componentName,
78
+ title: 'descope-button-multi-selection-group',
79
+ decorators: [
80
+ (story, { args }) => {
81
+ setTimeout(() => {
82
+ const ele = document.querySelector('descope-button-multi-selection-group');
83
+
84
+ if (args.itemsSource === 'prop') ele.data = args.data;
85
+ if (args.overrideRenderItem) ele.renderItem = altRenderItem;
86
+ });
87
+ return story();
88
+ },
89
+ toggleDefaultErrorMessageValueMissingDecorator,
90
+ withForm,
91
+ ],
92
+ argTypes: {
93
+ ...sizeControl,
94
+ ...labelControl,
95
+ ...readOnlyControl,
96
+ ...requiredControl,
97
+ ...helperTextControl,
98
+ ...disabledControl,
99
+ ...errorMissingValueControl,
100
+ ...fullWidthControl,
101
+ ...minItemsSelectionControl,
102
+ ...maxItemsSelectionControl,
103
+ 'default-values': {
104
+ name: 'Default Values',
105
+ control: { type: 'object' },
106
+ },
107
+ readonly: {
108
+ name: 'Read Only',
109
+ control: { type: 'boolean' },
110
+ },
111
+ ...overrideRenderItemControl,
112
+ ...itemsSourceControl,
113
+ ...directionControl,
114
+ ...errorMessageIconControl,
115
+ ...defaultValueMissingControl,
116
+ },
117
+ };
118
+
119
+ export const Default = Template.bind({});
120
+
121
+ Default.args = {
122
+ data: [
123
+ { value: 'itemId1', label: 'data item 1' },
124
+ { value: 'itemId2', label: 'data item 2' },
125
+ { value: 'itemId3', label: 'data item 3' },
126
+ { value: 'itemId4', label: 'data item 4' },
127
+ ],
128
+ itemsSource: 'children',
129
+ 'data-errormessage-value-missing': 'Please fill out this field.',
130
+ };
@@ -0,0 +1,131 @@
1
+ import { componentName } from '../src/components/button-selection-group-fields/descope-button-selection-group';
2
+ import {
3
+ sizeControl,
4
+ labelControl,
5
+ requiredControl,
6
+ readOnlyControl,
7
+ helperTextControl,
8
+ disabledControl,
9
+ errorMissingValueControl,
10
+ fullWidthControl,
11
+ directionControl,
12
+ overrideRenderItemControl,
13
+ itemsSourceControl,
14
+ errorMessageIconAttrs,
15
+ errorMessageIconControl,
16
+ defaultValueMissingControl,
17
+ } from './commonControls';
18
+ import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
19
+
20
+ const altRenderItem = ({ label, value }) => `<span value="${value}">${label}</span>`;
21
+
22
+ const Template = ({
23
+ size,
24
+ label,
25
+ required,
26
+ readonly,
27
+ 'full-width': fullWidth,
28
+ direction,
29
+ disabled,
30
+ 'helper-text': helperText,
31
+ 'default-value': defaultValue,
32
+ 'data-errormessage-value-missing': customErrorMissingValue,
33
+ data,
34
+ itemsSource,
35
+ overrideRenderItem,
36
+ 'allow-deselect': allowDeselect,
37
+ errorMsgIcon,
38
+ }) => {
39
+ let serializedData;
40
+
41
+ try {
42
+ serializedData = JSON.stringify(data);
43
+ } catch (e) {
44
+ // do nothing
45
+ }
46
+
47
+ return `
48
+ <descope-button-selection-group
49
+ data='${(itemsSource === 'attr' && serializedData) || ''}'
50
+ full-width="${fullWidth || false}"
51
+ size="${size || ''}"
52
+ label="${label || ''}"
53
+ helper-text="${helperText || ''}"
54
+ default-value="${defaultValue || ''}"
55
+ required="${required || false}"
56
+ readonly="${readonly || false}"
57
+ disabled="${disabled || false}"
58
+ allow-deselect="${allowDeselect || false}"
59
+ data-errormessage-value-missing="${customErrorMissingValue || ''}"
60
+ st-host-direction="${direction ?? ''}"
61
+ ${errorMsgIcon ? errorMessageIconAttrs : ''}
62
+ >
63
+ <descope-button-selection-group-item value="1">item1</descope-button-selection-group-item>
64
+ <descope-button-selection-group-item value="2">test test test test test test test test</descope-button-selection-group-item>
65
+ <descope-button-selection-group-item value="3">item2</descope-button-selection-group-item>
66
+ <descope-button-selection-group-item value="4">another item</descope-button-selection-group-item>
67
+ </descope-button-selection-group>
68
+ `;
69
+ };
70
+
71
+ export default {
72
+ component: componentName,
73
+ title: 'descope-button-selection-group',
74
+ decorators: [
75
+ (story, { args }) => {
76
+ setTimeout(() => {
77
+ const ele = document.querySelector('descope-button-selection-group');
78
+ if (args.itemsSource === 'prop') {
79
+ ele.data = args.data;
80
+ }
81
+
82
+ if (args.overrideRenderItem) {
83
+ ele.renderItem = altRenderItem;
84
+ }
85
+ });
86
+ return story();
87
+ },
88
+ toggleDefaultErrorMessageValueMissingDecorator,
89
+ withForm,
90
+ ],
91
+ argTypes: {
92
+ ...sizeControl,
93
+ ...labelControl,
94
+ ...readOnlyControl,
95
+ ...requiredControl,
96
+ ...helperTextControl,
97
+ ...disabledControl,
98
+ ...errorMissingValueControl,
99
+ ...fullWidthControl,
100
+ 'default-value': {
101
+ name: 'Default Value',
102
+ control: { type: 'text' },
103
+ },
104
+ 'allow-deselect': {
105
+ name: 'Allow Deselect',
106
+ control: { type: 'boolean' },
107
+ },
108
+ readonly: {
109
+ name: 'Read Only',
110
+ control: { type: 'boolean' },
111
+ },
112
+ ...overrideRenderItemControl,
113
+ ...itemsSourceControl,
114
+ ...directionControl,
115
+ ...errorMessageIconControl,
116
+ ...defaultValueMissingControl,
117
+ },
118
+ };
119
+
120
+ export const Default = Template.bind({});
121
+
122
+ Default.args = {
123
+ data: [
124
+ { value: '1', label: 'data item 1' },
125
+ { value: '2', label: 'data item 2' },
126
+ { value: '3', label: 'data item 3' },
127
+ { value: '4', label: 'data item 4' },
128
+ ],
129
+ itemsSource: 'children',
130
+ 'data-errormessage-value-missing': 'Please fill out this field.',
131
+ };
@@ -0,0 +1,115 @@
1
+ import { componentName } from '../src/components/descope-date-field/descope-calendar';
2
+ import { withForm } from './helpers';
3
+ import {
4
+ sizeControl,
5
+ fullWidthControl,
6
+ directionControl,
7
+ disabledControl,
8
+ readOnlyControl,
9
+ requiredControl,
10
+ borderedControl,
11
+ textAlignControl,
12
+ errorMissingValueControl,
13
+ } from './commonControls';
14
+
15
+ const Template = ({
16
+ size,
17
+ bordered,
18
+ direction,
19
+ required,
20
+ disabled,
21
+ readonly,
22
+ 'initial-value': initialValue,
23
+ 'initial-month': initialMonth,
24
+ 'initial-year': initialYear,
25
+ 'years-range': yearsRange,
26
+ 'full-width': fullWidth,
27
+ 'data-errormessage-value-missing': customErrorMessage,
28
+ 'calendar-months': dataMonths,
29
+ 'calendar-weekdays': dataWeekdays,
30
+ 'calendar-label-today': dataLabelToday,
31
+ 'calendar-label-submit': dataLabelCalendarSubmit,
32
+ 'calendar-label-cancel': dataLabelCalendarCancel,
33
+ }) => `
34
+ <descope-calendar
35
+ size="${size}"
36
+ bordered="${bordered}"
37
+ disabled="${disabled || false}"
38
+ initial-month="${initialMonth || ''}"
39
+ initial-year="${initialYear || ''}"
40
+ initial-value="${initialValue || ''}"
41
+ readonly="${readonly || false}"
42
+ required="${required || false}"
43
+ full-width="${fullWidth || false}"
44
+ data-errormessage-value-missing="${customErrorMessage || ''}"
45
+ st-host-direction="${direction ?? ''}"
46
+ years-range="${yearsRange || ''}"
47
+ calendar-months="${dataMonths || ''}"
48
+ calendar-weekdays="${dataWeekdays || ''}"
49
+ calendar-label-today="${dataLabelToday || ''}"
50
+ calendar-label-submit="${dataLabelCalendarSubmit || ''}"
51
+ calendar-label-cancel="${dataLabelCalendarCancel || ''}"
52
+ ></descope-calendar>
53
+ `;
54
+
55
+ export default {
56
+ component: componentName,
57
+ title: 'descope-calendar',
58
+ decorators: [
59
+ (story, { args }) => {
60
+ setTimeout(() => {
61
+ const calendar = document.querySelector('descope-calendar');
62
+ calendar.addEventListener('month-changed', (e) => console.log('month changed', e.detail));
63
+ calendar.addEventListener('year-changed', (e) => console.log('year changed', e.detail));
64
+ calendar.addEventListener('day-changed', (e) => console.log('day changed', e.detail));
65
+ calendar.addEventListener('date-submit', (e) => console.log('submit', e.detail));
66
+ calendar.addEventListener('date-cancel', (e) => console.log('cancel', e.detail));
67
+ });
68
+ return story();
69
+ },
70
+ withForm,
71
+ ],
72
+ argTypes: {
73
+ ...sizeControl,
74
+ ...fullWidthControl,
75
+ ...disabledControl,
76
+ ...readOnlyControl,
77
+ ...requiredControl,
78
+ ...borderedControl,
79
+ ...errorMissingValueControl,
80
+ ...directionControl,
81
+ ...textAlignControl,
82
+ 'initial-value': {
83
+ name: 'Initial Value',
84
+ control: { type: 'text' },
85
+ },
86
+ 'initial-year': {
87
+ name: 'Initial Year',
88
+ control: { type: 'number' },
89
+ },
90
+ 'initial-month': {
91
+ name: 'Initial Month',
92
+ control: { type: 'number' },
93
+ },
94
+ 'years-range': {
95
+ name: 'Years Range',
96
+ control: { type: 'text' },
97
+ },
98
+ 'calendar-months': {
99
+ name: 'Custom Months',
100
+ control: { type: 'text' },
101
+ },
102
+ 'calendar-weekdays': {
103
+ name: 'Custom Weekdays',
104
+ control: { type: 'text' },
105
+ },
106
+ },
107
+ };
108
+
109
+ export const Default = Template.bind({});
110
+
111
+ Default.args = {
112
+ bordered: true,
113
+ size: 'md',
114
+ 'years-range': '2000-2050',
115
+ };
@@ -0,0 +1,74 @@
1
+ import { componentName } from '../src/components/boolean-fields/descope-checkbox';
2
+ import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
3
+ import {
4
+ labelControl,
5
+ sizeControl,
6
+ fullWidthControl,
7
+ directionControl,
8
+ disabledControl,
9
+ requiredControl,
10
+ borderedControl,
11
+ checkboxValueControl,
12
+ errorMissingValueControl,
13
+ readOnlyControl,
14
+ errorMessageIconAttrs,
15
+ errorMessageIconControl,
16
+ defaultValueMissingControl,
17
+ } from './commonControls';
18
+
19
+ const Template = ({
20
+ label,
21
+ checked,
22
+ size,
23
+ bordered,
24
+ direction,
25
+ disabled,
26
+ required,
27
+ readonly,
28
+ 'full-width': fullWidth,
29
+ 'data-errormessage-value-missing': customErrorMissingValue,
30
+ errorMsgIcon,
31
+ }) =>
32
+ `
33
+ <descope-checkbox
34
+ size="${size}"
35
+ bordered="${bordered}"
36
+ label="${label || ''}"
37
+ checked="${checked || false}"
38
+ disabled="${disabled || false}"
39
+ required="${required || false}"
40
+ full-width="${fullWidth || false}"
41
+ readonly="${readonly || false}"
42
+ data-errormessage-value-missing="${customErrorMissingValue || ''}"
43
+ st-host-direction="${direction ?? ''}"
44
+ ${errorMsgIcon ? errorMessageIconAttrs : ''}
45
+ ></descope-checkbox>
46
+ `;
47
+
48
+ export default {
49
+ component: componentName,
50
+ title: 'descope-checkbox',
51
+ decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
52
+ argTypes: {
53
+ ...labelControl,
54
+ ...sizeControl,
55
+ ...fullWidthControl,
56
+ ...disabledControl,
57
+ ...requiredControl,
58
+ ...borderedControl,
59
+ ...checkboxValueControl,
60
+ ...errorMissingValueControl,
61
+ ...readOnlyControl,
62
+ ...directionControl,
63
+ ...errorMessageIconControl,
64
+ ...defaultValueMissingControl,
65
+ },
66
+ };
67
+
68
+ export const Default = Template.bind({});
69
+
70
+ Default.args = {
71
+ size: 'md',
72
+ bordered: true,
73
+ 'data-errormessage-value-missing': 'Please fill out this field.',
74
+ };
@@ -0,0 +1,118 @@
1
+ import { componentName } from '../src/components/descope-code-snippet';
2
+ import { textContentControl } from './commonControls';
3
+
4
+ const textSamples = {
5
+ html: `
6
+ &lt;!-- HTML comment --&gt;
7
+
8
+ &lt;div id=&quot;myId&quot; class=&quot;my-class&quot;&gt;
9
+ &lt;p data-type=&quot;paragraph&quot;&gt;
10
+ Snippet 1
11
+ &lt;/p&gt;
12
+ &lt;label for=&quot;myInput&quot;&gt;
13
+ &lt;input id=&quot;myInput&quot; type=&quot;text&quot;/&gt;
14
+ &lt;/label&gt;
15
+ &lt;/div&gt;
16
+ `,
17
+ xml: `
18
+ &lt;Response xmlns=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot; ID=&quot;id44273893780247019773985&quot; InResponseTo=&quot;_811889ea-3312-48b3-9cdd-02948193487d&quot; Destination=&quot;http://localhost:8000/v1/auth/saml/acs?projectId=P2gpW2KNAJabsOajsyop7MO6iMOL&amp;amp;tenantId=T2gzxO43zRDsvq9uMLmc7Ec0yBUS&quot; Version=&quot;2.0&quot; IssueInstant=&quot;2024-05-28T11:08:10.898Z&quot;&gt;
19
+ &lt;Status xmlns=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;&gt;
20
+ &lt;StatusCode xmlns=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot; Value=&quot;urn:oasis:names:tc:SAML:2.0:status:Success&quot;&gt;&lt;/StatusCode&gt;
21
+ &lt;/Status&gt;
22
+ &lt;Issuer xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;http://www.okta.com/exke4wdqfgKpAp5TN5d7&lt;/Issuer&gt;
23
+ &lt;Assertion xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot; Version=&quot;2.0&quot; ID=&quot;id4427389379724851920862989&quot; IssueInstant=&quot;2024-05-28T11:08:10.898Z&quot;&gt;
24
+ &lt;Issuer xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;http://www.okta.com/exke4wdqfgKpAp5TN5d7&lt;/Issuer&gt;
25
+ &lt;Subject xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;
26
+ &lt;NameID xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;user@email.com&lt;/NameID&gt;
27
+ &lt;SubjectConfirmation xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot; Method=&quot;urn:oasis:names:tc:SAML:2.0:cm:bearer&quot;&gt;
28
+ &lt;SubjectConfirmationData xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot; NotOnOrAfter=&quot;2024-05-28T11:13:10.898Z&quot; Recipient=&quot;http://localhost:8000/v1/auth/saml/acs?projectId=P2gpW2KNAJabsOajsyop7MO6iMOL&amp;amp;tenantId=T2gzxO43zRDsvq9uMLmc7Ec0yBUS&quot; InResponseTo=&quot;_811889ea-3312-48b3-9cdd-02948193487d&quot;&gt;&lt;/SubjectConfirmationData&gt;
29
+ &lt;/SubjectConfirmation&gt;
30
+ &lt;/Subject&gt;
31
+ &lt;Conditions xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot; NotBefore=&quot;2024-05-28T11:03:10.898Z&quot; NotOnOrAfter=&quot;2024-05-28T11:13:10.898Z&quot;&gt;
32
+ &lt;AudienceRestriction xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;
33
+ &lt;Audience xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;P2gpW2KNAJabsOajsyop7MO6iMOL-T2gzxO43zRDsvq9uMLmc7Ec0yBUS&lt;/Audience&gt;
34
+ &lt;/AudienceRestriction&gt;
35
+ &lt;/Conditions&gt;
36
+ &lt;/Assertion&gt;
37
+ &lt;/Response&gt;
38
+ `,
39
+ css: `
40
+ /* CSS comment */
41
+
42
+ .my-class {
43
+ background: lightgreen;
44
+ border: 1px solid #000;
45
+ padding: 1em;
46
+ margin: 0.25em 0.25em;
47
+ box-shadow: 0 0 1em rgba(0, 0, 0, 0.25);
48
+ }
49
+ `,
50
+ javascript: `
51
+ // JS comment 1
52
+ /* JS comment 2 */
53
+
54
+ const myObj = {
55
+ p1: "bla1",
56
+ p2: "bla2",
57
+ p3: {
58
+ q1: "fff"
59
+ },
60
+ };
61
+
62
+ console.log('myObj', myObj);
63
+ `,
64
+ json: `
65
+ {
66
+ "xd": [
67
+ {
68
+ "id": "user@email.com-T2gzxO43zRDsvq9uMLmc7Ec0yBUS",
69
+ "ty": "saml"
70
+ }
71
+ ],
72
+ "nm": "Doron",
73
+ "fn": "Doron",
74
+ "em": "user@email.com",
75
+ "vem": true,
76
+ "vph": true,
77
+ "ts": [
78
+ "T2gzxO43zRDsvq9uMLmc7Ec0yBUS"
79
+ ],
80
+ "saml": true
81
+ }
82
+ `,
83
+ };
84
+
85
+ const Template = ({ inline, lang, text, copyButton }) =>
86
+ `
87
+ <descope-code-snippet
88
+ inline="${inline || false}"
89
+ lang="${lang || ''}"
90
+ copy-button="${copyButton || false}"
91
+ >${text || textSamples[lang]}</descope-code-snippet>
92
+ `;
93
+
94
+ export default {
95
+ component: componentName,
96
+ title: 'descope-code-snippet',
97
+ argTypes: {
98
+ ...textContentControl,
99
+ lang: {
100
+ name: 'lang',
101
+ options: ['xml', 'html', 'css', 'javascript', 'json'],
102
+ control: { type: 'select' },
103
+ },
104
+ copyButton: {
105
+ name: 'copy-button',
106
+ control: { type: 'boolean' },
107
+ },
108
+ },
109
+ };
110
+
111
+ export const Default = Template.bind({});
112
+
113
+ Default.args = {
114
+ text: '',
115
+ inline: false,
116
+ lang: '',
117
+ copyButton: false,
118
+ };
@@ -0,0 +1,96 @@
1
+ import { componentName } from '../src/components/descope-container';
2
+ import {
3
+ boxShadowControl,
4
+ borderRadiusControl,
5
+ customHeightControl,
6
+ customWidthControl,
7
+ directionControl,
8
+ } from './commonControls';
9
+ import bgImageUrl from './images/game.png';
10
+
11
+ const Template = ({
12
+ 'vertical-alignment': verticalAlignment,
13
+ 'horizontal-alignment': horizontalAlignment,
14
+ 'vertical-padding': verticalPadding,
15
+ 'horizontal-padding': horizontalPadding,
16
+ 'flex-direction': flexDirection,
17
+ direction,
18
+ 'space-between': spaceBetween,
19
+ shadow,
20
+ 'border-radius': borderRadius,
21
+ 'st-host-height': customHeight,
22
+ 'st-host-width': customWidth,
23
+ 'st-background-color': backgroundColor,
24
+ 'st-items-grow': itemsGrow,
25
+ isBackgroundImage,
26
+ }) => `
27
+ <descope-container
28
+ vertical-alignment="${verticalAlignment || ''}"
29
+ horizontal-alignment="${horizontalAlignment || ''}"
30
+ vertical-padding="${verticalPadding || ''}"
31
+ horizontal-padding="${horizontalPadding || ''}"
32
+ direction="${flexDirection || ''}"
33
+ st-host-direction="${direction || ''}"
34
+ space-between="${spaceBetween || ''}"
35
+ shadow="${shadow || ''}"
36
+ border-radius="${borderRadius || ''}"
37
+ st-host-height="${customHeight || ''}"
38
+ st-host-width="${customWidth || ''}"
39
+ st-background-color="${backgroundColor || ''}"
40
+ st-background-image="${isBackgroundImage ? `url(${bgImageUrl})` : ''}"
41
+ st-items-grow="${itemsGrow || '0'}"
42
+ >
43
+ <descope-button variant="contained" size="md" mode="primary">Button</descope-button>
44
+ <descope-button variant="contained" size="md" mode="secondary">Button</descope-button>
45
+ </descope-container>
46
+ `;
47
+
48
+ export default {
49
+ component: componentName,
50
+ title: 'descope-container',
51
+ argTypes: {
52
+ ...boxShadowControl,
53
+ ...borderRadiusControl,
54
+ ...customHeightControl,
55
+ ...customWidthControl,
56
+ ...directionControl,
57
+ 'vertical-alignment': {
58
+ name: 'Vertical Alignment',
59
+ options: ['start', 'center', 'end'],
60
+ control: { type: 'select' },
61
+ },
62
+ 'horizontal-alignment': {
63
+ name: 'Horizontal Alignment',
64
+ options: ['start', 'center', 'end'],
65
+ control: { type: 'select' },
66
+ },
67
+ 'vertical-padding': {
68
+ name: 'Vertical Padding',
69
+ options: ['sm', 'md', 'lg'],
70
+ control: { type: 'select' },
71
+ },
72
+ 'horizontal-padding': {
73
+ name: 'Horizontal Padding',
74
+ options: ['sm', 'md', 'lg'],
75
+ control: { type: 'select' },
76
+ },
77
+ 'flex-direction': {
78
+ name: 'Direction',
79
+ options: ['row', 'column'],
80
+ control: { type: 'select' },
81
+ },
82
+ 'space-between': {
83
+ name: 'Space Between',
84
+ options: ['sm', 'md', 'lg'],
85
+ control: { type: 'select' },
86
+ },
87
+ },
88
+ };
89
+
90
+ export const Default = Template.bind({});
91
+
92
+ Default.args = {
93
+ 'st-background-color': '',
94
+ isBackgroundImage: false,
95
+ 'st-items-grow': '0',
96
+ };