@servicetitan/docs-anvil-uikit-contrib 38.0.0 → 38.2.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.
- package/docs/intl/currency.mdx +4 -5
- package/docs/intl/date-time.mdx +6 -6
- package/docs/intl/date.mdx +1 -0
- package/docs/intl/index.mdx +0 -3
- package/docs/intl/number.mdx +1 -0
- package/docs/intl/plural.mdx +1 -0
- package/docs/intl/time.mdx +1 -0
- package/docs/secrets.mdx +23 -0
- package/package.json +2 -2
package/docs/intl/currency.mdx
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
title: Currency
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
FormattedCurrencyMiniDemo
|
|
7
|
-
} from '@servicetitan/intl/demo';
|
|
5
|
+
import { FormattedCurrencyMiniDemo } from '@servicetitan/intl/demo';
|
|
8
6
|
import { DemoExample } from '@site/src/components/code-demo';
|
|
9
7
|
import Tabs from '@theme/Tabs';
|
|
8
|
+
import TabItem from '@theme/TabItem';
|
|
10
9
|
|
|
11
10
|
Numbers can be formatted as currency either by using the `FormattedCurrency` component from `@servicetitan/intl`, or via the `formatCurrency()` function as part of the `intl` object, which can be retrieved via the [`useIntl()`](./API/use-intl.mdx) hook or through the [`IntlStore`](./API/intlstore.mdx) store.
|
|
12
11
|
|
|
@@ -36,7 +35,7 @@ function CurrencyExample() {
|
|
|
36
35
|
<FormattedCurrency value={1234.56} currency="EUR" />
|
|
37
36
|
</>
|
|
38
37
|
);
|
|
39
|
-
}
|
|
38
|
+
}
|
|
40
39
|
```
|
|
41
40
|
|
|
42
41
|
### formatCurrency
|
|
@@ -64,7 +63,7 @@ function CurrencyExample() {
|
|
|
64
63
|
{intl.formatCurrency(1234.56, { style: 'currency', currency: 'EUR' })}
|
|
65
64
|
</>
|
|
66
65
|
);
|
|
67
|
-
}
|
|
66
|
+
}
|
|
68
67
|
```
|
|
69
68
|
|
|
70
69
|
</TabItem>
|
package/docs/intl/date-time.mdx
CHANGED
|
@@ -13,12 +13,12 @@ Use `FormattedDateTime` and `formatDateTime` to format a date value as a combine
|
|
|
13
13
|
|
|
14
14
|
The following standard ServiceTitan formats are available (examples are in `en-US` locale).
|
|
15
15
|
|
|
16
|
-
| Format | Description
|
|
17
|
-
| :------------------ |
|
|
18
|
-
| `short` | Short date and short time
|
|
19
|
-
| `shortWithTimeZone` | Short date and short time, with timezone
|
|
20
|
-
| `long` | Long date and short time
|
|
21
|
-
| `longWithTimeZone` | Long date and short time, with timezone
|
|
16
|
+
| Format | Description | Example |
|
|
17
|
+
| :------------------ | :-------------------------------------------------------------------------- | :------------------------------- |
|
|
18
|
+
| `short` | Short date and short time. This is the default when no format is specified. | `01/09/2025, 4:00 PM` |
|
|
19
|
+
| `shortWithTimeZone` | Short date and short time, with timezone | `01/09/2025, 4:00 PM EST` |
|
|
20
|
+
| `long` | Long date and short time | `January 9, 2025 at 4:00 PM` |
|
|
21
|
+
| `longWithTimeZone` | Long date and short time, with timezone | `January 9, 2025 at 4:00 PM EST` |
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
package/docs/intl/date.mdx
CHANGED
|
@@ -5,6 +5,7 @@ title: Date
|
|
|
5
5
|
import { FormattedDateMiniDemo } from '@servicetitan/intl/demo';
|
|
6
6
|
import { DemoExample } from '@site/src/components/code-demo';
|
|
7
7
|
import Tabs from '@theme/Tabs';
|
|
8
|
+
import TabItem from '@theme/TabItem';
|
|
8
9
|
|
|
9
10
|
Dates can be formatted either by using the [`FormattedDate`](#formatteddate) component from `@servicetitan/intl`, or via the [`formatDate`](#formatdate) function as part of the `intl` object, which can be retrieved via the [`useIntl`](./API/use-intl.mdx) hook or through the [`IntlStore`](./API/intlstore.mdx) store.
|
|
10
11
|
|
package/docs/intl/index.mdx
CHANGED
|
@@ -4,9 +4,6 @@ title: Intl (Internationalization)
|
|
|
4
4
|
|
|
5
5
|
#### [CHANGELOG (@servicetitan/intl)](https://github.com/servicetitan/anvil-uikit-contrib/blob/master/packages/intl/CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
import Tabs from '@theme/Tabs';
|
|
8
|
-
import TabItem from '@theme/TabItem';
|
|
9
|
-
|
|
10
7
|
`@servicetitan/intl` is a solution for helping setup internationalization in React projects (with optional MobX store) that is a light wrapper around [`Format.js`](https://formatjs.github.io/) and [`react-intl`](https://formatjs.github.io/docs/react-intl/). This library creates an internationalization API with a provided _locale_, _timeZone_, and _currency_, and provides that API to `react-intl` to be used within React context, as well as a store to be used within MobX.
|
|
11
8
|
|
|
12
9
|
## Setup
|
package/docs/intl/number.mdx
CHANGED
|
@@ -5,6 +5,7 @@ title: Number
|
|
|
5
5
|
import { FormattedNumberMiniDemo } from '@servicetitan/intl/demo';
|
|
6
6
|
import { DemoExample } from '@site/src/components/code-demo';
|
|
7
7
|
import Tabs from '@theme/Tabs';
|
|
8
|
+
import TabItem from '@theme/TabItem';
|
|
8
9
|
|
|
9
10
|
Numbers can be formatted either by using the `FormattedNumber` component from `@servicetitan/intl`, or via the `formatNumber()` function as part of the `intl` object, which can be retrieved via the [`useIntl()`](./API/use-intl.mdx) hook or through the [`IntlStore`](./API/intlstore.mdx) store.
|
|
10
11
|
|
package/docs/intl/plural.mdx
CHANGED
|
@@ -5,6 +5,7 @@ title: Plural
|
|
|
5
5
|
import { FormattedPluralMiniDemo } from '@servicetitan/intl/demo';
|
|
6
6
|
import { DemoExample } from '@site/src/components/code-demo';
|
|
7
7
|
import Tabs from '@theme/Tabs';
|
|
8
|
+
import TabItem from '@theme/TabItem';
|
|
8
9
|
|
|
9
10
|
Plurals can be formatted by using the `FormattedPlural` component from `@servicetitan/intl`, or via the `formatPluralMessage()` function as part of the `intl` object, which can be retrieved via the [`useIntl()`](./API/use-intl.mdx) hook or through the [`IntlStore`](./API/intlstore.mdx) store.
|
|
10
11
|
|
package/docs/intl/time.mdx
CHANGED
|
@@ -5,6 +5,7 @@ title: Time
|
|
|
5
5
|
import { FormattedTimeMiniDemo } from '@servicetitan/intl/demo';
|
|
6
6
|
import { DemoExample } from '@site/src/components/code-demo';
|
|
7
7
|
import Tabs from '@theme/Tabs';
|
|
8
|
+
import TabItem from '@theme/TabItem';
|
|
8
9
|
|
|
9
10
|
Times can be formatted either by using the [`FormattedTime`](#formattedtime) component from `@servicetitan/intl`, or via the [`formatTime`](#formattime) function as part of the `intl` object, which can be retrieved via the [`useIntl`](./API/use-intl.mdx) hook or through the [`IntlStore`](./API/intlstore.mdx) store.
|
|
10
11
|
|
package/docs/secrets.mdx
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Secrets
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
`@servicetitan/secrets` provides a centralized way to manage and distribute shared frontend secrets (API keys, tokens, etc.) across ServiceTitan's applications.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
Import secrets directly from the package:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { arcgisApiKey } from '@servicetitan/secrets';
|
|
13
|
+
|
|
14
|
+
const mapClient = new ArcGisClient(arcgisApiKey);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Managing Secrets
|
|
18
|
+
|
|
19
|
+
For detailed instructions on adding, updating, and managing secrets, see the [package README](https://github.com/servicetitan/anvil-uikit-contrib/blob/master/packages/secrets/README.md).
|
|
20
|
+
|
|
21
|
+
## Frontend Secrets Only
|
|
22
|
+
|
|
23
|
+
This package is designed for **frontend secrets only** - secrets that are safe to be public and checked into version control (e.g., read-only API keys, analytics tokens). Never store private keys, database credentials, or backend-only secrets here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-anvil-uikit-contrib",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"cli": {
|
|
17
17
|
"webpack": false
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "b013c9f39c05c44f888a5bca5ff6aadb89cd7a6f"
|
|
20
20
|
}
|