@netu-si/netu-react-dsf-components 0.0.1 → 0.0.4
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/README.md +4 -4
- package/dist/cjs/components/DSFBackLink/DSFBackLink.d.ts +11 -0
- package/dist/cjs/components/DSFDateInput/DSFDateInput.d.ts +2 -2
- package/dist/cjs/components/DSFFieldSet/DSFFieldSet.d.ts +2 -2
- package/dist/cjs/components/DSFFileUpload/DSFFileUpload.d.ts +5 -3
- package/dist/cjs/components/DSFFooter/DSFFooter.d.ts +8 -1
- package/dist/cjs/components/DSFFormGroup/DSFFormGroup.d.ts +2 -2
- package/dist/cjs/components/DSFHeader/DSFHeader.d.ts +4 -2
- package/dist/cjs/components/DSFLoadingBox/DSFLoadingBox.d.ts +2 -3
- package/dist/cjs/components/DSFMain/DSFMain.d.ts +3 -1
- package/dist/cjs/components/DSFPage/DSFPage.d.ts +46 -0
- package/dist/cjs/components/DSFPage/index.d.ts +1 -0
- package/dist/cjs/components/DSFPanel/DSFPanel.d.ts +2 -2
- package/dist/cjs/components/DSFRadio/DSFRadio.d.ts +0 -2
- package/dist/cjs/components/DSFSelect/DSFSelect.d.ts +1 -0
- package/dist/cjs/components/DSFTable/DSFTable.d.ts +8 -7
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/DSFBackLink/DSFBackLink.d.ts +11 -0
- package/dist/esm/components/DSFDateInput/DSFDateInput.d.ts +2 -2
- package/dist/esm/components/DSFFieldSet/DSFFieldSet.d.ts +2 -2
- package/dist/esm/components/DSFFileUpload/DSFFileUpload.d.ts +5 -3
- package/dist/esm/components/DSFFooter/DSFFooter.d.ts +8 -1
- package/dist/esm/components/DSFFormGroup/DSFFormGroup.d.ts +2 -2
- package/dist/esm/components/DSFHeader/DSFHeader.d.ts +4 -2
- package/dist/esm/components/DSFLoadingBox/DSFLoadingBox.d.ts +2 -3
- package/dist/esm/components/DSFMain/DSFMain.d.ts +3 -1
- package/dist/esm/components/DSFPage/DSFPage.d.ts +46 -0
- package/dist/esm/components/DSFPage/index.d.ts +1 -0
- package/dist/esm/components/DSFPanel/DSFPanel.d.ts +2 -2
- package/dist/esm/components/DSFRadio/DSFRadio.d.ts +0 -2
- package/dist/esm/components/DSFSelect/DSFSelect.d.ts +1 -0
- package/dist/esm/components/DSFTable/DSFTable.d.ts +8 -7
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +99 -16
- package/package.json +7 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import React, { FC, RefObject } from 'react';
|
|
1
|
+
import React, { FC, RefObject, ChangeEvent, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import { LinkProps } from 'react-router-dom';
|
|
3
3
|
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* ### References:
|
|
7
|
+
*
|
|
8
|
+
* - https://github.com/netu-si/netu-react-dsf-components/tree/main/src/components/DSFBackLink
|
|
9
|
+
*/
|
|
10
|
+
|
|
5
11
|
interface DSFBackLinkProps extends LinkProps {
|
|
6
12
|
onBackClick?: () => void;
|
|
7
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Use the back link component to help users go back to the previous page in a multi-page transaction.
|
|
16
|
+
*
|
|
17
|
+
* - https://animated-adventure-ey7gv1m.pages.github.io/?path=/docs/navigation-dsfbacklink--docs
|
|
18
|
+
* - https://gov-cy.github.io/govcy-design-system-docs/components/back_link
|
|
19
|
+
*/
|
|
8
20
|
declare const DSFBackLink: FC<DSFBackLinkProps>;
|
|
9
21
|
|
|
10
22
|
interface DSFButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
@@ -126,7 +138,7 @@ interface DSFDateInputProps {
|
|
|
126
138
|
};
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
|
-
declare const DSFDateInput:
|
|
141
|
+
declare const DSFDateInput: FC<DSFDateInputProps>;
|
|
130
142
|
|
|
131
143
|
interface DSFErrorSummaryProps {
|
|
132
144
|
/** onClick function to scroll the target element into view */
|
|
@@ -168,6 +180,7 @@ interface DSFSelectProps {
|
|
|
168
180
|
touched?: boolean;
|
|
169
181
|
};
|
|
170
182
|
children: React.ReactNode;
|
|
183
|
+
defaultValue?: string | number;
|
|
171
184
|
}
|
|
172
185
|
declare const DSFSelect: FC<DSFSelectProps>;
|
|
173
186
|
|
|
@@ -207,9 +220,11 @@ interface DSFHeaderProps {
|
|
|
207
220
|
headerTitle: string;
|
|
208
221
|
showLang?: boolean;
|
|
209
222
|
menu?: NavMenuItem[];
|
|
223
|
+
languageHandler?: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
224
|
+
defaultValue?: string | null;
|
|
210
225
|
}
|
|
211
226
|
declare const DSFHeader: {
|
|
212
|
-
({ headerTitle, menu, showLang }: DSFHeaderProps): React.JSX.Element;
|
|
227
|
+
({ headerTitle, menu, showLang, languageHandler, defaultValue }: DSFHeaderProps): React.JSX.Element;
|
|
213
228
|
defaultProps: {
|
|
214
229
|
showLang: boolean;
|
|
215
230
|
menu: undefined;
|
|
@@ -222,23 +237,31 @@ interface DSFFooterProps {
|
|
|
222
237
|
privacyStatementUrl?: string;
|
|
223
238
|
cookiePolicyUrl?: string;
|
|
224
239
|
accessibilityStatementUrl?: string;
|
|
240
|
+
privacyStatementText?: string;
|
|
241
|
+
cookiePolicyText?: string;
|
|
242
|
+
accessibilityStatementText?: string;
|
|
243
|
+
cyprusRepublicText?: string;
|
|
244
|
+
hasScroll?: boolean;
|
|
225
245
|
}
|
|
226
246
|
declare const DSFFooter: {
|
|
227
|
-
({ privacyStatementUrl, cookiePolicyUrl, accessibilityStatementUrl }: DSFFooterProps): React.JSX.Element;
|
|
247
|
+
({ privacyStatementUrl, cookiePolicyUrl, accessibilityStatementUrl, privacyStatementText, cookiePolicyText, accessibilityStatementText, cyprusRepublicText, hasScroll, }: DSFFooterProps): React.JSX.Element;
|
|
228
248
|
defaultProps: {
|
|
229
249
|
privacyStatementUrl: undefined;
|
|
230
250
|
cookiePolicyUrl: undefined;
|
|
231
251
|
accessibilityStatementUrl: undefined;
|
|
252
|
+
hasScroll: boolean;
|
|
232
253
|
};
|
|
233
254
|
displayName: string;
|
|
234
255
|
};
|
|
235
256
|
|
|
236
257
|
interface DSFMainProps {
|
|
258
|
+
id?: string;
|
|
237
259
|
children: React.ReactNode;
|
|
238
260
|
}
|
|
239
261
|
declare const DSFMain: {
|
|
240
|
-
({ children }: DSFMainProps): React.JSX.Element;
|
|
262
|
+
({ id, children }: DSFMainProps): React.JSX.Element;
|
|
241
263
|
defaultProps: {
|
|
264
|
+
id: string;
|
|
242
265
|
children: undefined;
|
|
243
266
|
};
|
|
244
267
|
displayName: string;
|
|
@@ -292,16 +315,15 @@ declare const DSFSkipLink: {
|
|
|
292
315
|
|
|
293
316
|
interface DSFLoadingBoxProps {
|
|
294
317
|
loading: boolean;
|
|
295
|
-
spinnerColor?: string;
|
|
296
318
|
children?: React.ReactNode;
|
|
297
319
|
}
|
|
298
|
-
declare const DSFLoadingBox:
|
|
320
|
+
declare const DSFLoadingBox: FC<DSFLoadingBoxProps>;
|
|
299
321
|
|
|
300
322
|
interface DSFFieldSetProps {
|
|
301
323
|
legend: React.ReactNode;
|
|
302
324
|
children?: React.ReactNode;
|
|
303
325
|
}
|
|
304
|
-
declare const DSFFieldSet:
|
|
326
|
+
declare const DSFFieldSet: FC<DSFFieldSetProps>;
|
|
305
327
|
|
|
306
328
|
interface DSFFormGroupProps {
|
|
307
329
|
label?: string;
|
|
@@ -310,7 +332,7 @@ interface DSFFormGroupProps {
|
|
|
310
332
|
hint?: string;
|
|
311
333
|
children?: React.ReactNode;
|
|
312
334
|
}
|
|
313
|
-
declare const DSFFormGroup:
|
|
335
|
+
declare const DSFFormGroup: FC<DSFFormGroupProps>;
|
|
314
336
|
|
|
315
337
|
interface DSFRadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
316
338
|
hint?: React.ReactNode;
|
|
@@ -324,15 +346,16 @@ interface DSFRadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
324
346
|
}
|
|
325
347
|
declare const DSFRadio: React.ForwardRefExoticComponent<DSFRadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
326
348
|
|
|
327
|
-
interface TableColumn {
|
|
328
|
-
header: string;
|
|
329
|
-
type?: 'text' | 'number';
|
|
330
|
-
}
|
|
331
349
|
interface DSFTableProps {
|
|
332
350
|
columns: TableColumn[];
|
|
333
|
-
rowData: (string | number)[][];
|
|
351
|
+
rowData: (string | number | React.ReactNode)[][];
|
|
352
|
+
hideNumberingColumn?: boolean;
|
|
353
|
+
}
|
|
354
|
+
declare const DSFTable: FC<DSFTableProps>;
|
|
355
|
+
interface TableColumn {
|
|
356
|
+
header: string;
|
|
357
|
+
align?: 'left' | 'right';
|
|
334
358
|
}
|
|
335
|
-
declare const DSFTable: React.FC<DSFTableProps>;
|
|
336
359
|
|
|
337
360
|
interface DSFUserSignOutProps {
|
|
338
361
|
fullName: string;
|
|
@@ -341,4 +364,64 @@ interface DSFUserSignOutProps {
|
|
|
341
364
|
}
|
|
342
365
|
declare const DSFUserSignOut: FC<DSFUserSignOutProps>;
|
|
343
366
|
|
|
344
|
-
|
|
367
|
+
/**
|
|
368
|
+
* ### References:
|
|
369
|
+
*
|
|
370
|
+
* - https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/back-link
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
interface DSFPageProps {
|
|
374
|
+
/**
|
|
375
|
+
* Page contents
|
|
376
|
+
*/
|
|
377
|
+
children?: React.ReactNode;
|
|
378
|
+
/**
|
|
379
|
+
* ID for page content
|
|
380
|
+
*/
|
|
381
|
+
id?: string;
|
|
382
|
+
/**
|
|
383
|
+
* Override the default page header component.
|
|
384
|
+
*/
|
|
385
|
+
header?: React.ReactNode;
|
|
386
|
+
/**
|
|
387
|
+
* Override the default page footer component.
|
|
388
|
+
*/
|
|
389
|
+
footer?: React.ReactNode;
|
|
390
|
+
/**
|
|
391
|
+
* Content that needs to appear after body starts and before other components
|
|
392
|
+
*/
|
|
393
|
+
bodyStartContainer?: React.ReactNode;
|
|
394
|
+
/**
|
|
395
|
+
* Content that needs to appear immediately before body ends
|
|
396
|
+
*/
|
|
397
|
+
bodyEndContainer?: React.ReactNode;
|
|
398
|
+
/**
|
|
399
|
+
* Content that needs to appear outside the main page wrapper (see `main`).
|
|
400
|
+
* For example: A back link component, breadcrumbs, user login component
|
|
401
|
+
*/
|
|
402
|
+
beforeMainContainer?: React.ReactNode;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Use the back link component to help users go back to the previous page in a multi-page transaction.
|
|
406
|
+
*
|
|
407
|
+
* - https://govuk-react.github.io/govuk-react/?path=/docs/back-link
|
|
408
|
+
* - https://design-system.service.gov.uk/components/back-link/
|
|
409
|
+
*/
|
|
410
|
+
declare const DSFPage: FC<DSFPageProps>;
|
|
411
|
+
|
|
412
|
+
interface DSFFileUploadProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
413
|
+
id: string;
|
|
414
|
+
meta: {
|
|
415
|
+
error?: string | string[];
|
|
416
|
+
touched?: boolean;
|
|
417
|
+
};
|
|
418
|
+
label: string;
|
|
419
|
+
hint?: string;
|
|
420
|
+
multiple?: boolean;
|
|
421
|
+
acceptedFormats?: string;
|
|
422
|
+
name?: string;
|
|
423
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
424
|
+
}
|
|
425
|
+
declare const DSFFileUpload: ForwardRefExoticComponent<DSFFileUploadProps & RefAttributes<HTMLInputElement>>;
|
|
426
|
+
|
|
427
|
+
export { DSFBackLink, DSFBeforeMainContainer, DSFBodyEndContainer, DSFBodyStartContainer, DSFButton, DSFCheckbox, DSFDateInput, DSFDateInputProps, DSFErrorSummary, DSFErrorText, DSFFieldSet, DSFFileUpload, DSFFooter, DSFFormGroup, DSFHeader, DSFHintText, DSFInput, DSFInputField, DSFLabel, DSFLoadingBox, DSFMain, DSFPage, DSFPanel, DSFRadio, DSFSelect, DSFSkipLink, DSFTable, DSFUserSignOut };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netu-si/netu-react-dsf-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "React Component Library Using the GOV-CY DSF Design System",
|
|
5
5
|
"repository": "https://github.com/netu-si/netu-react-dsf-components.git",
|
|
6
6
|
"homepage": "https://github.com/netu-si/netu-react-dsf-components#readme",
|
|
@@ -21,15 +21,12 @@
|
|
|
21
21
|
"storybook": "storybook dev -p 6006",
|
|
22
22
|
"build-storybook": "storybook build",
|
|
23
23
|
"predeploy": "npm run build-storybook",
|
|
24
|
-
"deploy-storybook": "set CACHE_DIR=/tmp
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"minor": "run() { yarn version-and-publish $1 minor; }; run",
|
|
28
|
-
"major": "run() { yarn version-and-publish $1 major; }; run"
|
|
24
|
+
"deploy-storybook": "set CACHE_DIR=/tmp&& gh-pages -d storybook-static",
|
|
25
|
+
"docs:components": "./scripts/generate-component-readme.sh ",
|
|
26
|
+
"docs": "yarn docs:components && node scripts/concat-readme.js"
|
|
29
27
|
},
|
|
30
28
|
"dependencies": {
|
|
31
|
-
"help": "^3.0.2"
|
|
32
|
-
"multi-input-input": "^0.0.3"
|
|
29
|
+
"help": "^3.0.2"
|
|
33
30
|
},
|
|
34
31
|
"peerDependencies": {
|
|
35
32
|
"react": "^18.2.0",
|
|
@@ -40,6 +37,7 @@
|
|
|
40
37
|
"@babel/preset-env": "^7.22.9",
|
|
41
38
|
"@babel/preset-react": "^7.22.5",
|
|
42
39
|
"@babel/preset-typescript": "^7.22.5",
|
|
40
|
+
"@netu-si/api-docs": "file:local-packages/api-docs",
|
|
43
41
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
44
42
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
45
43
|
"@rollup/plugin-typescript": "^11.1.2",
|
|
@@ -54,6 +52,7 @@
|
|
|
54
52
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
55
53
|
"@typescript-eslint/parser": "^6.0.0",
|
|
56
54
|
"can-npm-publish": "^1.3.6",
|
|
55
|
+
"concat": "^1.0.3",
|
|
57
56
|
"eslint": "^8.45.0",
|
|
58
57
|
"eslint-config-airbnb": "^19.0.4",
|
|
59
58
|
"eslint-config-airbnb-typescript": "^17.1.0",
|