@ks-digital/designsystem-angular 0.0.1-alpha.25 → 0.0.1-alpha.27

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 (107) hide show
  1. package/fesm2022/ks-digital-designsystem-angular.mjs +1100 -0
  2. package/fesm2022/ks-digital-designsystem-angular.mjs.map +1 -0
  3. package/index.d.ts +333 -0
  4. package/package.json +15 -20
  5. package/.storybook/customTheme.ts +0 -15
  6. package/.storybook/default-args.ts +0 -18
  7. package/.storybook/main.ts +0 -27
  8. package/.storybook/manager.ts +0 -10
  9. package/.storybook/preview-head.html +0 -16
  10. package/.storybook/preview.ts +0 -70
  11. package/.storybook/themes.ts +0 -9
  12. package/.storybook/tsconfig.json +0 -16
  13. package/.storybook/vite.config.mts +0 -5
  14. package/eslint.config.mjs +0 -28
  15. package/ng-package.json +0 -9
  16. package/project.json +0 -81
  17. package/src/components/alert/alert.mdx +0 -46
  18. package/src/components/alert/alert.spec.ts +0 -33
  19. package/src/components/alert/alert.stories.ts +0 -138
  20. package/src/components/alert/alert.ts +0 -46
  21. package/src/components/alert/index.ts +0 -1
  22. package/src/components/button/button.mdx +0 -40
  23. package/src/components/button/button.spec.ts +0 -86
  24. package/src/components/button/button.stories.ts +0 -123
  25. package/src/components/button/button.ts +0 -60
  26. package/src/components/button/index.ts +0 -1
  27. package/src/components/card/card-block.ts +0 -10
  28. package/src/components/card/card.mdx +0 -100
  29. package/src/components/card/card.spec.ts +0 -70
  30. package/src/components/card/card.stories.ts +0 -101
  31. package/src/components/card/card.ts +0 -44
  32. package/src/components/card/index.ts +0 -2
  33. package/src/components/checkbox/README.md +0 -13
  34. package/src/components/checkbox/checkbox.mdx +0 -50
  35. package/src/components/checkbox/checkbox.spec.ts +0 -21
  36. package/src/components/checkbox/checkbox.stories.ts +0 -182
  37. package/src/components/checkbox/index.ts +0 -0
  38. package/src/components/colors.ts +0 -36
  39. package/src/components/common-inputs.ts +0 -30
  40. package/src/components/details/controlled-details.ts +0 -63
  41. package/src/components/details/details-content.ts +0 -7
  42. package/src/components/details/details-summary.ts +0 -7
  43. package/src/components/details/details.mdx +0 -89
  44. package/src/components/details/details.spec.ts +0 -56
  45. package/src/components/details/details.stories.ts +0 -129
  46. package/src/components/details/details.ts +0 -69
  47. package/src/components/details/index.ts +0 -3
  48. package/src/components/field/field-counter.ts +0 -56
  49. package/src/components/field/field-description.ts +0 -10
  50. package/src/components/field/field-error.ts +0 -13
  51. package/src/components/field/field-observer.ts +0 -121
  52. package/src/components/field/field-state.ts +0 -21
  53. package/src/components/field/field.mdx +0 -40
  54. package/src/components/field/field.spec.ts +0 -131
  55. package/src/components/field/field.stories.ts +0 -98
  56. package/src/components/field/field.ts +0 -70
  57. package/src/components/field/index.ts +0 -3
  58. package/src/components/fieldset/fieldset-description.ts +0 -8
  59. package/src/components/fieldset/fieldset-legend.ts +0 -11
  60. package/src/components/fieldset/fieldset.spec.ts +0 -80
  61. package/src/components/fieldset/fieldset.ts +0 -11
  62. package/src/components/fieldset/index.ts +0 -3
  63. package/src/components/input/index.ts +0 -1
  64. package/src/components/input/input.mdx +0 -11
  65. package/src/components/input/input.spec.ts +0 -25
  66. package/src/components/input/input.stories.ts +0 -72
  67. package/src/components/input/input.ts +0 -67
  68. package/src/components/label/index.ts +0 -1
  69. package/src/components/label/label.ts +0 -17
  70. package/src/components/paragraph/index.ts +0 -1
  71. package/src/components/paragraph/paragraph.ts +0 -10
  72. package/src/components/popover/controlled-popover.ts +0 -62
  73. package/src/components/popover/index.ts +0 -1
  74. package/src/components/popover/popover.mdx +0 -81
  75. package/src/components/popover/popover.spec.ts +0 -143
  76. package/src/components/popover/popover.stories.ts +0 -63
  77. package/src/components/popover/popover.ts +0 -186
  78. package/src/components/radio/radio.mdx +0 -117
  79. package/src/components/radio/radio.stories.ts +0 -226
  80. package/src/components/search/index.ts +0 -4
  81. package/src/components/search/search-button.ts +0 -35
  82. package/src/components/search/search-clear.ts +0 -57
  83. package/src/components/search/search-input.ts +0 -18
  84. package/src/components/search/search.mdx +0 -56
  85. package/src/components/search/search.spec.ts +0 -48
  86. package/src/components/search/search.stories.ts +0 -205
  87. package/src/components/search/search.ts +0 -50
  88. package/src/components/spinner/index.ts +0 -1
  89. package/src/components/spinner/spinner.mdx +0 -24
  90. package/src/components/spinner/spinner.spec.ts +0 -13
  91. package/src/components/spinner/spinner.stories.ts +0 -54
  92. package/src/components/spinner/spinner.ts +0 -62
  93. package/src/components/switch/switch.mdx +0 -82
  94. package/src/components/switch/switch.stories.ts +0 -94
  95. package/src/components/textarea/textarea.mdx +0 -14
  96. package/src/components/textarea/textarea.stories.ts +0 -52
  97. package/src/components/validation-message/index.ts +0 -1
  98. package/src/components/validation-message/validation-message.ts +0 -11
  99. package/src/index.ts +0 -14
  100. package/src/test-setup.ts +0 -12
  101. package/src/utils/log-if-devmode.ts +0 -13
  102. package/src/utils/random-id.ts +0 -3
  103. package/tsconfig.json +0 -34
  104. package/tsconfig.lib.json +0 -28
  105. package/tsconfig.lib.prod.json +0 -9
  106. package/tsconfig.spec.json +0 -30
  107. package/vite.config.mts +0 -35
@@ -1,14 +0,0 @@
1
- import { Meta, Primary, Controls, Story } from '@storybook/addon-docs/blocks'
2
-
3
- import * as TextareaStories from './textarea.stories'
4
-
5
- <Meta of={TextareaStories} />
6
-
7
- # Textarea
8
-
9
- `Textarea` brukes når brukeren skal kunne skrive inn tekst som går over flere linjer.
10
-
11
- <Primary />
12
- <Controls />
13
-
14
- ## Bruk
@@ -1,52 +0,0 @@
1
- import {
2
- argsToTemplate,
3
- moduleMetadata,
4
- type Meta,
5
- type StoryObj,
6
- } from '@storybook/angular'
7
- import { CommonArgs } from '../../../.storybook/default-args'
8
- import { Field } from '../field/field'
9
- import { Input } from '../input/input'
10
- import { Label } from '../label/label'
11
-
12
- type TextareaArgs = CommonArgs & {
13
- readonly: boolean
14
- disabled: boolean
15
- }
16
-
17
- const meta: Meta<TextareaArgs> = {
18
- component: Input,
19
- title: 'Komponenter/Textarea',
20
- decorators: [
21
- moduleMetadata({
22
- imports: [Label, Field, Input],
23
- }),
24
- ],
25
- }
26
- export default meta
27
- type Story = StoryObj<TextareaArgs>
28
-
29
- export const Preview: Story = {
30
- args: {
31
- readonly: false,
32
- disabled: false,
33
- },
34
-
35
- render: (args) => ({
36
- props: args,
37
- template: `
38
- <div style="
39
- display: flex;
40
- flex-direction: column;
41
- gap: var(--ds-size-2);
42
- max-width: 100%;
43
- width: 20rem
44
- " >
45
- <ksd-field>
46
- <ksd-label>Label</ksd-label>
47
- <textarea ksd-input type="text" ${argsToTemplate(args)}></textarea>
48
- </ksd-field>
49
- </div>
50
- `,
51
- }),
52
- }
@@ -1 +0,0 @@
1
- export { ValidationMessage } from './validation-message'
@@ -1,11 +0,0 @@
1
- import { Directive } from '@angular/core'
2
-
3
- @Directive({
4
- // eslint-disable-next-line @angular-eslint/directive-selector
5
- selector: '[ksd-validation-message]',
6
- host: {
7
- class: 'ds-validation-message',
8
- 'data-field': 'validation',
9
- },
10
- })
11
- export class ValidationMessage {}
package/src/index.ts DELETED
@@ -1,14 +0,0 @@
1
- export * from './components/alert'
2
- export * from './components/button'
3
- export * from './components/card'
4
- export * from './components/common-inputs'
5
- export * from './components/details'
6
- export * from './components/field'
7
- export * from './components/fieldset'
8
- export * from './components/input'
9
- export * from './components/label'
10
- export * from './components/paragraph'
11
- export * from './components/popover'
12
- export * from './components/search'
13
- export * from './components/spinner'
14
- export * from './components/validation-message'
package/src/test-setup.ts DELETED
@@ -1,12 +0,0 @@
1
- import '@analogjs/vitest-angular/setup-zone'
2
-
3
- import { getTestBed } from '@angular/core/testing'
4
- import {
5
- BrowserTestingModule,
6
- platformBrowserTesting,
7
- } from '@angular/platform-browser/testing'
8
-
9
- getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting())
10
-
11
- // Need jest-dom for matchers like expect.toHaveAttribute
12
- import '@testing-library/jest-dom'
@@ -1,13 +0,0 @@
1
- import { isDevMode } from '@angular/core'
2
-
3
- export const logIfDevMode = ({
4
- component,
5
- message,
6
- }: {
7
- component: string
8
- message: string
9
- }) => {
10
- if (isDevMode()) {
11
- console.log(`[${component}] ${message}`)
12
- }
13
- }
@@ -1,3 +0,0 @@
1
- export const randomId = () => {
2
- return `:${Math.random().toString(36).slice(2, 7)}`
3
- }
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2022",
4
- "forceConsistentCasingInFileNames": true,
5
- "strict": true,
6
- "noImplicitOverride": true,
7
- "noPropertyAccessFromIndexSignature": true,
8
- "noImplicitReturns": true,
9
- "noFallthroughCasesInSwitch": true
10
- },
11
- "files": [],
12
- "include": [],
13
- "references": [
14
- {
15
- "path": "./tsconfig.lib.json"
16
- },
17
- {
18
- "path": "./tsconfig.spec.json"
19
- },
20
- {
21
- "path": "./.storybook/tsconfig.json"
22
- }
23
- ],
24
- "extends": "../../tsconfig.base.json",
25
- "angularCompilerOptions": {
26
- "enableI18nLegacyMessageIdFormat": false,
27
- "strictInputAccessModifiers": true,
28
- "strictInjectionParameters": true,
29
- "strictTemplates": true,
30
- "extendedDiagnostics": {
31
- "defaultCategory": "error"
32
- }
33
- }
34
- }
package/tsconfig.lib.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "declaration": true,
6
- "declarationMap": true,
7
- "inlineSources": true,
8
- "types": []
9
- },
10
- "include": ["src/**/*.ts", "src/typings.d.ts"],
11
- "exclude": [
12
- "vite.config.ts",
13
- "vite.config.mts",
14
- "vitest.config.ts",
15
- "vitest.config.mts",
16
- "src/**/*.spec.ts",
17
- "src/test-setup.ts",
18
- "jest.config.ts",
19
- "src/**/*.test.ts",
20
- "src/**/*.test.tsx",
21
- "src/**/*.spec.tsx",
22
- "src/**/*.test.js",
23
- "src/**/*.spec.js",
24
- "src/**/*.test.jsx",
25
- "src/**/*.spec.jsx",
26
- "src/test-setup.ts"
27
- ]
28
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {
7
- "compilationMode": "partial"
8
- }
9
- }
@@ -1,30 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "types": [
6
- "vitest/globals",
7
- "vitest/importMeta",
8
- "vite/client",
9
- "node",
10
- "vitest",
11
- "@testing-library/jest-dom"
12
- ]
13
- },
14
- "include": [
15
- "vite.config.ts",
16
- "vite.config.mts",
17
- "vitest.config.ts",
18
- "vitest.config.mts",
19
- "src/**/*.test.ts",
20
- "src/**/*.spec.ts",
21
- "src/**/*.test.tsx",
22
- "src/**/*.spec.tsx",
23
- "src/**/*.test.js",
24
- "src/**/*.spec.js",
25
- "src/**/*.test.jsx",
26
- "src/**/*.spec.jsx",
27
- "src/**/*.d.ts"
28
- ],
29
- "files": ["src/test-setup.ts"]
30
- }
package/vite.config.mts DELETED
@@ -1,35 +0,0 @@
1
- /// <reference types='vitest' />
2
- import angular from '@analogjs/vite-plugin-angular'
3
- import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'
4
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
5
- import * as path from 'path'
6
- import { defineConfig } from 'vite'
7
- import dts from 'vite-plugin-dts'
8
-
9
- export default defineConfig(() => ({
10
- root: __dirname,
11
- cacheDir: '../../node_modules/.vite/packages/angular',
12
- plugins: [
13
- angular({
14
- inlineStylesExtension: 'scss',
15
- }),
16
- nxViteTsPaths(),
17
- nxCopyAssetsPlugin(['*.md']),
18
- dts({
19
- entryRoot: 'src',
20
- tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
21
- }),
22
- ],
23
- test: {
24
- watch: false,
25
- globals: true,
26
- environment: 'jsdom',
27
- include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
28
- setupFiles: ['src/test-setup.ts'],
29
- reporters: ['default'],
30
- coverage: {
31
- reportsDirectory: '../../coverage/packages/angular',
32
- provider: 'v8' as const,
33
- },
34
- },
35
- }))