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.
Files changed (24) hide show
  1. package/build/index.d.ts +3 -1
  2. package/build/index.js +840 -201
  3. package/build/index.js.map +1 -1
  4. package/build/index.mjs.js +838 -201
  5. package/build/index.mjs.js.map +1 -1
  6. package/build/library/components/BudgetSlider/BudgetSlider.d.ts +4 -0
  7. package/build/library/components/BudgetSlider/BudgetSlider.test.d.ts +1 -0
  8. package/build/library/components/BudgetSlider/BudgetSlider.types.d.ts +56 -0
  9. package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.d.ts +4 -0
  10. package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.test.d.ts +1 -0
  11. package/build/library/components/QuestionAndAnswer/QuestionAndAnswer.types.d.ts +17 -0
  12. package/build/library/components/RadioCheckboxInput/RadioCheckboxInput.types.d.ts +4 -0
  13. package/build/library/components/logos/WestColouredLogo/logo.d.ts +2 -2
  14. package/build/library/pages/BudgetGameExample/BudgetGameExample.d.ts +4 -0
  15. package/build/library/pages/BudgetQuizExample/BudgetQuizExample.d.ts +4 -0
  16. package/build/library/slices/BudgetGame/BudgetGame.d.ts +7 -0
  17. package/build/library/slices/BudgetGame/BudgetGame.storydata.d.ts +2 -0
  18. package/build/library/slices/BudgetGame/BudgetGame.test.d.ts +1 -0
  19. package/build/library/slices/BudgetGame/BudgetGame.types.d.ts +20 -0
  20. package/build/library/slices/Quiz/Quiz.d.ts +4 -0
  21. package/build/library/slices/Quiz/Quiz.storydata.d.ts +2 -0
  22. package/build/library/slices/Quiz/Quiz.test.d.ts +1 -0
  23. package/build/library/slices/Quiz/Quiz.types.d.ts +11 -0
  24. package/package.json +3 -1
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { BudgetSliderProps } from './BudgetSlider.types';
3
+ declare const BudgetSlider: React.FunctionComponent<BudgetSliderProps>;
4
+ export default BudgetSlider;
@@ -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,4 @@
1
+ import React from 'react';
2
+ import { QuestionAndAnswerProps } from './QuestionAndAnswer.types';
3
+ declare const QuestionAndAnswer: React.FunctionComponent<QuestionAndAnswerProps>;
4
+ export default QuestionAndAnswer;
@@ -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
+ }
@@ -27,4 +27,8 @@ export interface RadioCheckboxInputProps {
27
27
  * Is the field in an error state
28
28
  */
29
29
  isErrored?: boolean;
30
+ /**
31
+ * Is the radio button disabled?
32
+ */
33
+ isDisabled?: boolean;
30
34
  }
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import { LogoProps } from "./logo.types";
1
+ import React from 'react';
2
+ import { LogoProps } from './logo.types';
3
3
  declare const WestColouredLogo: React.FC<LogoProps>;
4
4
  export default WestColouredLogo;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export interface BudgetGamePageExampleProps {
3
+ }
4
+ export declare const BudgetGamePageExample: React.FunctionComponent<BudgetGamePageExampleProps>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export interface BudgetQuizPageExampleProps {
3
+ }
4
+ export declare const BudgetQuizPageExample: React.FunctionComponent<BudgetQuizPageExampleProps>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { BudgetGameProps } from './BudgetGame.types';
3
+ /**
4
+ * A budget game with sliders to set your own budget
5
+ */
6
+ declare const BudgetGame: React.FunctionComponent<BudgetGameProps>;
7
+ export default BudgetGame;
@@ -0,0 +1,2 @@
1
+ import { BudgetGameProps } from './BudgetGame.types';
2
+ export declare const ExampleBudgetGameProps: BudgetGameProps;
@@ -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,4 @@
1
+ import React from 'react';
2
+ import { QuizProps } from './Quiz.types';
3
+ declare const Quiz: React.FunctionComponent<QuizProps>;
4
+ export default Quiz;
@@ -0,0 +1,2 @@
1
+ import { QuizProps } from './Quiz.types';
2
+ export declare const ExampleQuizProps: QuizProps;
@@ -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.2.0",
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",