@matteusan/himig 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 (82) hide show
  1. package/README.md +29 -0
  2. package/_index.scss +219 -0
  3. package/_init-font-pack.scss +809 -0
  4. package/ms-badge/_badge-base.scss +45 -0
  5. package/ms-badge/_badge-extend.scss +53 -0
  6. package/ms-badge/_badge-styles.scss +43 -0
  7. package/ms-badge/_badge-theme.scss +47 -0
  8. package/ms-badge/_index.scss +24 -0
  9. package/ms-button/_button-base.scss +76 -0
  10. package/ms-button/_button-extend.scss +53 -0
  11. package/ms-button/_button-mixins.scss +191 -0
  12. package/ms-button/_button-styles.scss +210 -0
  13. package/ms-button/_button-theme.scss +67 -0
  14. package/ms-button/_index.scss +24 -0
  15. package/ms-core/_index.scss +76 -0
  16. package/ms-core/breakpoint/_breakpoint-sentro.scss +53 -0
  17. package/ms-core/breakpoint/_index.scss +23 -0
  18. package/ms-core/color/_color-constants.scss +33 -0
  19. package/ms-core/color/_color-setters.scss +75 -0
  20. package/ms-core/color/_color-utils.scss +62 -0
  21. package/ms-core/color/_color-validators.scss +59 -0
  22. package/ms-core/color/_index.scss +25 -0
  23. package/ms-core/component/component-base.ts +81 -0
  24. package/ms-core/component/component-properties.ts +25 -0
  25. package/ms-core/component/index.ts +29 -0
  26. package/ms-core/component/types/ms-component.d.ts +24 -0
  27. package/ms-core/index.ts +29 -0
  28. package/ms-core/sprite/_index.scss +23 -0
  29. package/ms-core/sprite/_sprite-mixins.scss +29 -0
  30. package/ms-core/struct/_index.scss +24 -0
  31. package/ms-core/struct/_struct-setters.scss +98 -0
  32. package/ms-core/struct/_struct-utils.scss +222 -0
  33. package/ms-core/struct/_struct-validators.scss +57 -0
  34. package/ms-core/theme/_index.scss +30 -0
  35. package/ms-core/theme/_theme-get.scss +41 -0
  36. package/ms-core/theme/_theme-keys.scss +43 -0
  37. package/ms-core/theme/_theme-merge.scss +46 -0
  38. package/ms-core/theme/_theme-properties.scss +52 -0
  39. package/ms-core/theme/_theme-setters.scss +139 -0
  40. package/ms-core/theme/_theme-tokens.scss +57 -0
  41. package/ms-core/tokens/_index.scss +23 -0
  42. package/ms-core/tokens/_token-data.scss +242 -0
  43. package/ms-core/tokens/_token-methods.scss +98 -0
  44. package/ms-core/tools/_index.scss +26 -0
  45. package/ms-core/tools/_tools-color.scss +79 -0
  46. package/ms-core/tools/_tools-sentro.scss +52 -0
  47. package/ms-core/tools/_tools-string.scss +45 -0
  48. package/ms-core/tools/_tools-validation.scss +71 -0
  49. package/ms-core/typography/_index.scss +24 -0
  50. package/ms-core/typography/_typography-setters.scss +78 -0
  51. package/ms-core/typography/_typography-utils.scss +76 -0
  52. package/ms-core/typography/_typography-validators.scss +47 -0
  53. package/ms-form-field/_form-field-base.scss +113 -0
  54. package/ms-form-field/_form-field-extend.scss +53 -0
  55. package/ms-form-field/_form-field-styles.scss +212 -0
  56. package/ms-form-field/_form-field-theme.scss +63 -0
  57. package/ms-form-field/_index.scss +24 -0
  58. package/ms-item-card/_index.scss +24 -0
  59. package/ms-item-card/_item-card-base.scss +96 -0
  60. package/ms-item-card/_item-card-extend.scss +53 -0
  61. package/ms-item-card/_item-card-styles.scss +64 -0
  62. package/ms-item-card/_item-card-theme.scss +66 -0
  63. package/ms-list/_index.scss +24 -0
  64. package/ms-list/_list-base.scss +62 -0
  65. package/ms-list/_list-extend.scss +53 -0
  66. package/ms-list/_list-styles.scss +77 -0
  67. package/ms-list/_list-theme.scss +59 -0
  68. package/ms-sprite/_index.scss +23 -0
  69. package/ms-sprite/_sprite-styles.scss +57 -0
  70. package/ms-surface/_index.scss +24 -0
  71. package/ms-surface/_surface-base.scss +111 -0
  72. package/ms-surface/_surface-extend.scss +53 -0
  73. package/ms-surface/_surface-styles.scss +88 -0
  74. package/ms-surface/_surface-theme.scss +55 -0
  75. package/ms-utils/_color-utils.scss +99 -0
  76. package/ms-utils/_consts.scss +25 -0
  77. package/ms-utils/_index.scss +26 -0
  78. package/ms-utils/_layout-utils.scss +307 -0
  79. package/ms-utils/_struct-utils.scss +322 -0
  80. package/ms-utils/_typography-utils.scss +167 -0
  81. package/ms-utils/_util-helpers.scss +54 -0
  82. package/package.json +15 -0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ ![Gaia Logo Light Mode](https://raw.githubusercontent.com/GrowStocks/gaia/main/media/gds-logo-light.svg?sanitize=true#gh-light-mode-only)
2
+ ![Gaia Logo Dark Mode](https://raw.githubusercontent.com/GrowStocks/gaia/main/media/gds-logo-dark.svg?sanitize=true#gh-dark-mode-only)
3
+
4
+ ## Prerequisites
5
+ Be sure to have [NodeJS](https://nodejs.org) LTS installed. Any other version will risk the project breaking in
6
+ development.
7
+ This design system is dependent on the CSS preprocessor, [Sass](https://sass-lang.com). When using sass, **be sure to
8
+ use DartSass instead of the now deprecated LibSass (node-sass)**.
9
+
10
+ ## Setup
11
+ ```sh
12
+ $ npm install @growstocks/himig --save
13
+
14
+ # or
15
+
16
+ $ yarn add @growstocks/himig
17
+ ```
18
+ ```scss
19
+ // main.scss
20
+
21
+ @use 'node_modules/@matteusan/himig';
22
+ @use 'node_modules/@matteusan/himig/ms-button';
23
+
24
+ @include himig.init {
25
+ @include ms-button.render();
26
+ }
27
+ ```
28
+ ## Contributing
29
+ Contributing guidelines are located [here](https://github.com/GrowStocks/gaia/tree/main/.github/CONTRIBUTING.md).
package/_index.scss ADDED
@@ -0,0 +1,219 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ $expressive-inks: false !default;
24
+ $module-mode: false !default;
25
+ $test-mode: $module-mode !default;
26
+ $vue-mode: $test-mode !default;
27
+
28
+ @use 'ms-core' with (
29
+ $expressive-inks: $expressive-inks,
30
+ $module-mode: $module-mode,
31
+ $test-mode: $test-mode,
32
+ $vue-mode: $vue-mode,
33
+ );
34
+ @use 'sass:map';
35
+ @use 'init-font-pack' as font-pack;
36
+
37
+ // For accessing core lib from the main himig module.
38
+ @forward 'ms-core';
39
+
40
+ @mixin init(
41
+ $surface: 'ms-blue',
42
+ $accent: 'ms-yellow',
43
+ $background: 'ms-blue.800',
44
+ $error: 'ms-red',
45
+ $warning: 'ms-yellow',
46
+ $success: 'ms-green',
47
+ $undefined: 'ms-grey',
48
+ $radius: (),
49
+ $global: (),
50
+ $supertitle: (),
51
+ $title: (),
52
+ $subtitle: (),
53
+ $body: (),
54
+ $mono: (),
55
+ $small: (),
56
+ $breakpoints: (),
57
+ $extend: (),
58
+ ) {
59
+
60
+ $_init-family: 'family.sans-serif';
61
+ $_init-line-height: 'line-height.normal';
62
+
63
+ $_init-type-global: (
64
+ 'family': $_init-family,
65
+ 'size': 'size.sm',
66
+ 'weight': 'weight.normal',
67
+ 'line-height': $_init-line-height,
68
+ );
69
+
70
+ $_init-type-supertitle: (
71
+ 'family': $_init-family,
72
+ 'size': 'size.xl',
73
+ 'weight': 'weight.black',
74
+ 'line-height': $_init-line-height,
75
+ );
76
+
77
+ $_init-type-title: (
78
+ 'family': $_init-family,
79
+ 'size': 'size.lg',
80
+ 'weight': 'weight.bold',
81
+ 'line-height': $_init-line-height,
82
+ );
83
+
84
+ $_init-type-subtitle: (
85
+ 'family': $_init-family,
86
+ 'size': 'size.md',
87
+ 'weight': 'weight.bold',
88
+ 'line-height': $_init-line-height,
89
+ );
90
+
91
+ $_init-type-body: (
92
+ 'family': $_init-family,
93
+ 'size': 'size.sm',
94
+ 'weight': 'weight.normal',
95
+ 'line-height': $_init-line-height,
96
+ );
97
+
98
+ $_init-type-mono: (
99
+ 'family': 'family.mono',
100
+ 'size': 'size.sm',
101
+ 'weight': 'weight.normal',
102
+ 'line-height': $_init-line-height,
103
+ );
104
+
105
+ $_init-type-small: (
106
+ 'family': $_init-family,
107
+ 'size': 'size.xs',
108
+ 'weight': 'weight.light',
109
+ 'line-height': $_init-line-height,
110
+ );
111
+
112
+ $_init-breakpoints: (
113
+ 'small': ms-core.primitive-token-get('breakpoint.sm'),
114
+ 'medium': ms-core.primitive-token-get('breakpoint.md'),
115
+ 'large': ms-core.primitive-token-get('breakpoint.lg'),
116
+ 'xlarge': ms-core.primitive-token-get('breakpoint.xl'),
117
+ );
118
+
119
+ :root {
120
+ @include ms-core.primitive-token-register($map: $extend);
121
+ @include ms-core.theme-config(
122
+ $surface: $surface,
123
+ $accent: $accent,
124
+ $background: $background,
125
+ $error: $error,
126
+ $warning: $warning,
127
+ $success: $success,
128
+ $undefined: $undefined,
129
+ $radius: $radius,
130
+ $breakpoints: $breakpoints,
131
+ $global: map.merge($_init-type-global, $global),
132
+ $supertitle: map.merge($_init-type-supertitle, $supertitle),
133
+ $title: map.merge($_init-type-title, $title),
134
+ $subtitle: map.merge($_init-type-subtitle, $subtitle),
135
+ $body: map.merge($_init-type-body, $body),
136
+ $mono: map.merge($_init-type-mono, $mono),
137
+ $small: map.merge($_init-type-small, $small),
138
+ );
139
+
140
+ // Immutables
141
+ --ms-shadow-color: rgba(0, 0, 0, 0.25);
142
+ --ms-sprite-size: 32px;
143
+ --ms-transition-time: 0.2s;
144
+ }
145
+
146
+ @include ms-core.breakpoint-config(map.merge($_init-breakpoints, $breakpoints));
147
+
148
+ @include font-pack.load((
149
+ 'global': map.get($global, 'family'),
150
+ 'supertitle': map.get($supertitle, 'family'),
151
+ 'title': map.get($title, 'family'),
152
+ 'subtitle': map.get($subtitle, 'family'),
153
+ 'body': map.get($body, 'family'),
154
+ 'mono': map.get($mono, 'family'),
155
+ 'small': map.get($small, 'family'),
156
+ ));
157
+
158
+ *,
159
+ :before,
160
+ :after {
161
+ margin: 0;
162
+ padding: 0;
163
+ box-sizing: inherit;
164
+ color: inherit;
165
+ }
166
+
167
+ html {
168
+ box-sizing: border-box;
169
+ font-size: 100%;
170
+ }
171
+
172
+ body {
173
+ background: ms-core.key-create('body-fill', ms-core.token-get('background'));
174
+ color: ms-core.key-create('body-ink', ms-core.token-get('background-ink'));
175
+ }
176
+
177
+ a {
178
+ text-decoration: none;
179
+ color: inherit;
180
+ }
181
+
182
+ h1,
183
+ h2,
184
+ h3,
185
+ h4,
186
+ h5,
187
+ h6,
188
+ p,
189
+ span,
190
+ a {
191
+ font-family: inherit;
192
+ font-size: inherit;
193
+ font-weight: inherit;
194
+ line-height: ms-core.primitive-token-get('line-height.normal');
195
+ }
196
+
197
+ main.content-wrap {
198
+ $margin: 15px;
199
+ width: calc(100% - #{$margin * 2});
200
+ max-width: ms-core.key-create('content-wrap-max-width', ms-core.primitive-token-get('dimension.xl'));
201
+ display: ms-core.key-create('content-wrap-display', grid);
202
+ grid-template-columns: repeat(ms-core.key-create('content-wrap-cols', 4), 1fr);
203
+ gap: ms-core.key-create('content-wrap-gap', ms-core.primitive-token-get('spacing.md'));
204
+ margin: 0 auto;
205
+ padding:
206
+ ms-core.key-create('content-wrap-padding-y', ms-core.primitive-token-get('spacing.lg'))
207
+ ms-core.key-create('content-wrap-padding-x', ms-core.primitive-token-get('spacing.none'));
208
+
209
+ @include ms-core.breakpoint-create('medium') {
210
+ @include ms-core.key-bind('content-wrap-cols', repeat(8, 1fr));
211
+ }
212
+
213
+ @include ms-core.breakpoint-create('large') {
214
+ @include ms-core.key-bind('content-wrap-cols', repeat(12, 1fr));
215
+ }
216
+ }
217
+
218
+ @content;
219
+ }