@neovici/cosmoz-button 2.1.0 → 2.2.1

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/README.md CHANGED
@@ -90,6 +90,8 @@ import '@neovici/cosmoz-button';
90
90
  | `lg` | 36px | 36px | 14px |
91
91
  | `xl` | 40px | 40px | 14px |
92
92
 
93
+ Heights come from the `--cz-control-height-{sm,md,lg,xl}` tokens in `@neovici/cosmoz-tokens`, which inputs use too.
94
+
93
95
  ## Icons
94
96
 
95
97
  The button supports prefix and suffix icon slots:
@@ -207,6 +209,10 @@ cosmoz-button::part(button) {
207
209
 
208
210
  This component uses CSS custom properties from `@neovici/cosmoz-tokens`. The tokens are automatically applied but can be customized at the application level.
209
211
 
212
+ | Property | Default | Description |
213
+ | --------------------------------- | -------- | --------------------------------------------------------------------------------------- |
214
+ | `--cosmoz-button-justify-content` | `center` | Alignment of the label and icons. Containers set `flex-start` for full-width menu rows. |
215
+
210
216
  ## Accessibility
211
217
 
212
218
  ### Button Type
package/dist/styles.js CHANGED
@@ -28,7 +28,7 @@ export const styles = css `
28
28
  * ======================================== */
29
29
 
30
30
  :host([size='sm']) .button {
31
- height: 28px;
31
+ height: var(--cz-control-height-sm);
32
32
  padding: calc(var(--cz-spacing) * 1) calc(var(--cz-spacing) * 2.5);
33
33
  font-size: var(--cz-text-xs);
34
34
  line-height: var(--cz-text-xs-line-height);
@@ -41,7 +41,7 @@ export const styles = css `
41
41
  }
42
42
 
43
43
  :host([size='lg']) .button {
44
- height: 36px;
44
+ height: var(--cz-control-height-lg);
45
45
  padding: calc(var(--cz-spacing) * 2) calc(var(--cz-spacing) * 3.5);
46
46
  font-size: var(--cz-text-sm);
47
47
  line-height: var(--cz-text-sm-line-height);
@@ -49,7 +49,7 @@ export const styles = css `
49
49
  }
50
50
 
51
51
  :host([size='xl']) .button {
52
- height: 40px;
52
+ height: var(--cz-control-height-xl);
53
53
  padding: calc(var(--cz-spacing) * 2.5) calc(var(--cz-spacing) * 4);
54
54
  font-size: var(--cz-text-sm);
55
55
  line-height: var(--cz-text-sm-line-height);
@@ -61,8 +61,8 @@ export const styles = css `
61
61
  * ======================================== */
62
62
 
63
63
  :host([icon-only]) .button {
64
- width: 32px;
65
- height: 32px;
64
+ width: var(--cz-control-height-md);
65
+ height: var(--cz-control-height-md);
66
66
  padding: calc(var(--cz-spacing) * 1.5);
67
67
  font-size: var(--cz-text-sm);
68
68
  line-height: var(--cz-text-sm-line-height);
@@ -70,20 +70,20 @@ export const styles = css `
70
70
  }
71
71
 
72
72
  :host([icon-only][size='sm']) .button {
73
- width: 28px;
74
- height: 28px;
73
+ width: var(--cz-control-height-sm);
74
+ height: var(--cz-control-height-sm);
75
75
  padding: calc(var(--cz-spacing) * 1.5);
76
76
  }
77
77
 
78
78
  :host([icon-only][size='lg']) .button {
79
- width: 36px;
80
- height: 36px;
79
+ width: var(--cz-control-height-lg);
80
+ height: var(--cz-control-height-lg);
81
81
  padding: calc(var(--cz-spacing) * 1.5);
82
82
  }
83
83
 
84
84
  :host([icon-only][size='xl']) .button {
85
- width: 40px;
86
- height: 40px;
85
+ width: var(--cz-control-height-xl);
86
+ height: var(--cz-control-height-xl);
87
87
  padding: calc(var(--cz-spacing) * 1.5);
88
88
  }
89
89
 
@@ -104,7 +104,7 @@ export const styles = css `
104
104
  .button {
105
105
  display: inline-flex;
106
106
  align-items: center;
107
- justify-content: center;
107
+ justify-content: var(--cosmoz-button-justify-content, center);
108
108
  gap: 8px;
109
109
  cursor: pointer;
110
110
  font-family: var(--cz-font-body);
@@ -121,7 +121,7 @@ export const styles = css `
121
121
  text-align: center;
122
122
 
123
123
  /* Medium (md) default size */
124
- height: 32px;
124
+ height: var(--cz-control-height-md);
125
125
  padding: calc(var(--cz-spacing) * 1.5) calc(var(--cz-spacing) * 3);
126
126
  font-size: var(--cz-text-sm);
127
127
  line-height: var(--cz-text-sm-line-height);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-button",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "A customizable button web component built with Untitled UI design tokens",
5
5
  "keywords": [
6
6
  "web-components",
@@ -50,7 +50,7 @@
50
50
  "./cosmoz-button": "./dist/cosmoz-button.js"
51
51
  },
52
52
  "dependencies": {
53
- "@neovici/cosmoz-tokens": "^4.2.0",
53
+ "@neovici/cosmoz-tokens": "^4.8.0",
54
54
  "@neovici/cosmoz-tooltip": "^1.4.0",
55
55
  "@pionjs/pion": "^2.5.2",
56
56
  "lit-html": "^3.3.1"