@rededor/cura 0.4.6 → 0.4.8
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.
- package/dist/assets/icons/iconset-default-list.ts +1 -1
- package/dist/assets/icons/iconset-default-tmp.svg +27 -5
- package/dist/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/{cura-button_10.cjs.entry.js → cura-accordion_12.cjs.entry.js} +129 -3
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/{index-0e874533.js → index-72217b50.js} +10 -2
- package/dist/cjs/index-72217b50.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +27 -5
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets-raw/icons/default/doc.svg +5 -5
- package/dist/collection/assets-raw/icons/default/examDoc.svg +8 -0
- package/dist/collection/assets-raw/icons/default/siren.svg +12 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.css +14 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +272 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +160 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -0
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +139 -0
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +199 -0
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -0
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js +93 -47
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +168 -0
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +168 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -0
- package/dist/collection/components/cura-icon/cura-icon.stories.js +75 -0
- package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js +56 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.stories.js +80 -0
- package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -0
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js +91 -0
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -0
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +94 -0
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/cura-accordion-item.d.ts +11 -0
- package/dist/components/cura-accordion-item.js +76 -0
- package/dist/components/cura-accordion-item.js.map +1 -0
- package/dist/components/cura-accordion.d.ts +11 -0
- package/dist/components/cura-accordion.js +121 -0
- package/dist/components/cura-accordion.js.map +1 -0
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/cura.js +1 -1
- package/dist/cura/p-03b4f9a3.system.js +2 -0
- package/dist/cura/p-03b4f9a3.system.js.map +1 -0
- package/dist/cura/p-2cbf52f1.js +3 -0
- package/dist/cura/p-2cbf52f1.js.map +1 -0
- package/dist/cura/p-74e2e763.entry.js +2 -0
- package/dist/cura/p-74e2e763.entry.js.map +1 -0
- package/dist/cura/{p-a84ae34f.system.js → p-8da635b7.system.js} +3 -3
- package/dist/cura/{p-cbc91ac5.js.map → p-8da635b7.system.js.map} +1 -1
- package/dist/cura/p-d6eee1ad.system.entry.js +2 -0
- package/dist/cura/p-d6eee1ad.system.entry.js.map +1 -0
- package/dist/esm/{cura-button_10.entry.js → cura-accordion_12.entry.js} +128 -4
- package/dist/esm/cura-accordion_12.entry.js.map +1 -0
- package/dist/esm/cura.js +3 -3
- package/dist/esm/{index-92c824be.js → index-9af0cdbd.js} +10 -2
- package/dist/esm/index-9af0cdbd.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm-es5/cura-accordion_12.entry.js +2 -0
- package/dist/esm-es5/cura-accordion_12.entry.js.map +1 -0
- package/dist/esm-es5/cura.js +1 -1
- package/dist/esm-es5/cura.js.map +1 -1
- package/dist/esm-es5/{index-92c824be.js → index-9af0cdbd.js} +2 -2
- package/dist/esm-es5/index-9af0cdbd.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +39 -0
- package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +154 -0
- package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +29 -0
- package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +87 -35
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +171 -0
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +171 -0
- package/dist/types/components/cura-icon/cura-icon.stories.d.ts +65 -0
- package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.stories.d.ts +43 -0
- package/dist/types/components/text/cura-display/cura-display.stories.d.ts +76 -0
- package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +90 -0
- package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +74 -0
- package/dist/types/components.d.ts +114 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/cura-button_10.cjs.entry.js.map +0 -1
- package/dist/cjs/index-0e874533.js.map +0 -1
- package/dist/cura/p-19176c44.system.js +0 -2
- package/dist/cura/p-19176c44.system.js.map +0 -1
- package/dist/cura/p-a84ae34f.system.js.map +0 -1
- package/dist/cura/p-b7e3230a.entry.js +0 -2
- package/dist/cura/p-b7e3230a.entry.js.map +0 -1
- package/dist/cura/p-cbc91ac5.js +0 -3
- package/dist/cura/p-e45582d9.system.entry.js +0 -2
- package/dist/cura/p-e45582d9.system.entry.js.map +0 -1
- package/dist/esm/cura-button_10.entry.js.map +0 -1
- package/dist/esm/index-92c824be.js.map +0 -1
- package/dist/esm-es5/cura-button_10.entry.js +0 -2
- package/dist/esm-es5/cura-button_10.entry.js.map +0 -1
- package/dist/esm-es5/index-92c824be.js.map +0 -1
- /package/dist/collection/stories/{Button.stories.js → Button.st.js} +0 -0
- /package/dist/collection/stories/{Header.stories.js → Header.st.js} +0 -0
- /package/dist/collection/stories/{Page.stories.js → Page.st.js} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class CuraAccordionItem {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.label = '';
|
|
5
|
+
this.iconSize = 32;
|
|
6
|
+
this.openIcon = 'down';
|
|
7
|
+
this.closeIcon = 'up';
|
|
8
|
+
this.iconColor = '';
|
|
9
|
+
this.iconActiveColor = '';
|
|
10
|
+
this.colorMode = 'dark';
|
|
11
|
+
this.opened = false;
|
|
12
|
+
this.styles = {};
|
|
13
|
+
}
|
|
14
|
+
getIconColor() {
|
|
15
|
+
const inverted = this.colorMode === 'light';
|
|
16
|
+
const iconColor = inverted ? 'neutral-lighter' : `${this.iconColor}-base`;
|
|
17
|
+
const iconActiveColor = inverted ? 'neutral-purewhite' : `${this.iconActiveColor}-base`;
|
|
18
|
+
return this.opened ? iconActiveColor : iconColor;
|
|
19
|
+
}
|
|
20
|
+
getClasses() {
|
|
21
|
+
const classes = {};
|
|
22
|
+
classes['accordion-item'] = true;
|
|
23
|
+
classes['active'] = this.opened;
|
|
24
|
+
classes['inverted'] = this.colorMode === 'light';
|
|
25
|
+
return classes;
|
|
26
|
+
}
|
|
27
|
+
accordionItemClick(_) {
|
|
28
|
+
this.opened = !this.opened;
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return (h(Host, { slot: "accordion-item" }, h("div", { class: this.getClasses(), style: this.styles }, h("div", { class: "label", onClick: e => this.accordionItemClick(e) }, h("div", { class: "label-container" }, h("span", null, this.label), h("cura-icon", { name: this.opened ? this.closeIcon : this.openIcon, size: this.iconSize, color: this.getIconColor() }))), h("div", { class: 'content' }, h("div", { class: "content-wrapper" }, h("slot", null))))));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "cura-accordion-item"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get originalStyleUrls() {
|
|
36
|
+
return {
|
|
37
|
+
"$": ["cura-accordion-item.scss"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static get styleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["cura-accordion-item.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get properties() {
|
|
46
|
+
return {
|
|
47
|
+
"label": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": "Text label for accordion item"
|
|
60
|
+
},
|
|
61
|
+
"attribute": "label",
|
|
62
|
+
"reflect": true,
|
|
63
|
+
"defaultValue": "''"
|
|
64
|
+
},
|
|
65
|
+
"iconSize": {
|
|
66
|
+
"type": "number",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "number",
|
|
70
|
+
"resolved": "number",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": "Accordion items icons"
|
|
78
|
+
},
|
|
79
|
+
"attribute": "icon-size",
|
|
80
|
+
"reflect": true,
|
|
81
|
+
"defaultValue": "32"
|
|
82
|
+
},
|
|
83
|
+
"openIcon": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "string",
|
|
88
|
+
"resolved": "string",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": ""
|
|
96
|
+
},
|
|
97
|
+
"attribute": "open-icon",
|
|
98
|
+
"reflect": true,
|
|
99
|
+
"defaultValue": "'down'"
|
|
100
|
+
},
|
|
101
|
+
"closeIcon": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "close-icon",
|
|
116
|
+
"reflect": true,
|
|
117
|
+
"defaultValue": "'up'"
|
|
118
|
+
},
|
|
119
|
+
"iconColor": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Color scheme base color\n(By default, the icon will use the same color of 'color' and 'activeColor')"
|
|
132
|
+
},
|
|
133
|
+
"attribute": "icon-color",
|
|
134
|
+
"reflect": true,
|
|
135
|
+
"defaultValue": "''"
|
|
136
|
+
},
|
|
137
|
+
"iconActiveColor": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"mutable": false,
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "string",
|
|
142
|
+
"resolved": "string",
|
|
143
|
+
"references": {}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": false,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": ""
|
|
150
|
+
},
|
|
151
|
+
"attribute": "icon-active-color",
|
|
152
|
+
"reflect": true,
|
|
153
|
+
"defaultValue": "''"
|
|
154
|
+
},
|
|
155
|
+
"colorMode": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"mutable": false,
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "'dark' | 'light'",
|
|
160
|
+
"resolved": "\"dark\" | \"light\"",
|
|
161
|
+
"references": {}
|
|
162
|
+
},
|
|
163
|
+
"required": false,
|
|
164
|
+
"optional": false,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": "Set the color mode to dark or light"
|
|
168
|
+
},
|
|
169
|
+
"attribute": "color-mode",
|
|
170
|
+
"reflect": false,
|
|
171
|
+
"defaultValue": "'dark'"
|
|
172
|
+
},
|
|
173
|
+
"opened": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"mutable": true,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "boolean",
|
|
178
|
+
"resolved": "boolean",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": ""
|
|
186
|
+
},
|
|
187
|
+
"attribute": "opened",
|
|
188
|
+
"reflect": true,
|
|
189
|
+
"defaultValue": "false"
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
static get states() {
|
|
194
|
+
return {
|
|
195
|
+
"styles": {}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=cura-accordion-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-accordion-item.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion-item/cura-accordion-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAG,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOjE,MAAM,OAAO,iBAAiB;;iBAKW,EAAE;oBAMP,EAAE;oBACF,MAAM;qBACL,IAAI;qBAMJ,EAAE;2BACI,EAAE;qBAKL,MAAM;kBAEc,KAAK;kBAE7C,EAAE;;EAEpB,YAAY;IACV,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC;IAC5C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,OAAO,CAAC;IAC1E,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,eAAe,OAAO,CAAC;IACxF,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;EACnD,CAAC;EAED,UAAU;IACR,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IAChC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC;IACjD,OAAO,OAAO,CAAC;EACjB,CAAC;EAED,kBAAkB,CAAC,CAAQ;IACzB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;EAC7B,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB;MACzB,WAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM;QAC/C,WAAK,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;UACzD,WAAK,KAAK,EAAC,iBAAiB;YAC1B,gBAAO,IAAI,CAAC,KAAK,CAAQ;YACzB,iBAAW,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,GAAc,CACxH,CACF;QACN,WAAK,KAAK,EAAC,SAAS;UAClB,WAAK,KAAK,EAAC,iBAAiB;YAC1B,eAAa,CACT,CACF,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-accordion-item',\n styleUrl: 'cura-accordion-item.scss',\n shadow: true,\n})\nexport class CuraAccordionItem {\n\n /**\n * Text label for accordion item\n */\n @Prop({reflect: true}) label: string = '';\n\n /** ***Properties below are inherited from the cura-accordion*** */\n /**\n * Accordion items icons\n */\n @Prop({reflect: true}) iconSize = 32;\n @Prop({reflect: true}) openIcon = 'down';\n @Prop({reflect: true}) closeIcon = 'up';\n\n /**\n * Color scheme base color\n * (By default, the icon will use the same color of 'color' and 'activeColor')\n */\n @Prop({reflect: true}) iconColor = '';\n @Prop({reflect: true}) iconActiveColor = '';\n\n /**\n * Set the color mode to dark or light\n */\n @Prop() colorMode: 'dark' | 'light' = 'dark';\n\n @Prop({ reflect: true, mutable: true }) opened: boolean = false;\n\n @State() styles = {};\n\n getIconColor() {\n const inverted = this.colorMode === 'light';\n const iconColor = inverted ? 'neutral-lighter' : `${this.iconColor}-base`;\n const iconActiveColor = inverted ? 'neutral-purewhite' : `${this.iconActiveColor}-base`;\n return this.opened ? iconActiveColor : iconColor;\n }\n\n getClasses() {\n const classes = {};\n classes['accordion-item'] = true;\n classes['active'] = this.opened;\n classes['inverted'] = this.colorMode === 'light';\n return classes;\n }\n\n accordionItemClick(_: Event) {\n this.opened = !this.opened;\n }\n\n render() {\n return (\n <Host slot=\"accordion-item\">\n <div class={this.getClasses()} style={this.styles}>\n <div class=\"label\" onClick={e => this.accordionItemClick(e)}>\n <div class=\"label-container\">\n <span>{this.label}</span>\n <cura-icon name={this.opened ? this.closeIcon : this.openIcon} size={this.iconSize} color={this.getIconColor()}></cura-icon>\n </div>\n </div>\n <div class='content'>\n <div class=\"content-wrapper\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -35,47 +35,126 @@ export default {
|
|
|
35
35
|
</cura-button>`;
|
|
36
36
|
},
|
|
37
37
|
argTypes: {
|
|
38
|
-
label: {
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
label: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',
|
|
41
|
+
name: 'Label'
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
control: 'boolean',
|
|
45
|
+
description: 'Estado desabilitado.',
|
|
46
|
+
table: {
|
|
47
|
+
category: 'State',
|
|
48
|
+
defaultValue: { summary: 'false' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
isLoading: {
|
|
52
|
+
control: 'boolean',
|
|
53
|
+
description: 'Estado de carregamento. Também desabilita ação do botão e pode ser usado em conjunto com a propriedade disabled.',
|
|
54
|
+
table: {
|
|
55
|
+
category: 'State',
|
|
56
|
+
defaultValue: { summary: 'false' }
|
|
57
|
+
},
|
|
58
|
+
name: 'is-loading'
|
|
59
|
+
},
|
|
41
60
|
size: {
|
|
42
61
|
control: { type: 'inline-radio' },
|
|
43
62
|
options: ['small', 'medium', 'large'],
|
|
63
|
+
description: 'Tamanhos disponíveis.',
|
|
64
|
+
table: {
|
|
65
|
+
category: 'Properties',
|
|
66
|
+
defaultValue: { summary: 'medium' }
|
|
67
|
+
}
|
|
44
68
|
},
|
|
45
69
|
color: {
|
|
46
70
|
control: { type: 'select' },
|
|
47
|
-
options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral']
|
|
71
|
+
options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
|
|
72
|
+
description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
|
|
73
|
+
table: {
|
|
74
|
+
category: 'Properties',
|
|
75
|
+
defaultValue: { summary: 'accent' }
|
|
76
|
+
}
|
|
48
77
|
},
|
|
49
78
|
fontColor: {
|
|
50
79
|
control: { type: 'inline-radio' },
|
|
51
|
-
options: ['dark', 'light']
|
|
80
|
+
options: ['dark', 'light'],
|
|
81
|
+
description: 'Define cor clara ou escura de acordo com contexto.',
|
|
82
|
+
table: {
|
|
83
|
+
category: 'Properties',
|
|
84
|
+
defaultValue: { summary: 'dark' }
|
|
85
|
+
},
|
|
86
|
+
name: 'font-color'
|
|
52
87
|
},
|
|
53
88
|
textAlign: {
|
|
54
89
|
control: { type: 'inline-radio' },
|
|
55
|
-
options: ['left', 'center', 'right']
|
|
90
|
+
options: ['left', 'center', 'right'],
|
|
91
|
+
description: 'Alinha texto de múltiplas linhas.',
|
|
92
|
+
table: {
|
|
93
|
+
category: 'Properties',
|
|
94
|
+
defaultValue: { summary: 'left' }
|
|
95
|
+
},
|
|
96
|
+
name: 'text-align'
|
|
97
|
+
},
|
|
98
|
+
fullWidth: {
|
|
99
|
+
control: 'boolean',
|
|
100
|
+
description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em largura total',
|
|
101
|
+
table: {
|
|
102
|
+
category: 'CSS',
|
|
103
|
+
defaultValue: { summary: 'false' }
|
|
104
|
+
}
|
|
56
105
|
},
|
|
57
|
-
fullWidth: { control: 'boolean' },
|
|
58
106
|
iconName: {
|
|
59
107
|
control: { type: 'select' },
|
|
60
|
-
options: iconNames
|
|
108
|
+
options: iconNames,
|
|
109
|
+
description: 'Nome do ícone a ser utilizado no iconset.',
|
|
110
|
+
table: {
|
|
111
|
+
category: 'Icons'
|
|
112
|
+
},
|
|
113
|
+
name: 'icon-name'
|
|
61
114
|
},
|
|
62
115
|
iconPosition: {
|
|
63
116
|
control: { type: 'inline-radio' },
|
|
64
|
-
options: ['left', 'right']
|
|
117
|
+
options: ['left', 'right'],
|
|
118
|
+
description: 'Posição do ícone no botão.',
|
|
119
|
+
table: {
|
|
120
|
+
category: 'Icons',
|
|
121
|
+
defaultValue: { summary: 'left' }
|
|
122
|
+
},
|
|
123
|
+
name: 'icon-position'
|
|
124
|
+
},
|
|
125
|
+
iconOnly: {
|
|
126
|
+
control: 'boolean',
|
|
127
|
+
description: 'Oculta o label do botão exibindo somente o ícone.',
|
|
128
|
+
table: {
|
|
129
|
+
category: 'Icons',
|
|
130
|
+
defaultValue: { summary: 'false' }
|
|
131
|
+
},
|
|
132
|
+
name: 'icon-only'
|
|
65
133
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
134
|
+
href: {
|
|
135
|
+
control: 'text',
|
|
136
|
+
description: `Se definido o elemento de ação renderizado internamente será um link.`,
|
|
137
|
+
table: {
|
|
138
|
+
category: 'Properties'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
target: {
|
|
142
|
+
control: 'text',
|
|
143
|
+
description: 'Define o comportamento de abertura do link quando href for informado.',
|
|
144
|
+
table: {
|
|
145
|
+
category: 'Properties',
|
|
146
|
+
defaultValue: { summary: '_self' }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
69
149
|
},
|
|
70
150
|
};
|
|
71
|
-
export const
|
|
151
|
+
export const Button = {
|
|
72
152
|
args: {
|
|
73
153
|
label: 'Button',
|
|
74
154
|
size: 'medium',
|
|
75
155
|
color: 'primary',
|
|
76
156
|
fontColor: 'light',
|
|
77
157
|
textAlign: 'left',
|
|
78
|
-
fullWidth: false,
|
|
79
158
|
iconName: iconNames[0],
|
|
80
159
|
iconPosition: 'left',
|
|
81
160
|
iconOnly: false,
|
|
@@ -83,40 +162,7 @@ export const Primary = {
|
|
|
83
162
|
isLoading: false,
|
|
84
163
|
href: '',
|
|
85
164
|
target: '_self',
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
export const Secondary = {
|
|
89
|
-
args: {
|
|
90
|
-
label: 'Button',
|
|
91
|
-
size: 'medium',
|
|
92
|
-
color: 'secondary',
|
|
93
|
-
fontColor: 'dark',
|
|
94
|
-
textAlign: 'left',
|
|
95
165
|
fullWidth: false,
|
|
96
|
-
iconName: iconNames[0],
|
|
97
|
-
iconPosition: 'left',
|
|
98
|
-
iconOnly: false,
|
|
99
|
-
disabled: false,
|
|
100
|
-
isLoading: false,
|
|
101
|
-
href: '',
|
|
102
|
-
target: '_self',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
export const Accent = {
|
|
106
|
-
args: {
|
|
107
|
-
label: 'Button',
|
|
108
|
-
size: 'medium',
|
|
109
|
-
color: 'accent',
|
|
110
|
-
fontColor: 'dark',
|
|
111
|
-
textAlign: 'left',
|
|
112
|
-
fullWidth: false,
|
|
113
|
-
iconName: iconNames[0],
|
|
114
|
-
iconPosition: 'left',
|
|
115
|
-
iconOnly: false,
|
|
116
|
-
disabled: false,
|
|
117
|
-
isLoading: false,
|
|
118
|
-
href: '',
|
|
119
|
-
target: '_self',
|
|
120
166
|
},
|
|
121
167
|
};
|
|
122
168
|
//# sourceMappingURL=cura-button.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-button.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button/cura-button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,eAAe;EACb,KAAK,EAAE,2BAA2B;EAClC,IAAI,EAAE,CAAC,UAAU,CAAC;EAClB,MAAM,EAAE,CAAC,EAAkB,EAAE,EAAE;QAAtB,EAAE,KAAK,OAAW,EAAN,IAAI,cAAhB,SAAkB,CAAF;IACvB,mFAAmF;IACnF,gCAAgC;IAChC,OAAO;UACD,IAAI,CAAC,IAAI;cACL,IAAI,CAAC,QAAQ;gBACX,IAAI,CAAC,SAAS;WACnB,IAAI,CAAC,KAAK;gBACL,IAAI,CAAC,SAAS;eACf,IAAI,CAAC,QAAQ;mBACT,IAAI,CAAC,YAAY;eACrB,IAAI,CAAC,QAAQ;UAClB,IAAI,CAAC,IAAI;YACP,IAAI,CAAC,MAAM;gBACP,IAAI,CAAC,SAAS;WACnB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;MACxC,KAAK;eACI,CAAC;EACd,CAAC;EACD,QAAQ,EAAE;IACR,KAAK,EAAE,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cura-button.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button/cura-button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEn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Content":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nexport default {\n title: 'Components/Buttons/Button',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n // You can either use a function to create DOM elements or use a plain html string!\n // return `<div>${label}</div>`;\n return `<cura-button\n size=\"${args.size}\"\n disabled=\"${args.disabled}\"\n is-loading=\"${args.isLoading}\"\n color=\"${args.color}\"\n font-color=\"${args.fontColor}\"\n icon-name=\"${args.iconName}\"\n icon-position=\"${args.iconPosition}\"\n icon-only=\"${args.iconOnly}\"\n href=\"${args.href}\"\n target=\"${args.target}\"\n text-align=\"${args.textAlign}\"\n style=\"${args.fullWidth ? 'width: 100%' : ''}\">\n ${label}\n</cura-button>`;\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',\n name: 'Label'\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado.',\n table: {\n category: 'State',\n defaultValue: { summary: 'false'}\n }\n },\n isLoading: {\n control: 'boolean',\n description: 'Estado de carregamento. Também desabilita ação do botão e pode ser usado em conjunto com a propriedade disabled.',\n table: {\n category: 'State',\n defaultValue: { summary: 'false'}\n },\n name: 'is-loading'\n },\n size: {\n control: { type: 'inline-radio' },\n options: ['small', 'medium', 'large'],\n description: 'Tamanhos disponíveis.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'medium'}\n }\n },\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'accent'}\n }\n },\n fontColor: {\n control: { type: 'inline-radio' },\n options: ['dark', 'light'],\n description: 'Define cor clara ou escura de acordo com contexto.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'dark'}\n },\n name: 'font-color'\n },\n textAlign: {\n control: { type: 'inline-radio' },\n options: ['left', 'center', 'right'],\n description: 'Alinha texto de múltiplas linhas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'left'}\n },\n name: 'text-align'\n },\n fullWidth: {\n control: 'boolean',\n description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em largura total',\n table: {\n category: 'CSS',\n defaultValue: { summary: 'false'}\n }\n },\n iconName: {\n control: {type: 'select' },\n options: iconNames,\n description: 'Nome do ícone a ser utilizado no iconset.',\n table: {\n category: 'Icons'\n },\n name: 'icon-name'\n },\n iconPosition: {\n control: { type: 'inline-radio' },\n options: ['left', 'right'],\n description: 'Posição do ícone no botão.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'left'}\n },\n name: 'icon-position'\n },\n iconOnly: {\n control: 'boolean',\n description: 'Oculta o label do botão exibindo somente o ícone.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'false'}\n },\n name: 'icon-only'\n },\n href: {\n control: 'text',\n description: `Se definido o elemento de ação renderizado internamente será um link.`,\n table: {\n category: 'Properties'\n }\n },\n target: {\n control: 'text',\n description: 'Define o comportamento de abertura do link quando href for informado.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '_self'}\n }\n }\n },\n};\n\nexport const Button = {\n args: {\n label: 'Button',\n size: 'medium',\n color: 'primary',\n fontColor: 'light',\n textAlign: 'left',\n iconName: iconNames[0],\n iconPosition: 'left',\n iconOnly: false,\n disabled: false,\n isLoading: false,\n href: '',\n target: '_self',\n fullWidth: false,\n },\n};\n"]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import iconNames from '../../../assets/icons/iconset-default-list';
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Components/Buttons/Button Outline',
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
render: (_a) => {
|
|
18
|
+
var { label } = _a, args = __rest(_a, ["label"]);
|
|
19
|
+
// You can either use a function to create DOM elements or use a plain html string!
|
|
20
|
+
// return `<div>${label}</div>`;
|
|
21
|
+
return `<cura-button-outline
|
|
22
|
+
size="${args.size}"
|
|
23
|
+
disabled="${args.disabled}"
|
|
24
|
+
is-loading="${args.isLoading}"
|
|
25
|
+
color="${args.color}"
|
|
26
|
+
font-color="${args.fontColor}"
|
|
27
|
+
icon-name="${args.iconName}"
|
|
28
|
+
icon-position="${args.iconPosition}"
|
|
29
|
+
icon-only="${args.iconOnly}"
|
|
30
|
+
href="${args.href}"
|
|
31
|
+
target="${args.target}"
|
|
32
|
+
text-align="${args.textAlign}"
|
|
33
|
+
style="${args.fullWidth ? 'width: 100%' : ''}">
|
|
34
|
+
${label}
|
|
35
|
+
</cura-button-outline>`;
|
|
36
|
+
},
|
|
37
|
+
argTypes: {
|
|
38
|
+
label: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',
|
|
41
|
+
name: 'Label'
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
control: 'boolean',
|
|
45
|
+
description: 'Estado desabilitado.',
|
|
46
|
+
table: {
|
|
47
|
+
category: 'State',
|
|
48
|
+
defaultValue: { summary: 'false' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
isLoading: {
|
|
52
|
+
control: 'boolean',
|
|
53
|
+
description: 'Estado de carregamento. Também desabilita ação do botão e pode ser usado em conjunto com a propriedade disabled.',
|
|
54
|
+
table: {
|
|
55
|
+
category: 'State',
|
|
56
|
+
defaultValue: { summary: 'false' }
|
|
57
|
+
},
|
|
58
|
+
name: 'is-loading'
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
control: { type: 'inline-radio' },
|
|
62
|
+
options: ['small', 'medium', 'large'],
|
|
63
|
+
description: 'Tamanhos disponíveis.',
|
|
64
|
+
table: {
|
|
65
|
+
category: 'Properties',
|
|
66
|
+
defaultValue: { summary: 'medium' }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
control: { type: 'select' },
|
|
71
|
+
options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
|
|
72
|
+
description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
|
|
73
|
+
table: {
|
|
74
|
+
category: 'Properties',
|
|
75
|
+
defaultValue: { summary: 'accent' }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
fontColor: {
|
|
79
|
+
control: { type: 'inline-radio' },
|
|
80
|
+
options: ['dark', 'light'],
|
|
81
|
+
description: 'Define cor clara ou escura de acordo com contexto.',
|
|
82
|
+
table: {
|
|
83
|
+
category: 'Properties',
|
|
84
|
+
defaultValue: { summary: 'dark' }
|
|
85
|
+
},
|
|
86
|
+
name: 'font-color'
|
|
87
|
+
},
|
|
88
|
+
textAlign: {
|
|
89
|
+
control: { type: 'inline-radio' },
|
|
90
|
+
options: ['left', 'center', 'right'],
|
|
91
|
+
description: 'Alinha texto de múltiplas linhas.',
|
|
92
|
+
table: {
|
|
93
|
+
category: 'Properties',
|
|
94
|
+
defaultValue: { summary: 'left' }
|
|
95
|
+
},
|
|
96
|
+
name: 'text-align'
|
|
97
|
+
},
|
|
98
|
+
fullWidth: {
|
|
99
|
+
control: 'boolean',
|
|
100
|
+
description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em largura total',
|
|
101
|
+
table: {
|
|
102
|
+
category: 'CSS',
|
|
103
|
+
defaultValue: { summary: 'false' }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
iconName: {
|
|
107
|
+
control: { type: 'select' },
|
|
108
|
+
options: iconNames,
|
|
109
|
+
description: 'Nome do ícone a ser utilizado no iconset.',
|
|
110
|
+
table: {
|
|
111
|
+
category: 'Icons'
|
|
112
|
+
},
|
|
113
|
+
name: 'icon-name'
|
|
114
|
+
},
|
|
115
|
+
iconPosition: {
|
|
116
|
+
control: { type: 'inline-radio' },
|
|
117
|
+
options: ['left', 'right'],
|
|
118
|
+
description: 'Posição do ícone no botão.',
|
|
119
|
+
table: {
|
|
120
|
+
category: 'Icons',
|
|
121
|
+
defaultValue: { summary: 'left' }
|
|
122
|
+
},
|
|
123
|
+
name: 'icon-position'
|
|
124
|
+
},
|
|
125
|
+
iconOnly: {
|
|
126
|
+
control: 'boolean',
|
|
127
|
+
description: 'Oculta o label do botão exibindo somente o ícone.',
|
|
128
|
+
table: {
|
|
129
|
+
category: 'Icons',
|
|
130
|
+
defaultValue: { summary: 'false' }
|
|
131
|
+
},
|
|
132
|
+
name: 'icon-only'
|
|
133
|
+
},
|
|
134
|
+
href: {
|
|
135
|
+
control: 'text',
|
|
136
|
+
description: `Se definido o elemento de ação renderizado internamente será um link.`,
|
|
137
|
+
table: {
|
|
138
|
+
category: 'Properties'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
target: {
|
|
142
|
+
control: 'text',
|
|
143
|
+
description: 'Define o comportamento de abertura do link quando href for informado.',
|
|
144
|
+
table: {
|
|
145
|
+
category: 'Properties',
|
|
146
|
+
defaultValue: { summary: '_self' }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
export const ButtonOutline = {
|
|
152
|
+
args: {
|
|
153
|
+
label: 'Button',
|
|
154
|
+
size: 'medium',
|
|
155
|
+
color: 'primary',
|
|
156
|
+
fontColor: 'dark',
|
|
157
|
+
textAlign: 'left',
|
|
158
|
+
iconName: iconNames[0],
|
|
159
|
+
iconPosition: 'left',
|
|
160
|
+
iconOnly: false,
|
|
161
|
+
disabled: false,
|
|
162
|
+
isLoading: false,
|
|
163
|
+
href: '',
|
|
164
|
+
target: '_self',
|
|
165
|
+
fullWidth: false,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=cura-button-outline.stories.js.map
|
package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-button-outline.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-outline/cura-button-outline.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,eAAe;EACb,KAAK,EAAE,mCAAmC;EAC1C,IAAI,EAAE,CAAC,UAAU,CAAC;EAClB,MAAM,EAAE,CAAC,EAAkB,EAAE,EAAE;QAAtB,EAAE,KAAK,OAAW,EAAN,IAAI,cAAhB,SAAkB,CAAF;IACvB,mFAAmF;IACnF,gCAAgC;IAChC,OAAO;UACD,IAAI,CAAC,IAAI;cACL,IAAI,CAAC,QAAQ;gBACX,IAAI,CAAC,SAAS;WACnB,IAAI,CAAC,KAAK;gBACL,IAAI,CAAC,SAAS;eACf,IAAI,CAAC,QAAQ;mBACT,IAAI,CAAC,YAAY;eACrB,IAAI,CAAC,QAAQ;UAClB,IAAI,CAAC,IAAI;YACP,IAAI,CAAC,MAAM;gBACP,IAAI,CAAC,SAAS;WACnB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;MACxC,KAAK;uBACY,CAAC;EACtB,CAAC;EACD,QAAQ,EAAE;IACR,KAAK,EAAE;MACL,OAAO,EAAE,MAAM;MACf,WAAW,EAAE,qFAAqF;MAClG,IAAI,EAAE,OAAO;KACd;IACD,QAAQ,EAAE;MACR,OAAO,EAAE,SAAS;MAClB,WAAW,EAAE,sBAAsB;MACnC,KAAK,E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E,OAAO,EAAE,OAAO,EAAC;OAClC;KACF;GACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;EAC3B,IAAI,EAAE;IACJ,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACtB,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,KAAK;GACjB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nexport default {\n title: 'Components/Buttons/Button Outline',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n // You can either use a function to create DOM elements or use a plain html string!\n // return `<div>${label}</div>`;\n return `<cura-button-outline\n size=\"${args.size}\"\n disabled=\"${args.disabled}\"\n is-loading=\"${args.isLoading}\"\n color=\"${args.color}\"\n font-color=\"${args.fontColor}\"\n icon-name=\"${args.iconName}\"\n icon-position=\"${args.iconPosition}\"\n icon-only=\"${args.iconOnly}\"\n href=\"${args.href}\"\n target=\"${args.target}\"\n text-align=\"${args.textAlign}\"\n style=\"${args.fullWidth ? 'width: 100%' : ''}\">\n ${label}\n</cura-button-outline>`;\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',\n name: 'Label'\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado.',\n table: {\n category: 'State',\n defaultValue: { summary: 'false'}\n }\n },\n isLoading: {\n control: 'boolean',\n description: 'Estado de carregamento. Também desabilita ação do botão e pode ser usado em conjunto com a propriedade disabled.',\n table: {\n category: 'State',\n defaultValue: { summary: 'false'}\n },\n name: 'is-loading'\n },\n size: {\n control: { type: 'inline-radio' },\n options: ['small', 'medium', 'large'],\n description: 'Tamanhos disponíveis.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'medium'}\n }\n },\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'accent'}\n }\n },\n fontColor: {\n control: { type: 'inline-radio' },\n options: ['dark', 'light'],\n description: 'Define cor clara ou escura de acordo com contexto.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'dark'}\n },\n name: 'font-color'\n },\n textAlign: {\n control: { type: 'inline-radio' },\n options: ['left', 'center', 'right'],\n description: 'Alinha texto de múltiplas linhas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'left'}\n },\n name: 'text-align'\n },\n fullWidth: {\n control: 'boolean',\n description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em largura total',\n table: {\n category: 'CSS',\n defaultValue: { summary: 'false'}\n }\n },\n iconName: {\n control: {type: 'select' },\n options: iconNames,\n description: 'Nome do ícone a ser utilizado no iconset.',\n table: {\n category: 'Icons'\n },\n name: 'icon-name'\n },\n iconPosition: {\n control: { type: 'inline-radio' },\n options: ['left', 'right'],\n description: 'Posição do ícone no botão.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'left'}\n },\n name: 'icon-position'\n },\n iconOnly: {\n control: 'boolean',\n description: 'Oculta o label do botão exibindo somente o ícone.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'false'}\n },\n name: 'icon-only'\n },\n href: {\n control: 'text',\n description: `Se definido o elemento de ação renderizado internamente será um link.`,\n table: {\n category: 'Properties'\n }\n },\n target: {\n control: 'text',\n description: 'Define o comportamento de abertura do link quando href for informado.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '_self'}\n }\n }\n },\n};\n\nexport const ButtonOutline = {\n args: {\n label: 'Button',\n size: 'medium',\n color: 'primary',\n fontColor: 'dark',\n textAlign: 'left',\n iconName: iconNames[0],\n iconPosition: 'left',\n iconOnly: false,\n disabled: false,\n isLoading: false,\n href: '',\n target: '_self',\n fullWidth: false,\n },\n};\n"]}
|