@nuralyui/button 0.0.10 → 0.0.12

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 (47) hide show
  1. package/demo/{hy-buttons-demo.d.ts → nr-buttons-demo.d.ts} +3 -3
  2. package/demo/nr-buttons-demo.d.ts.map +1 -0
  3. package/demo/nr-buttons-demo.js +211 -0
  4. package/demo/nr-buttons-demo.js.map +1 -0
  5. package/index.d.ts +1 -1
  6. package/index.js +1 -1
  7. package/index.js.map +1 -1
  8. package/nr-button.component.d.ts +36 -0
  9. package/nr-button.component.d.ts.map +1 -0
  10. package/{hy-button.component.js → nr-button.component.js} +45 -19
  11. package/nr-button.component.js.map +1 -0
  12. package/nr-button.style.d.ts +19 -0
  13. package/nr-button.style.d.ts.map +1 -0
  14. package/{hy-button.style.js → nr-button.style.js} +182 -111
  15. package/nr-button.style.js.map +1 -0
  16. package/nr-button.style.variables.d.ts +11 -0
  17. package/nr-button.style.variables.d.ts.map +1 -0
  18. package/nr-button.style.variables.js +194 -0
  19. package/nr-button.style.variables.js.map +1 -0
  20. package/{hy-button.constants.d.ts → nr-button.types.d.ts} +2 -2
  21. package/nr-button.types.d.ts.map +1 -0
  22. package/nr-button.types.js +2 -0
  23. package/nr-button.types.js.map +1 -0
  24. package/package.json +11 -3
  25. package/react.d.ts +2 -2
  26. package/react.d.ts.map +1 -1
  27. package/react.js +4 -4
  28. package/react.js.map +1 -1
  29. package/test/nr-button_test.d.ts +2 -0
  30. package/test/nr-button_test.d.ts.map +1 -0
  31. package/test/{hy-button_test.js → nr-button_test.js} +15 -15
  32. package/test/nr-button_test.js.map +1 -0
  33. package/demo/hy-buttons-demo.d.ts.map +0 -1
  34. package/demo/hy-buttons-demo.js +0 -211
  35. package/demo/hy-buttons-demo.js.map +0 -1
  36. package/hy-button.component.d.ts +0 -21
  37. package/hy-button.component.d.ts.map +0 -1
  38. package/hy-button.component.js.map +0 -1
  39. package/hy-button.constants.d.ts.map +0 -1
  40. package/hy-button.constants.js +0 -2
  41. package/hy-button.constants.js.map +0 -1
  42. package/hy-button.style.d.ts +0 -2
  43. package/hy-button.style.d.ts.map +0 -1
  44. package/hy-button.style.js.map +0 -1
  45. package/test/hy-button_test.d.ts +0 -2
  46. package/test/hy-button_test.d.ts.map +0 -1
  47. package/test/hy-button_test.js.map +0 -1
@@ -0,0 +1,194 @@
1
+ import { css } from 'lit';
2
+ /**
3
+ * Button component CSS custom properties (design tokens)
4
+ *
5
+ * This file contains all the CSS custom properties used by the nr-button component,
6
+ * organized by functionality and including both light and dark theme variants.
7
+ *
8
+ * The styling system uses CSS custom properties with fallbacks to allow
9
+ * for both global and local customization of button appearance.
10
+ */
11
+ export const buttonVariables = css `
12
+ :host {
13
+ /* ----------------------------------------
14
+ * DEFAULT BUTTON STYLES
15
+ * ---------------------------------------- */
16
+ --hybrid-button-local-border-top: 2px solid #d0d0d0;
17
+ --hybrid-button-local-border-bottom: 2px solid #d0d0d0;
18
+ --hybrid-button-local-border-left: 2px solid #d0d0d0;
19
+ --hybrid-button-local-border-right: 2px solid #d0d0d0;
20
+ --hybrid-button-local-border-top-left-radius: 0px;
21
+ --hybrid-button-local-border-top-right-radius: 0px;
22
+ --hybrid-button-local-border-bottom-left-radius: 0px;
23
+ --hybrid-button-local-border-bottom-right-radius: 0px;
24
+ --hybrid-button-local-background-color: #f9f9f9;
25
+ --hybrid-button-local-text-color: #393939;
26
+ --hybrid-button-local-hover-border-color: #1677ff;
27
+ --hybrid-button-local-hover-color: #1677ff;
28
+ --hybrid-button-local-font-size: 0.9rem;
29
+ --hybrid-button-local-font-weight: normal;
30
+ --hybrid-button-local-text-transform: none;
31
+ --hybrid-button-local-active-border-color: #1661b1;
32
+ --hybrid-button-local-active-color: #184d86;
33
+ --hybrid-button-local-disabled-background-color: #c6c6c6;
34
+ --hybrid-button-local-disabled-text-color: #8d8d8d;
35
+ --hybrid-button-local-disabled-border-color: #bbb;
36
+ --hybrid-button-local-height: auto;
37
+ --hybrid-button-local-width: auto;
38
+ --hybrid-button-local-padding-y: 0.5rem;
39
+ --hybrid-button-local-padding-x: 0.6rem;
40
+ --hybrid-button-local-icon-width: 18px;
41
+ --hybrid-button-local-icon-height: 14px;
42
+
43
+ /* ----------------------------------------
44
+ * PRIMARY BUTTON STYLES
45
+ * ---------------------------------------- */
46
+ --hybrid-button-local-primary-border-color: #0f62fe;
47
+ --hybrid-button-local-primary-background-color: #0f62fe;
48
+ --hybrid-button-local-primary-text-color: #ffffff;
49
+ --hybrid-button-local-primary-outline: 1px solid white;
50
+ --hybrid-button-local-primary-outline-offset: -3px;
51
+ --hybrid-button-local-primary-hover-background-color: #0353e9;
52
+ --hybrid-button-local-primary-hover-border-color: #0353e9;
53
+ --hybrid-button-local-primary-active-background-color: #0f62fe;
54
+ --hybrid-button-local-primary-active-border-color: #0f62fe;
55
+ --hybrid-button-local-primary-disabled-text-color: #8d8d8d;
56
+ --hybrid-button-local-primary-disabled-background-color: #c6c6c6;
57
+ --hybrid-button-local-primary-disabled-border-color: #c6c6c6;
58
+ --hybrid-button-local-primary-dashed-border-color: #ffffff;
59
+
60
+ /* ----------------------------------------
61
+ * DANGER BUTTON STYLES
62
+ * ---------------------------------------- */
63
+ --hybrid-button-local-danger-background-color: #da1e28;
64
+ --hybrid-button-local-danger-text-color: #ffffff;
65
+ --hybrid-button-local-danger-border-color: #da1e28;
66
+ --hybrid-button-local-danger-outline: 1px solid white;
67
+ --hybrid-button-local-danger-outline-offset: -3px;
68
+ --hybrid-button-local-danger-hover-background-color: #ba1b23;
69
+ --hybrid-button-local-danger-hover-border-color: #ba1b23;
70
+ --hybrid-button-local-danger-active-background-color: #da1e28;
71
+ --hybrid-button-local-danger-active-border-color: #0f62fe;
72
+ --hybrid-button-local-danger-disabled-background-color: #c6c6c6;
73
+ --hybrid-button-local-danger-disabled-text-color: #8d8d8d;
74
+ --hybrid-button-local-danger-disabled-border-color: #c6c6c6;
75
+ --hybrid-button-local-danger-dashed-border-color: #ffffff;
76
+
77
+ /* ----------------------------------------
78
+ * GHOST BUTTON STYLES
79
+ * ---------------------------------------- */
80
+ --hybrid-button-local-ghost-background-color: #ffffff;
81
+ --hybrid-button-local-ghost-text-color: #0f62fe;
82
+ --hybrid-button-local-ghost-border-color: #ffffff;
83
+ --hybrid-button-local-ghost-active-background-color: #ffffff;
84
+ --hybrid-button-local-ghost-active-text-color: #054ada;
85
+ --hybrid-button-local-ghost-active-border-color: #0f62fe;
86
+ --hybrid-button-local-ghost-hover-background-color: #e5e5e5;
87
+ --hybrid-button-local-ghost-hover-border-color: #e5e5e5;
88
+ --hybrid-button-local-ghost-hover-text-color: #054ada;
89
+ --hybrid-button-local-ghost-disabled-background-color: #ffffff;
90
+ --hybrid-button-local-ghost-disabled-text-color: #c6c6c6;
91
+ --hybrid-button-local-ghost-disabled-border-color: #ffffff;
92
+ --hybrid-button-local-ghost-dashed-border-color: #c6c6c6;
93
+
94
+ /* ----------------------------------------
95
+ * SECONDARY BUTTON STYLES
96
+ * ---------------------------------------- */
97
+ --hybrid-button-local-secondary-background-color: #393939;
98
+ --hybrid-button-local-secondary-border-color: #393939;
99
+ --hybrid-button-local-secondary-text-color: #ffffff;
100
+ --hybrid-button-local-secondary-outline: 1px solid white;
101
+ --hybrid-button-local-secondary-outline-offset: -3px;
102
+ --hybrid-button-local-secondary-hover-background-color: #4c4c4c;
103
+ --hybrid-button-local-secondary-hover-border-color: #4c4c4c;
104
+ --hybrid-button-local-secondary-active-background-color: #393939;
105
+ --hybrid-button-local-secondary-active-border-color: #0f62fe;
106
+ --hybrid-button-local-secondary-disabled-background-color: #c6c6c6;
107
+ --hybrid-button-local-secondary-disabled-text-color: #8d8d8d;
108
+ --hybrid-button-local-secondary-disabled-border-color: #c6c6c6;
109
+ --hybrid-button-local-secondary-dashed-border-color: #ffffff;
110
+
111
+ /* ----------------------------------------
112
+ * SIZE VARIANTS
113
+ * ---------------------------------------- */
114
+ /* Large button sizing */
115
+ --hybrid-large-button-local-padding-y: 0.5rem;
116
+ --hybrid-large-button-local-padding-x: 0.9rem;
117
+ --hybrid-large-button-local-font-size: 1rem;
118
+
119
+ /* Small button sizing */
120
+ --hybrid-small-button-local-padding-y: 0.5rem;
121
+ --hybrid-small-button-local-padding-x: 0.4rem;
122
+ --hybrid-small-button-local-font-size: 0.7rem;
123
+ }
124
+
125
+ /* ========================================
126
+ * DARK THEME OVERRIDES
127
+ * ======================================== */
128
+
129
+ /**
130
+ * Dark theme styles using data-theme attribute on button element
131
+ * These override the light theme defaults when data-theme="dark" is applied
132
+ */
133
+ button[data-theme="dark"] {
134
+ /* Default button dark theme overrides */
135
+ --hybrid-button-local-background-color: #000000;
136
+ --hybrid-button-local-text-color: #ffffff;
137
+ --hybrid-button-local-hover-border-color: #6f6f6f;
138
+ --hybrid-button-local-hover-color: #6f6f6f;
139
+ --hybrid-button-local-active-border-color: #c6c6c6;
140
+ --hybrid-button-local-active-color: #c6c6c6;
141
+ --hybrid-button-local-disabled-background-color: #c6c6c6;
142
+
143
+ /* Primary button dark theme overrides */
144
+ --hybrid-button-local-primary-outline: 1px solid black;
145
+ --hybrid-button-local-primary-outline-offset: -3px;
146
+ --hybrid-button-local-primary-active-border-color: #ffffff;
147
+ --hybrid-button-local-primary-disabled-text-color: #c6c6c6;
148
+ --hybrid-button-local-primary-disabled-background-color: #8d8d8d;
149
+ --hybrid-button-local-primary-disabled-border-color: #8d8d8d;
150
+
151
+ /* Secondary button dark theme overrides */
152
+ --hybrid-button-local-secondary-background-color: #6f6f6f;
153
+ --hybrid-button-local-secondary-border-color: #6f6f6f;
154
+ --hybrid-button-local-secondary-text-color: #ffffff;
155
+ --hybrid-button-local-secondary-active-border-color: #ffffff;
156
+ --hybrid-button-local-secondary-active-background-color: #6f6f6f;
157
+ --hybrid-button-local-secondary-outline: 1px solid black;
158
+ --hybrid-button-local-secondary-outline-offset: -3px;
159
+ --hybrid-button-local-secondary-hover-background-color: #606060;
160
+ --hybrid-button-local-secondary-hover-border-color: #606060;
161
+ --hybrid-button-local-secondary-disabled-background-color: #6f6f6f;
162
+ --hybrid-button-local-secondary-disabled-text-color: #8d8d8d;
163
+ --hybrid-button-local-secondary-disabled-border-color: #6f6f6f;
164
+ --hybrid-button-local-secondary-dashed-border-color: #ffffff;
165
+
166
+ /* Ghost button dark theme overrides */
167
+ --hybrid-button-local-ghost-background-color: transparent;
168
+ --hybrid-button-local-ghost-text-color: #78a9ff;
169
+ --hybrid-button-local-ghost-border-color: transparent;
170
+ --hybrid-button-local-ghost-active-background-color: transparent;
171
+ --hybrid-button-local-ghost-active-text-color: #a6c8ff;
172
+ --hybrid-button-local-ghost-active-border-color: #ffffff;
173
+ --hybrid-button-local-ghost-hover-background-color: #4c4c4c;
174
+ --hybrid-button-local-ghost-hover-border-color: #4c4c4c;
175
+ --hybrid-button-local-ghost-hover-text-color: #a6c8ff;
176
+ --hybrid-button-local-ghost-disabled-background-color: transparent;
177
+ --hybrid-button-local-ghost-disabled-text-color: #6f6f6f;
178
+ --hybrid-button-local-ghost-disabled-border-color: transparent;
179
+ --hybrid-button-local-ghost-dashed-border-color: #c6c6c6;
180
+
181
+ /* Danger button dark theme overrides */
182
+ --hybrid-button-local-danger-outline: 1px solid #000000;
183
+ --hybrid-button-local-danger-outline-offset: -3px;
184
+ --hybrid-button-local-danger-hover-background-color: #ba1b23;
185
+ --hybrid-button-local-danger-hover-border-color: #ba1b23;
186
+ --hybrid-button-local-danger-active-background-color: #da1e28;
187
+ --hybrid-button-local-danger-active-border-color: #ffffff;
188
+ --hybrid-button-local-danger-disabled-background-color: #6f6f6f;
189
+ --hybrid-button-local-danger-disabled-text-color: #8d8d8d;
190
+ --hybrid-button-local-danger-disabled-border-color: #6f6f6f;
191
+ --hybrid-button-local-danger-dashed-border-color: #ffffff;
192
+ }
193
+ `;
194
+ //# sourceMappingURL=nr-button.style.variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nr-button.style.variables.js","sourceRoot":"","sources":["../../../src/components/button/nr-button.style.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsLjC,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * Button component CSS custom properties (design tokens)\n * \n * This file contains all the CSS custom properties used by the nr-button component,\n * organized by functionality and including both light and dark theme variants.\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of button appearance.\n */\nexport const buttonVariables = css`\n :host {\n /* ----------------------------------------\n * DEFAULT BUTTON STYLES\n * ---------------------------------------- */\n --hybrid-button-local-border-top: 2px solid #d0d0d0;\n --hybrid-button-local-border-bottom: 2px solid #d0d0d0;\n --hybrid-button-local-border-left: 2px solid #d0d0d0;\n --hybrid-button-local-border-right: 2px solid #d0d0d0;\n --hybrid-button-local-border-top-left-radius: 0px;\n --hybrid-button-local-border-top-right-radius: 0px;\n --hybrid-button-local-border-bottom-left-radius: 0px;\n --hybrid-button-local-border-bottom-right-radius: 0px;\n --hybrid-button-local-background-color: #f9f9f9;\n --hybrid-button-local-text-color: #393939;\n --hybrid-button-local-hover-border-color: #1677ff;\n --hybrid-button-local-hover-color: #1677ff;\n --hybrid-button-local-font-size: 0.9rem;\n --hybrid-button-local-font-weight: normal;\n --hybrid-button-local-text-transform: none;\n --hybrid-button-local-active-border-color: #1661b1;\n --hybrid-button-local-active-color: #184d86;\n --hybrid-button-local-disabled-background-color: #c6c6c6;\n --hybrid-button-local-disabled-text-color: #8d8d8d;\n --hybrid-button-local-disabled-border-color: #bbb;\n --hybrid-button-local-height: auto;\n --hybrid-button-local-width: auto;\n --hybrid-button-local-padding-y: 0.5rem;\n --hybrid-button-local-padding-x: 0.6rem;\n --hybrid-button-local-icon-width: 18px;\n --hybrid-button-local-icon-height: 14px;\n\n /* ----------------------------------------\n * PRIMARY BUTTON STYLES\n * ---------------------------------------- */\n --hybrid-button-local-primary-border-color: #0f62fe;\n --hybrid-button-local-primary-background-color: #0f62fe;\n --hybrid-button-local-primary-text-color: #ffffff;\n --hybrid-button-local-primary-outline: 1px solid white;\n --hybrid-button-local-primary-outline-offset: -3px;\n --hybrid-button-local-primary-hover-background-color: #0353e9;\n --hybrid-button-local-primary-hover-border-color: #0353e9;\n --hybrid-button-local-primary-active-background-color: #0f62fe;\n --hybrid-button-local-primary-active-border-color: #0f62fe;\n --hybrid-button-local-primary-disabled-text-color: #8d8d8d;\n --hybrid-button-local-primary-disabled-background-color: #c6c6c6;\n --hybrid-button-local-primary-disabled-border-color: #c6c6c6;\n --hybrid-button-local-primary-dashed-border-color: #ffffff;\n\n /* ----------------------------------------\n * DANGER BUTTON STYLES\n * ---------------------------------------- */\n --hybrid-button-local-danger-background-color: #da1e28;\n --hybrid-button-local-danger-text-color: #ffffff;\n --hybrid-button-local-danger-border-color: #da1e28;\n --hybrid-button-local-danger-outline: 1px solid white;\n --hybrid-button-local-danger-outline-offset: -3px;\n --hybrid-button-local-danger-hover-background-color: #ba1b23;\n --hybrid-button-local-danger-hover-border-color: #ba1b23;\n --hybrid-button-local-danger-active-background-color: #da1e28;\n --hybrid-button-local-danger-active-border-color: #0f62fe;\n --hybrid-button-local-danger-disabled-background-color: #c6c6c6;\n --hybrid-button-local-danger-disabled-text-color: #8d8d8d;\n --hybrid-button-local-danger-disabled-border-color: #c6c6c6;\n --hybrid-button-local-danger-dashed-border-color: #ffffff;\n\n /* ----------------------------------------\n * GHOST BUTTON STYLES\n * ---------------------------------------- */\n --hybrid-button-local-ghost-background-color: #ffffff;\n --hybrid-button-local-ghost-text-color: #0f62fe;\n --hybrid-button-local-ghost-border-color: #ffffff;\n --hybrid-button-local-ghost-active-background-color: #ffffff;\n --hybrid-button-local-ghost-active-text-color: #054ada;\n --hybrid-button-local-ghost-active-border-color: #0f62fe;\n --hybrid-button-local-ghost-hover-background-color: #e5e5e5;\n --hybrid-button-local-ghost-hover-border-color: #e5e5e5;\n --hybrid-button-local-ghost-hover-text-color: #054ada;\n --hybrid-button-local-ghost-disabled-background-color: #ffffff;\n --hybrid-button-local-ghost-disabled-text-color: #c6c6c6;\n --hybrid-button-local-ghost-disabled-border-color: #ffffff;\n --hybrid-button-local-ghost-dashed-border-color: #c6c6c6;\n\n /* ----------------------------------------\n * SECONDARY BUTTON STYLES\n * ---------------------------------------- */\n --hybrid-button-local-secondary-background-color: #393939;\n --hybrid-button-local-secondary-border-color: #393939;\n --hybrid-button-local-secondary-text-color: #ffffff;\n --hybrid-button-local-secondary-outline: 1px solid white;\n --hybrid-button-local-secondary-outline-offset: -3px;\n --hybrid-button-local-secondary-hover-background-color: #4c4c4c;\n --hybrid-button-local-secondary-hover-border-color: #4c4c4c;\n --hybrid-button-local-secondary-active-background-color: #393939;\n --hybrid-button-local-secondary-active-border-color: #0f62fe;\n --hybrid-button-local-secondary-disabled-background-color: #c6c6c6;\n --hybrid-button-local-secondary-disabled-text-color: #8d8d8d;\n --hybrid-button-local-secondary-disabled-border-color: #c6c6c6;\n --hybrid-button-local-secondary-dashed-border-color: #ffffff;\n\n /* ----------------------------------------\n * SIZE VARIANTS\n * ---------------------------------------- */\n /* Large button sizing */\n --hybrid-large-button-local-padding-y: 0.5rem;\n --hybrid-large-button-local-padding-x: 0.9rem;\n --hybrid-large-button-local-font-size: 1rem;\n\n /* Small button sizing */\n --hybrid-small-button-local-padding-y: 0.5rem;\n --hybrid-small-button-local-padding-x: 0.4rem;\n --hybrid-small-button-local-font-size: 0.7rem;\n }\n\n /* ========================================\n * DARK THEME OVERRIDES\n * ======================================== */\n \n /**\n * Dark theme styles using data-theme attribute on button element\n * These override the light theme defaults when data-theme=\"dark\" is applied\n */\n button[data-theme=\"dark\"] {\n /* Default button dark theme overrides */\n --hybrid-button-local-background-color: #000000;\n --hybrid-button-local-text-color: #ffffff;\n --hybrid-button-local-hover-border-color: #6f6f6f;\n --hybrid-button-local-hover-color: #6f6f6f;\n --hybrid-button-local-active-border-color: #c6c6c6;\n --hybrid-button-local-active-color: #c6c6c6;\n --hybrid-button-local-disabled-background-color: #c6c6c6;\n\n /* Primary button dark theme overrides */\n --hybrid-button-local-primary-outline: 1px solid black;\n --hybrid-button-local-primary-outline-offset: -3px;\n --hybrid-button-local-primary-active-border-color: #ffffff;\n --hybrid-button-local-primary-disabled-text-color: #c6c6c6;\n --hybrid-button-local-primary-disabled-background-color: #8d8d8d;\n --hybrid-button-local-primary-disabled-border-color: #8d8d8d;\n\n /* Secondary button dark theme overrides */\n --hybrid-button-local-secondary-background-color: #6f6f6f;\n --hybrid-button-local-secondary-border-color: #6f6f6f;\n --hybrid-button-local-secondary-text-color: #ffffff;\n --hybrid-button-local-secondary-active-border-color: #ffffff;\n --hybrid-button-local-secondary-active-background-color: #6f6f6f;\n --hybrid-button-local-secondary-outline: 1px solid black;\n --hybrid-button-local-secondary-outline-offset: -3px;\n --hybrid-button-local-secondary-hover-background-color: #606060;\n --hybrid-button-local-secondary-hover-border-color: #606060;\n --hybrid-button-local-secondary-disabled-background-color: #6f6f6f;\n --hybrid-button-local-secondary-disabled-text-color: #8d8d8d;\n --hybrid-button-local-secondary-disabled-border-color: #6f6f6f;\n --hybrid-button-local-secondary-dashed-border-color: #ffffff;\n\n /* Ghost button dark theme overrides */\n --hybrid-button-local-ghost-background-color: transparent;\n --hybrid-button-local-ghost-text-color: #78a9ff;\n --hybrid-button-local-ghost-border-color: transparent;\n --hybrid-button-local-ghost-active-background-color: transparent;\n --hybrid-button-local-ghost-active-text-color: #a6c8ff;\n --hybrid-button-local-ghost-active-border-color: #ffffff;\n --hybrid-button-local-ghost-hover-background-color: #4c4c4c;\n --hybrid-button-local-ghost-hover-border-color: #4c4c4c;\n --hybrid-button-local-ghost-hover-text-color: #a6c8ff;\n --hybrid-button-local-ghost-disabled-background-color: transparent;\n --hybrid-button-local-ghost-disabled-text-color: #6f6f6f;\n --hybrid-button-local-ghost-disabled-border-color: transparent;\n --hybrid-button-local-ghost-dashed-border-color: #c6c6c6;\n\n /* Danger button dark theme overrides */\n --hybrid-button-local-danger-outline: 1px solid #000000;\n --hybrid-button-local-danger-outline-offset: -3px;\n --hybrid-button-local-danger-hover-background-color: #ba1b23;\n --hybrid-button-local-danger-hover-border-color: #ba1b23;\n --hybrid-button-local-danger-active-background-color: #da1e28;\n --hybrid-button-local-danger-active-border-color: #ffffff;\n --hybrid-button-local-danger-disabled-background-color: #6f6f6f;\n --hybrid-button-local-danger-disabled-text-color: #8d8d8d;\n --hybrid-button-local-danger-disabled-border-color: #6f6f6f;\n --hybrid-button-local-danger-dashed-border-color: #ffffff;\n }\n`;\n"]}
@@ -8,11 +8,11 @@ export declare const enum ButtonType {
8
8
  export declare const enum ButtonSize {
9
9
  Small = "small",
10
10
  Default = "default",
11
- Large = "Large"
11
+ Large = "large"
12
12
  }
13
13
  export declare const enum IconPosition {
14
14
  Left = "left",
15
15
  Right = "right"
16
16
  }
17
17
  export declare const EMPTY_STRING = "";
18
- //# sourceMappingURL=hy-button.constants.d.ts.map
18
+ //# sourceMappingURL=nr-button.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nr-button.types.d.ts","sourceRoot":"","sources":["../../../src/components/button/nr-button.types.ts"],"names":[],"mappings":"AAAA,0BAAkB,UAAU;IAC1B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,0BAAkB,UAAU;IAC1B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,0BAAkB,YAAY;IAC5B,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AACD,eAAO,MAAM,YAAY,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const EMPTY_STRING = '';
2
+ //# sourceMappingURL=nr-button.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nr-button.types.js","sourceRoot":"","sources":["../../../src/components/button/nr-button.types.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC","sourcesContent":["export const enum ButtonType {\n Primary = 'primary',\n Secondary = 'secondary',\n Danger = 'danger',\n Ghost = 'ghost',\n Default = 'default',\n}\n\nexport const enum ButtonSize {\n Small = 'small',\n Default = 'default',\n Large = 'large',\n}\n\nexport const enum IconPosition {\n Left = 'left',\n Right = 'right',\n}\nexport const EMPTY_STRING = '';\n"]}
package/package.json CHANGED
@@ -1,12 +1,20 @@
1
1
  {
2
2
  "name": "@nuralyui/button",
3
- "version": "0.0.10",
4
- "description": "",
3
+ "version": "0.0.12",
4
+ "description": "Button component for NuralyUI library",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
10
  "author": "Labidi Aymen",
11
- "license": "ISC"
11
+ "license": "ISC",
12
+ "nuralyui": {
13
+ "requiredComponents": [
14
+ "hy-icon"
15
+ ]
16
+ },
17
+ "peerDependencies": {
18
+ "@nuralyui/icon": "^0.0.1"
19
+ }
12
20
  }
package/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { HyButtonElement } from './hy-button.component.js';
2
- export declare const HyButton: import("@lit-labs/react").ReactWebComponent<HyButtonElement, {
1
+ import { NrButtonElement } from './nr-button.component.js';
2
+ export declare const NrButton: import("@lit-labs/react").ReactWebComponent<NrButtonElement, {
3
3
  click: string;
4
4
  }>;
5
5
  //# sourceMappingURL=react.d.ts.map
package/react.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/button/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,eAAO,MAAM,QAAQ;;EAOnB,CAAC"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/button/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,eAAO,MAAM,QAAQ;;EAOnB,CAAC"}
package/react.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { createComponent } from '@lit-labs/react';
2
2
  import * as React from 'react';
3
- import { HyButtonElement } from './hy-button.component.js';
4
- export const HyButton = createComponent({
5
- tagName: 'hy-button',
6
- elementClass: HyButtonElement,
3
+ import { NrButtonElement } from './nr-button.component.js';
4
+ export const NrButton = createComponent({
5
+ tagName: 'nr-button',
6
+ elementClass: NrButtonElement,
7
7
  react: React,
8
8
  events: {
9
9
  click: 'click',
package/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/button/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,OAAO,EAAE,WAAW;IACpB,YAAY,EAAE,eAAe;IAC7B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC","sourcesContent":["import {createComponent} from '@lit-labs/react';\nimport * as React from 'react';\nimport {HyButtonElement} from './hy-button.component.js';\nexport const HyButton = createComponent({\n tagName: 'hy-button',\n elementClass: HyButtonElement,\n react: React,\n events: {\n click: 'click',\n },\n});\n"]}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/button/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,OAAO,EAAE,WAAW;IACpB,YAAY,EAAE,eAAe;IAC7B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\nimport { NrButtonElement } from './nr-button.component.js';\nexport const NrButton = createComponent({\n tagName: 'nr-button',\n elementClass: NrButtonElement,\n react: React,\n events: {\n click: 'click',\n },\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import '../nr-button.component';
2
+ //# sourceMappingURL=nr-button_test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nr-button_test.d.ts","sourceRoot":"","sources":["../../../../src/components/button/test/nr-button_test.ts"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAC"}
@@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { html, fixture, expect } from '@open-wc/testing';
11
- import { EMPTY_STRING } from '../hy-button.constants.js';
12
- import '../hy-button.component';
13
- suite('HyButtonElement', () => {
11
+ import { EMPTY_STRING } from '../nr-button.types.js';
12
+ import '../nr-button.component';
13
+ suite('NrButtonElement', () => {
14
14
  test('has default properties', () => __awaiter(void 0, void 0, void 0, function* () {
15
- const el = yield fixture(html `<hy-button></hy-button>`);
15
+ const el = yield fixture(html `<nr-button></nr-button>`);
16
16
  const button = el.shadowRoot.querySelector('button');
17
17
  const icon = el.shadowRoot.querySelector('hy-icon');
18
18
  expect(el.disabled).to.be.false;
@@ -30,13 +30,13 @@ suite('HyButtonElement', () => {
30
30
  }));
31
31
  test('has a label', () => __awaiter(void 0, void 0, void 0, function* () {
32
32
  const buttonLabel = 'Test content';
33
- const el = yield fixture(html `<hy-button>${buttonLabel}</hy-button>`);
33
+ const el = yield fixture(html `<nr-button>${buttonLabel}</nr-button>`);
34
34
  const slot = el.shadowRoot.querySelector('slot');
35
35
  const assignedNode = slot.assignedNodes();
36
36
  expect(assignedNode[0].textContent).to.equal(buttonLabel);
37
37
  }));
38
38
  test('fires onClick event when clicked', () => __awaiter(void 0, void 0, void 0, function* () {
39
- const el = yield fixture(html `<hy-button></hy-button>`);
39
+ const el = yield fixture(html `<nr-button></nr-button>`);
40
40
  const button = el.shadowRoot.querySelector('button');
41
41
  let eventFired = false;
42
42
  el.addEventListener('click', () => {
@@ -46,12 +46,12 @@ suite('HyButtonElement', () => {
46
46
  expect(eventFired).to.be.true;
47
47
  }));
48
48
  test('has a disabled property on the button element', () => __awaiter(void 0, void 0, void 0, function* () {
49
- const el = yield fixture(html `<hy-button disabled></hy-button>`);
49
+ const el = yield fixture(html `<nr-button disabled></nr-button>`);
50
50
  const button = el.shadowRoot.querySelector('button');
51
51
  expect(button.disabled).to.be.true;
52
52
  }));
53
53
  test('does not fire onClick event when disabled', () => __awaiter(void 0, void 0, void 0, function* () {
54
- const el = yield fixture(html `<hy-button disabled></hy-button>`);
54
+ const el = yield fixture(html `<nr-button disabled></nr-button>`);
55
55
  const button = el.shadowRoot.querySelector('button');
56
56
  let eventFired = false;
57
57
  el.addEventListener('click', () => {
@@ -62,30 +62,30 @@ suite('HyButtonElement', () => {
62
62
  }));
63
63
  test('renders the icon', () => __awaiter(void 0, void 0, void 0, function* () {
64
64
  const iconName = 'sample-icon';
65
- const el = yield fixture(html `<hy-button icon=${iconName}></hy-button>`);
65
+ const el = yield fixture(html `<nr-button icon=${iconName}></nr-button>`);
66
66
  const icon = el.shadowRoot.querySelector('hy-icon');
67
67
  expect(icon).to.exist;
68
68
  expect(icon).to.have.attribute('name', iconName);
69
69
  }));
70
70
  test('applies the correct classe for dashed', () => __awaiter(void 0, void 0, void 0, function* () {
71
- const el = yield fixture(html `<hy-button dashed></hy-button>`);
71
+ const el = yield fixture(html `<nr-button dashed></nr-button>`);
72
72
  const button = el.shadowRoot.querySelector('button');
73
73
  expect(button).to.have.class('button-dashed');
74
74
  }));
75
75
  test('reflects the loading property as data-state on the button element', () => __awaiter(void 0, void 0, void 0, function* () {
76
- const el = yield fixture(html `<hy-button loading></hy-button>`);
76
+ const el = yield fixture(html `<nr-button loading></nr-button>`);
77
77
  const button = el.shadowRoot.querySelector('button');
78
78
  expect(button).to.have.attribute('data-state', 'loading');
79
79
  }));
80
80
  test('reflects the size property as data-size on the button element', () => __awaiter(void 0, void 0, void 0, function* () {
81
- const el = yield fixture(html `<hy-button size=${"Large" /* ButtonSize.Large */}></hy-button>`);
81
+ const el = yield fixture(html `<nr-button size=${"large" /* ButtonSize.Large */}></nr-button>`);
82
82
  const button = el.shadowRoot.querySelector('button');
83
- expect(button).to.have.attribute('data-size', "Large" /* ButtonSize.Large */);
83
+ expect(button).to.have.attribute('data-size', "large" /* ButtonSize.Large */);
84
84
  }));
85
85
  test('reflects the type property as data-type on the button element', () => __awaiter(void 0, void 0, void 0, function* () {
86
- const el = yield fixture(html `<hy-button type=${"primary" /* ButtonType.Primary */}></hy-button>`);
86
+ const el = yield fixture(html `<nr-button type=${"primary" /* ButtonType.Primary */}></nr-button>`);
87
87
  const button = el.shadowRoot.querySelector('button');
88
88
  expect(button).to.have.attribute('data-type', "primary" /* ButtonType.Primary */);
89
89
  }));
90
90
  });
91
- //# sourceMappingURL=hy-button_test.js.map
91
+ //# sourceMappingURL=nr-button_test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nr-button_test.js","sourceRoot":"","sources":["../../../../src/components/button/test/nr-button_test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAA0B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,wBA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C,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, fixture, expect } from '@open-wc/testing';\nimport { NrButtonElement } from '../nr-button.component';\nimport { ButtonSize, ButtonType, EMPTY_STRING } from '../nr-button.types.js';\nimport '../nr-button.component';\n\nsuite('NrButtonElement', () => {\n test('has default properties', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button></nr-button>`);\n const button: HTMLButtonElement = el.shadowRoot!.querySelector('button')!;\n const icon = el.shadowRoot!.querySelector('hy-icon');\n\n expect(el.disabled).to.be.false;\n expect(el.loading).to.be.false;\n expect(el.size).to.equal(EMPTY_STRING);\n expect(el.type).to.equal(ButtonType.Default);\n expect(el.dashed).to.be.false;\n expect(el.icon).to.equal(EMPTY_STRING);\n expect(button).to.not.have.class('button-dashed');\n expect(button).to.not.have.attribute('data-size');\n expect(button).to.not.have.attribute('data-state');\n expect(button).to.have.attribute('data-type', ButtonType.Default);\n expect(button.disabled).to.be.false;\n expect(icon).to.not.exist;\n });\n\n test('has a label', async () => {\n const buttonLabel = 'Test content';\n const el: NrButtonElement = await fixture(html`<nr-button>${buttonLabel}</nr-button>`);\n const slot = el.shadowRoot!.querySelector('slot');\n const assignedNode = slot!.assignedNodes();\n expect(assignedNode[0].textContent).to.equal(buttonLabel);\n });\n test('fires onClick event when clicked', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n let eventFired = false;\n el.addEventListener('click', () => {\n eventFired = true;\n });\n button.click();\n expect(eventFired).to.be.true;\n });\n\n test('has a disabled property on the button element', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button disabled></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n expect(button.disabled).to.be.true;\n });\n test('does not fire onClick event when disabled', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button disabled></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n let eventFired = false;\n el.addEventListener('click', () => {\n eventFired = true;\n });\n button.click();\n expect(eventFired).to.be.false;\n });\n\n test('renders the icon', async () => {\n const iconName = 'sample-icon';\n const el: NrButtonElement = await fixture(html`<nr-button icon=${iconName}></nr-button>`);\n const icon = el.shadowRoot!.querySelector('hy-icon');\n expect(icon).to.exist;\n expect(icon).to.have.attribute('name', iconName);\n });\n\n test('applies the correct classe for dashed', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button dashed></nr-button>`);\n const button = el.shadowRoot!.querySelector('button');\n expect(button).to.have.class('button-dashed');\n });\n test('reflects the loading property as data-state on the button element', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button loading></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n expect(button).to.have.attribute('data-state', 'loading');\n });\n\n test('reflects the size property as data-size on the button element', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button size=${ButtonSize.Large}></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n expect(button).to.have.attribute('data-size', ButtonSize.Large);\n });\n\n test('reflects the type property as data-type on the button element', async () => {\n const el: NrButtonElement = await fixture(html`<nr-button type=${ButtonType.Primary}></nr-button>`);\n const button = el.shadowRoot!.querySelector('button')!;\n expect(button).to.have.attribute('data-type', ButtonType.Primary);\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hy-buttons-demo.d.ts","sourceRoot":"","sources":["../../../../src/components/button/demo/hy-buttons-demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,wBAAwB,CAAC;AAChC,OAAO,+BAA+B,CAAC;AACvC,qBACa,mBAAoB,SAAQ,UAAU;IACxC,MAAM;CA6LhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,mBAAmB,CAAC;KACxC;CACF"}
@@ -1,211 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Google Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
- return c > 3 && r && Object.defineProperty(target, key, r), r;
11
- };
12
- import { LitElement, html } from 'lit';
13
- import { customElement } from 'lit/decorators.js';
14
- import '../hy-button.component';
15
- import '../../../helpers/ThemeHandler';
16
- let ElButtonDemoElement = class ElButtonDemoElement extends LitElement {
17
- render() {
18
- return html `
19
- <theme-handler>
20
- <h1>Sizes</h1>
21
- <br />
22
- <hy-button> Default Button</hy-button>
23
- <hy-button size="small">Small Button</hy-button>
24
- <hy-button size="large">Large Button</hy-button>
25
- <br /><br />
26
- <hy-button .icon="${['search']}"> Default Button</hy-button>
27
- <hy-button .icon="${['search']}" size="small">Small Button</hy-button>
28
- <hy-button .icon="${['search']}" size="large">Large Button</hy-button>
29
-
30
- <br /><br />
31
- <hy-button .icon="${['search']}"></hy-button>
32
- <hy-button .icon="${['search']}" size="small"></hy-button>
33
- <hy-button .icon="${['search']}" size="large"></hy-button>
34
- <br /><br />
35
-
36
- <h1>Types</h1>
37
- <br /><br />
38
-
39
- <table>
40
- <tbody>
41
- <tr>
42
- <td></td>
43
- <td>Primary</td>
44
- <td>Secondary</td>
45
- <td>Ghost</td>
46
- <td>Danger</td>
47
- <td>Default</td>
48
- </tr>
49
- <tr>
50
- <td>Default</td>
51
- <td>
52
- <hy-button type="primary"><span>Primary Button</span></hy-button>
53
- </td>
54
- <td>
55
- <hy-button type="secondary"><span>Secondary Button </span></hy-button>
56
- </td>
57
- <td>
58
- <hy-button type="ghost"> <span>Ghost button</span></hy-button>
59
- </td>
60
- <td>
61
- <hy-button type="danger"><span>Danger Button </span></hy-button>
62
- </td>
63
- <td>
64
- <hy-button><span>Default Button</span></hy-button>
65
- </td>
66
- </tr>
67
- <tr>
68
- <td>Dashed</td>
69
- <td>
70
- <hy-button type="primary" ?dashed=${true}><span>Primary Button text only</span></hy-button>
71
- </td>
72
- <td>
73
- <hy-button type="secondary" ?dashed=${true}><span>Secondary dashed</span></hy-button>
74
- </td>
75
- <td>
76
- <hy-button type="ghost" ?dashed=${true}><span>Ghost dashed</span></hy-button>
77
- </td>
78
- <td>
79
- <hy-button type="danger" ?dashed=${true}><span>Danger dashed</span></hy-button>
80
- </td>
81
- <td>
82
- <hy-button ?dashed=${true}><span>Default dashed</span></hy-button>
83
- </td>
84
- </tr>
85
- <tr>
86
- <td>Loading</td>
87
- <td>
88
- <hy-button type="primary" loading><span>Primary Button loading</span></hy-button>
89
- </td>
90
- <td>
91
- <hy-button type="secondary" loading><span>Secondary button loading </span></hy-button>
92
- </td>
93
- <td>
94
- <hy-button type="ghost" loading><span>Ghost button loading</span></hy-button>
95
- </td>
96
- <td>
97
- <hy-button type="danger" loading><span>Danger button loading</span></hy-button>
98
- </td>
99
- <td>
100
- <hy-button loading><span>Default button loading</span></hy-button>
101
- </td>
102
- </tr>
103
- <tr>
104
- <td>Disabled</td>
105
- <td>
106
- <hy-button type="primary" disabled><span>Primary Button disabled</span></hy-button>
107
- </td>
108
- <td>
109
- <hy-button type="secondary" disabled><span>Secondary Button disabled</span></hy-button>
110
- </td>
111
- <td>
112
- <hy-button type="ghost" disabled> <span>Ghost button disabled</span></hy-button>
113
- </td>
114
- <td>
115
- <hy-button type="danger" disabled><span>Danger Button disabled</span></hy-button>
116
- </td>
117
- <td>
118
- <hy-button disabled><span>Default Button disabled</span></hy-button>
119
- </td>
120
- </tr>
121
- <tr>
122
- <td>Icon with text default: icon left</td>
123
- <td>
124
- <hy-button type="primary" .icon="${['search']}"><span> Primary button icon+text</span></hy-button>
125
- </td>
126
- <td>
127
- <hy-button type="secondary" .icon="${['search']}"><span> Secondary button icon+text</span></hy-button>
128
- </td>
129
- <td>
130
- <hy-button type="ghost" .icon="${['search']}"><span> Ghost button icon+text</span></hy-button>
131
- </td>
132
- <td>
133
- <hy-button type="danger" .icon="${['search']}"><span> Danger button icon+text</span></hy-button>
134
- </td>
135
- <td>
136
- <hy-button .icon="${['search']}"><span> Default button icon+text</span></hy-button>
137
- </td>
138
- </tr>
139
- <tr>
140
- <td>Icon with text: icon right</td>
141
- <td>
142
- <hy-button type="primary" .icon="${['search']}" iconPosition="right"
143
- ><span> Primary button icon+text</span></hy-button
144
- >
145
- </td>
146
- <td>
147
- <hy-button type="secondary" .icon="${['search']}" iconPosition="right"
148
- ><span> Secondary button icon+text</span></hy-button
149
- >
150
- </td>
151
- <td>
152
- <hy-button type="ghost" .icon="${['search']}" iconPosition="right"
153
- ><span> Ghost button icon+text</span></hy-button
154
- >
155
- </td>
156
- <td>
157
- <hy-button type="danger" .icon="${['search']}" iconPosition="right"
158
- ><span> Danger button icon+text</span></hy-button
159
- >
160
- </td>
161
- <td>
162
- <hy-button .icon="${['search']}" iconPosition="right"><span> Default button icon+text</span></hy-button>
163
- </td>
164
- </tr>
165
- <tr>
166
- <td>Icon with text: icon both side</td>
167
- <td>
168
- <hy-button type="primary" .icon="${['search', 'bomb']}" iconPosition="right"
169
- ><span> Primary button icon+text</span></hy-button
170
- >
171
- </td>
172
- <td>
173
- <hy-button type="secondary" .icon="${['search', 'bomb']}" iconPosition="right"
174
- ><span> Secondary button icon+text</span></hy-button
175
- >
176
- </td>
177
- <td>
178
- <hy-button type="ghost" .icon="${['search', 'bomb']}" iconPosition="right"
179
- ><span> Ghost button icon+text</span></hy-button
180
- >
181
- </td>
182
- <td>
183
- <hy-button type="danger" .icon="${['search', 'bomb']}" iconPosition="right"
184
- ><span> Danger button icon+text</span></hy-button
185
- >
186
- </td>
187
- <td>
188
- <hy-button .icon="${['search', 'bomb']}" iconPosition="right"
189
- ><span> Default button icon+text</span></hy-button
190
- >
191
- </td>
192
- </tr>
193
- <tr>
194
- <td>Icon only</td>
195
- <td><hy-button type="primary" .icon="${['search']}"></hy-button></td>
196
- <td><hy-button type="secondary" .icon="${['search']}"></hy-button></td>
197
- <td><hy-button type="ghost" .icon="${['search']}"></hy-button></td>
198
- <td><hy-button type="danger" .icon="${['search']}"></hy-button></td>
199
- <td><hy-button .icon="${['search']}"></hy-button></td>
200
- </tr>
201
- </tbody>
202
- </table>
203
- </theme-handler>
204
- `;
205
- }
206
- };
207
- ElButtonDemoElement = __decorate([
208
- customElement('hy-buttons-demo')
209
- ], ElButtonDemoElement);
210
- export { ElButtonDemoElement };
211
- //# sourceMappingURL=hy-buttons-demo.js.map