@scottish-government/designsystem-react 0.3.0 → 0.5.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/@types/common/AbstractNotificationBanner.d.ts +17 -0
- package/@types/components/Table.d.ts +8 -0
- package/@types/components/Tabs.d.ts +22 -0
- package/@types/components/TaskList.d.ts +1 -1
- package/dist/common/abstract-notification-banner.jsx +63 -0
- package/dist/components/accordion/accordion.jsx +2 -3
- package/dist/components/breadcrumbs/breadcrumbs.jsx +2 -2
- package/dist/components/cookie-banner/cookie-banner.jsx +21 -0
- package/dist/components/notification-banner/notification-banner.jsx +7 -34
- package/dist/components/page-metadata/page-metadata.jsx +2 -3
- package/dist/components/table/table.jsx +24 -0
- package/dist/components/tabs/tabs.jsx +99 -0
- package/dist/components/task-list/task-list.jsx +6 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/slugify.js +15 -0
- package/package.json +1 -1
- package/src/common/abstract-notification-banner.test.tsx +126 -0
- package/src/common/abstract-notification-banner.tsx +87 -0
- package/src/common/conditional-wrapper.test.tsx +1 -1
- package/src/common/screen-reader-text.test.tsx +1 -1
- package/src/common/wrapper-tag.test.tsx +3 -3
- package/src/components/accordion/accordion.test.tsx +40 -40
- package/src/components/accordion/accordion.tsx +4 -2
- package/src/components/aspect-box/aspect-box.test.tsx +7 -7
- package/src/components/breadcrumbs/breadcrumbs.tsx +0 -2
- package/src/components/checkbox/checkbox.test.tsx +8 -8
- package/src/components/confirmation-message/confirmation-message.test.tsx +1 -1
- package/src/components/cookie-banner/cookie-banner.test.tsx +25 -0
- package/src/components/cookie-banner/cookie-banner.tsx +36 -0
- package/src/components/details/details.test.tsx +7 -7
- package/src/components/inset-text/inset-text.test.tsx +1 -1
- package/src/components/notification-banner/notification-banner.test.tsx +13 -73
- package/src/components/notification-banner/notification-banner.tsx +13 -41
- package/src/components/notification-panel/notification-panel.test.tsx +6 -6
- package/src/components/page-header/page-header.test.tsx +2 -2
- package/src/components/page-metadata/page-metadata.test.tsx +12 -12
- package/src/components/page-metadata/page-metadata.tsx +4 -2
- package/src/components/pagination/pagination.test.tsx +28 -30
- package/src/components/phase-banner/phase-banner.test.tsx +8 -8
- package/src/components/question/question.test.tsx +3 -3
- package/src/components/radio-button/radio-button.test.tsx +7 -7
- package/src/components/select/select.test.tsx +9 -9
- package/src/components/sequential-navigation/sequential-navigation.test.tsx +4 -4
- package/src/components/side-navigation/side-navigation.test.tsx +1 -1
- package/src/components/site-header/site-header.test.tsx +22 -22
- package/src/components/site-search/site-search.test.tsx +9 -9
- package/src/components/skip-links/skip-links.test.tsx +3 -3
- package/src/components/summary-card/summary-card.test.tsx +2 -2
- package/src/components/summary-list/summary-list.test.tsx +35 -16
- package/src/components/table/table.test.tsx +77 -0
- package/src/components/table/table.tsx +36 -0
- package/src/components/tabs/tabs.test.tsx +258 -0
- package/src/components/tabs/tabs.tsx +110 -0
- package/src/components/task-list/task-list.test.tsx +81 -83
- package/src/components/task-list/task-list.tsx +9 -5
- package/src/components/text-input/text-input.test.tsx +6 -6
- package/src/components/textarea/textarea.test.tsx +2 -2
- package/src/components/warning-text/warning-text.test.tsx +1 -1
- package/src/utils/slugify.ts +13 -0
- package/vite.config.ts +6 -1
- package/vitest-setup.ts +1 -1
- package/@types/components/NotificationBanner.d.ts +0 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function (string: string) {
|
|
2
|
+
string = String(string);
|
|
3
|
+
|
|
4
|
+
return string
|
|
5
|
+
// Make lower-case
|
|
6
|
+
.toLowerCase()
|
|
7
|
+
// Remove misc punctuation
|
|
8
|
+
.replace(/['"’‘”“`]/g, '')
|
|
9
|
+
// Replace non-word characters with dashes
|
|
10
|
+
.replace(/[\W|_]+/g, '-')
|
|
11
|
+
// Remove starting and trailing dashes
|
|
12
|
+
.replace(/^-+|-+$/g, '');
|
|
13
|
+
}
|
package/vite.config.ts
CHANGED
|
@@ -7,6 +7,11 @@ export default defineConfig({
|
|
|
7
7
|
],
|
|
8
8
|
test: {
|
|
9
9
|
environment: 'jsdom',
|
|
10
|
-
setupFiles: ["./vitest-setup.ts"]
|
|
10
|
+
setupFiles: ["./vitest-setup.ts"],
|
|
11
|
+
coverage: {
|
|
12
|
+
exclude: ["src/icons"],
|
|
13
|
+
include: ["src/**"],
|
|
14
|
+
reporter: ["text", "lcov"],
|
|
15
|
+
}
|
|
11
16
|
}
|
|
12
17
|
});
|
package/vitest-setup.ts
CHANGED