You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, tree-shaking extra Shoelace components proved to be a challenge. As a result, we now recommend cherry-picking components you want to use, rather than importing from a single entrypoint.
61
+
However, tree-shaking extra Terra components proved to be a challenge. As a result, we now recommend cherry-picking components you want to use, rather than importing from a single entrypoint.
62
62
63
63
```diff
64
64
- import { TerraButton } from '@nasa-terra/components/%NPMDIR%/react';
@@ -69,7 +69,7 @@ You can find a copy + paste import for each component in the "importing" section
69
69
70
70
### Event Handling
71
71
72
-
Many Shoelace components emit [custom events](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent). For example, the [input component](/components/input) emits the `terra-input` event when it receives input. In React, you can listen for the event using `onSlInput`.
72
+
Many Terra components emit [custom events](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent). For example, the [input component](/components/input) emits the `terra-input` event when it receives input. In React, you can listen for the event using `onSlInput`.
73
73
74
74
Here's how you can bind the input's value to a state variable.
75
75
@@ -137,7 +137,7 @@ export default MyComponent
137
137
138
138
Testing with web components can be challenging if your test environment runs in a Node environment (i.e. it doesn't run in a real browser). Fortunately, [Jest](https://jestjs.io/) has made a number of strides to support web components and provide additional browser APIs. However, it's still not a complete replication of a browser environment.
139
139
140
-
Here are some tips that will help smooth things over if you're having trouble with Jest + Shoelace.
140
+
Here are some tips that will help smooth things over if you're having trouble with Jest + Terra.
141
141
142
142
:::tip
143
143
If you're looking for a fast, modern testing alternative, consider [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/).
@@ -179,18 +179,18 @@ For more details, refer to Jest's [manual mocking](https://jestjs.io/docs/manual
179
179
180
180
### Transform ES Modules
181
181
182
-
ES Modules are a [well-supported browser standard](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/). This is how Shoelace is distributed, but most React apps expect CommonJS. As a result, you'll probably run into the following error.
182
+
ES Modules are a [well-supported browser standard](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/). This is how Terra is distributed, but most React apps expect CommonJS. As a result, you'll probably run into the following error.
183
183
184
184
```
185
185
Error: Unable to import outside of a module
186
186
```
187
187
188
-
To fix this, add the following to your `package.json` which tells the transpiler to process Shoelace modules.
188
+
To fix this, add the following to your `package.json` which tells the transpiler to process Terra modules.
@@ -200,5 +200,5 @@ These instructions are for apps created via Create React App. If you're using Je
200
200
For more details, refer to Jest's [`transformIgnorePatterns` customization](https://jestjs.io/docs/tutorial-react-native#transformignorepatterns-customization) documentation.
201
201
202
202
:::tip
203
-
Are you using Shoelace with React? [Help us improve this page!](https://github.com/nasa/terra-ui-components/blob/next/docs/frameworks/react.md)
203
+
Are you using Terra with React? [Help us improve this page!](https://github.com/nasa/terra-ui-components/blob/next/docs/frameworks/react.md)
If that's too verbose for your liking, you can use a custom directive instead. [This utility](https://www.npmjs.com/package/@shoelace-style/vue-terra-model) adds a custom directive that will work just like `v-model` but for Shoelace components. To install it, use this command.
77
-
78
-
```bash
79
-
npm install @shoelace-style/vue-terra-model@1
80
-
```
81
-
82
-
Next, import the directive and enable it like this.
Copy file name to clipboardExpand all lines: docs/pages/frameworks/vue.md
+6-12Lines changed: 6 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
2
meta:
3
3
title: Vue
4
-
description: Tips for using Shoelace in your Vue 3 app.
4
+
description: Tips for using terra in your Vue 3 app.
5
5
---
6
6
7
7
# Vue
8
8
9
-
Vue [plays nice](https://custom-elements-everywhere.com/#vue) with custom elements, so you can use Shoelace in your Vue apps with ease.
9
+
Vue [plays nice](https://custom-elements-everywhere.com/#vue) with custom elements, so you can use Terra in your Vue apps with ease.
10
10
11
11
:::tip
12
12
These instructions are for Vue 3 and above. If you're using Vue 2, please see the [Vue 2 instructions](/frameworks/vue-2).
13
13
:::
14
14
15
15
## Installation
16
16
17
-
To add Shoelace to your Vue app, install the package from npm.
17
+
To add Terra to your Vue app, install the package from npm.
18
18
19
19
```bash
20
20
npm install @nasa-terra/components
@@ -37,11 +37,11 @@ If you'd rather not use the CDN for assets, you can create a build task that cop
37
37
38
38
If you haven't configured your Vue.js project to work with custom elements/web components, follow [the instructions here](https://vuejs.org/guide/extras/web-components.html#using-custom-elements-in-vue) based on your project type to ensure your project will not throw an error when it encounters a custom element.
39
39
40
-
Now you can start using Shoelace components in your app!
40
+
Now you can start using Terra components in your app!
41
41
42
42
## Types
43
43
44
-
Once you have configured your application for custom elements, you should be able to use Shoelace in your application without it causing any errors. Unfortunately, this doesn't register the custom elements to behave like components built using Vue. To provide autocomplete information and type safety for your components, you can import the Shoelace Vue types into your `tsconfig.json` to get better integration in your standard Vue and JSX templates.
44
+
Once you have configured your application for custom elements, you should be able to use Terra in your application without it causing any errors. Unfortunately, this doesn't register the custom elements to behave like components built using Vue. To provide autocomplete information and type safety for your components, you can import the Terra Vue types into your `tsconfig.json` to get better integration in your standard Vue and JSX templates.
45
45
46
46
```json
47
47
{
@@ -105,15 +105,9 @@ One caveat is there's currently [no support for v-model on custom elements](http
If that's too verbose for your liking, you can use a custom directive instead. [This utility](https://www.npmjs.com/package/@shoelace-style/vue-terra-model) adds a custom directive that will work just like `v-model` but for Shoelace components.
109
-
110
-
:::tip
111
-
Are you using Shoelace with Vue? [Help us improve this page!](https://github.com/nasa/terra-ui-components/blob/next/docs/frameworks/vue.md)
112
-
:::
113
-
114
108
### Slots
115
109
116
-
Slots in Shoelace/web components are functionally the same as basic slots in Vue. Slots can be assigned to elements using the `slot` attribute followed by the name of the slot it is being assigned to.
110
+
Slots in Terra/web components are functionally the same as basic slots in Vue. Slots can be assigned to elements using the `slot` attribute followed by the name of the slot it is being assigned to.
Copy file name to clipboardExpand all lines: docs/pages/getting-started/customizing.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
meta:
3
3
title: Customizing
4
-
description: Learn how to customize Shoelace through parts and custom properties.
4
+
description: Learn how to customize Terra through parts and custom properties.
5
5
---
6
6
7
7
# Customizing
8
8
9
-
Shoelace components can be customized at a high level through design tokens. This gives you control over theme colors and general styling. For more advanced customizations, you can make use of CSS parts and custom properties to target individual components.
9
+
Terra components can be customized at a high level through design tokens. This gives you control over theme colors and general styling. For more advanced customizations, you can make use of CSS parts and custom properties to target individual components.
10
10
11
11
## Design Tokens
12
12
13
-
Shoelace makes use of several design tokens to provide a consistent appearance across components. You can customize them and use them in your own application with pure CSS — no preprocessor required.
13
+
Terra makes use of several design tokens to provide a consistent appearance across components. You can customize them and use them in your own application with pure CSS — no preprocessor required.
14
14
15
15
Design tokens offer a high-level way to customize the library with minimal effort. There are no component-specific variables, however, as design tokens are intended to be generic and highly reusable. To customize an individual component, refer to the section entitled [CSS Parts](#css-parts).
16
16
@@ -41,7 +41,7 @@ Many design tokens are described further along in this documentation. For a comp
41
41
42
42
Whereas design tokens offer a high-level way to customize the library, CSS parts offer a low-level way to customize individual components. Again, this is done with pure CSS — no preprocessor required.
43
43
44
-
Shoelace components use a [shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) to encapsulate their styles and behaviors. As a result, you can't simply target their internals with the usual CSS selectors. Instead, components expose "parts" that can be targeted with the [CSS part selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part), or `::part()`.
44
+
Terra components use a [shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) to encapsulate their styles and behaviors. As a result, you can't simply target their internals with the usual CSS selectors. Instead, components expose "parts" that can be targeted with the [CSS part selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part), or `::part()`.
45
45
46
46
Here's an example that modifies buttons with the `tomato-button` class.
47
47
@@ -112,7 +112,7 @@ Not all components expose CSS custom properties. For those that do, they can be
112
112
113
113
## Animations
114
114
115
-
Some components use animation, such as when a dialog is shown or hidden. Animations are performed using the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API) rather than CSS. However, you can still customize them through Shoelace's animation registry. If a component has customizable animations, they'll be listed in the "Animation" section of its documentation.
115
+
Some components use animation, such as when a dialog is shown or hidden. Animations are performed using the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API) rather than CSS. However, you can still customize them through Terra's animation registry. If a component has customizable animations, they'll be listed in the "Animation" section of its documentation.
116
116
117
117
To customize a default animation, use the `setDefaultAnimation()` method. The function accepts an animation name (found in the component's docs) and an object with `keyframes`, and `options` or `null` to disable the animation.
0 commit comments