@ulu/frontend 0.6.10 → 0.6.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.
@@ -80,6 +80,7 @@ $config: (
80
80
 
81
81
  $rule-styles: (
82
82
  "default": 1px solid color.get("rule"),
83
+ "large": 2px solid color.get("rule"),
83
84
  "light": 1px solid color.get("rule-light"),
84
85
  ) !default;
85
86
 
@@ -41,10 +41,91 @@ $config: (
41
41
  @return utils.require-map-get($config, $name, "layout [config]");
42
42
  }
43
43
 
44
+ /// System widths
45
+ /// @type Map
46
+ /// @prop {Map} [name] The width definition
47
+ /// @prop {String|Number} [name].value The base width value
48
+ /// @prop {Boolean} [name].helper-class Output a helper class for this width
49
+ /// @prop {Map} [name].breakpoints Responsive breakpoints (optional)
50
+
51
+ $widths: (
52
+ "small-x": (
53
+ "value": 6rem,
54
+ "helper-class": true
55
+ ),
56
+ "small": (
57
+ "value": 8rem,
58
+ "helper-class": true
59
+ ),
60
+ "medium": (
61
+ "value": 16rem,
62
+ "helper-class": true
63
+ ),
64
+ "large": (
65
+ "value": 32rem,
66
+ "helper-class": true
67
+ )
68
+ ) !default;
69
+
70
+ /// Change widths config
71
+ /// @param {Map} $changes Map of changes
72
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
73
+
74
+ @mixin set-widths($changes, $merge-mode: null) {
75
+ $widths: utils.map-merge($widths, $changes, $merge-mode) !global;
76
+ }
77
+
78
+ /// Get a width config by name
79
+ /// @param {String} $name Name of width
80
+ /// @return {Map} The width configuration object
81
+
82
+ @function get-width($name) {
83
+ @return utils.require-map-get($widths, $name, "layout [widths]");
84
+ }
85
+
86
+ /// System max-widths
87
+ /// @type Map
88
+ /// @prop {Map} [name] The max-width definition
89
+ /// @prop {String|Number} [name].value The base max-width value
90
+ /// @prop {Boolean} [name].helper-class Output a helper class for this max-width
91
+ /// @prop {Map} [name].breakpoints Responsive breakpoints (optional)
92
+
93
+ $max-widths: (
94
+ "small": (
95
+ "value": 20rem,
96
+ "helper-class": true
97
+ ),
98
+ "medium": (
99
+ "value": 40rem,
100
+ "helper-class": true
101
+ ),
102
+ "large": (
103
+ "value": 60rem,
104
+ "helper-class": true
105
+ )
106
+ ) !default;
107
+
108
+ /// Change max-widths config
109
+ /// @param {Map} $changes Map of changes
110
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
111
+
112
+ @mixin set-max-widths($changes, $merge-mode: null) {
113
+ $max-widths: utils.map-merge($max-widths, $changes, $merge-mode) !global;
114
+ }
115
+
116
+ /// Get a max-width config by name
117
+ /// @param {String} $name Name of max-width
118
+ /// @return {Map} The max-width configuration object
119
+
120
+ @function get-max-width($name) {
121
+ @return utils.require-map-get($max-widths, $name, "layout [max-widths]");
122
+ }
123
+
44
124
  /// Containers Lookup (use set-containers)
45
125
  /// @type Map
46
126
  /// @ignore This needs to be below the methods it uses!
47
127
 
128
+
48
129
  $containers: (
49
130
  "container" : (
50
131
  "width" : 100%,
@@ -7,6 +7,7 @@
7
7
 
8
8
  @use "../utils";
9
9
  @use "../cssvar";
10
+ @use "../layout";
10
11
 
11
12
  /// Module Settings
12
13
  /// @type Map
@@ -102,4 +103,12 @@ $cssvars: () !default;
102
103
  // This may need to be adjusted if config is used for something else
103
104
  @include cssvar.declare-all($config, $prefix);
104
105
  @include cssvar.declare("scrollbar-width", 0px, $prefix); // Set by JS
106
+
107
+ @each $name, $props in layout.$widths {
108
+ @include cssvar.declare("width-#{ $name }", $props, $prefix);
109
+ }
110
+
111
+ @each $name, $props in layout.$max-widths {
112
+ @include cssvar.declare("max-width-#{ $name }", $props, $prefix);
113
+ }
105
114
  }
@@ -0,0 +1,182 @@
1
+ ////
2
+ /// @group graphic-text-group
3
+ /// Graphic Text Group layout component
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use "sass:meta";
8
+ @use "sass:math";
9
+
10
+ @use "../selector";
11
+ @use "../utils";
12
+ @use "../element";
13
+ @use "../breakpoint";
14
+
15
+ // Used for function fallback
16
+ $-fallbacks: (
17
+ "rule-border": (
18
+ "function": meta.get-function("get-rule-style", false, "element"),
19
+ "arguments": ("large",)
20
+ ),
21
+ "separator-border": (
22
+ "function": meta.get-function("get-rule-style", false, "element"),
23
+ "arguments": ("light",)
24
+ )
25
+ );
26
+
27
+ /// Module Settings
28
+ /// @type Map
29
+ /// @prop {CssUnit} gap [1rem] The gap between graphic and text.
30
+ /// @prop {List} margin [2em 0] Margin applied to the group.
31
+ /// @prop {CssUnit} graphic-width [3.5rem] The default safe width for the graphic.
32
+ /// @prop {Border} rule-border [true] The border style for the rules.
33
+ /// @prop {CssUnit} rule-padding [1rem] The padding applied when using rules.
34
+ /// @prop {String} wrap-breakpoint ["small"] The breakpoint name at which the layout wraps to a column.
35
+ /// @prop {Border} separator-border [true] The border style for the separator between graphic and text.
36
+ /// @prop {CssUnit} separator-gap [0.5rem] The gap when the separator modifier is used (typically smaller since there are two gaps around the separator).
37
+
38
+ $config: (
39
+ "gap" : 1rem,
40
+ "margin" : (2em 0),
41
+ "graphic-width" : 3.5rem,
42
+ "rule-border" : true,
43
+ "rule-padding" : 1rem,
44
+ "wrap-breakpoint" : "small",
45
+ "separator-border" : true,
46
+ "separator-gap" : 0.8rem,
47
+ ) !default;
48
+
49
+ /// Change modules $config
50
+ /// @param {Map} $changes Map of changes
51
+ /// @example scss
52
+ /// @include ulu.component-graphic-text-group-set(( "property" : value ));
53
+
54
+ @mixin set($changes) {
55
+ $config: map.merge($config, $changes) !global;
56
+ }
57
+
58
+ /// Get a config option
59
+ /// @param {Map} $name Name of property
60
+ /// @example scss
61
+ /// @include ulu.component-graphic-text-group-get("property");
62
+
63
+ @function get($name) {
64
+ $value: utils.require-map-get($config, $name, "graphic-text-group [config]");
65
+ @return utils.function-fallback($name, $value, $-fallbacks);
66
+ }
67
+
68
+ /// Prints component styles
69
+ /// @demo graphic-text-group
70
+ /// @example scss
71
+ /// @include ulu.component-graphic-text-group-styles();
72
+
73
+ @mixin styles {
74
+ $prefix: selector.class("graphic-text-group");
75
+
76
+ #{ $prefix } {
77
+ display: flex;
78
+ align-items: center;
79
+ gap: get("gap");
80
+ margin: get("margin");
81
+ }
82
+
83
+ #{ $prefix }__graphic {
84
+ flex-shrink: 0;
85
+ width: get("graphic-width");
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ order: 1;
90
+
91
+ img, svg {
92
+ margin: 0;
93
+ }
94
+ }
95
+
96
+ #{ $prefix }__text {
97
+ flex-grow: 1;
98
+ min-width: 0;
99
+ order: 3;
100
+ }
101
+
102
+ // Separator Modifier
103
+ #{ $prefix }--separator {
104
+ gap: get("separator-gap");
105
+ &::before {
106
+ content: "";
107
+ display: block;
108
+ order: 2;
109
+ align-self: stretch;
110
+ border-left: get("separator-border");
111
+ }
112
+ &#{ $prefix }--top,
113
+ &#{ $prefix }--bottom {
114
+ &::before {
115
+ border-left: none;
116
+ border-bottom: get("separator-border");
117
+ }
118
+ }
119
+ }
120
+
121
+ // Responsive Modifiers
122
+ #{ $prefix }--wrap {
123
+ @include breakpoint.max(get("wrap-breakpoint")) {
124
+ flex-direction: column;
125
+ align-items: flex-start;
126
+ &#{ $prefix }--separator::before {
127
+ border-left: none;
128
+ border-bottom: get("separator-border");
129
+ }
130
+ }
131
+ }
132
+
133
+ // Alignment Modifiers
134
+ #{ $prefix }--align-start {
135
+ align-items: flex-start;
136
+ }
137
+
138
+ #{ $prefix }--align-end {
139
+ align-items: flex-end;
140
+ }
141
+
142
+ // Position Modifiers
143
+ #{ $prefix }--right {
144
+ > #{ $prefix }__graphic {
145
+ order: 3;
146
+ }
147
+ > #{ $prefix }__text {
148
+ order: 1;
149
+ }
150
+ }
151
+
152
+ #{ $prefix }--top {
153
+ flex-direction: column;
154
+ }
155
+
156
+ #{ $prefix }--bottom {
157
+ flex-direction: column;
158
+ > #{ $prefix }__graphic {
159
+ order: 3;
160
+ }
161
+ > #{ $prefix }__text {
162
+ order: 1;
163
+ }
164
+ }
165
+
166
+ #{ $prefix }--center {
167
+ align-items: center;
168
+ text-align: center;
169
+ }
170
+
171
+ // Rule Modifiers
172
+ #{ $prefix }--rule-top {
173
+ border-top: get("rule-border");
174
+ padding-top: get("rule-padding");
175
+ }
176
+
177
+ #{ $prefix }--rule-bottom {
178
+ border-bottom: get("rule-border");
179
+ padding-bottom: get("rule-padding");
180
+ }
181
+ }
182
+
@@ -25,6 +25,7 @@
25
25
  @forward "flipcard" as flipcard-*;
26
26
  @forward "flipcard-grid" as flipcard-grid-*;
27
27
  @forward "form-theme" as form-theme-*;
28
+ @forward "graphic-text-group" as graphic-text-group-*;
28
29
  @forward "headline-label" as headline-label-*;
29
30
  @forward "input-group" as input-group-*;
30
31
  @forward "rule-inline" as rule-inline-*;
@@ -91,6 +92,7 @@
91
92
  @use "flipcard";
92
93
  @use "flipcard-grid";
93
94
  @use "form-theme";
95
+ @use "graphic-text-group";
94
96
  @use "headline-label";
95
97
  @use "input-group";
96
98
  @use "rule-inline";
@@ -158,6 +160,7 @@ $all-includes: (
158
160
  "flipcard",
159
161
  "flipcard-grid",
160
162
  "form-theme",
163
+ "graphic-text-group",
161
164
  "headline-label",
162
165
  "input-group",
163
166
  "rule-inline",
@@ -309,6 +312,9 @@ $current-includes: $all-includes;
309
312
  @if (list.index($includes, "form-theme")) {
310
313
  @include form-theme.styles;
311
314
  }
315
+ @if (list.index($includes, "graphic-text-group")) {
316
+ @include graphic-text-group.styles;
317
+ }
312
318
  @if (list.index($includes, "headline-label")) {
313
319
  @include headline-label.styles;
314
320
  }
@@ -28,24 +28,20 @@ $-fallbacks: (
28
28
  "link-line-height" : (
29
29
  "function" : meta.get-function("get", false, "typography"),
30
30
  "property" : "line-height-dense"
31
+ ),
32
+ "stacked-link-border-radius" : (
33
+ "function" : meta.get-function("get", false, "element"),
34
+ "property" : "border-radius-small"
31
35
  )
32
36
  );
33
37
 
34
38
  /// Module Settings
35
39
  /// @type Map
36
- /// @prop {Boolean} link-separated-margin [false] Enables a margin between the items in the menu-stack.
37
- /// @prop {Boolean} link-separated-rule-style [false] Enables a rule between the items in the menu-stack.
40
+
38
41
  /// @prop {Dimension} nested-indent [0.5em] The indentation of child lists within the menu-stack.
39
42
  /// @prop {Dimension} rule-margin [0.5em] Sets the padding and margin of the rule.
40
43
  /// @prop {String} rule-style [default] Determines the styling of the rule. Uses the rule.scss component.
41
44
  /// @prop {Number} toggle-icon-rotate [false] Set a value to rotate the collapsible item toggle icon rotation when open (ie. 90deg)
42
- /// @prop {Dimension} compact-link-padding-x [0.75em] The links horizontal padding when using the compact option.
43
- /// @prop {Dimension} compact-link-padding-y [0.25em] The links vertical padding when using the compact option.
44
- /// @prop {Dimension} compact-link-margin [0.2em] Margin between items when compact
45
- /// @prop {Dimension} compact-link-border-radius [null] Unless set will use the normal link border radius
46
- /// @prop {Dimension} compact-selectable-input-width [2em] The width of the checkbox/radio input (when compact modifier)
47
- /// @prop {Dimension} compact-selectable-input-font-size [null] Optional compact input font-size
48
- /// @prop {Dimension} compact-selectable-input-top [null] Optional y/top for input
49
45
  /// @prop {Color} label-color [null] The type color of the label.
50
46
  /// @prop {Dimension} label-margin [0.5em] The margin of the label.
51
47
  /// @prop {CssValue} label-text-transform [uppercase] Transforms the label text.
@@ -68,6 +64,8 @@ $-fallbacks: (
68
64
  /// @prop {Dimension} link-margin [0.2em] Margin for the menu-stack toggle.
69
65
  /// @prop {Dimension} link-padding-x [1em] Horizontal padding for menu-stack toggle.
70
66
  /// @prop {Dimension} link-padding-y [0.35em] Vertical padding for menu-stack toggle.
67
+ /// @prop {Boolean} link-separated-margin [false] Enables a margin between the items in the menu-stack.
68
+ /// @prop {Boolean} link-separated-rule-style [false] Enables a rule between the items in the menu-stack.
71
69
  /// @prop {Dimension} selectable-input-width [3em] The width of the checkbox/radio input
72
70
  /// @prop {Dimension} selectable-input-top [0.73em] To fine tune the y/top value for absolutely positioned input, if you pass null/falsey it will use the padding which isn't always perfect since this is setup to not be centered when wrapping lines in label
73
71
  /// @prop {Dimension} selectable-input-font-size [null] Optional to set a specific font-size on the input
@@ -81,7 +79,18 @@ $-fallbacks: (
81
79
  /// @prop {Boolean} title-separated-margin [false] Use specific margin for title separated items.
82
80
  /// @prop {Dimension} columns-gap [2rem] The gap between columns in a columns menu stack.
83
81
  /// @prop {Dimension} columns-min-width [18rem] The minimum width of a column in a columns menu stack.
84
-
82
+ /// @prop {Dimension} compact-link-padding-x [0.75em] The links horizontal padding when using the compact option.
83
+ /// @prop {Dimension} compact-link-padding-y [0.25em] The links vertical padding when using the compact option.
84
+ /// @prop {Dimension} compact-link-margin [0.2em] Margin between items when compact
85
+ /// @prop {Dimension} compact-link-border-radius [null] Unless set will use the normal link border radius
86
+ /// @prop {Dimension} compact-selectable-input-width [2em] The width of the checkbox/radio input (when compact modifier)
87
+ /// @prop {Dimension} compact-selectable-input-font-size [null] Optional compact input font-size
88
+ /// @prop {Dimension} compact-selectable-input-top [null] Optional y/top for input
89
+ /// @prop {Dimension} stacked-link-padding-x [0.4em] The links horizontal padding when using the stacked option.
90
+ /// @prop {Dimension} stacked-link-padding-y [0.4em] The links vertical padding when using the stacked option.
91
+ /// @prop {Dimension} stacked-link-icon-margin [0.35em] Margin between icon and text when stacked.
92
+ /// @prop {Dimension} stacked-link-border-radius [true] Border radius for stacked style of links, defaults to element "border-radius-small"
93
+ /// @prop {Dimension} stacked-link-font-weight [true] Optional font-weight for stacked style
85
94
 
86
95
  $config: (
87
96
  "nested-indent" : 0.5em,
@@ -121,6 +130,12 @@ $config: (
121
130
  "compact-selectable-input-width": 2.2em,
122
131
  "compact-selectable-input-top" : 0.5em,
123
132
  "compact-selectable-input-font-size": 0.8em,
133
+ "stacked-link-padding-x": 0.4em,
134
+ "stacked-link-padding-y": 0.8em,
135
+ "stacked-link-margin": 0.4em,
136
+ "stacked-link-icon-margin": 0.35em,
137
+ "stacked-link-border-radius": true,
138
+ "stacked-link-font-weight" : null,
124
139
  "selectable-input-width" : 3em,
125
140
  "selectable-input-top" : 0.73em,
126
141
  "selectable-input-font-size" : null,
@@ -372,6 +387,30 @@ $config: (
372
387
  }
373
388
  }
374
389
 
390
+ #{ $prefix }--stacked {
391
+ @include cssvar.declare-ulu("menu-stack-link-padding-x", get("stacked-link-padding-x"));
392
+
393
+ #{ $prefix }__link,
394
+ #{ $prefix }__toggle {
395
+ flex-direction: column;
396
+ justify-content: center;
397
+ text-align: center;
398
+ border-radius: get("stacked-link-border-radius");
399
+ padding-top: get("stacked-link-padding-y");
400
+ padding-bottom: get("stacked-link-padding-y");
401
+ margin: get("stacked-link-margin") 0;
402
+ font-weight: get("stacked-link-font-weight");
403
+ }
404
+ #{ $prefix }__link-icon {
405
+ margin-right: 0;
406
+ margin-bottom: get("stacked-link-icon-margin");
407
+
408
+ &:last-child {
409
+ margin-bottom: 0;
410
+ }
411
+ }
412
+ }
413
+
375
414
  #{ $prefix }--columns {
376
415
  > #{ $prefix }__list {
377
416
  display: grid;
@@ -9,6 +9,7 @@
9
9
  @forward "print" as print-*;
10
10
  @forward "units" as units-*;
11
11
  @forward "color" as color-*;
12
+ @forward "layout" as layout-*;
12
13
 
13
14
  @use "sass:list";
14
15
 
@@ -19,6 +20,7 @@
19
20
  @use "units";
20
21
  @use "print";
21
22
  @use "color";
23
+ @use "layout";
22
24
 
23
25
  /// Default includes, all modules
24
26
  /// @type List
@@ -29,7 +31,8 @@ $all-includes: (
29
31
  "display",
30
32
  "utilities",
31
33
  "print",
32
- "color"
34
+ "color",
35
+ "layout"
33
36
  );
34
37
 
35
38
  /// Current included modules (for output when using styles), defaults to all
@@ -71,6 +74,9 @@ $current-includes: $all-includes;
71
74
  @if (list.index($includes, "units")) {
72
75
  @include units.styles;
73
76
  }
77
+ @if (list.index($includes, "layout")) {
78
+ @include layout.styles;
79
+ }
74
80
  @if (list.index($includes, "display")) {
75
81
  @include display.styles;
76
82
  }
@@ -89,3 +95,4 @@ $current-includes: $all-includes;
89
95
 
90
96
 
91
97
 
98
+
@@ -0,0 +1,36 @@
1
+ ////
2
+ /// @group layout
3
+ /// Output layout helper classes (widths, max-widths, etc)
4
+ ////
5
+
6
+ @use "sass:map";
7
+
8
+ @use "../layout";
9
+ @use "../selector";
10
+ @use "../utils";
11
+ @use "../cssvar";
12
+
13
+ /// Output Layout Helper Styles
14
+
15
+ @mixin styles {
16
+ @include utils.file-header('helpers', 'layout');
17
+
18
+ $prefix-width: selector.class("width");
19
+ @each $name, $props in layout.$widths {
20
+ @if map.get($props, "helper-class") {
21
+ #{ $prefix-width }-#{ $name } {
22
+ width: cssvar.use-ulu("width-#{ $name }");
23
+ max-width: 100%;
24
+ }
25
+ }
26
+ }
27
+
28
+ $prefix-max-width: selector.class("max-width");
29
+ @each $name, $props in layout.$max-widths {
30
+ @if map.get($props, "helper-class") {
31
+ #{ $prefix-max-width }-#{ $name } {
32
+ max-width: cssvar.use-ulu("max-width-#{ $name }");
33
+ }
34
+ }
35
+ }
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
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": [
@@ -12,7 +12,7 @@
12
12
  "types": "./dist/es/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
- "sass" : "./lib/scss/index.scss",
15
+ "sass": "./lib/scss/index.scss",
16
16
  "types": "./dist/es/index.d.ts",
17
17
  "import": "./dist/es/index.js",
18
18
  "require": "./dist/umd/ulu-frontend.umd.js"
@@ -99,6 +99,7 @@
99
99
  "@fortawesome/fontawesome-free": "^6.5.2",
100
100
  "@ulu/eleventy-plugin-nav-tree": "^0.0.1",
101
101
  "@ulu/markdown-output-utils": "^0.0.6",
102
+ "@ulu/mcp-context-server": "^0.0.3",
102
103
  "@ulu/sassdoc-to-markdown": "^0.0.16",
103
104
  "@ulu/utils": "^0.0.34",
104
105
  "@ulu/vite-plugin-eleventy": "^0.0.1",