@octaviaflow/themes 1.0.1 → 2.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.
- package/CHANGELOG.md +70 -0
- package/es/index.js +4981 -0
- package/lib/index.js +2404 -2618
- package/package.json +13 -14
- package/scss/generated/_button-tokens.scss +115 -0
- package/scss/generated/_content-switcher-tokens.scss +30 -0
- package/scss/generated/_notification-tokens.scss +77 -0
- package/scss/generated/_status-tokens.scss +75 -0
- package/scss/generated/_tag-tokens.scss +289 -0
- package/scss/generated/_themes.scss +604 -0
- package/scss/generated/_tokens.scss +443 -0
- package/src/__tests__/themes-test.js +26 -0
- package/src/__tests__/themes.test.js +26 -0
- package/src/__tests__/tools-test.js +34 -0
- package/src/__tests__/tools.test.js +34 -0
- package/src/component-tokens/content-switcher/index.js +8 -0
- package/src/component-tokens/content-switcher/tokens.js +31 -0
- package/src/component-tokens/status/index.js +8 -0
- package/src/component-tokens/status/tokens.js +91 -0
- package/src/tokens/__tests__/Token-test.js +50 -0
- package/src/tokens/__tests__/TokenFormat-test.js +32 -0
- package/src/tokens/__tests__/TokenGroup-test.js +166 -0
- package/src/tokens/__tests__/TokenSet-test.js +111 -0
- package/src/tokens/__tests__/__snapshots__/v11-test.js.snap +291 -0
- package/src/tokens/__tests__/metadata-test.js +1674 -0
- package/src/tokens/__tests__/v11-test.js +36 -0
- package/src/v10/__tests__/themes-test.js +32 -0
- package/src/v10/__tests__/tokens-test.js +23 -0
- package/telemetry.yml +12 -8
- package/umd/index.js +5421 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow
|
|
3
|
+
* Author: Vishal Kumar
|
|
4
|
+
* Created: 11/November/2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
import * as v11TokenGroup from '../v11TokenGroup';
|
|
12
|
+
|
|
13
|
+
describe('v11', () => {
|
|
14
|
+
test('v11 token group', () => {
|
|
15
|
+
expect(
|
|
16
|
+
v11TokenGroup.group.getTokens().map((token) => token.name)
|
|
17
|
+
).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test.each([
|
|
21
|
+
'background',
|
|
22
|
+
'layer',
|
|
23
|
+
'field',
|
|
24
|
+
'border',
|
|
25
|
+
'text',
|
|
26
|
+
'link',
|
|
27
|
+
'icon',
|
|
28
|
+
'support',
|
|
29
|
+
'focus',
|
|
30
|
+
'skeleton',
|
|
31
|
+
])('%s token group', (group) => {
|
|
32
|
+
expect(
|
|
33
|
+
v11TokenGroup[group].getTokens().map((token) => token.name)
|
|
34
|
+
).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @jest-environment node
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { themes, tokens } = require('../');
|
|
11
|
+
|
|
12
|
+
const tokenList = Object.keys(tokens).reduce((acc, key) => {
|
|
13
|
+
return acc.concat(tokens[key]);
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
describe('themes', () => {
|
|
17
|
+
describe.each(Object.keys(themes))('%s', (name) => {
|
|
18
|
+
const theme = themes[name];
|
|
19
|
+
|
|
20
|
+
// Test to make sure that all tokens defined exist in the theme
|
|
21
|
+
test.each(tokenList)('%s should be defined', (token) => {
|
|
22
|
+
expect(theme[token]).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Test to make sure that all values in the them are actually tokens, useful
|
|
26
|
+
// for catching a case where we have an extra token that should be in the
|
|
27
|
+
// tokens export
|
|
28
|
+
test.each(Object.keys(theme))('%s should be a token', (token) => {
|
|
29
|
+
expect(tokenList.indexOf(token)).not.toBe(-1);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright OctaviaFlow. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @jest-environment node
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { unstable__meta as meta, tokens } from '../tokens';
|
|
11
|
+
|
|
12
|
+
const { colors } = tokens;
|
|
13
|
+
|
|
14
|
+
describe('tokens', () => {
|
|
15
|
+
describe('colors', () => {
|
|
16
|
+
test.each(colors)('%s should be grouped in meta', (color) => {
|
|
17
|
+
const entry = meta.colors.find((group) => {
|
|
18
|
+
return group.tokens.includes(color);
|
|
19
|
+
});
|
|
20
|
+
expect(entry).toBeDefined();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
package/telemetry.yml
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://unpkg.com/@octaviaflow/telemetry-config-schema@v1.0.0/dist/config.schema.json
|
|
2
2
|
version: 1
|
|
3
|
-
projectId:
|
|
4
|
-
name:
|
|
3
|
+
projectId: "64db1997-f0bc-4900-8a91-e98f3f770ad0"
|
|
4
|
+
name: "octaviaflow-themes"
|
|
5
|
+
endpoint: "https://telemetry.octaviaflow.com/api/v1/collect"
|
|
5
6
|
storage:
|
|
6
|
-
type:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
type: "http"
|
|
8
|
+
http:
|
|
9
|
+
endpoint: "https://telemetry.octaviaflow.com/api/v1/collect"
|
|
10
|
+
method: "POST"
|
|
11
|
+
headers:
|
|
12
|
+
Content-Type: "application/json"
|
|
13
|
+
X-Project-Id: "64db1997-f0bc-4900-8a91-e98f3f770ad0"
|
|
14
|
+
timeout: 5000
|
|
15
|
+
retryAttempts: 3
|
|
12
16
|
collect:
|
|
13
17
|
npm:
|
|
14
18
|
dependencies: null
|