@sula-tech/webcomponents 0.1.0 → 0.2.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 (63) hide show
  1. package/dist/cjs/{index-7973b779.js → index-3eac14f6.js} +102 -4
  2. package/dist/cjs/index-3eac14f6.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/{sula-avatar_3.cjs.entry.js → sula-avatar_4.cjs.entry.js} +133 -5
  5. package/dist/cjs/sula-avatar_4.cjs.entry.js.map +1 -0
  6. package/dist/cjs/webcomponents.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +2 -1
  8. package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
  9. package/dist/collection/components/sula-avatar/sula-avatar.stories.js +14 -17
  10. package/dist/collection/components/sula-avatar/sula-avatar.stories.js.map +1 -1
  11. package/dist/collection/components/sula-button/sula-button.css +1 -1
  12. package/dist/collection/components/sula-button/sula-button.stories.js +36 -9
  13. package/dist/collection/components/sula-button/sula-button.stories.js.map +1 -1
  14. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  15. package/dist/collection/components/sula-icon/sula-icon.stories.js +35 -14
  16. package/dist/collection/components/sula-icon/sula-icon.stories.js.map +1 -1
  17. package/dist/collection/components/sula-textfield/model/sula-textfield.model.js +11 -0
  18. package/dist/collection/components/sula-textfield/model/sula-textfield.model.js.map +1 -0
  19. package/dist/collection/components/sula-textfield/sula-textfield.css +1 -0
  20. package/dist/collection/components/sula-textfield/sula-textfield.js +376 -0
  21. package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -0
  22. package/dist/collection/components/sula-textfield/sula-textfield.stories.js +148 -0
  23. package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -0
  24. package/dist/components/index.js +1 -1
  25. package/dist/components/{p-81fcc74a.js → p-a07ff261.js} +3 -3
  26. package/dist/components/{p-81fcc74a.js.map → p-a07ff261.js.map} +1 -1
  27. package/dist/components/{p-d3ba6302.js → p-ca146b16.js} +91 -5
  28. package/dist/components/p-ca146b16.js.map +1 -0
  29. package/dist/components/sula-avatar.js +3 -3
  30. package/dist/components/sula-avatar.js.map +1 -1
  31. package/dist/components/sula-button.js +3 -3
  32. package/dist/components/sula-button.js.map +1 -1
  33. package/dist/components/sula-icon.js +1 -1
  34. package/dist/components/sula-textfield.d.ts +11 -0
  35. package/dist/components/sula-textfield.js +171 -0
  36. package/dist/components/sula-textfield.js.map +1 -0
  37. package/dist/esm/{index-9bf8f892.js → index-1dc4ae53.js} +102 -4
  38. package/dist/esm/index-1dc4ae53.js.map +1 -0
  39. package/dist/esm/loader.js +3 -3
  40. package/dist/esm/{sula-avatar_3.entry.js → sula-avatar_4.entry.js} +133 -6
  41. package/dist/esm/sula-avatar_4.entry.js.map +1 -0
  42. package/dist/esm/webcomponents.js +3 -3
  43. package/dist/types/components/sula-avatar/sula-avatar.stories.d.ts +0 -1
  44. package/dist/types/components/sula-button/sula-button.stories.d.ts +2 -0
  45. package/dist/types/components/sula-icon/sula-icon.stories.d.ts +5 -2
  46. package/dist/types/components/sula-textfield/model/sula-textfield.model.d.ts +8 -0
  47. package/dist/types/components/sula-textfield/sula-textfield.d.ts +74 -0
  48. package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +108 -0
  49. package/dist/types/components.d.ts +116 -0
  50. package/dist/webcomponents/{p-82d7a024.entry.js → p-77709b3c.entry.js} +201 -9
  51. package/dist/webcomponents/p-77709b3c.entry.js.map +1 -0
  52. package/dist/webcomponents/{p-cca32e44.js → p-fbee9d79.js} +426 -325
  53. package/dist/webcomponents/p-fbee9d79.js.map +1 -0
  54. package/dist/webcomponents/webcomponents.esm.js +27 -13
  55. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  56. package/package.json +20 -27
  57. package/dist/cjs/index-7973b779.js.map +0 -1
  58. package/dist/cjs/sula-avatar_3.cjs.entry.js.map +0 -1
  59. package/dist/components/p-d3ba6302.js.map +0 -1
  60. package/dist/esm/index-9bf8f892.js.map +0 -1
  61. package/dist/esm/sula-avatar_3.entry.js.map +0 -1
  62. package/dist/webcomponents/p-82d7a024.entry.js.map +0 -1
  63. package/dist/webcomponents/p-cca32e44.js.map +0 -1
@@ -0,0 +1,148 @@
1
+ import { SulaTextfieldStatus, SulaTextfieldType } from "./model/sula-textfield.model";
2
+ export default {
3
+ title: 'Components/sula-textfield',
4
+ tags: ['autodocs'],
5
+ argTypes: {
6
+ value: {
7
+ control: 'text',
8
+ defaultValue: '',
9
+ description: 'Value for the input',
10
+ type: {
11
+ required: false,
12
+ },
13
+ },
14
+ type: {
15
+ control: { type: 'select' },
16
+ options: Object.values(SulaTextfieldType),
17
+ defaultValue: SulaTextfieldType.Text,
18
+ description: 'The textfield type',
19
+ type: {
20
+ required: false,
21
+ },
22
+ },
23
+ status: {
24
+ control: { type: 'select' },
25
+ options: Object.values(SulaTextfieldStatus),
26
+ defaultValue: SulaTextfieldStatus.Default,
27
+ description: 'The textfield status',
28
+ type: {
29
+ required: false,
30
+ },
31
+ },
32
+ label: {
33
+ control: 'text',
34
+ defaultValue: 'Label',
35
+ description: 'The textfield label',
36
+ type: {
37
+ required: false,
38
+ },
39
+ },
40
+ placeholder: {
41
+ control: 'text',
42
+ defaultValue: 'Placeholder',
43
+ description: 'The textfield placeholder',
44
+ type: {
45
+ required: false,
46
+ },
47
+ },
48
+ disabled: {
49
+ control: 'boolean',
50
+ defaultValue: false,
51
+ description: 'The textfield is disabled',
52
+ type: {
53
+ required: false,
54
+ },
55
+ },
56
+ helpText: {
57
+ control: 'text',
58
+ defaultValue: '',
59
+ description: 'The help text for textfield',
60
+ type: {
61
+ required: false,
62
+ },
63
+ },
64
+ maxLength: {
65
+ control: 'number',
66
+ defaultValue: 0,
67
+ description: 'The textfield max length',
68
+ type: {
69
+ required: false,
70
+ },
71
+ },
72
+ icon: {
73
+ control: 'text',
74
+ defaultValue: '',
75
+ description: 'The textfield icon',
76
+ type: {
77
+ required: false,
78
+ },
79
+ },
80
+ valueChanged: {
81
+ action: 'valueChanged',
82
+ description: 'Evento emitido quando o valor muda',
83
+ },
84
+ focusedOn: {
85
+ action: 'focusedOn',
86
+ description: 'Evento emitido quando o campo recebe foco',
87
+ },
88
+ focusedOut: {
89
+ action: 'focusedOut',
90
+ description: 'Evento emitido quando o campo perde foco',
91
+ },
92
+ },
93
+ };
94
+ const Template = args => {
95
+ const container = document.createElement('div');
96
+ container.style.maxWidth = '400px';
97
+ container.style.margin = '20px';
98
+ const el = document.createElement('sula-textfield');
99
+ if (args.value)
100
+ el.setAttribute('value', args.value);
101
+ el.setAttribute('type', args.type);
102
+ el.setAttribute('status', args.status);
103
+ el.setAttribute('label', args.label);
104
+ el.setAttribute('placeholder', args.placeholder);
105
+ el.setAttribute('disabled', args.disabled.toString());
106
+ if (args.helpText)
107
+ el.setAttribute('help-text', args.helpText);
108
+ if (args.maxLength > 0)
109
+ el.setAttribute('max-length', args.maxLength.toString());
110
+ if (args.icon)
111
+ el.setAttribute('icon', args.icon);
112
+ el.addEventListener('valueChanged', args.valueChanged);
113
+ el.addEventListener('focusedOn', args.focusedOn);
114
+ el.addEventListener('focusedOut', args.focusedOut);
115
+ container.appendChild(el);
116
+ return container;
117
+ };
118
+ export const Default = Template.bind({});
119
+ Default.args = {
120
+ value: '',
121
+ type: SulaTextfieldType.Text,
122
+ status: SulaTextfieldStatus.Default,
123
+ label: 'Nome',
124
+ placeholder: 'Digite seu nome',
125
+ disabled: false,
126
+ helpText: '',
127
+ maxLength: 0,
128
+ icon: '',
129
+ };
130
+ export const WithValue = Template.bind({});
131
+ WithValue.args = Object.assign(Object.assign({}, Default.args), { value: 'John Doe', label: 'Nome completo' });
132
+ export const WithHelpText = Template.bind({});
133
+ WithHelpText.args = Object.assign(Object.assign({}, Default.args), { label: 'E-mail', placeholder: 'Digite seu e-mail', helpText: 'Informe um e-mail válido' });
134
+ export const WithMaxLength = Template.bind({});
135
+ WithMaxLength.args = Object.assign(Object.assign({}, Default.args), { label: 'Descrição', placeholder: 'Digite uma descrição', maxLength: 100, helpText: 'Máximo de 100 caracteres' });
136
+ export const WithIcon = Template.bind({});
137
+ WithIcon.args = Object.assign(Object.assign({}, Default.args), { label: 'Pesquisar', placeholder: 'Digite sua busca', icon: 'ph ph-magnifying-glass' });
138
+ export const Password = Template.bind({});
139
+ Password.args = Object.assign(Object.assign({}, Default.args), { type: SulaTextfieldType.Password, label: 'Senha', placeholder: 'Digite sua senha' });
140
+ export const Error = Template.bind({});
141
+ Error.args = Object.assign(Object.assign({}, Default.args), { status: SulaTextfieldStatus.Error, label: 'E-mail', placeholder: 'Digite seu e-mail', helpText: 'E-mail inválido' });
142
+ export const Disabled = Template.bind({});
143
+ Disabled.args = Object.assign(Object.assign({}, Default.args), { disabled: true, label: 'Campo desabilitado' });
144
+ export const WithIconAndHelpText = Template.bind({});
145
+ WithIconAndHelpText.args = Object.assign(Object.assign({}, Default.args), { label: 'Endereço', placeholder: 'Digite seu endereço', icon: 'ph ph-map-pin', helpText: 'Informe o endereço completo' });
146
+ export const ErrorWithMaxLength = Template.bind({});
147
+ ErrorWithMaxLength.args = Object.assign(Object.assign({}, Default.args), { status: SulaTextfieldStatus.Error, label: 'Mensagem', placeholder: 'Digite sua mensagem', maxLength: 50, helpText: 'Excedeu o limite de caracteres', value: 'Esta é uma mensagem de teste que excede o limite de caracteres permitido' });
148
+ //# sourceMappingURL=sula-textfield.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sula-textfield.stories.js","sourceRoot":"","sources":["../../../src/components/sula-textfield/sula-textfield.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtF,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,EAAE;YAChB,WAAW,EA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AI,mCACR,OAAO,CAAC,IAAI,KACf,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,oBAAoB,GAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,mBAAmB,CAAC,IAAI,mCACnB,OAAO,CAAC,IAAI,KACf,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,qBAAqB,EAClC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,6BAA6B,GACxC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,kBAAkB,CAAC,IAAI,mCAClB,OAAO,CAAC,IAAI,KACf,MAAM,EAAE,mBAAmB,CAAC,KAAK,EACjC,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,qBAAqB,EAClC,SAAS,EAAE,EAAE,EACb,QAAQ,EAAE,gCAAgC,EAC1C,KAAK,EAAE,0EAA0E,GAClF,CAAC","sourcesContent":["import { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';\n\nexport default {\n title: 'Components/sula-textfield',\n tags: ['autodocs'],\n argTypes: {\n value: {\n control: 'text',\n defaultValue: '',\n description: 'Value for the input',\n type: {\n required: false,\n },\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaTextfieldType),\n defaultValue: SulaTextfieldType.Text,\n description: 'The textfield type',\n type: {\n required: false,\n },\n },\n status: {\n control: { type: 'select' },\n options: Object.values(SulaTextfieldStatus),\n defaultValue: SulaTextfieldStatus.Default,\n description: 'The textfield status',\n type: {\n required: false,\n },\n },\n label: {\n control: 'text',\n defaultValue: 'Label',\n description: 'The textfield label',\n type: {\n required: false,\n },\n },\n placeholder: {\n control: 'text',\n defaultValue: 'Placeholder',\n description: 'The textfield placeholder',\n type: {\n required: false,\n },\n },\n disabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'The textfield is disabled',\n type: {\n required: false,\n },\n },\n helpText: {\n control: 'text',\n defaultValue: '',\n description: 'The help text for textfield',\n type: {\n required: false,\n },\n },\n maxLength: {\n control: 'number',\n defaultValue: 0,\n description: 'The textfield max length',\n type: {\n required: false,\n },\n },\n icon: {\n control: 'text',\n defaultValue: '',\n description: 'The textfield icon',\n type: {\n required: false,\n },\n },\n valueChanged: {\n action: 'valueChanged',\n description: 'Evento emitido quando o valor muda',\n },\n focusedOn: {\n action: 'focusedOn',\n description: 'Evento emitido quando o campo recebe foco',\n },\n focusedOut: {\n action: 'focusedOut',\n description: 'Evento emitido quando o campo perde foco',\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.maxWidth = '400px';\n container.style.margin = '20px';\n\n const el = document.createElement('sula-textfield');\n\n if (args.value) el.setAttribute('value', args.value);\n el.setAttribute('type', args.type);\n el.setAttribute('status', args.status);\n el.setAttribute('label', args.label);\n el.setAttribute('placeholder', args.placeholder);\n el.setAttribute('disabled', args.disabled.toString());\n\n if (args.helpText) el.setAttribute('help-text', args.helpText);\n if (args.maxLength > 0) el.setAttribute('max-length', args.maxLength.toString());\n if (args.icon) el.setAttribute('icon', args.icon);\n\n el.addEventListener('valueChanged', args.valueChanged);\n el.addEventListener('focusedOn', args.focusedOn);\n el.addEventListener('focusedOut', args.focusedOut);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n value: '',\n type: SulaTextfieldType.Text,\n status: SulaTextfieldStatus.Default,\n label: 'Nome',\n placeholder: 'Digite seu nome',\n disabled: false,\n helpText: '',\n maxLength: 0,\n icon: '',\n};\n\nexport const WithValue = Template.bind({});\nWithValue.args = {\n ...Default.args,\n value: 'John Doe',\n label: 'Nome completo',\n};\n\nexport const WithHelpText = Template.bind({});\nWithHelpText.args = {\n ...Default.args,\n label: 'E-mail',\n placeholder: 'Digite seu e-mail',\n helpText: 'Informe um e-mail válido',\n};\n\nexport const WithMaxLength = Template.bind({});\nWithMaxLength.args = {\n ...Default.args,\n label: 'Descrição',\n placeholder: 'Digite uma descrição',\n maxLength: 100,\n helpText: 'Máximo de 100 caracteres',\n};\n\nexport const WithIcon = Template.bind({});\nWithIcon.args = {\n ...Default.args,\n label: 'Pesquisar',\n placeholder: 'Digite sua busca',\n icon: 'ph ph-magnifying-glass',\n};\n\nexport const Password = Template.bind({});\nPassword.args = {\n ...Default.args,\n type: SulaTextfieldType.Password,\n label: 'Senha',\n placeholder: 'Digite sua senha',\n};\n\nexport const Error = Template.bind({});\nError.args = {\n ...Default.args,\n status: SulaTextfieldStatus.Error,\n label: 'E-mail',\n placeholder: 'Digite seu e-mail',\n helpText: 'E-mail inválido',\n};\n\nexport const Disabled = Template.bind({});\nDisabled.args = {\n ...Default.args,\n disabled: true,\n label: 'Campo desabilitado',\n};\n\nexport const WithIconAndHelpText = Template.bind({});\nWithIconAndHelpText.args = {\n ...Default.args,\n label: 'Endereço',\n placeholder: 'Digite seu endereço',\n icon: 'ph ph-map-pin',\n helpText: 'Informe o endereço completo',\n};\n\nexport const ErrorWithMaxLength = Template.bind({});\nErrorWithMaxLength.args = {\n ...Default.args,\n status: SulaTextfieldStatus.Error,\n label: 'Mensagem',\n placeholder: 'Digite sua mensagem',\n maxLength: 50,\n helpText: 'Excedeu o limite de caracteres',\n value: 'Esta é uma mensagem de teste que excede o limite de caracteres permitido',\n};\n"]}
@@ -1,3 +1,3 @@
1
- export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-d3ba6302.js';
1
+ export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-ca146b16.js';
2
2
 
3
3
  //# sourceMappingURL=index.js.map