@snyk-mktg/brand-ui 2.5.9-canary.0 → 2.5.9-canary.1

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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@snyk-mktg/brand-ui",
3
- "version": "2.5.9-canary.0",
3
+ "version": "2.5.9-canary.1",
4
4
  "description": "The official style library for Snyk’s BrandUI Design System",
5
5
  "scripts": {
6
6
  "dev:css": "gulp devCss",
7
7
  "build": "gulp",
8
8
  "test": "jest",
9
9
  "lint": "sass-lint -v",
10
- "lint:fix": "sass-lint-auto-fix"
10
+ "lint:fix": "sass-lint-auto-fix",
11
+ "compile": "rm -rf dist/js && tsc -p tsconfig.build.json && tsc -p tsconfig.build.json --module CommonJs --moduleResolution node --outDir dist/js/cjs"
11
12
  },
12
13
  "type": "module",
13
14
  "repository": {
@@ -1 +0,0 @@
1
- export {};
@@ -1,59 +0,0 @@
1
- import { expect, describe, it } from '@jest/globals';
2
- import { formatCase } from './';
3
- describe('formatCase', () => {
4
- it('should convert text to kebab case', () => {
5
- const text = 'helloWorld';
6
- const result = formatCase(text, 'kebab');
7
- expect(result).toBe('hello-world');
8
- });
9
- it('should convert text to snake case', () => {
10
- const text = 'helloWorld';
11
- const result = formatCase(text, 'snake');
12
- expect(result).toBe('hello_world');
13
- });
14
- it('should convert text to space case', () => {
15
- const text = 'helloWorld';
16
- const result = formatCase(text, 'space');
17
- expect(result).toBe('hello world');
18
- });
19
- it('should convert text to camel case', () => {
20
- const text = 'hello world';
21
- const result = formatCase(text, 'camel');
22
- expect(result).toBe('helloWorld');
23
- });
24
- it('should convert text to sentence case', () => {
25
- const text = 'hello world';
26
- const result = formatCase(text, 'sentence');
27
- expect(result).toBe('Hello world');
28
- });
29
- it('should capitalize the first letter', () => {
30
- const text = 'hello world';
31
- const result = formatCase(text, 'capitalize');
32
- expect(result).toBe('Hello world');
33
- });
34
- it('should capitalize the first letter of each word', () => {
35
- const text = 'hello world';
36
- const result = formatCase(text, 'capitalizeSentence');
37
- expect(result).toBe('Hello World');
38
- });
39
- it('should handle empty text', () => {
40
- const text = '';
41
- const result = formatCase(text, 'kebab');
42
- expect(result).toBe('');
43
- });
44
- it('should handle invalid convertCase', () => {
45
- const text = 'hello world';
46
- const result = formatCase(text, 'invalid');
47
- expect(result).toBe('hello world');
48
- });
49
- it('should handle text with special characters', () => {
50
- const text = 'hello-world123';
51
- const result = formatCase(text, 'kebab');
52
- expect(result).toBe('hello-world123');
53
- });
54
- it('should handle text with mixed case', () => {
55
- const text = 'HelloWorld';
56
- const result = formatCase(text, 'camel');
57
- expect(result).toBe('helloWorld');
58
- });
59
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- import { expect, describe, it } from '@jest/globals';
2
- import { classNames } from './'; // Replace with the correct import path
3
- describe('classNames', () => {
4
- it('should return an empty string with no classes', () => {
5
- expect(classNames()).toBe('');
6
- });
7
- it('should return a single class', () => {
8
- expect(classNames('class1')).toBe('class1');
9
- });
10
- it('should return multiple classes joined by spaces', () => {
11
- expect(classNames('class1', 'class2', 'class3')).toBe('class1 class2 class3');
12
- });
13
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,29 +0,0 @@
1
- import { expect, describe, it } from '@jest/globals';
2
- import { getInitials } from './';
3
- describe('getInitials', () => {
4
- it('should return the first and last initials for a full name', () => {
5
- const fullName = 'John Doe';
6
- const initials = getInitials(fullName);
7
- expect(initials).toBe('JD');
8
- });
9
- it('should return the first initial for a single name', () => {
10
- const fullName = 'John';
11
- const initials = getInitials(fullName);
12
- expect(initials).toBe('J');
13
- });
14
- it('should handle empty string input', () => {
15
- const fullName = '';
16
- const initials = getInitials(fullName);
17
- expect(initials).toBe('');
18
- });
19
- it('should handle multiple middle names', () => {
20
- const fullName = 'John William Doe Smith';
21
- const initials = getInitials(fullName);
22
- expect(initials).toBe('JS');
23
- });
24
- it('should handle names with special characters', () => {
25
- const fullName = 'John O\'Brien Smith';
26
- const initials = getInitials(fullName);
27
- expect(initials).toBe('JS');
28
- });
29
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- import { expect, describe, it } from '@jest/globals';
2
- import { gridSplit, gridSpacing } from './';
3
- describe('gridSplit', () => {
4
- it('should return the count when count is less than maxCols', () => {
5
- expect(gridSplit(3)).toBe(3);
6
- expect(gridSplit(4, 10)).toBe(4);
7
- });
8
- it('should return maxCols when count is greater than or equal to maxCols', () => {
9
- expect(gridSplit(6)).toBe(5); // Default maxCols is 5
10
- expect(gridSplit(10, 8)).toBe(8);
11
- });
12
- it('should return 12 when maxCols is greater than or equal to 12 and sount is 0', () => {
13
- expect(gridSplit(0, 15)).toBe(12);
14
- expect(gridSplit(0, 13)).toBe(12);
15
- });
16
- it('should return 1 for invalid or zero count', () => {
17
- expect(gridSplit(0)).toBe(1);
18
- expect(gridSplit(-2)).toBe(1);
19
- });
20
- });
21
- describe('gridSpacing', () => {
22
- it('should return max width for 2 or less columns', () => {
23
- const spacing2 = gridSpacing(2);
24
- expect(spacing2.hasMaxWidth).toBe(true);
25
- const spacing1 = gridSpacing(1);
26
- expect(spacing1.hasMaxWidth).toBe(true);
27
- });
28
- it('should adjust padding and gap for 4 columns', () => {
29
- const spacing = gridSpacing(4);
30
- expect(spacing).toEqual({
31
- hasMaxWidth: false,
32
- itemPadding: 'medium',
33
- gap: 'medium',
34
- });
35
- });
36
- it('should adjust padding and gap for more than 4 columns', () => {
37
- const spacing = gridSpacing(5);
38
- expect(spacing).toEqual({
39
- hasMaxWidth: false,
40
- itemPadding: 'medium',
41
- gap: 'small',
42
- });
43
- });
44
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { expect, describe, it } from '@jest/globals';
2
- import { range } from './';
3
- describe('range', () => {
4
- it('should generate a simple range', () => {
5
- const result = range(1, 5, 1);
6
- expect(result).toEqual([1, 2, 3, 4, 5]);
7
- });
8
- it('should generate a range with a step of 2', () => {
9
- const result = range(1, 10, 2);
10
- expect(result).toEqual([1, 3, 5, 7, 9]);
11
- });
12
- it('should handle negative step', () => {
13
- const result = range(5, 1, -1);
14
- expect(result).toEqual([5, 4, 3, 2, 1]);
15
- });
16
- it('should handle zero step', () => {
17
- const result = range(1, 5, 0);
18
- expect(result).toEqual([]);
19
- });
20
- it('should handle empty range', () => {
21
- const result = range(5, 1, 1);
22
- expect(result).toEqual([]);
23
- });
24
- });