Skip to content

Commit

Permalink
Rename references to Gaia to Himig
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteuSan committed Mar 26, 2024
1 parent fe186d4 commit d89e71d
Show file tree
Hide file tree
Showing 24 changed files with 274 additions and 69 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Gaia
# Contributing to Himig

## Workflow Digest
1. Create a fork of this repository and clone it locally.
Expand All @@ -21,13 +21,13 @@

## Details on Contributing
### Contributing Scopes
When contributing to Gaia, it is important to keep in mind what a contributor can code and cannot code.
When contributing to Himig, it is important to keep in mind what a contributor can code and cannot code.

- Authoring new components are almost always left up to the internal team working on the design system.
- Code deviating from the specifications is NOT allowed. Follow the specifications in the design docs or in the `/specs` directory.

### Installing Dependencies
The current dependency list will always be compatible with the latest version of himig However, the root directory, the tests and dev versions of the docs require the current in-development version of Gaia (aka the version you're working on). Which is why we're going to be using the `npm link` feature to easily link the dev version of Gaia to the tests and docs.
The current dependency list will always be compatible with the latest version of himig However, the root directory, the tests and dev versions of the docs require the current in-development version of Himig (aka the version you're working on). Which is why we're going to be using the `npm link` feature to easily link the dev version of Himig to the tests and docs.

First `cd` into the source folder.
```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
id: version
attributes:
label: Version
description: What version of Gaia are you using?
description: What version of Himig are you using?
options:
- 0.x
validations:
Expand Down
10 changes: 5 additions & 5 deletions specs/api/composition/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /api/composition/color
---
# Color Composition API
## Apply Mixin
This mixin is located inside the main `gaia` module. This mixin allows you to apply colors based on Gaia's component
This mixin is located inside the main `Himig` module. This mixin allows you to apply colors based on Himig's component
color anatomy spec, and creating an API with it.

```scss
Expand Down Expand Up @@ -33,7 +33,7 @@ color anatomy spec, and creating an API with it.
| $theme | `map<string, string>` | The colors you want to apply. (`fill`, `ink`, `border`) |

## Bind Mixin
This mixin is located inside the main `gaia` module. This mixin allows you to bind colors based on Gaia's component
This mixin is located inside the main `Himig` module. This mixin allows you to bind colors based on Himig's component
color anatomy spec to an existing styled component (with the appropriate keys).

This is especially useful whenever you want to make variants in color on an already styled component.
Expand Down Expand Up @@ -64,7 +64,7 @@ This is especially useful whenever you want to make variants in color on an alre
| $theme | `map<string, string>` | The colors you want to apply. (`fill`, `ink`, `border`) |

## Border Mixin
The border mixin lets you apply border color to an element while creating an API around it that follows the Gaia spec.
The border mixin lets you apply border color to an element while creating an API around it that follows the Himig spec.

```scss
@use 'node_modules/@matteusan/himig';
Expand All @@ -81,7 +81,7 @@ The border mixin lets you apply border color to an element while creating an API
| $intent | `string` | The intention of the color application. Choose between `create` and `bind`. |

## Fill Mixin
The fill mixin lets you apply background color to an element while creating an API around it that follows the Gaia spec.
The fill mixin lets you apply background color to an element while creating an API around it that follows the Himig spec.

```scss
@use 'node_modules/@matteusan/himig';
Expand All @@ -98,7 +98,7 @@ The fill mixin lets you apply background color to an element while creating an A
| $intent | `string` | The intention of the color application. Choose between `create` and `bind`. |

## Ink Mixin
The ink mixin lets you apply text color to an element while creating an API around it that follows the Gaia spec.
The ink mixin lets you apply text color to an element while creating an API around it that follows the Himig spec.

```scss
@use 'node_modules/@matteusan/himig';
Expand Down
4 changes: 2 additions & 2 deletions specs/api/composition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Composition API
slug: /api/composition
---
# Composition API
Gaia lets you compose complex components that can't be solved by utility classes alone. By using the composition API,
it lets you create components with the same API patterns as Gaia's primitive components.
Himig lets you compose complex components that can't be solved by utility classes alone. By using the composition API,
it lets you create components with the same API patterns as Himig's primitive components.

Here are the composition APIs you can work with:
- [Color](color.md)
Expand Down
6 changes: 3 additions & 3 deletions specs/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Components
slug: /components
---
# Components
Gaia's components serve as primitive building blocks to build complex interfaces. These are carefully crafted to produce
Himig's components serve as primitive building blocks to build complex interfaces. These are carefully crafted to produce
the same experiences all throughout the GrowStocks ecosystem.

## Instantiation
Expand Down Expand Up @@ -65,7 +65,7 @@ Modifying a component in the SCSS is your second way of customizing a component.
```

## Extending Components
Creating your own variant component uses Gaia's provided extension API. Instantiate a new variant by calling the `extend()` mixin and filling in the variant name parameter.
Creating your own variant component uses Himig's provided extension API. Instantiate a new variant by calling the `extend()` mixin and filling in the variant name parameter.

```scss
@use 'node_modules/@matteusan/himig';
Expand All @@ -90,7 +90,7 @@ Make adjustments to the variant by calling the modifier mixins. These mixins are
padding: ('md' 'xl')
));
@include ms-component.typography((
size: 'subtitle',
size: 'md',
));
}
}
Expand Down
172 changes: 172 additions & 0 deletions specs/components/ms-button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
---
title: MSButton
slug: /components/ms-button
---
# MSButton
Buttons call the user to a specific action in the page. May it be in a form, or a hyperlink.

## Usage
### HTML
```html
<button class="ms-button" role="button">
<span class="ms-button__label">Button</span>
</button>
```
There's a caveat to the HTML structure. If you wish to use the button component to redirect a user to another page, please use `<a></a>` tags instead. This improves accessibility, and the way styles work for this component.

Additionally, anchor elements don't have a disabled attribute so you wouldn't really need a disabled state for this.
```html
<a href="#" class="ms-button" role="link">
<span class="ms-button__label">Button</span>
</a>
```

### SCSS
```scss
@use 'node_modules/@matteusan/himig';
@use 'node_modules/@matteusan/himig/ms-button';

@include himig.init() {
@include ms-button.render();
}
```

## Variants
Button variants are called using the [`is-` modifier](../foundation/components.md#structure).

### Text Variant
These are used as tertiary actions, or actions that are of the least attention to.
```html
<button class="ms-button" role="button">
<span class="ms-button__label">Button</span>
</button>
```

### Outlined Variant
These are used as secondary actions, or actions that are of the second of the attention to.
```html
<button class="ms-button is-outlined" role="button">
<span class="ms-button__label">Button</span>
</button>
```

### Filled Variant
These are used as primary actions, or actions that are of the first of the attention to.
```html
<button class="ms-button is-filled" role="button">
<span class="ms-button__label">Button</span>
</button>
```

## Icons
Icons are great for attaching pictograms to actions. This makes repeated actions more memorable and easier to understand at a glance. Either can be placed as a leading or trailing icon; but never both at the same time.

### Leading Icon
```html
<button class="ms-button is-filled" role="button">
<span class="ms-button__label">Button</span>
<i class="ms-button__icon"><!-- svg --></i>
</button>
```

### Trailing Icon
```html
<button class="ms-button is-filled" role="button">
<i class="ms-button__icon"><!-- svg --></i>
<span class="ms-button__label">Button</span>
</button>
```

## API
### Anatomical Classes
These classes make up the elements inside a component.

| Class | Effect |
|---------------------|-----------------------------|
| `.ms-button` | Main button class. |
| `.ms-button__label` | Class for the button label. |
| `.ms-button__icon` | Class for the button icon. |

### Variant Classes
For information on how to use these classes, [click here](index.md#modification-html).

| Class | Effect |
|-----------------|-------------------------------------------------------|
| `.is-outlined` | Renders the component in its outlined style. |
| `.is-filled` | Renders the component in its filled style. |
| `.is-error` | Renders the component in its error state. |


### Custom Properties
These are for creating your own component theme classes that you can append to the parent element markup.

| Property | Effect |
|--------------------------|------------------------------------------|
| `--ms-button-fill` | Changes the button's background color. |
| `--ms-button-ink` | Changes the button's text color. |
| `--ms-button-border` | Changes the button's border color. |
| `--ms-button-radius` | Changes the button's border radius. |
| `--ms-button-gap` | Changes the button's label and icon gap. |
| `--ms-button-padding` | Changes the button's padding. |
| `--ms-button-weight` | Changes the button's weight. |
| `--ms-button-icon-ink` | Changes the button's icon color. |
| `--ms-button-icon-size` | Changes the button's icon size. |
| `--ms-button-label-ink` | Changes the button's label color. |
| `--ms-button-label-size` | Changes the button's label size. |

### Configuring styles
Here are all the themeable properties for this component. The directions to use these properties are located in
the [render API](index.md#modification-scss).

```scss
// _button-theme.scss

$init-color: (
fill: (
default: 'accent-400',
hover: 'accent-300',
active: 'accent-200',
focus: 'accent-400',
disabled: 'disabled',
),
ink: (
default: 'accent-ink',
hover: 'accent-ink',
active: 'accent-ink',
focus: 'accent-ink',
disabled: 'disabled-ink',
),
border: (
default: 'accent-400',
hover: 'accent-300',
active: 'accent-200',
focus: 'accent-400',
disabled: 'disabled',
),
);

$init-struct: (
width: (
default: 100%,
min: 69px,
max: max-content
),
padding: ('md' 'lg'),
radius: 'small',
border-width: 'xs',
border-style: solid,
gap: 'xs'
);

$init-typography: (
family: 'global',
size: 'body',
weight: 'bold',
line-height: 1.25rem
);

$init-settings: ();
```

### Extending styles
If you wish to extend the component styles, the [`extend()` API](index.md#extension-scss) might come in handy.
14 changes: 7 additions & 7 deletions specs/foundation/color/applying-colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Applying Colors
slug: /foundation/color/applying-colors
---
# Applying Colors
Gaia's guidelines to applying colors to an element.
Himig's guidelines to applying colors to an element.

## Component Color Anatomy
When applying color to a component, we generally apply it to three main parts of an element/component:
Expand All @@ -27,7 +27,7 @@ For the API information, please visit the [color composition API page](../../api
@use 'node_modules/@matteusan/himig';

.ms-component {
@include himigcolor-fill('component', 'token-or-value');
@include himig.color-fill('component', 'token-or-value');
}
```

Expand All @@ -44,7 +44,7 @@ For the API information, please visit the [color composition API page](../../api
@use 'node_modules/@matteusan/himig';

.ms-component {
@include himigcolor-ink('component', 'token-or-value');
@include himig.color-ink('component', 'token-or-value');
}
```

Expand All @@ -60,20 +60,20 @@ For the API information, please visit the [color composition API page](../../api
@use 'node_modules/@matteusan/himig';

.ms-component {
@include himigcolor-border('component', 'token-or-value');
@include himig.color-border('component', 'token-or-value');
}
```

## Applying the colors together
Gaia provides an SCSS mixin that lets you apply all three in one go. It's the `color-apply()` mixin. It takes the component name, and the color map.
Himig provides an SCSS mixin that lets you apply all three in one go. It's the `color-apply()` mixin. It takes the component name, and the color map.

For the API information, please visit the [color composition API page](../../api/composition/color.md).

```scss
@use 'node_modules/@matteusan/himig';

.ms-component {
@include himigcolor-apply('component', (
@include himig.color-apply('component', (
fill: 'token-or-value',
ink: 'token-or-value',
border: 'token-or-value'
Expand All @@ -82,7 +82,7 @@ For the API information, please visit the [color composition API page](../../api
```

### What if we don't want a color on the `x` part?
The design system doesn't prohibit you to use the **transparent color** for a specific part of the component. In fact, it is used in the outlined styles of a component (see [outlined button style](page missing)).
The design system doesn't prohibit you to use the **transparent color** for a specific part of the component. In fact, it is used in the outlined styles of a component (see [outlined button style](https://github.com/MatteuSan/himig/blob/main/packages/himig/ms-button/_button-mixins.scss#L91-L93)).

## Valid Raw Colors
Here's a list of all the valid raw colors you can use:
Expand Down
2 changes: 1 addition & 1 deletion specs/foundation/color/color-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Color Tokens
slug: /foundation/color/tokens
---
# Color Tokens
Gaia provides an extensive list of carefully crafted, pre-made color tokens ready to go.
Himig provides an extensive list of carefully crafted, pre-made color tokens ready to go.

## Color Token Schema
The color tokens follow a specific schema to make indexing much easier. The color tokens follow a `200-800` color schema:
Expand Down
Loading

0 comments on commit d89e71d

Please sign in to comment.