@jumpgroup/jump-design-system 0.2.2 → 0.2.3

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 (81) hide show
  1. package/dist/cjs/{index-79e97f36.js → index-12f40d28.js} +58 -8
  2. package/dist/cjs/index-12f40d28.js.map +1 -0
  3. package/dist/cjs/jump-badge.cjs.entry.js +1 -1
  4. package/dist/cjs/jump-button.cjs.entry.js +9 -6
  5. package/dist/cjs/jump-button.cjs.entry.js.map +1 -1
  6. package/dist/cjs/jump-card.cjs.entry.js +2 -2
  7. package/dist/cjs/jump-card.cjs.entry.js.map +1 -1
  8. package/dist/cjs/jump-design-system.cjs.js +2 -2
  9. package/dist/cjs/jump-icon.cjs.entry.js +1 -1
  10. package/dist/cjs/jump-pagination.cjs.entry.js +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/components/jump-button/jump-button-anchor.stories.js +253 -0
  13. package/dist/collection/components/jump-button/jump-button-anchor.stories.js.map +1 -0
  14. package/dist/collection/components/jump-button/jump-button-dimension.stories.js +236 -0
  15. package/dist/collection/components/jump-button/jump-button-dimension.stories.js.map +1 -0
  16. package/dist/collection/components/jump-button/jump-button-filled.stories.js +5 -259
  17. package/dist/collection/components/jump-button/jump-button-filled.stories.js.map +1 -1
  18. package/dist/collection/components/jump-button/jump-button-only-icon.stories.js +342 -0
  19. package/dist/collection/components/jump-button/jump-button-only-icon.stories.js.map +1 -0
  20. package/dist/collection/components/jump-button/jump-button-outline.stories.js +5 -74
  21. package/dist/collection/components/jump-button/jump-button-outline.stories.js.map +1 -1
  22. package/dist/collection/components/jump-button/jump-button-text.stories.js +289 -0
  23. package/dist/collection/components/jump-button/jump-button-text.stories.js.map +1 -0
  24. package/dist/collection/components/jump-button/jump-button.css +92 -43
  25. package/dist/collection/components/jump-button/jump-button.js +20 -17
  26. package/dist/collection/components/jump-button/jump-button.js.map +1 -1
  27. package/dist/collection/components/jump-button/test/jump-button.spec.js +2 -2
  28. package/dist/collection/components/jump-button/test/jump-button.spec.js.map +1 -1
  29. package/dist/collection/components/jump-card/jump-card-border-radius.stories.js +2 -14
  30. package/dist/collection/components/jump-card/jump-card-border-radius.stories.js.map +1 -1
  31. package/dist/collection/components/jump-card/jump-card-top-border-content-radius.stories.js +1 -2
  32. package/dist/collection/components/jump-card/jump-card-top-border-content-radius.stories.js.map +1 -1
  33. package/dist/collection/components/jump-card/jump-card.css +50 -1
  34. package/dist/collection/utils/utils.js +13 -0
  35. package/dist/collection/utils/utils.js.map +1 -1
  36. package/dist/components/jump-button.js +24 -20
  37. package/dist/components/jump-button.js.map +1 -1
  38. package/dist/components/jump-card.js +1 -1
  39. package/dist/components/jump-card.js.map +1 -1
  40. package/dist/esm/{index-7feee8ea.js → index-d09b8a38.js} +58 -8
  41. package/dist/esm/index-d09b8a38.js.map +1 -0
  42. package/dist/esm/jump-badge.entry.js +1 -1
  43. package/dist/esm/jump-button.entry.js +9 -6
  44. package/dist/esm/jump-button.entry.js.map +1 -1
  45. package/dist/esm/jump-card.entry.js +2 -2
  46. package/dist/esm/jump-card.entry.js.map +1 -1
  47. package/dist/esm/jump-design-system.js +3 -3
  48. package/dist/esm/jump-icon.entry.js +1 -1
  49. package/dist/esm/jump-pagination.entry.js +1 -1
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  52. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  53. package/dist/jump-design-system/p-062fa189.entry.js +2 -0
  54. package/dist/jump-design-system/p-062fa189.entry.js.map +1 -0
  55. package/dist/jump-design-system/p-407027a9.js +3 -0
  56. package/dist/jump-design-system/p-407027a9.js.map +1 -0
  57. package/dist/jump-design-system/{p-99238e3f.entry.js → p-81fba573.entry.js} +2 -2
  58. package/dist/jump-design-system/{p-bc02e346.entry.js → p-b2967e30.entry.js} +2 -2
  59. package/dist/jump-design-system/{p-ddb6c98c.entry.js → p-e0c9453d.entry.js} +2 -2
  60. package/dist/jump-design-system/p-fea57bd7.entry.js +2 -0
  61. package/dist/jump-design-system/p-fea57bd7.entry.js.map +1 -0
  62. package/dist/types/components/jump-button/jump-button-anchor.stories.d.ts +160 -0
  63. package/dist/types/components/jump-button/jump-button-dimension.stories.d.ts +158 -0
  64. package/dist/types/components/jump-button/jump-button-filled.stories.d.ts +0 -13
  65. package/dist/types/components/jump-button/jump-button-only-icon.stories.d.ts +164 -0
  66. package/dist/types/components/jump-button/jump-button-outline.stories.d.ts +0 -2
  67. package/dist/types/components/jump-button/jump-button-text.stories.d.ts +161 -0
  68. package/dist/types/components/jump-button/jump-button.d.ts +2 -1
  69. package/dist/types/utils/utils.d.ts +2 -1
  70. package/package.json +1 -1
  71. package/dist/cjs/index-79e97f36.js.map +0 -1
  72. package/dist/esm/index-7feee8ea.js.map +0 -1
  73. package/dist/jump-design-system/p-7cfed9c6.entry.js +0 -2
  74. package/dist/jump-design-system/p-7cfed9c6.entry.js.map +0 -1
  75. package/dist/jump-design-system/p-9fd6e0a0.entry.js +0 -2
  76. package/dist/jump-design-system/p-9fd6e0a0.entry.js.map +0 -1
  77. package/dist/jump-design-system/p-c560071a.js +0 -3
  78. package/dist/jump-design-system/p-c560071a.js.map +0 -1
  79. /package/dist/jump-design-system/{p-99238e3f.entry.js.map → p-81fba573.entry.js.map} +0 -0
  80. /package/dist/jump-design-system/{p-bc02e346.entry.js.map → p-b2967e30.entry.js.map} +0 -0
  81. /package/dist/jump-design-system/{p-ddb6c98c.entry.js.map → p-e0c9453d.entry.js.map} +0 -0
@@ -0,0 +1,236 @@
1
+ import feather from "feather-icons";
2
+ import { generateAttributesFromArgs } from "../../utils/utils";
3
+ export default {
4
+ title: 'Components/Button/Dimension',
5
+ tags: ['autodocs'],
6
+ argTypes: {
7
+ label: {
8
+ name: 'Etichetta',
9
+ description: 'Imposta il testo del bottone',
10
+ control: 'text'
11
+ },
12
+ variant: {
13
+ name: 'Variante',
14
+ description: 'Imposta la variante di colore del bottone',
15
+ control: 'select',
16
+ options: [
17
+ 'primary',
18
+ 'secondary',
19
+ 'neutral',
20
+ 'white'
21
+ ],
22
+ },
23
+ outline: {
24
+ name: 'Outline',
25
+ description: 'Imposta se il bottone deve avere il solo bordo',
26
+ control: 'boolean'
27
+ },
28
+ size: {
29
+ name: 'Dimensione',
30
+ description: 'Imposta la dimensione del bottone',
31
+ control: 'select',
32
+ options: [
33
+ 'small',
34
+ 'medium',
35
+ 'large'
36
+ ],
37
+ labels: {
38
+ small: 'Piccolo',
39
+ medium: 'Medio',
40
+ large: 'Grande'
41
+ }
42
+ },
43
+ pill: {
44
+ name: 'Bordo a Pillola',
45
+ description: 'Imposta se il bottone deve avere il bordo completamente stondato a pillola',
46
+ control: 'boolean'
47
+ },
48
+ disabled: {
49
+ name: 'Disabilitato',
50
+ description: 'Imposta se il bottone deve essere disabilitato',
51
+ control: 'boolean'
52
+ },
53
+ text: {
54
+ name: 'Testo',
55
+ description: 'Imposta se il bottone è solo testo, quindi senza bordo, sfondo e padding',
56
+ control: 'boolean'
57
+ },
58
+ showIcon: {
59
+ name: 'Mostra Icona',
60
+ description: 'Imposta se il bottone deve mostrare un\'icona',
61
+ control: 'boolean'
62
+ },
63
+ iconOnly: {
64
+ name: 'Mostra solo Icona',
65
+ description: 'Imposta se il bottone deve mostrare solo l\'icona',
66
+ control: 'boolean',
67
+ if: {
68
+ arg: 'showIcon',
69
+ eq: true
70
+ },
71
+ },
72
+ iconName: {
73
+ name: 'Nome Icona',
74
+ control: 'select',
75
+ options: Object.keys(feather.icons),
76
+ description: 'Seleziona il nome dell\'icona dal menu a tendina',
77
+ defaultValue: Object.keys(feather.icons)[0],
78
+ if: {
79
+ arg: 'showIcon',
80
+ eq: true
81
+ },
82
+ },
83
+ iconPosition: {
84
+ name: 'Posizione Icona',
85
+ description: 'Imposta la posizione dell\'icona',
86
+ defaultValue: 'left',
87
+ control: 'select',
88
+ options: [
89
+ 'left',
90
+ 'right'
91
+ ],
92
+ if: {
93
+ arg: 'showIcon',
94
+ eq: true
95
+ },
96
+ labels: {
97
+ left: 'Sinistra',
98
+ right: 'Destra'
99
+ }
100
+ },
101
+ type: {
102
+ name: 'Tipo di bottone',
103
+ description: 'Imposta il tipo di bottone',
104
+ default: 'button',
105
+ control: 'select',
106
+ if: {
107
+ arg: 'href',
108
+ exists: false
109
+ },
110
+ options: [
111
+ 'button',
112
+ 'submit',
113
+ 'reset'
114
+ ],
115
+ labels: {
116
+ button: 'button',
117
+ submit: 'submit',
118
+ reset: 'reset',
119
+ }
120
+ },
121
+ name: {
122
+ name: 'Nome del bottone',
123
+ description: 'Imposta il nome del bottone',
124
+ control: 'text',
125
+ if: {
126
+ arg: 'href',
127
+ exists: false
128
+ }
129
+ },
130
+ value: {
131
+ name: 'Value del bottone',
132
+ description: 'Imposta il value del bottone',
133
+ control: 'text',
134
+ if: {
135
+ arg: 'href',
136
+ exists: false
137
+ }
138
+ },
139
+ ariaLabel: {
140
+ name: 'Aria Label',
141
+ description: 'Imposta aria label',
142
+ control: 'text',
143
+ },
144
+ href: {
145
+ name: 'Href',
146
+ description: 'Imposta l\'href del link',
147
+ control: 'text',
148
+ },
149
+ target: {
150
+ name: 'Target',
151
+ description: 'Imposta il target del link',
152
+ default: '_self',
153
+ control: 'select',
154
+ if: {
155
+ arg: 'href',
156
+ exists: true
157
+ },
158
+ options: [
159
+ '_blank',
160
+ '_parent',
161
+ '_self',
162
+ '_top'
163
+ ],
164
+ labels: {
165
+ _blank: '_blank',
166
+ _parent: '_parent',
167
+ _self: '_self',
168
+ _top: '_top'
169
+ }
170
+ },
171
+ id: {
172
+ name: 'ID',
173
+ description: 'Imposta l\'id del bottone',
174
+ control: 'text'
175
+ },
176
+ }
177
+ };
178
+ const Template = (args) => {
179
+ const attributes = generateAttributesFromArgs(args);
180
+ return `<jump-button ${attributes} ${!args.label ? ' only-icon' : ''}> ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''} ${!args.iconOnly ? args.label : ''} ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''} </jump-button>`;
181
+ };
182
+ export const Small = Template.bind({});
183
+ Small.args = {
184
+ label: 'Small',
185
+ variant: 'primary',
186
+ outline: false,
187
+ pill: false,
188
+ size: 'small',
189
+ disabled: false,
190
+ text: false,
191
+ showIcon: false,
192
+ iconOnly: false,
193
+ iconName: Object.keys(feather.icons)[0],
194
+ iconPosition: 'left',
195
+ type: 'button',
196
+ name: 'nome bottone',
197
+ value: 'value bottone',
198
+ ariaLabel: 'sono un bottone'
199
+ };
200
+ export const Medium = Template.bind({});
201
+ Medium.args = {
202
+ label: 'Medium',
203
+ variant: 'primary',
204
+ outline: false,
205
+ pill: false,
206
+ size: 'medium',
207
+ disabled: false,
208
+ text: false,
209
+ showIcon: false,
210
+ iconOnly: false,
211
+ iconName: Object.keys(feather.icons)[0],
212
+ iconPosition: 'left',
213
+ type: 'button',
214
+ name: 'nome bottone',
215
+ value: 'value bottone',
216
+ ariaLabel: 'sono un bottone'
217
+ };
218
+ export const Large = Template.bind({});
219
+ Large.args = {
220
+ label: 'Large',
221
+ variant: 'primary',
222
+ outline: false,
223
+ pill: false,
224
+ size: 'large',
225
+ disabled: false,
226
+ text: false,
227
+ showIcon: false,
228
+ iconOnly: false,
229
+ iconName: Object.keys(feather.icons)[0],
230
+ iconPosition: 'left',
231
+ type: 'button',
232
+ name: 'nome bottone',
233
+ value: 'value bottone',
234
+ ariaLabel: 'sono un bottone'
235
+ };
236
+ //# sourceMappingURL=jump-button-dimension.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jump-button-dimension.stories.js","sourceRoot":"","sources":["../../../src/components/jump-button/jump-button-dimension.stories.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAC,MAAM,mBAAmB,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,6B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EAAE,iBAAiB;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACX,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM;IACpB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,iBAAiB;CAC7B,CAAC","sourcesContent":["import feather from 'feather-icons';\nimport { generateAttributesFromArgs} from '../../utils/utils';\n\nexport default {\n title: 'Components/Button/Dimension',\n tags: ['autodocs'],\n argTypes: {\n label: {\n name: 'Etichetta',\n description: 'Imposta il testo del bottone',\n control: 'text'\n },\n variant: {\n name: 'Variante',\n description: 'Imposta la variante di colore del bottone',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'white'\n ],\n },\n outline : {\n name: 'Outline',\n description: 'Imposta se il bottone deve avere il solo bordo',\n control: 'boolean'\n },\n size: {\n name: 'Dimensione',\n description: 'Imposta la dimensione del bottone',\n control: 'select',\n options: [\n 'small',\n 'medium',\n 'large'\n ],\n labels: {\n small: 'Piccolo',\n medium: 'Medio',\n large: 'Grande'\n }\n },\n pill: {\n name: 'Bordo a Pillola',\n description: 'Imposta se il bottone deve avere il bordo completamente stondato a pillola',\n control: 'boolean'\n },\n disabled: {\n name: 'Disabilitato',\n description: 'Imposta se il bottone deve essere disabilitato',\n control: 'boolean'\n },\n text: {\n name: 'Testo',\n description: 'Imposta se il bottone è solo testo, quindi senza bordo, sfondo e padding',\n control: 'boolean'\n },\n showIcon: {\n name: 'Mostra Icona',\n description: 'Imposta se il bottone deve mostrare un\\'icona',\n control: 'boolean'\n },\n iconOnly: {\n name: 'Mostra solo Icona',\n description: 'Imposta se il bottone deve mostrare solo l\\'icona',\n control: 'boolean',\n if: {\n arg: 'showIcon',\n eq: true\n },\n },\n iconName: {\n name: 'Nome Icona',\n control: 'select',\n options: Object.keys(feather.icons),\n description: 'Seleziona il nome dell\\'icona dal menu a tendina',\n defaultValue: Object.keys(feather.icons)[0],\n if: {\n arg: 'showIcon',\n eq: true\n },\n },\n iconPosition: {\n name: 'Posizione Icona',\n description: 'Imposta la posizione dell\\'icona',\n defaultValue: 'left',\n control: 'select',\n options: [\n 'left',\n 'right'\n ],\n if: {\n arg: 'showIcon',\n eq: true\n },\n labels: {\n left: 'Sinistra',\n right: 'Destra'\n }\n },\n type: {\n name: 'Tipo di bottone',\n description: 'Imposta il tipo di bottone',\n default: 'button',\n control: 'select',\n if:{\n arg: 'href',\n exists: false\n },\n options: [\n 'button',\n 'submit',\n 'reset'\n ],\n labels: {\n button: 'button',\n submit: 'submit',\n reset: 'reset',\n }\n },\n name: {\n name: 'Nome del bottone',\n description: 'Imposta il nome del bottone',\n control: 'text',\n if:{\n arg: 'href',\n exists: false\n }\n },\n value: {\n name: 'Value del bottone',\n description: 'Imposta il value del bottone',\n control: 'text',\n if:{\n arg: 'href',\n exists: false\n }\n },\n ariaLabel: {\n name: 'Aria Label',\n description: 'Imposta aria label',\n control: 'text',\n },\n href: {\n name: 'Href',\n description: 'Imposta l\\'href del link',\n control: 'text',\n },\n target: {\n name: 'Target',\n description: 'Imposta il target del link',\n default: '_self',\n control: 'select',\n if:{\n arg: 'href',\n exists: true\n },\n options: [\n '_blank',\n '_parent',\n '_self',\n '_top'\n ],\n labels: {\n _blank: '_blank',\n _parent: '_parent',\n _self: '_self',\n _top: '_top'\n }\n },\n id: {\n name: 'ID',\n description: 'Imposta l\\'id del bottone',\n control: 'text'\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return `<jump-button ${attributes} ${ !args.label ? ' only-icon' : ''}> ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''} ${ !args.iconOnly ? args.label : ''} ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''} </jump-button>`\n}\n\nexport const Small = Template.bind({});\nSmall.args = {\n label: 'Small',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'small',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left',\n type: 'button',\n name: 'nome bottone',\n value: 'value bottone',\n ariaLabel: 'sono un bottone'\n};\n\nexport const Medium = Template.bind({});\nMedium.args = {\n label: 'Medium',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left',\n type: 'button',\n name: 'nome bottone',\n value: 'value bottone',\n ariaLabel: 'sono un bottone'\n};\n\nexport const Large = Template.bind({});\nLarge.args = {\n label: 'Large',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'large',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left',\n type: 'button',\n name: 'nome bottone',\n value: 'value bottone',\n ariaLabel: 'sono un bottone'\n};\n"]}
@@ -1,4 +1,5 @@
1
1
  import feather from "feather-icons";
2
+ import { generateAttributesFromArgs } from "../../utils/utils";
2
3
  export default {
3
4
  title: 'Components/Button/Filled',
4
5
  tags: ['autodocs'],
@@ -174,18 +175,10 @@ export default {
174
175
  },
175
176
  }
176
177
  };
177
- // TODO: non far passare gli undefined
178
- const Anchor = (args) => {
179
- var _a;
180
- return `<jump-button id="${args.id}" class="${(_a = args.class) !== null && _a !== void 0 ? _a : ''}" "variant="${args.variant}" size="${args.size}" href="${args.href}" target="${args.target}" ariaLabel="${args.ariaLabel}" ${args.pill == true ? ' pill' : ''} ${args.outline == true ? ' outline' : ''} ${args.text == true ? ' text' : ''} ${!args.label || args.iconOnly ? ' only-icon' : ''}>
181
- ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''} ${!args.iconOnly ? args.label : ''} ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}</jump-button>`;
178
+ const Template = (args) => {
179
+ const attributes = generateAttributesFromArgs(args);
180
+ return `<jump-button ${attributes} ${!args.label ? ' only-icon' : ''}> ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''} ${!args.iconOnly ? args.label : ''} ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''} </jump-button>`;
182
181
  };
183
- const Button = (args) => {
184
- var _a;
185
- return `<jump-button id="${args.id}" class="${(_a = args.class) !== null && _a !== void 0 ? _a : ''}" "variant="${args.variant}" size="${args.size}" type="${args.type}" ariaLabel="${args.ariaLabel}" name="${args.name}" value="${args.value}" ${args.disabled == true ? ' disabled' : ''}${args.pill == true ? ' pill' : ''} ${args.outline == true ? ' outline' : ''} ${args.text == true ? ' text' : ''} ${!args.label || args.iconOnly ? ' only-icon' : ''}> ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}${!args.iconOnly ? args.label : ''}${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}</jump-button>`;
186
- };
187
- const Template = (args) => `${args.href ? Anchor(args) : !args.label && !args.showIcon ? 'Errore nella configurazione del bottone' : Button(args)}`;
188
- // TODO: gestire la prop che è opzione: cmq se copio il codice e tolgo le props undefined dovrebbe andare tutto
189
182
  export const Primary = Template.bind({});
190
183
  Primary.args = {
191
184
  label: 'Primary',
@@ -258,78 +251,6 @@ White.args = {
258
251
  value: 'value bottone',
259
252
  ariaLabel: 'sono un bottone'
260
253
  };
261
- export const OutlinePrimary = Template.bind({});
262
- OutlinePrimary.args = {
263
- label: 'Outline Primary',
264
- variant: 'primary',
265
- outline: true,
266
- pill: false,
267
- size: 'medium',
268
- disabled: false,
269
- text: false,
270
- showIcon: false,
271
- iconOnly: false,
272
- iconName: Object.keys(feather.icons)[0],
273
- iconPosition: 'left',
274
- type: 'button',
275
- name: 'nome bottone',
276
- value: 'value bottone',
277
- ariaLabel: 'sono un bottone'
278
- };
279
- export const OutlineSecondary = Template.bind({});
280
- OutlineSecondary.args = {
281
- label: 'Outline Secondary',
282
- variant: 'secondary',
283
- outline: true,
284
- pill: false,
285
- size: 'medium',
286
- disabled: false,
287
- text: false,
288
- showIcon: false,
289
- iconOnly: false,
290
- iconName: Object.keys(feather.icons)[0],
291
- iconPosition: 'left',
292
- type: 'button',
293
- name: 'nome bottone',
294
- value: 'value bottone',
295
- ariaLabel: 'sono un bottone'
296
- };
297
- export const OutlineGrey = Template.bind({});
298
- OutlineGrey.args = {
299
- label: 'Outline Neutral',
300
- variant: 'neutral',
301
- outline: true,
302
- pill: false,
303
- size: 'medium',
304
- disabled: false,
305
- text: false,
306
- showIcon: false,
307
- iconOnly: false,
308
- iconName: Object.keys(feather.icons)[0],
309
- iconPosition: 'left',
310
- type: 'button',
311
- name: 'nome bottone',
312
- value: 'value bottone',
313
- ariaLabel: 'sono un bottone'
314
- };
315
- export const OutlineWhite = Template.bind({});
316
- OutlineWhite.args = {
317
- label: 'Outline White',
318
- variant: 'white',
319
- outline: true,
320
- pill: false,
321
- size: 'medium',
322
- disabled: false,
323
- text: false,
324
- showIcon: false,
325
- iconOnly: false,
326
- iconName: Object.keys(feather.icons)[0],
327
- iconPosition: 'left',
328
- type: 'button',
329
- name: 'nome bottone',
330
- value: 'value bottone',
331
- ariaLabel: 'sono un bottone'
332
- };
333
254
  export const PillPrimary = Template.bind({});
334
255
  PillPrimary.args = {
335
256
  label: 'Pill Primary',
@@ -348,98 +269,7 @@ PillPrimary.args = {
348
269
  value: 'value bottone',
349
270
  ariaLabel: 'sono un bottone'
350
271
  };
351
- export const OutlinePillPrimary = Template.bind({});
352
- OutlinePillPrimary.args = {
353
- label: 'Pill Primary',
354
- variant: 'primary',
355
- outline: true,
356
- pill: true,
357
- size: 'medium',
358
- disabled: false,
359
- text: false,
360
- showIcon: false,
361
- iconOnly: false,
362
- iconName: Object.keys(feather.icons)[0],
363
- iconPosition: 'left',
364
- type: 'button',
365
- name: 'nome bottone',
366
- value: 'value bottone',
367
- ariaLabel: 'sono un bottone'
368
- };
369
- export const TextPrimary = Template.bind({});
370
- TextPrimary.args = {
371
- label: 'Button Text Primary',
372
- variant: 'primary',
373
- outline: false,
374
- pill: false,
375
- size: 'medium',
376
- disabled: false,
377
- text: true,
378
- showIcon: false,
379
- iconOnly: false,
380
- iconName: Object.keys(feather.icons)[0],
381
- iconPosition: 'left',
382
- type: 'button',
383
- name: 'nome bottone',
384
- value: 'value bottone',
385
- ariaLabel: 'sono un bottone'
386
- };
387
- export const TextSecondary = Template.bind({});
388
- TextSecondary.args = {
389
- label: 'Button Text Secondary',
390
- variant: 'secondary',
391
- outline: false,
392
- pill: false,
393
- size: 'medium',
394
- disabled: false,
395
- text: true,
396
- showIcon: false,
397
- iconOnly: false,
398
- iconName: Object.keys(feather.icons)[0],
399
- iconPosition: 'left',
400
- type: 'button',
401
- name: 'nome bottone',
402
- value: 'value bottone',
403
- ariaLabel: 'sono un bottone'
404
- };
405
- export const TextGrey = Template.bind({});
406
- TextGrey.args = {
407
- label: 'Button Text Neutral',
408
- variant: 'neutral',
409
- outline: false,
410
- pill: false,
411
- size: 'medium',
412
- disabled: false,
413
- text: true,
414
- showIcon: false,
415
- iconOnly: false,
416
- iconName: Object.keys(feather.icons)[0],
417
- iconPosition: 'left',
418
- type: 'button',
419
- name: 'nome bottone',
420
- value: 'value bottone',
421
- ariaLabel: 'sono un bottone'
422
- };
423
- export const TextWhite = Template.bind({});
424
- TextWhite.args = {
425
- label: 'Button Text White',
426
- variant: 'white',
427
- outline: false,
428
- pill: false,
429
- size: 'medium',
430
- disabled: false,
431
- text: true,
432
- showIcon: false,
433
- iconOnly: false,
434
- iconName: Object.keys(feather.icons)[0],
435
- iconPosition: 'left',
436
- type: 'button',
437
- name: 'nome bottone',
438
- value: 'value bottone',
439
- ariaLabel: 'sono un bottone'
440
- };
441
- const TemplateWithIcon = (args) => `<jump-button id="${args.id}" class="${args.class}" variant="${args.variant}" size="${args.size}" type="${args.type}" ariaLabel="${args.ariaLabel}" name="${args.name}" value="${args.value}" ${args.disabled == true ? ' disabled' : ''} ${args.pill == true ? ' pill' : ''} ${args.outline == true ? ' outline' : ''} ${args.text == true ? ' text' : ''}> ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''} ${args.label} ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}</jump-button>`;
442
- export const ButtonWithIcon = TemplateWithIcon.bind({});
272
+ export const ButtonWithIcon = Template.bind({});
443
273
  ButtonWithIcon.args = {
444
274
  label: 'Primary',
445
275
  variant: 'primary',
@@ -456,90 +286,6 @@ ButtonWithIcon.args = {
456
286
  value: 'value bottone',
457
287
  ariaLabel: 'sono un bottone'
458
288
  };
459
- const TemplateWithOnlyIcon = (args) => `<jump-button
460
- id="${args.id}"
461
- class="${args.class}"
462
- variant="${args.variant}"
463
- size="${args.size}"
464
- type="${args.type}"
465
- ariaLabel="${args.ariaLabel}"
466
- name="${args.name}"
467
- value="${args.value}"
468
- ${args.disabled == true ? ' disabled' : ''}
469
- ${args.pill == true ? ' pill' : ''}
470
- ${args.outline == true ? ' outline' : ''}
471
- ${args.text == true ? ' text' : ''}
472
- ${!args.label ? ' only-icon' : ''}>
473
- ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}
474
- ${args.label}
475
- ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
476
-
477
- </jump-button>`;
478
- export const ButtonWithOnlyIconSquare = TemplateWithOnlyIcon.bind({});
479
- ButtonWithOnlyIconSquare.args = {
480
- label: '',
481
- variant: 'primary',
482
- outline: false,
483
- pill: false,
484
- size: 'medium',
485
- disabled: false,
486
- text: false,
487
- showIcon: true,
488
- iconName: 'home',
489
- iconPosition: 'left',
490
- type: 'button',
491
- name: 'nome bottone',
492
- value: 'value bottone',
493
- ariaLabel: 'sono un bottone'
494
- };
495
- export const ButtonWithOnlyIconPill = TemplateWithOnlyIcon.bind({});
496
- ButtonWithOnlyIconPill.args = {
497
- label: '',
498
- variant: 'primary',
499
- outline: false,
500
- pill: true,
501
- size: 'medium',
502
- disabled: false,
503
- text: false,
504
- showIcon: true,
505
- iconName: 'home',
506
- iconPosition: 'left',
507
- type: 'button',
508
- name: 'nome bottone',
509
- value: 'value bottone',
510
- ariaLabel: 'sono un bottone'
511
- };
512
- export const Link = Template.bind({});
513
- Link.args = {
514
- label: 'Link',
515
- variant: 'primary',
516
- outline: false,
517
- pill: false,
518
- size: 'medium',
519
- disabled: false,
520
- text: true,
521
- showIcon: false,
522
- iconOnly: false,
523
- iconName: Object.keys(feather.icons)[0],
524
- iconPosition: 'left',
525
- href: 'www.jumpgroup.it',
526
- target: '_blank',
527
- };
528
- export const AnchorWithIcon = TemplateWithIcon.bind({});
529
- AnchorWithIcon.args = {
530
- label: 'Link with icon',
531
- variant: 'primary',
532
- outline: false,
533
- pill: false,
534
- size: 'medium',
535
- disabled: false,
536
- text: true,
537
- showIcon: true,
538
- iconName: 'arrow-right',
539
- iconPosition: 'right',
540
- href: 'www.google.it',
541
- ariaLabel: 'sono un bottone'
542
- };
543
289
  export const Disabled = Template.bind({});
544
290
  Disabled.args = {
545
291
  label: 'Disabled',