@ulu/frontend 0.6.12 → 0.6.14

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.
@@ -28,6 +28,7 @@ $-fallbacks: (
28
28
  /// @prop {Dimension} min-width [9rem] The smallest width for all buttons
29
29
  /// @prop {Dimension} padding [(0.75em 1.5em)] Button inner padding value, pass space separated list
30
30
  /// @prop {CssValue} white-space [nowrap] Adjust button line wrapping, by default line's are not wrapped
31
+ /// @prop {Dimension} gap [0.5em] Gap to use between items within the button
31
32
  /// @prop {String} border-color ["control-border"] The border color for the button, usually if there is no border we set this to match the background color so if a button with no borders is adjacent a style that has borders the heights will match.
32
33
  /// @prop {String} border-color-hover ["control-border-hover"] Color of border when button is hovered
33
34
  /// @prop {String} border-color-active ["control-border-active"] Color of border when a button has active class
@@ -84,7 +85,7 @@ $config: (
84
85
  "transition-enabled": true,
85
86
  "transition-duration": 200ms,
86
87
  "transition-properties": (border-color, background-color, color, box-shadow),
87
- "button-icon-offset": true,
88
+ "gap": 0.5em,
88
89
  ) !default;
89
90
 
90
91
  /// Button sizes
@@ -199,9 +200,11 @@ $styles: (
199
200
  @include reset();
200
201
  }
201
202
  appearance: none; // If used with select for example
202
- display: inline-block;
203
+ display: inline-flex;
204
+ align-items: center;
205
+ justify-content: center;
206
+ gap: get("gap");
203
207
  text-transform: get("text-transform");
204
- text-align: center;
205
208
  text-shadow: get("text-shadow");
206
209
  vertical-align: middle;
207
210
  font-family: get("font-family");
@@ -20,20 +20,28 @@ $-fallbacks: (
20
20
 
21
21
  /// Module Settings
22
22
  /// @type Map
23
- /// @prop {Number} background-color [gray] Background color (if no image)
23
+ /// @prop {Color} background-color [gray] Background color (if no image)
24
+ /// @prop {Color} background-color-hover [null] Optional background color for hover when using badge--clickable modifier
24
25
  /// @prop {Number} border-radius [50%] Border radius of badge
25
- /// @prop {Number} color [black] Type color
26
+ /// @prop {Color} color [black] Type color
27
+ /// @prop {Color} color-hover [null] Optional color for hover when using badge--clickable modifier
28
+ /// @prop {CssValue} box-shadow [null] Optional box-shadow
29
+ /// @prop {CssValue} box-shadow-hover [null] Optional box-shadow for hover when using badge--clickable modifier
26
30
  /// @prop {Number} font-size [1.3rem] Font size (basic ie. 1.3rem) for badge
27
- /// @prop {Number} font-weight [bold] Font weight
28
- /// @prop {Number} font-family [true] Specify font family, defaults to typography font-family-sans
31
+ /// @prop {Keyword} font-weight [bold] Font weight
32
+ /// @prop {String} font-family [true] Specify font family, defaults to typography font-family-sans
29
33
  /// @prop {Number} width [10rem] Width of badge (default size)
30
34
  /// @prop {Number} hover-scale [1.2] Scale of badge (if clickable) on hover (enlarges badge)
31
35
  /// @prop {List} sizes [Object] List of other sizes (large by default), each size is a map of (width, font-size)
32
36
 
33
37
  $config: (
34
- "background-color": gray,
38
+ "background-color": rgb(205, 205, 205),
39
+ "background-color-hover": null,
35
40
  "border-radius": 50%,
36
41
  "color": black,
42
+ "color-hover": null,
43
+ "box-shadow" : null,
44
+ "box-shadow-hover" : null,
37
45
  "font-size": 1.5rem,
38
46
  "font-weight": bold,
39
47
  "font-family": true,
@@ -110,7 +118,8 @@ $config: (
110
118
  text-align: center;
111
119
  border-radius: get("border-radius");
112
120
  transition: transform 100ms ease-in-out;
113
- // Incase this is used as a link or router-link
121
+ box-shadow: get("box-shadow");
122
+ // In case this is used as a link or router-link
114
123
  &,
115
124
  &:hover,
116
125
  &:focus,
@@ -125,6 +134,9 @@ $config: (
125
134
  &:hover,
126
135
  &:focus {
127
136
  #{ $prefix }__inner {
137
+ color: color.get(get("color-hover"));
138
+ background-color: color.get(get("background-color-hover"));
139
+ box-shadow: get("box-shadow-hover");
128
140
  transform: scale(get("hover-scale"));
129
141
  }
130
142
  }
@@ -22,3 +22,9 @@
22
22
  description: A larger button variant.
23
23
  -->
24
24
  <button class="button button--large">Large Button</button>
25
+
26
+ <!-- @ulu-demo
27
+ title: Left Aligned Button
28
+ description: A button with its content aligned to the left, useful when the button spans a larger width.
29
+ -->
30
+ <button class="button button--left" style="width: 100%;">Left Aligned</button>
@@ -18,10 +18,8 @@ $-fallbacks: (
18
18
 
19
19
  /// Module Settings
20
20
  /// @type Map
21
- /// @prop {Dimension} icon-margin [1em] List of other sizes (large by default), each size is a map of (width, font-size)
22
21
 
23
22
  $config: (
24
- "icon-margin" : 0.5em,
25
23
  "icon-centered-vertical-offset": true
26
24
  ) !default;
27
25
 
@@ -65,13 +63,9 @@ $config: (
65
63
  #{ $prefix }--fit {
66
64
  min-width: 0;
67
65
  }
68
- #{ $prefix }__icon {
69
- &:not(:first-child) {
70
- margin-inline-start: get("icon-margin");
71
- }
72
- &:not(:last-child) {
73
- margin-inline-end: get("icon-margin");
74
- }
66
+ #{ $prefix }--left {
67
+ justify-content: flex-start;
68
+ text-align: left;
75
69
  }
76
70
 
77
71
  @each $size, $values in button.$sizes {
@@ -88,9 +82,6 @@ $config: (
88
82
 
89
83
  #{ $icon-selector } {
90
84
 
91
- display: inline-flex;
92
- align-items: center;
93
- justify-content: center;
94
85
  min-width: 0;
95
86
  max-width: none;
96
87
  border-radius: button.get("icon-border-radius");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend",
3
- "version": "0.6.12",
3
+ "version": "0.6.14",
4
4
  "description": "A framework-agnostic frontend toolkit providing a modular, tree-shakable library of accessible components and utilities. Designed for seamless integration, it features a highly configurable SCSS system for any environment and vanilla JavaScript modules optimized for traditional websites and content management systems.",
5
5
  "type": "module",
6
6
  "files": [