@luster-ui/ui 1.0.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 (176) hide show
  1. package/PUBLISHING.md +469 -0
  2. package/README.md +423 -0
  3. package/dist/cjs/index-Couc0LVo.js +1571 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +12 -0
  6. package/dist/cjs/luster-accordion_19.cjs.entry.js +555 -0
  7. package/dist/cjs/luster-card.cjs.entry.js +25 -0
  8. package/dist/cjs/luster.cjs.js +24 -0
  9. package/dist/collection/collection-manifest.json +32 -0
  10. package/dist/collection/components/luster-accordion/luster-accordion.css +76 -0
  11. package/dist/collection/components/luster-accordion/luster-accordion.js +160 -0
  12. package/dist/collection/components/luster-accordion/luster-accordion.stories.js +88 -0
  13. package/dist/collection/components/luster-activity-item/luster-activity-item.css +102 -0
  14. package/dist/collection/components/luster-activity-item/luster-activity-item.js +188 -0
  15. package/dist/collection/components/luster-activity-item/luster-activity-item.stories.js +94 -0
  16. package/dist/collection/components/luster-alert/luster-alert.css +71 -0
  17. package/dist/collection/components/luster-alert/luster-alert.js +171 -0
  18. package/dist/collection/components/luster-alert/luster-alert.stories.js +82 -0
  19. package/dist/collection/components/luster-article-card/luster-article-card.css +120 -0
  20. package/dist/collection/components/luster-article-card/luster-article-card.js +192 -0
  21. package/dist/collection/components/luster-article-card/luster-article-card.stories.js +82 -0
  22. package/dist/collection/components/luster-badge/luster-badge.css +38 -0
  23. package/dist/collection/components/luster-badge/luster-badge.js +87 -0
  24. package/dist/collection/components/luster-badge/luster-badge.stories.js +86 -0
  25. package/dist/collection/components/luster-button/luster-button.css +121 -0
  26. package/dist/collection/components/luster-button/luster-button.js +179 -0
  27. package/dist/collection/components/luster-button/luster-button.stories.js +103 -0
  28. package/dist/collection/components/luster-card/luster-card.css +29 -0
  29. package/dist/collection/components/luster-card/luster-card.js +92 -0
  30. package/dist/collection/components/luster-card/luster-card.stories.js +67 -0
  31. package/dist/collection/components/luster-checkbox/luster-checkbox.css +42 -0
  32. package/dist/collection/components/luster-checkbox/luster-checkbox.js +162 -0
  33. package/dist/collection/components/luster-checkbox/luster-checkbox.stories.js +78 -0
  34. package/dist/collection/components/luster-color-swatch/luster-color-swatch.css +33 -0
  35. package/dist/collection/components/luster-color-swatch/luster-color-swatch.js +108 -0
  36. package/dist/collection/components/luster-color-swatch/luster-color-swatch.stories.js +58 -0
  37. package/dist/collection/components/luster-feature-quote/luster-feature-quote.css +84 -0
  38. package/dist/collection/components/luster-feature-quote/luster-feature-quote.js +108 -0
  39. package/dist/collection/components/luster-feature-quote/luster-feature-quote.stories.js +52 -0
  40. package/dist/collection/components/luster-hero/luster-hero.css +119 -0
  41. package/dist/collection/components/luster-hero/luster-hero.js +129 -0
  42. package/dist/collection/components/luster-hero/luster-hero.stories.js +72 -0
  43. package/dist/collection/components/luster-input/luster-input.css +72 -0
  44. package/dist/collection/components/luster-input/luster-input.js +332 -0
  45. package/dist/collection/components/luster-input/luster-input.stories.js +106 -0
  46. package/dist/collection/components/luster-modal/luster-modal.css +103 -0
  47. package/dist/collection/components/luster-modal/luster-modal.js +215 -0
  48. package/dist/collection/components/luster-modal/luster-modal.stories.js +78 -0
  49. package/dist/collection/components/luster-navbar/luster-navbar.css +151 -0
  50. package/dist/collection/components/luster-navbar/luster-navbar.js +87 -0
  51. package/dist/collection/components/luster-navbar/luster-navbar.stories.js +41 -0
  52. package/dist/collection/components/luster-profile-card/luster-profile-card.css +89 -0
  53. package/dist/collection/components/luster-profile-card/luster-profile-card.js +194 -0
  54. package/dist/collection/components/luster-profile-card/luster-profile-card.stories.js +56 -0
  55. package/dist/collection/components/luster-resource-table/luster-resource-table.css +141 -0
  56. package/dist/collection/components/luster-resource-table/luster-resource-table.js +78 -0
  57. package/dist/collection/components/luster-resource-table/luster-resource-table.stories.js +44 -0
  58. package/dist/collection/components/luster-sidebar/luster-sidebar.css +152 -0
  59. package/dist/collection/components/luster-sidebar/luster-sidebar.js +78 -0
  60. package/dist/collection/components/luster-sidebar/luster-sidebar.stories.js +34 -0
  61. package/dist/collection/components/luster-stat-card/luster-stat-card.css +82 -0
  62. package/dist/collection/components/luster-stat-card/luster-stat-card.js +194 -0
  63. package/dist/collection/components/luster-stat-card/luster-stat-card.stories.js +75 -0
  64. package/dist/collection/components/luster-tabs/luster-tabs.css +35 -0
  65. package/dist/collection/components/luster-tabs/luster-tabs.js +116 -0
  66. package/dist/collection/components/luster-tabs/luster-tabs.stories.js +56 -0
  67. package/dist/collection/components/luster-toggle/luster-toggle.css +48 -0
  68. package/dist/collection/components/luster-toggle/luster-toggle.js +120 -0
  69. package/dist/collection/components/luster-toggle/luster-toggle.stories.js +66 -0
  70. package/dist/components/index.d.ts +33 -0
  71. package/dist/components/index.js +1 -0
  72. package/dist/components/luster-accordion.d.ts +11 -0
  73. package/dist/components/luster-accordion.js +1 -0
  74. package/dist/components/luster-activity-item.d.ts +11 -0
  75. package/dist/components/luster-activity-item.js +1 -0
  76. package/dist/components/luster-alert.d.ts +11 -0
  77. package/dist/components/luster-alert.js +1 -0
  78. package/dist/components/luster-article-card.d.ts +11 -0
  79. package/dist/components/luster-article-card.js +1 -0
  80. package/dist/components/luster-badge.d.ts +11 -0
  81. package/dist/components/luster-badge.js +1 -0
  82. package/dist/components/luster-badge2.js +1 -0
  83. package/dist/components/luster-button.d.ts +11 -0
  84. package/dist/components/luster-button.js +1 -0
  85. package/dist/components/luster-button2.js +1 -0
  86. package/dist/components/luster-card.d.ts +11 -0
  87. package/dist/components/luster-card.js +1 -0
  88. package/dist/components/luster-checkbox.d.ts +11 -0
  89. package/dist/components/luster-checkbox.js +1 -0
  90. package/dist/components/luster-color-swatch.d.ts +11 -0
  91. package/dist/components/luster-color-swatch.js +1 -0
  92. package/dist/components/luster-feature-quote.d.ts +11 -0
  93. package/dist/components/luster-feature-quote.js +1 -0
  94. package/dist/components/luster-hero.d.ts +11 -0
  95. package/dist/components/luster-hero.js +1 -0
  96. package/dist/components/luster-input.d.ts +11 -0
  97. package/dist/components/luster-input.js +1 -0
  98. package/dist/components/luster-modal.d.ts +11 -0
  99. package/dist/components/luster-modal.js +1 -0
  100. package/dist/components/luster-navbar.d.ts +11 -0
  101. package/dist/components/luster-navbar.js +1 -0
  102. package/dist/components/luster-profile-card.d.ts +11 -0
  103. package/dist/components/luster-profile-card.js +1 -0
  104. package/dist/components/luster-resource-table.d.ts +11 -0
  105. package/dist/components/luster-resource-table.js +1 -0
  106. package/dist/components/luster-sidebar.d.ts +11 -0
  107. package/dist/components/luster-sidebar.js +1 -0
  108. package/dist/components/luster-stat-card.d.ts +11 -0
  109. package/dist/components/luster-stat-card.js +1 -0
  110. package/dist/components/luster-tabs.d.ts +11 -0
  111. package/dist/components/luster-tabs.js +1 -0
  112. package/dist/components/luster-toggle.d.ts +11 -0
  113. package/dist/components/luster-toggle.js +1 -0
  114. package/dist/components/luster-toggle2.js +1 -0
  115. package/dist/esm/index-CeYIN8dN.js +1563 -0
  116. package/dist/esm/index.js +1 -0
  117. package/dist/esm/loader.js +10 -0
  118. package/dist/esm/luster-accordion_19.entry.js +535 -0
  119. package/dist/esm/luster-card.entry.js +23 -0
  120. package/dist/esm/luster.js +20 -0
  121. package/dist/index.cjs.js +1 -0
  122. package/dist/index.js +1 -0
  123. package/dist/luster/index.esm.js +0 -0
  124. package/dist/luster/luster.css +313 -0
  125. package/dist/luster/luster.esm.js +1 -0
  126. package/dist/luster/p-3c4ce897.entry.js +1 -0
  127. package/dist/luster/p-CeYIN8dN.js +2 -0
  128. package/dist/luster/p-e368ec08.entry.js +1 -0
  129. package/dist/types/.stencil/luster-accordion/luster-accordion.d.ts +13 -0
  130. package/dist/types/.stencil/luster-accordion/luster-accordion.stories.d.ts +10 -0
  131. package/dist/types/.stencil/luster-activity-item/luster-activity-item.d.ts +11 -0
  132. package/dist/types/.stencil/luster-activity-item/luster-activity-item.stories.d.ts +9 -0
  133. package/dist/types/.stencil/luster-alert/luster-alert.d.ts +13 -0
  134. package/dist/types/.stencil/luster-alert/luster-alert.stories.d.ts +10 -0
  135. package/dist/types/.stencil/luster-article-card/luster-article-card.d.ts +11 -0
  136. package/dist/types/.stencil/luster-article-card/luster-article-card.stories.d.ts +8 -0
  137. package/dist/types/.stencil/luster-badge/luster-badge.d.ts +6 -0
  138. package/dist/types/.stencil/luster-badge/luster-badge.stories.d.ts +12 -0
  139. package/dist/types/.stencil/luster-button/luster-button.d.ts +12 -0
  140. package/dist/types/.stencil/luster-button/luster-button.stories.d.ts +13 -0
  141. package/dist/types/.stencil/luster-card/luster-card.d.ts +6 -0
  142. package/dist/types/.stencil/luster-card/luster-card.stories.d.ts +10 -0
  143. package/dist/types/.stencil/luster-checkbox/luster-checkbox.d.ts +13 -0
  144. package/dist/types/.stencil/luster-checkbox/luster-checkbox.stories.d.ts +10 -0
  145. package/dist/types/.stencil/luster-color-swatch/luster-color-swatch.d.ts +7 -0
  146. package/dist/types/.stencil/luster-color-swatch/luster-color-swatch.stories.d.ts +8 -0
  147. package/dist/types/.stencil/luster-feature-quote/luster-feature-quote.d.ts +7 -0
  148. package/dist/types/.stencil/luster-feature-quote/luster-feature-quote.stories.d.ts +8 -0
  149. package/dist/types/.stencil/luster-hero/luster-hero.d.ts +8 -0
  150. package/dist/types/.stencil/luster-hero/luster-hero.stories.d.ts +8 -0
  151. package/dist/types/.stencil/luster-input/luster-input.d.ts +25 -0
  152. package/dist/types/.stencil/luster-input/luster-input.stories.d.ts +9 -0
  153. package/dist/types/.stencil/luster-modal/luster-modal.d.ts +17 -0
  154. package/dist/types/.stencil/luster-modal/luster-modal.stories.d.ts +8 -0
  155. package/dist/types/.stencil/luster-navbar/luster-navbar.d.ts +6 -0
  156. package/dist/types/.stencil/luster-navbar/luster-navbar.stories.d.ts +6 -0
  157. package/dist/types/.stencil/luster-profile-card/luster-profile-card.d.ts +11 -0
  158. package/dist/types/.stencil/luster-profile-card/luster-profile-card.stories.d.ts +7 -0
  159. package/dist/types/.stencil/luster-resource-table/luster-resource-table.d.ts +14 -0
  160. package/dist/types/.stencil/luster-resource-table/luster-resource-table.stories.d.ts +6 -0
  161. package/dist/types/.stencil/luster-sidebar/luster-sidebar.d.ts +9 -0
  162. package/dist/types/.stencil/luster-sidebar/luster-sidebar.stories.d.ts +8 -0
  163. package/dist/types/.stencil/luster-stat-card/luster-stat-card.d.ts +11 -0
  164. package/dist/types/.stencil/luster-stat-card/luster-stat-card.stories.d.ts +8 -0
  165. package/dist/types/.stencil/luster-tabs/luster-tabs.d.ts +15 -0
  166. package/dist/types/.stencil/luster-tabs/luster-tabs.stories.d.ts +7 -0
  167. package/dist/types/.stencil/luster-toggle/luster-toggle.d.ts +11 -0
  168. package/dist/types/.stencil/luster-toggle/luster-toggle.stories.d.ts +9 -0
  169. package/dist/types/components.d.ts +1355 -0
  170. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  171. package/loader/cdn.js +1 -0
  172. package/loader/index.cjs.js +1 -0
  173. package/loader/index.d.ts +24 -0
  174. package/loader/index.es2017.js +1 -0
  175. package/loader/index.js +2 -0
  176. package/package.json +73 -0
@@ -0,0 +1,188 @@
1
+ import { h } from "@stencil/core";
2
+ export class DcActivityItem {
3
+ constructor() {
4
+ this.label = '';
5
+ this.description = '';
6
+ this.time = '';
7
+ this.variant = 'activity';
8
+ this.icon = 'edit';
9
+ this.fileSize = '';
10
+ this.downloadable = false;
11
+ }
12
+ getIcon() {
13
+ switch (this.icon) {
14
+ case 'edit':
15
+ return (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
16
+ case 'sync':
17
+ return (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("polyline", { points: "1 4 1 10 7 10", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M3.51 15a9 9 0 1 0 .49-8.49", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
18
+ case 'user':
19
+ return (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2", stroke: "currentColor", "stroke-width": "2" }), h("circle", { cx: "12", cy: "7", r: "4", stroke: "currentColor", "stroke-width": "2" })));
20
+ case 'file':
21
+ return (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z", stroke: "currentColor", "stroke-width": "2" }), h("polyline", { points: "14,2 14,8 20,8", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
22
+ default:
23
+ return (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "2" })));
24
+ }
25
+ }
26
+ render() {
27
+ if (this.variant === 'file') {
28
+ return (h("div", { class: "activity-item activity-item--file" }, h("div", { class: "activity-item__file-icon" }, this.getIcon()), h("div", { class: "activity-item__content" }, h("span", { class: "activity-item__title" }, this.label), h("span", { class: "activity-item__meta" }, this.fileSize && h("span", null, this.fileSize), this.time && h("span", null, "\u00B7 ", this.time))), this.downloadable && (h("button", { class: "activity-item__download", "aria-label": "Download" }, h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("polyline", { points: "7,10 12,15 17,10", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("line", { x1: "12", y1: "15", x2: "12", y2: "3", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }))))));
29
+ }
30
+ return (h("div", { class: "activity-item" }, h("div", { class: "activity-item__icon" }, this.getIcon()), h("div", { class: "activity-item__content" }, h("span", { class: "activity-item__title" }, this.label), this.description && (h("span", { class: "activity-item__desc" }, this.description)), this.time && h("span", { class: "activity-item__time" }, this.time))));
31
+ }
32
+ static get is() { return "luster-activity-item"; }
33
+ static get encapsulation() { return "shadow"; }
34
+ static get originalStyleUrls() {
35
+ return {
36
+ "$": ["luster-activity-item.css"]
37
+ };
38
+ }
39
+ static get styleUrls() {
40
+ return {
41
+ "$": ["luster-activity-item.css"]
42
+ };
43
+ }
44
+ static get properties() {
45
+ return {
46
+ "label": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "getter": false,
61
+ "setter": false,
62
+ "reflect": false,
63
+ "attribute": "label",
64
+ "defaultValue": "''"
65
+ },
66
+ "description": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "getter": false,
81
+ "setter": false,
82
+ "reflect": false,
83
+ "attribute": "description",
84
+ "defaultValue": "''"
85
+ },
86
+ "time": {
87
+ "type": "string",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "string",
91
+ "resolved": "string",
92
+ "references": {}
93
+ },
94
+ "required": false,
95
+ "optional": false,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": ""
99
+ },
100
+ "getter": false,
101
+ "setter": false,
102
+ "reflect": false,
103
+ "attribute": "time",
104
+ "defaultValue": "''"
105
+ },
106
+ "variant": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "'activity' | 'file'",
111
+ "resolved": "\"activity\" | \"file\"",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": false,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": ""
119
+ },
120
+ "getter": false,
121
+ "setter": false,
122
+ "reflect": false,
123
+ "attribute": "variant",
124
+ "defaultValue": "'activity'"
125
+ },
126
+ "icon": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "getter": false,
141
+ "setter": false,
142
+ "reflect": false,
143
+ "attribute": "icon",
144
+ "defaultValue": "'edit'"
145
+ },
146
+ "fileSize": {
147
+ "type": "string",
148
+ "mutable": false,
149
+ "complexType": {
150
+ "original": "string",
151
+ "resolved": "string",
152
+ "references": {}
153
+ },
154
+ "required": false,
155
+ "optional": false,
156
+ "docs": {
157
+ "tags": [],
158
+ "text": ""
159
+ },
160
+ "getter": false,
161
+ "setter": false,
162
+ "reflect": false,
163
+ "attribute": "file-size",
164
+ "defaultValue": "''"
165
+ },
166
+ "downloadable": {
167
+ "type": "boolean",
168
+ "mutable": false,
169
+ "complexType": {
170
+ "original": "boolean",
171
+ "resolved": "boolean",
172
+ "references": {}
173
+ },
174
+ "required": false,
175
+ "optional": false,
176
+ "docs": {
177
+ "tags": [],
178
+ "text": ""
179
+ },
180
+ "getter": false,
181
+ "setter": false,
182
+ "reflect": false,
183
+ "attribute": "downloadable",
184
+ "defaultValue": "false"
185
+ }
186
+ };
187
+ }
188
+ }
@@ -0,0 +1,94 @@
1
+ import { html } from "lit";
2
+ const meta = {
3
+ title: 'Cards/Activity Item',
4
+ tags: ['autodocs'],
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Item de feed de atividade ou arquivo. Props: `label`, `description`, `time`, `variant`, `icon`, `file-size`, `downloadable`.',
9
+ },
10
+ },
11
+ },
12
+ argTypes: {
13
+ label: { control: 'text', description: 'Título da atividade' },
14
+ description: { control: 'text', description: 'Descrição adicional' },
15
+ time: { control: 'text', description: 'Timestamp' },
16
+ variant: {
17
+ control: 'select',
18
+ options: ['activity', 'file'],
19
+ description: 'Tipo de item',
20
+ table: { defaultValue: { summary: 'activity' } },
21
+ },
22
+ icon: {
23
+ control: 'select',
24
+ options: ['edit', 'sync', 'user', 'file'],
25
+ description: 'Ícone do item',
26
+ table: { defaultValue: { summary: 'edit' } },
27
+ },
28
+ fileSize: { control: 'text', description: 'Tamanho do arquivo (apenas no variant file)' },
29
+ downloadable: {
30
+ control: 'boolean',
31
+ description: 'Exibe botão de download (apenas no variant file)',
32
+ table: { defaultValue: { summary: 'false' } },
33
+ },
34
+ },
35
+ args: {
36
+ label: 'Article draft updated',
37
+ description: 'Changes saved by Alex Curator',
38
+ time: '2 min ago',
39
+ variant: 'activity',
40
+ icon: 'edit',
41
+ fileSize: '',
42
+ downloadable: false,
43
+ },
44
+ };
45
+ export default meta;
46
+ const render = (args) => html `
47
+ <luster-activity-item
48
+ label="${args.label}"
49
+ description="${args.description}"
50
+ time="${args.time}"
51
+ variant="${args.variant}"
52
+ icon="${args.icon}"
53
+ file-size="${args.fileSize}"
54
+ ?downloadable="${args.downloadable}"
55
+ ></luster-activity-item>
56
+ `;
57
+ export const ActivityEdit = {
58
+ name: 'Activity — Edit',
59
+ args: { label: 'Article draft updated', description: 'By Alex Curator', time: '2 min ago', icon: 'edit' },
60
+ render,
61
+ };
62
+ export const ActivitySync = {
63
+ name: 'Activity — Sync',
64
+ args: { label: 'Content synced to CDN', description: 'Automatic publish', time: '15 min ago', icon: 'sync' },
65
+ render,
66
+ };
67
+ export const ActivityUser = {
68
+ name: 'Activity — User',
69
+ args: { label: 'New collaborator added', description: 'Jordan Reyes joined the team', time: '1 hr ago', icon: 'user' },
70
+ render,
71
+ };
72
+ export const FileDownloadable = {
73
+ name: 'File — Downloadable',
74
+ args: {
75
+ label: 'design-tokens.json',
76
+ variant: 'file',
77
+ icon: 'file',
78
+ fileSize: '24 KB',
79
+ time: 'Yesterday',
80
+ downloadable: true,
81
+ },
82
+ render,
83
+ };
84
+ export const ActivityFeed = {
85
+ name: 'Activity Feed',
86
+ render: () => html `
87
+ <div style="display:flex;flex-direction:column;gap:0.25rem;width:360px;">
88
+ <luster-activity-item label="Article draft updated" description="By Alex Curator" time="2 min ago" icon="edit"></luster-activity-item>
89
+ <luster-activity-item label="Content synced" description="Automatic publish" time="15 min ago" icon="sync"></luster-activity-item>
90
+ <luster-activity-item label="Jordan Reyes joined" description="New collaborator" time="1 hr ago" icon="user"></luster-activity-item>
91
+ <luster-activity-item label="brand-guidelines.pdf" variant="file" icon="file" file-size="1.2 MB" time="Yesterday" ?downloadable="${true}"></luster-activity-item>
92
+ </div>
93
+ `,
94
+ };
@@ -0,0 +1,71 @@
1
+ :host { display: block; }
2
+
3
+ .alert {
4
+ display: flex;
5
+ align-items: flex-start;
6
+ gap: var(--dc-space-3);
7
+ padding: var(--dc-space-3) var(--dc-space-4);
8
+ border-radius: var(--dc-round-3);
9
+ border-left: 3px solid currentColor;
10
+ animation: slideIn 0.2s ease-out;
11
+ }
12
+
13
+ .alert--info { background: rgba(163, 166, 255, 0.08); color: var(--dc-primary); }
14
+ .alert--success { background: rgba(76, 206, 172, 0.08); color: var(--dc-success); }
15
+ .alert--warning { background: rgba(255, 209, 102, 0.08); color: var(--dc-warning); }
16
+ .alert--error { background: rgba(255, 180, 171, 0.08); color: var(--dc-error); }
17
+
18
+ .alert__icon {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ flex-shrink: 0;
23
+ margin-top: 1px;
24
+ }
25
+
26
+ .alert__body {
27
+ flex: 1;
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 2px;
31
+ }
32
+
33
+ .alert__title {
34
+ font-family: var(--dc-font-body);
35
+ font-size: var(--dc-body-sm);
36
+ font-weight: 600;
37
+ color: var(--dc-on-surface);
38
+ }
39
+
40
+ .alert__message {
41
+ font-size: var(--dc-body-sm);
42
+ color: var(--dc-on-surface-variant);
43
+ }
44
+
45
+ .alert__time {
46
+ font-size: var(--dc-label-sm);
47
+ color: var(--dc-on-surface-variant);
48
+ margin-top: var(--dc-space-1);
49
+ }
50
+
51
+ .alert__close {
52
+ background: none;
53
+ border: none;
54
+ cursor: pointer;
55
+ color: var(--dc-on-surface-variant);
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ padding: var(--dc-space-1);
60
+ border-radius: var(--dc-round-1);
61
+ flex-shrink: 0;
62
+ opacity: 0.6;
63
+ transition: opacity var(--dc-transition-fast);
64
+ }
65
+
66
+ .alert__close:hover { opacity: 1; }
67
+
68
+ @keyframes slideIn {
69
+ from { opacity: 0; transform: translateY(-4px); }
70
+ to { opacity: 1; transform: translateY(0); }
71
+ }
@@ -0,0 +1,171 @@
1
+ import { h } from "@stencil/core";
2
+ export class DcAlert {
3
+ constructor() {
4
+ this.heading = '';
5
+ this.message = '';
6
+ this.variant = 'info';
7
+ this.dismissible = true;
8
+ this.timestamp = '';
9
+ this.visible = true;
10
+ this.dismiss = () => {
11
+ this.visible = false;
12
+ this.dcDismiss.emit();
13
+ };
14
+ }
15
+ getIcon() {
16
+ switch (this.variant) {
17
+ case 'success':
18
+ return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "2" }), h("path", { d: "M8 12l3 3 5-5", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
19
+ case 'error':
20
+ return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "2" }), h("line", { x1: "15", y1: "9", x2: "9", y2: "15", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("line", { x1: "9", y1: "9", x2: "15", y2: "15", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
21
+ case 'warning':
22
+ return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, h("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z", stroke: "currentColor", "stroke-width": "2" }), h("line", { x1: "12", y1: "9", x2: "12", y2: "13", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("line", { x1: "12", y1: "17", x2: "12.01", y2: "17", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
23
+ default:
24
+ return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, h("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "2" }), h("line", { x1: "12", y1: "8", x2: "12", y2: "12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("line", { x1: "12", y1: "16", x2: "12.01", y2: "16", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
25
+ }
26
+ }
27
+ render() {
28
+ if (!this.visible)
29
+ return null;
30
+ return (h("div", { class: `alert alert--${this.variant}`, role: "alert" }, h("span", { class: "alert__icon" }, this.getIcon()), h("div", { class: "alert__body" }, this.heading && h("span", { class: "alert__title" }, this.heading), this.message && h("span", { class: "alert__message" }, this.message), this.timestamp && h("span", { class: "alert__time" }, this.timestamp)), this.dismissible && (h("button", { class: "alert__close", onClick: this.dismiss, "aria-label": "Dismiss" }, h("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }))))));
31
+ }
32
+ static get is() { return "luster-alert"; }
33
+ static get encapsulation() { return "shadow"; }
34
+ static get originalStyleUrls() {
35
+ return {
36
+ "$": ["luster-alert.css"]
37
+ };
38
+ }
39
+ static get styleUrls() {
40
+ return {
41
+ "$": ["luster-alert.css"]
42
+ };
43
+ }
44
+ static get properties() {
45
+ return {
46
+ "heading": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "getter": false,
61
+ "setter": false,
62
+ "reflect": false,
63
+ "attribute": "heading",
64
+ "defaultValue": "''"
65
+ },
66
+ "message": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "getter": false,
81
+ "setter": false,
82
+ "reflect": false,
83
+ "attribute": "message",
84
+ "defaultValue": "''"
85
+ },
86
+ "variant": {
87
+ "type": "string",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "'info' | 'success' | 'warning' | 'error'",
91
+ "resolved": "\"error\" | \"info\" | \"success\" | \"warning\"",
92
+ "references": {}
93
+ },
94
+ "required": false,
95
+ "optional": false,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": ""
99
+ },
100
+ "getter": false,
101
+ "setter": false,
102
+ "reflect": false,
103
+ "attribute": "variant",
104
+ "defaultValue": "'info'"
105
+ },
106
+ "dismissible": {
107
+ "type": "boolean",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "boolean",
111
+ "resolved": "boolean",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": false,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": ""
119
+ },
120
+ "getter": false,
121
+ "setter": false,
122
+ "reflect": false,
123
+ "attribute": "dismissible",
124
+ "defaultValue": "true"
125
+ },
126
+ "timestamp": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "getter": false,
141
+ "setter": false,
142
+ "reflect": false,
143
+ "attribute": "timestamp",
144
+ "defaultValue": "''"
145
+ }
146
+ };
147
+ }
148
+ static get states() {
149
+ return {
150
+ "visible": {}
151
+ };
152
+ }
153
+ static get events() {
154
+ return [{
155
+ "method": "dcDismiss",
156
+ "name": "dcDismiss",
157
+ "bubbles": true,
158
+ "cancelable": true,
159
+ "composed": true,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": ""
163
+ },
164
+ "complexType": {
165
+ "original": "void",
166
+ "resolved": "void",
167
+ "references": {}
168
+ }
169
+ }];
170
+ }
171
+ }
@@ -0,0 +1,82 @@
1
+ import { html } from "lit";
2
+ const meta = {
3
+ title: 'Navigation/Alert',
4
+ tags: ['autodocs'],
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Mensagem de feedback contextual. Props: `heading`, `message`, `variant`, `dismissible`, `timestamp`.',
9
+ },
10
+ },
11
+ },
12
+ argTypes: {
13
+ variant: {
14
+ control: 'select',
15
+ options: ['info', 'success', 'warning', 'error'],
16
+ description: 'Tipo de alerta',
17
+ table: { defaultValue: { summary: 'info' } },
18
+ },
19
+ heading: { control: 'text', description: 'Título do alerta' },
20
+ message: { control: 'text', description: 'Corpo da mensagem' },
21
+ dismissible: {
22
+ control: 'boolean',
23
+ description: 'Exibe botão para fechar',
24
+ table: { defaultValue: { summary: 'true' } },
25
+ },
26
+ timestamp: { control: 'text', description: 'Timestamp exibido no rodapé' },
27
+ },
28
+ args: {
29
+ variant: 'info',
30
+ heading: 'Heads up',
31
+ message: 'This is an informational message.',
32
+ dismissible: true,
33
+ timestamp: '',
34
+ },
35
+ };
36
+ export default meta;
37
+ const render = (args) => html `
38
+ <luster-alert
39
+ variant="${args.variant}"
40
+ heading="${args.heading}"
41
+ message="${args.message}"
42
+ ?dismissible="${args.dismissible}"
43
+ timestamp="${args.timestamp}"
44
+ ></luster-alert>
45
+ `;
46
+ export const Info = {
47
+ args: { variant: 'info', heading: 'Information', message: 'Your changes have been saved to draft.' },
48
+ render,
49
+ };
50
+ export const Success = {
51
+ args: { variant: 'success', heading: 'Published!', message: 'The article is now live on the platform.' },
52
+ render,
53
+ };
54
+ export const Warning = {
55
+ args: { variant: 'warning', heading: 'Review needed', message: 'Some references could not be verified.' },
56
+ render,
57
+ };
58
+ export const Error = {
59
+ args: { variant: 'error', heading: 'Upload failed', message: 'The file exceeds the 10 MB limit.' },
60
+ render,
61
+ };
62
+ export const WithTimestamp = {
63
+ name: 'With Timestamp',
64
+ args: {
65
+ variant: 'info',
66
+ heading: 'Scheduled',
67
+ message: 'Publication is queued for the next release window.',
68
+ timestamp: 'Today at 14:30',
69
+ },
70
+ render,
71
+ };
72
+ export const AllVariants = {
73
+ name: 'All Variants',
74
+ render: () => html `
75
+ <div style="display:flex;flex-direction:column;gap:0.75rem;width:480px;">
76
+ <luster-alert variant="info" heading="Info" message="Informational feedback message."></luster-alert>
77
+ <luster-alert variant="success" heading="Success" message="Operation completed successfully."></luster-alert>
78
+ <luster-alert variant="warning" heading="Warning" message="Please review before continuing."></luster-alert>
79
+ <luster-alert variant="error" heading="Error" message="Something went wrong. Try again."></luster-alert>
80
+ </div>
81
+ `,
82
+ };