northants-design-system 2.2.0 → 2.3.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/build/index.d.ts +3 -1
- package/build/index.js +840 -201
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +838 -201
- package/build/index.mjs.js.map +1 -1
- package/build/library/components/BudgetSlider/BudgetSlider.d.ts +4 -0
- package/build/library/components/BudgetSlider/BudgetSlider.test.d.ts +1 -0
- package/build/library/components/BudgetSlider/BudgetSlider.types.d.ts +56 -0
- package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.d.ts +4 -0
- package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.test.d.ts +1 -0
- package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.types.d.ts +17 -0
- package/build/library/components/RadioCheckboxInput/RadioCheckboxInput.types.d.ts +4 -0
- package/build/library/components/logos/WestColouredLogo/logo.d.ts +2 -2
- package/build/library/pages/BudgetGameExample/BudgetGameExample.d.ts +4 -0
- package/build/library/pages/BudgetQuizExample/BudgetQuizExample.d.ts +4 -0
- package/build/library/slices/BudgetGame/BudgetGame.d.ts +7 -0
- package/build/library/slices/BudgetGame/BudgetGame.storydata.d.ts +2 -0
- package/build/library/slices/BudgetGame/BudgetGame.test.d.ts +1 -0
- package/build/library/slices/BudgetGame/BudgetGame.types.d.ts +20 -0
- package/build/library/slices/Quiz/Quiz.d.ts +4 -0
- package/build/library/slices/Quiz/Quiz.storydata.d.ts +2 -0
- package/build/library/slices/Quiz/Quiz.test.d.ts +1 -0
- package/build/library/slices/Quiz/Quiz.types.d.ts +11 -0
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface BudgetSliderProps {
|
|
2
|
+
/**
|
|
3
|
+
* The budget slider title heading text
|
|
4
|
+
*/
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* A line of summary text to describe the slider
|
|
8
|
+
*/
|
|
9
|
+
summary?: string;
|
|
10
|
+
/**
|
|
11
|
+
* An optional icon name
|
|
12
|
+
*/
|
|
13
|
+
icon?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* The minimum percentage allowed
|
|
16
|
+
*/
|
|
17
|
+
minimum: number;
|
|
18
|
+
/**
|
|
19
|
+
* The maximum percentage allowed
|
|
20
|
+
*/
|
|
21
|
+
maximum: number;
|
|
22
|
+
/**
|
|
23
|
+
* The value
|
|
24
|
+
*/
|
|
25
|
+
initialValue?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Optional array of impacts
|
|
28
|
+
*/
|
|
29
|
+
impacts?: ImpactProps[];
|
|
30
|
+
/**
|
|
31
|
+
* The function passed in that will triggered when the value is updated (for parent component to manage)
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (value: number, index: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* The index number of the service from the parent component
|
|
36
|
+
*/
|
|
37
|
+
index?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ImpactProps {
|
|
40
|
+
/**
|
|
41
|
+
* The minimum threshold for the impact
|
|
42
|
+
*/
|
|
43
|
+
minimum: number;
|
|
44
|
+
/**
|
|
45
|
+
* The maximum threshold for the impact
|
|
46
|
+
*/
|
|
47
|
+
maximum: number;
|
|
48
|
+
/**
|
|
49
|
+
* The impact title
|
|
50
|
+
*/
|
|
51
|
+
title: 'low' | 'medium' | 'high';
|
|
52
|
+
/**
|
|
53
|
+
* The summary text for the impact
|
|
54
|
+
*/
|
|
55
|
+
summary: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface QuestionAndAnswerProps {
|
|
2
|
+
/**
|
|
3
|
+
* What is this?
|
|
4
|
+
*/
|
|
5
|
+
questionText: string;
|
|
6
|
+
hintText?: string | null;
|
|
7
|
+
answers: AnswerProps[];
|
|
8
|
+
category?: string | null;
|
|
9
|
+
icon?: string | null;
|
|
10
|
+
onSubmit?: (answer: boolean, index: number) => void;
|
|
11
|
+
index?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface AnswerProps {
|
|
14
|
+
answerText: string;
|
|
15
|
+
correctAnswer: boolean;
|
|
16
|
+
answerSummary: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BudgetSliderProps } from '../../components/BudgetSlider/BudgetSlider.types';
|
|
2
|
+
export interface BudgetGameProps {
|
|
3
|
+
/**
|
|
4
|
+
* The total budget percentage allowed, e.g. 85
|
|
5
|
+
*/
|
|
6
|
+
totalAllowed: number;
|
|
7
|
+
/**
|
|
8
|
+
* An array of Budget Slider props
|
|
9
|
+
*/
|
|
10
|
+
budgetServices: BudgetSliderProps[];
|
|
11
|
+
/**
|
|
12
|
+
* Optional function that is triggered when results are submitted
|
|
13
|
+
* For example, trigger a custom event in Google Analytics
|
|
14
|
+
*/
|
|
15
|
+
onSubmitResults?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Optional function that is triggered when try again is pressed
|
|
18
|
+
*/
|
|
19
|
+
onTryAgain?: () => void;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QuestionAndAnswerProps } from '../../components/QuestionAndAnswer/QuestionAndAnswer.types';
|
|
2
|
+
export interface QuizProps {
|
|
3
|
+
/**
|
|
4
|
+
* The quiz title
|
|
5
|
+
*/
|
|
6
|
+
title: string;
|
|
7
|
+
/**
|
|
8
|
+
* An array of questions and answers for the quiz
|
|
9
|
+
*/
|
|
10
|
+
questions: QuestionAndAnswerProps[];
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "northants-design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Design system for West & North Northamptonshire Councils, two unitary councils encompassing Wellingborough, Corby, Daventry, East Northants, Kettering, Northampton, Northamptonshire County and South Northants.",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"@testing-library/react": "^16.0.0",
|
|
80
80
|
"@types/google.maps": "^3.50.5",
|
|
81
81
|
"@types/jest": "^30.0.0",
|
|
82
|
+
"@types/jest-axe": "^3.5.9",
|
|
82
83
|
"@types/react": "19.1.8",
|
|
83
84
|
"@types/react-dom": "19.1.6",
|
|
84
85
|
"@typescript-eslint/eslint-plugin": "^8.0",
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
"eslint-plugin-storybook": "^9.0.17",
|
|
96
97
|
"identity-obj-proxy": "^3.0.0",
|
|
97
98
|
"jest": "^29.7.0",
|
|
99
|
+
"jest-axe": "^10.0.0",
|
|
98
100
|
"jest-environment-jsdom": "^29.3.1",
|
|
99
101
|
"jsuri": "^1.3.1",
|
|
100
102
|
"react": "19.1.0",
|