matcha-theme 1.0.23 → 1.0.25

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
@@ -1,193 +1,9 @@
1
- # MatchaComponents
2
-
3
- #### Repository
4
- [Link to the project](https://bitbucket.org/inradar/design-system/src/master/).
5
-
6
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0. | Node Version - lts/iron -> v20.12.2
7
-
8
- ## How to create a component
9
-
10
-
11
- ### Create a new module
12
- To generate a new module run the command:
13
- > Terminal: `ng g m test-component --project matcha-components`
14
-
15
- ### Create a new Component
16
- To generate a component inside of your module run the command:
17
- > Terminal: `ng g c test-component/my-test-component --project matcha-components`
18
-
19
- ### Update your new module file
20
-
21
- Import the component file inside of created module.
22
-
23
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/test-component.module.ts
24
- ``` TS
25
- import { MyTestComponentComponent } from './test-component/my-test-component.component';
26
- ```
27
-
28
- Declare the new component
29
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/test-component.module.ts
30
- ``` TS
31
- declarations: [MyTestComponentComponent],
32
- ```
33
-
34
- Export the new component
35
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/test-component.module.ts
36
- ``` TS
37
- exports: [MyTestComponentComponent],
38
- ```
39
-
40
- ### Update your new component file
41
- We are working with modules and by default the angular-cli create components to working with standalone. Update your component decorator to look like this:
42
-
43
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/my-test-component.component.ts
44
- ``` TS
45
- @Component({
46
- selector: 'lib-my-test-component',
47
- templateUrl: './my-test-component.component.html',
48
- styleUrl: './my-test-component.component.scss'
49
- })
50
- ```
51
-
52
- ### Update MatchaComponentsModule
53
- Update the core module of library matcha-components.
54
- Import the module of the component file inside of created module.
55
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/matcha-components.module.ts
56
- ```TS
57
- import { TestComponentModule } from './test-component/test-component.module';`
58
- ```
59
-
60
- Import the new module
61
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/matcha-components.module.ts
62
- ```TS
63
- imports: [TestComponentModule, ...`
64
- ```
65
-
66
- Export the new module
67
- ###### Path: design-system/projects/matcha-components/src/lib/test-component/matcha-components.module.ts
68
- ```TS
69
- exports: [TestComponentModule, ...`
70
- ```
71
-
72
- ### Update Public API File
73
- Add the export for your new component
74
- ###### Path: design-system/projects/matcha-components/src/public-api.ts
75
- ```TS
76
- export * from './lib/test-component/my-test-component/my-test-component.component';
77
- ```
78
-
79
- Add the export for your new module
80
- ###### Path: design-system/projects/matcha-components/src/public-api.ts
81
- ```TS
82
- export * from './lib/test-component/test-component.module';
83
- ```
84
-
85
- ## How to test a component before publish
86
-
87
- ### Update AppModule
88
- Go to the main project folder src and find the app.modules.ts file.
89
-
90
- Import the module file inside app.module.
91
- ###### Path: design-system/src/app/app.modules.ts
92
- ```TS
93
- import { TestComponentModule } from '../../projects/matcha-components/src/public-api';
94
- ```
95
-
96
- Import the module
97
- ###### Path: design-system/src/app/app.modules.ts
98
- ```TS
99
- imports: [TestComponentModule, ...
100
- ```
101
-
102
- ### Call the component tag somewhere in your test aplication
103
- Add the component `tag` inside of template file
104
- ###### Path: design-system/src/app/dashboard/dashboard.component.html
105
- ``` HTML
106
- <lib-my-test-component></lib-my-test-component>
107
- ```
108
-
109
- ### Run the test project
110
- Run the serve command
111
- > Terminal: `ng s`
112
-
113
- ## How to publish
114
-
115
- ### Update Version
116
- Inside of projects folder in find the package.json of matcha-components and update the version
117
- ###### Path: design-system/projects/matcha-components/package.json
118
- ```JSON
119
- {
120
- "name": "matcha-components",
121
- "version": "x.x.xx",
122
- "peerDependencies": {},
123
- "dependencies": {},
124
- "sideEffects": false
125
- }
126
- ```
127
-
128
- ### Build the matcha-component project
129
- The build artifacts will be stored in the `dist/` directory. Run the build command
130
- > Terminal: `ng build matcha-components`
131
-
132
- ### Publicação do pacote
133
- In the terminal change the directory to the bundle folder of matcha-components inside of dist folder. This is the folder that will be published in NPM.
134
- > Terminal: `cd dist/matcha-components`
135
-
136
- Now we can do the package publication command:
137
- > Terminal: `npm publish`
138
-
139
- ## Test published component
140
-
141
- In the terminal go back to the root of design-system
142
-
143
- > Terminal: `cd ../..`
144
-
145
- Now you must remove the previous installation of matcha-components to ensure the new installation.
146
- > Terminal: `npm uninstall matcha-components`
147
-
148
- Than install the new version of matcha-components
149
- > Terminal: `npm i matcha-components`
150
-
151
- Update the imports in app.modules to the matcha-component from node_modules.
152
-
153
- ###### Path: design-system/src/app/app.modules.ts
154
- ```TS
155
- import { TestComponentModule } from 'matcha-components';
156
- ```
157
- Run the serve command:
158
- > Terminal: `ng s`
159
-
160
-
161
- ---
162
-
163
- ### Storybook
164
- Run `ng run matcha-components:storybook` or `npm run storybook`to execute the storybook aplication and see the documentation of all components via [storybook](https://storybook.js.org/tutorials/intro-to-storybook/angular/en/get-started/).
165
-
166
- ---
167
-
168
- ### Scaffold
169
- You can also use `ng g directive|pipe|service|class|guard|interface|enum|module --project matcha-components`, in case of nested components you can use `ng g c component-name/child-component --project matcha-component`.
170
-
171
- > Note: Don't forget to add `--project matcha-components` or else it will be added to the default project in your `angular.json` file.
172
-
173
- ---
174
-
175
- ### Running example aplication
176
-
177
- Run `ng s --project matcha-design-system` to execute an angular aplication that you can for exemple test your components or directives in pratice.
178
-
179
- ---
180
-
181
- ### Unit tests
182
-
183
- Run `ng test matcha-components` to execute the unit tests via [Karma](https://karma-runner.github.io).
184
-
185
1
  # Matcha-Theme
186
2
 
187
3
  ### Theming Matcha Components
188
4
  Place the class (`.theme-default-light`) that you define in theme file, inside of `body` tag. This way you can cover the whole application with the theme.
189
5
 
190
- Some like this `<body class=".theme-default-light">`.
6
+ Some like this `<body class="theme-default-light">`.
191
7
 
192
8
 
193
9
  ```scss
@@ -377,6 +377,19 @@ $index: 0;
377
377
  #{$attribute}: map-get($warn, default) !important;
378
378
  }
379
379
  }
380
+
381
+ @if ($attribute == "color") {
382
+ .primary {
383
+ #{$attribute}: map-get($primary, default-contrast) !important;
384
+ }
385
+ .accent {
386
+ #{$attribute}: map-get($accent, default-contrast) !important;
387
+ }
388
+ .warn {
389
+ #{$attribute}: map-get($warn, default-contrast) !important;
390
+ }
391
+ }
392
+
380
393
  .#{$attribute}-primary {
381
394
  #{$attribute}: map-get($primary, default) !important;
382
395
  &-alpha {
@@ -172,7 +172,7 @@
172
172
  // Note: The spec doesn't mention letter spacing. The values here come from
173
173
  // eyeballing it until it looked exactly like the spec examples.
174
174
  @function matcha-typography-config(
175
- $font-family: '"CircularStd", "Helvetica Neue", "Arial", sans-serif, "angular";',
175
+ $font-family: 'CircularStd, "Helvetica Neue", "Arial", sans-serif, "angular";',
176
176
  $display-4: matcha-typography-level(112px, 112px, 300, $letter-spacing: -0.05em),
177
177
  $display-3: matcha-typography-level(56px, 56px, 400, $letter-spacing: -0.02em),
178
178
  $display-2: matcha-typography-level(45px, 48px, 400, $letter-spacing: -0.005em),
@@ -152,3 +152,15 @@
152
152
  }
153
153
  }
154
154
  }
155
+ .max-w-1920{
156
+ max-width: 1920px;
157
+ }
158
+ .max-w-1440{
159
+ max-width: 1440px;
160
+ }
161
+ .max-w-1024{
162
+ max-width: 1024px;
163
+ }
164
+ .max-w-600{
165
+ max-width: 600px;
166
+ }
@@ -118,4 +118,7 @@
118
118
  & {
119
119
  font-family: matcha-font-family($config, body-1);
120
120
  }
121
+ button{
122
+ font-family: matcha-font-family($config, title);
123
+ }
121
124
  }
@@ -13,39 +13,41 @@
13
13
  transition: all 50ms linear;
14
14
  overflow: hidden;
15
15
  position: relative;
16
+ font-size: 16px;
17
+ font-weight: 700;
16
18
  &-xs {
17
- font-size: 14px;
18
- padding: $spacing-inline-s;
19
- border-radius: $border-radius-medium;
20
- line-height: $size-line-height-minimum;
19
+ padding: 0 px-to-rem(32px);
20
+ border-radius: px-to-rem(8px);
21
+ line-height: px-to-rem(32px);
22
+ max-height: px-to-rem(32px);
21
23
  }
22
24
 
23
25
  &-sm {
24
- font-size: 16px;
25
- padding: $spacing-inline-s;
26
- border-radius: $border-radius-medium;
27
- line-height: $size-line-height-small;
26
+ padding: 0 px-to-rem(32px);
27
+ border-radius: px-to-rem(8px);
28
+ line-height: px-to-rem(40px);
29
+ max-height: px-to-rem(40px);
28
30
  }
29
31
 
30
32
  &-md {
31
- font-size: 16px;
32
- padding: $spacing-inline-s;
33
- border-radius: $border-radius-medium;
34
- line-height: $size-line-height-medium;
33
+ padding: 0 px-to-rem(32px);
34
+ border-radius: px-to-rem(8px);
35
+ line-height: px-to-rem(48px);
36
+ max-height: px-to-rem(48px);
35
37
  }
36
38
 
37
39
  &-lg {
38
- font-size: 20px;
39
- padding: $spacing-inline-s;
40
- border-radius: $border-radius-medium;
41
- line-height: $size-line-height-large;
40
+ padding: 0 px-to-rem(32px);
41
+ border-radius: px-to-rem(8px);
42
+ line-height: px-to-rem(56px);
43
+ max-height: px-to-rem(56px);
42
44
  }
43
45
 
44
46
  &-xl {
45
- font-size: 20px;
46
- padding: $spacing-inline-m;
47
- border-radius: $border-radius-medium;
48
- line-height: $size-line-height-xlarge;
47
+ padding: 0 px-to-rem(32px);
48
+ border-radius: px-to-rem(8px);
49
+ line-height: px-to-rem(56px);
50
+ max-height: px-to-rem(56px);
49
51
  }
50
52
 
51
53
  &-main {
@@ -59,7 +61,7 @@
59
61
  &-md,
60
62
  &-lg,
61
63
  &-xl {
62
- min-width: 48px;
64
+ min-width: 24px;
63
65
 
64
66
  &.stroked {
65
67
  box-shadow: 0px 0px 0px 2px inset;
@@ -107,6 +109,15 @@
107
109
  text-decoration: underline;
108
110
  padding: 0;
109
111
  }
112
+
113
+ &-icon {
114
+ aspect-ratio: 1;
115
+ padding: 0 !important;
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ }
120
+
110
121
  .ripple {
111
122
  position: absolute;
112
123
  background: rgba(0,0,0,.15);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matcha-theme",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "styles for matcha-design-system",
5
5
  "main": "main.scss",
6
6
  "scripts": {