@3dsource/source-ui-native 0.0.1 → 1.0.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 (106) hide show
  1. package/fesm2022/3dsource-source-ui-native.mjs +662 -0
  2. package/fesm2022/3dsource-source-ui-native.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/components/source-badge/components/source-badge.component.d.ts +27 -0
  5. package/lib/components/source-badge/constants/sourceBadgeSize.d.ts +6 -0
  6. package/lib/components/source-badge/constants/sourceBadgeType.d.ts +9 -0
  7. package/lib/components/source-banner/components/source-banner.component.d.ts +9 -0
  8. package/lib/components/source-banner/constants/sourceBannerType.d.ts +8 -0
  9. package/lib/components/source-button/components/source-button.component.d.ts +86 -0
  10. package/lib/components/source-button/constants/sourceButtonAppearance.d.ts +5 -0
  11. package/lib/components/source-button/constants/sourceButtonColorScheme.d.ts +6 -0
  12. package/lib/components/source-button/constants/sourceButtonSize.d.ts +7 -0
  13. package/lib/components/source-button/constants/sourceButtonType.d.ts +6 -0
  14. package/lib/components/source-button/interfaces/defaultSourceButton.config.d.ts +2 -0
  15. package/lib/components/source-button/interfaces/sourceButton.interface.d.ts +19 -0
  16. package/lib/components/source-copyright/components/source-copyright.component.d.ts +7 -0
  17. package/lib/components/source-divider/components/source-divider.component.d.ts +7 -0
  18. package/lib/components/source-hint/components/source-hint.component.d.ts +7 -0
  19. package/lib/components/source-icon-button/components/source-icon-button.component.d.ts +40 -0
  20. package/lib/components/source-icon-button/constants/sourceIconButtonShape.d.ts +5 -0
  21. package/lib/components/source-icon-button/constants/sourceIconButtonSize.d.ts +8 -0
  22. package/lib/components/source-icon-button/constants/sourceIconButtonType.d.ts +6 -0
  23. package/lib/components/source-loading/components/source-loading.component.d.ts +37 -0
  24. package/lib/components/source-loading/constants/sourceLoadingLineCap.d.ts +6 -0
  25. package/lib/components/source-logo-loading/components/source-logo-loading.component.d.ts +8 -0
  26. package/lib/components/source-slider/components/source-slider.component.d.ts +63 -0
  27. package/package.json +13 -2
  28. package/eslint.config.js +0 -37
  29. package/ng-package.json +0 -7
  30. package/src/lib/components/source-badge/components/source-badge.component.html +0 -20
  31. package/src/lib/components/source-badge/components/source-badge.component.scss +0 -76
  32. package/src/lib/components/source-badge/components/source-badge.component.ts +0 -62
  33. package/src/lib/components/source-badge/constants/sourceBadgeSize.ts +0 -8
  34. package/src/lib/components/source-badge/constants/sourceBadgeType.ts +0 -11
  35. package/src/lib/components/source-banner/components/source-banner.component.html +0 -10
  36. package/src/lib/components/source-banner/components/source-banner.component.scss +0 -75
  37. package/src/lib/components/source-banner/components/source-banner.component.ts +0 -25
  38. package/src/lib/components/source-banner/constants/sourceBannerType.ts +0 -10
  39. package/src/lib/components/source-button/components/source-button.component.html +0 -44
  40. package/src/lib/components/source-button/components/source-button.component.scss +0 -355
  41. package/src/lib/components/source-button/components/source-button.component.ts +0 -220
  42. package/src/lib/components/source-button/constants/sourceButtonAppearance.ts +0 -7
  43. package/src/lib/components/source-button/constants/sourceButtonColorScheme.ts +0 -8
  44. package/src/lib/components/source-button/constants/sourceButtonSize.ts +0 -8
  45. package/src/lib/components/source-button/constants/sourceButtonType.ts +0 -8
  46. package/src/lib/components/source-button/interfaces/defaultSourceButton.config.ts +0 -24
  47. package/src/lib/components/source-button/interfaces/sourceButton.interface.ts +0 -26
  48. package/src/lib/components/source-copyright/components/source-copyright.component.html +0 -20
  49. package/src/lib/components/source-copyright/components/source-copyright.component.scss +0 -81
  50. package/src/lib/components/source-copyright/components/source-copyright.component.ts +0 -18
  51. package/src/lib/components/source-divider/components/source-divider.component.html +0 -5
  52. package/src/lib/components/source-divider/components/source-divider.component.scss +0 -15
  53. package/src/lib/components/source-divider/components/source-divider.component.ts +0 -18
  54. package/src/lib/components/source-hint/components/source-hint.component.html +0 -8
  55. package/src/lib/components/source-hint/components/source-hint.component.scss +0 -31
  56. package/src/lib/components/source-hint/components/source-hint.component.ts +0 -18
  57. package/src/lib/components/source-icon-button/components/source-icon-button.component.html +0 -18
  58. package/src/lib/components/source-icon-button/components/source-icon-button.component.scss +0 -89
  59. package/src/lib/components/source-icon-button/components/source-icon-button.component.ts +0 -87
  60. package/src/lib/components/source-icon-button/constants/sourceIconButtonShape.ts +0 -7
  61. package/src/lib/components/source-icon-button/constants/sourceIconButtonSize.ts +0 -10
  62. package/src/lib/components/source-icon-button/constants/sourceIconButtonType.ts +0 -8
  63. package/src/lib/components/source-loading/components/source-loading.component.html +0 -40
  64. package/src/lib/components/source-loading/components/source-loading.component.scss +0 -62
  65. package/src/lib/components/source-loading/components/source-loading.component.ts +0 -79
  66. package/src/lib/components/source-loading/constants/sourceLoadingLineCap.ts +0 -7
  67. package/src/lib/components/source-logo-loading/components/source-logo-loading.component.html +0 -23
  68. package/src/lib/components/source-logo-loading/components/source-logo-loading.component.scss +0 -33
  69. package/src/lib/components/source-logo-loading/components/source-logo-loading.component.ts +0 -21
  70. package/src/lib/components/source-slider/components/source-slider.component.html +0 -38
  71. package/src/lib/components/source-slider/components/source-slider.component.scss +0 -132
  72. package/src/lib/components/source-slider/components/source-slider.component.ts +0 -122
  73. package/src/lib/styles/base.scss +0 -68
  74. package/src/lib/styles/elements/_src-button.scss +0 -235
  75. package/src/lib/styles/elements/_src-input.scss +0 -83
  76. package/src/lib/styles/elements/_src-list.scss +0 -82
  77. package/src/lib/styles/elements/_src-select.scss +0 -71
  78. package/src/lib/styles/elements/elements.scss +0 -4
  79. package/src/lib/styles/fonts/Inter-VariableFont_slnt,wght.woff2 +0 -0
  80. package/src/lib/styles/fonts.scss +0 -18
  81. package/src/lib/styles/source.ui.scss +0 -23
  82. package/src/lib/styles/typography.scss +0 -90
  83. package/src/lib/styles/utils.scss +0 -40
  84. package/src/lib/styles/variables/_borders.scss +0 -14
  85. package/src/lib/styles/variables/_colors-aliases.scss +0 -39
  86. package/src/lib/styles/variables/_colors.scss +0 -64
  87. package/src/lib/styles/variables/_shadows.scss +0 -9
  88. package/src/lib/styles/variables/_typography.scss +0 -32
  89. package/src/lib/styles/variables/index.scss +0 -5
  90. package/tsconfig.lib.json +0 -13
  91. package/tsconfig.lib.prod.json +0 -11
  92. /package/{src/lib/components/source-badge/constants/index.ts → lib/components/source-badge/constants/index.d.ts} +0 -0
  93. /package/{src/lib/components/source-badge/index.ts → lib/components/source-badge/index.d.ts} +0 -0
  94. /package/{src/lib/components/source-banner/index.ts → lib/components/source-banner/index.d.ts} +0 -0
  95. /package/{src/lib/components/source-button/constants/index.ts → lib/components/source-button/constants/index.d.ts} +0 -0
  96. /package/{src/lib/components/source-button/index.ts → lib/components/source-button/index.d.ts} +0 -0
  97. /package/{src/lib/components/source-button/interfaces/index.ts → lib/components/source-button/interfaces/index.d.ts} +0 -0
  98. /package/{src/lib/components/source-copyright/index.ts → lib/components/source-copyright/index.d.ts} +0 -0
  99. /package/{src/lib/components/source-divider/index.ts → lib/components/source-divider/index.d.ts} +0 -0
  100. /package/{src/lib/components/source-hint/index.ts → lib/components/source-hint/index.d.ts} +0 -0
  101. /package/{src/lib/components/source-icon-button/constants/index.ts → lib/components/source-icon-button/constants/index.d.ts} +0 -0
  102. /package/{src/lib/components/source-icon-button/index.ts → lib/components/source-icon-button/index.d.ts} +0 -0
  103. /package/{src/lib/components/source-loading/index.ts → lib/components/source-loading/index.d.ts} +0 -0
  104. /package/{src/lib/components/source-logo-loading/index.ts → lib/components/source-logo-loading/index.d.ts} +0 -0
  105. /package/{src/lib/components/source-slider/index.ts → lib/components/source-slider/index.d.ts} +0 -0
  106. /package/{src/public-api.ts → public-api.d.ts} +0 -0
package/eslint.config.js DELETED
@@ -1,37 +0,0 @@
1
- // @ts-check
2
- const tseslint = require('typescript-eslint');
3
- const rootConfig = require('../../../eslint.config.js');
4
-
5
- module.exports = tseslint.config(
6
- ...rootConfig,
7
- {
8
- files: ['**/*.ts'],
9
- languageOptions: {
10
- parserOptions: {
11
- projectService: true,
12
- },
13
- },
14
- rules: {
15
- '@angular-eslint/directive-selector': [
16
- 'error',
17
- {
18
- type: 'attribute',
19
- prefix: 'lib',
20
- style: 'camelCase',
21
- },
22
- ],
23
- '@angular-eslint/component-selector': [
24
- 'error',
25
- {
26
- type: 'element',
27
- prefix: 'lib',
28
- style: 'kebab-case',
29
- },
30
- ],
31
- },
32
- },
33
- {
34
- files: ['**/*.html'],
35
- rules: {},
36
- },
37
- );
package/ng-package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../../dist/3dsource/source-ui-native",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- }
7
- }
@@ -1,20 +0,0 @@
1
- <div
2
- class="src-badge"
3
- [ngClass]="classes"
4
- [ngStyle]="
5
- type
6
- ? {}
7
- : {
8
- '--srcBadgeBorderColor': borderColor,
9
- '--srcBadgeBackgroundColor': backgroundColor,
10
- '--srcBadgeBorderWidth': borderWidth,
11
- '--srcBadgeTextColor': textColor,
12
- }
13
- "
14
- [attr.data-testid]="testID"
15
- >
16
- @if (number) {
17
- {{ number }}
18
- }
19
- <ng-content></ng-content>
20
- </div>
@@ -1,76 +0,0 @@
1
- // source-badge.component.scss
2
- .src-badge {
3
- --srcBadgeHeight: 18px;
4
- --srcBadgeBorderWidth: 2px;
5
- --srcBadgePadding: 2px 4px;
6
- --srcBadgeBackgroundColor: var(--src-color-brand-500, darkgreen);
7
- --srcBadgeBorderColor: var(--src-color-bg-default, #fff);
8
- --srcBadgeTextColor: var(--src-color-text-inverse, #fff);
9
- display: inline-block;
10
- width: auto;
11
- min-width: var(--srcBadgeHeight);
12
- height: var(--srcBadgeHeight);
13
- padding: var(--srcBadgePadding);
14
- vertical-align: top;
15
- text-align: center;
16
- border-radius: 99px;
17
- border: var(--srcBadgeBorderWidth) solid var(--srcBadgeBorderColor, #fff);
18
- background: var(--srcBadgeBackgroundColor);
19
- color: var(--srcBadgeTextColor);
20
- font-size: 9px;
21
- font-weight: 700;
22
- line-height: 1;
23
-
24
- &--small {
25
- --srcBadgeHeight: 16px;
26
- font-size: 8px;
27
- }
28
-
29
- &--large {
30
- --srcBadgeHeight: 20px;
31
- font-size: 10px;
32
- }
33
-
34
- &--neutral,
35
- &--informational,
36
- &--success,
37
- &--warning,
38
- &--attention,
39
- &--critical {
40
- --srcBadgeHeight: 20px;
41
- --srcBadgeBorderWidth: 0px;
42
- --srcBadgePadding: 2px 8px;
43
- --srcBadgeBackgroundColor: var(--src-color-bg-strong);
44
- --srcBadgeTextColor: var(--src-color-text-default, #1f2937);
45
- text-align: center;
46
- font-family: var(--src-font-family-sans);
47
- font-size: var(--src-fs-small);
48
- font-style: normal;
49
- font-weight: var(--src-fw-medium, 500);
50
- line-height: var(--src-lh-small);
51
- }
52
-
53
- &--neutral {
54
- --srcBadgeBackgroundColor: var(--src-color-bg-strong);
55
- }
56
-
57
- &--informational {
58
- --srcBadgeBackgroundColor: #a4e8f2;
59
- }
60
-
61
- &--success {
62
- --srcBadgeBackgroundColor: #aee9d1;
63
- }
64
-
65
- &--warning {
66
- --srcBadgeBackgroundColor: #ffd79d;
67
- }
68
-
69
- &--attention {
70
- --srcBadgeBackgroundColor: #ffea8a;
71
- }
72
-
73
- &--critical {
74
- --srcBadgeBackgroundColor: #ffb7b7;
75
- }
76
- }
@@ -1,62 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- Input,
5
- input,
6
- OnInit,
7
- ViewEncapsulation,
8
- } from '@angular/core';
9
- import {
10
- SourceBadgeSize,
11
- SourceBadgeSizeValues,
12
- SourceBadgeType,
13
- } from '../constants';
14
- import { NgClass, NgStyle } from '@angular/common';
15
-
16
- @Component({
17
- selector: 'src-badge',
18
- templateUrl: './source-badge.component.html',
19
- styleUrls: ['./source-badge.component.scss'],
20
- imports: [NgStyle, NgClass],
21
- encapsulation: ViewEncapsulation.None,
22
- changeDetection: ChangeDetectionStrategy.OnPush,
23
- })
24
- export class SourceBadgeComponent implements OnInit {
25
- @Input() number = 0;
26
- @Input() backgroundColor? = 'var(--src-color-icon-critical, #B91C1C)';
27
- @Input() type: SourceBadgeType | string | null = null;
28
- @Input() size?: SourceBadgeSizeValues | string = SourceBadgeSize.DEFAULT;
29
- /**
30
- * Custom class to be added to the badge.
31
- */
32
- @Input() customClass?: string | string[];
33
- /**
34
- * 2 px border around the badge to increase visibility.
35
- */
36
- @Input() borderColor? = 'var(--src-color-bg-default, #FFFFFF)';
37
- /**
38
- * It's not recommended to change the border width. If you're changing the width of the border, you should also change the size of the badge manually through scss.
39
- * */
40
- @Input() borderWidth? = '2px';
41
- @Input() textColor? = 'var(--src-color-text-inverse, #FFFFFF)';
42
- testID = input('', { alias: 'data-testid' });
43
-
44
- classes: string[] = [];
45
-
46
- ngOnInit() {
47
- this.classes = [
48
- this.type ? `src-badge--${this.type}` : '',
49
- this.size && !this.type ? `src-badge--${this.size}` : '',
50
- ];
51
-
52
- if (this.customClass) {
53
- if (Array.isArray(this.customClass)) {
54
- this.classes.forEach((customClass) => {
55
- this.classes.push(customClass);
56
- });
57
- } else {
58
- this.classes.push(this.customClass);
59
- }
60
- }
61
- }
62
- }
@@ -1,8 +0,0 @@
1
- export const SourceBadgeSize = {
2
- SMALL: 'small',
3
- DEFAULT: 'default',
4
- LARGE: 'large',
5
- } as const;
6
-
7
- export type SourceBadgeSizeValues =
8
- (typeof SourceBadgeSize)[keyof typeof SourceBadgeSize];
@@ -1,11 +0,0 @@
1
- export const SourceBadgeType = {
2
- NEUTRAL: 'neutral',
3
- INFORMATIONAL: 'informational',
4
- SUCCESS: 'success',
5
- WARNING: 'warning',
6
- ATTENTION: 'attention',
7
- CRITICAL: 'critical',
8
- } as const;
9
-
10
- export type SourceBadgeType =
11
- (typeof SourceBadgeType)[keyof typeof SourceBadgeType];
@@ -1,10 +0,0 @@
1
- <div
2
- class="src-banner"
3
- [class.src-banner--compact]="isCompact()"
4
- [ngClass]="type() !== 'default' ? 'src-banner--' + type() : ''"
5
- [attr.data-testid]="testID"
6
- >
7
- <ng-content select="[srcIconPrefix]"></ng-content>
8
- <ng-content></ng-content>
9
- <ng-content select="[srcIconPostfix]"></ng-content>
10
- </div>
@@ -1,75 +0,0 @@
1
- // source-banner.component.scss
2
- .src-banner {
3
- --srcBannerPadding: 20px;
4
- --srcBannerBackgroundColor: var(--src-color-bg-default-subdued, #f9fafb);
5
- --srcBannerBorderWidth: 1px;
6
- --srcBannerBorderColor: var(--src-color-border-default, #e5e7eb);
7
- --srcBannerTextColor: var(--src-color-text-default, #1f2937);
8
- --srcBannerIconColor: var(--src-color-icon-default, #6b7280);
9
- --srcBannerBorderRadius: var(--src-br-small, 4px);
10
- --srcBannerIconMargin: 16px;
11
- display: flex;
12
- gap: 8px;
13
- width: 100%;
14
- padding: var(--srcBannerPadding, 20px);
15
- border: var(--srcBannerBorderWidth) solid var(--srcBannerBorderColor, #fff);
16
- border-radius: var(--srcBannerBorderRadius);
17
- background: var(--srcBannerBackgroundColor);
18
- color: var(--srcBannerTextColor);
19
- font-size: var(--src-fs-base, 14px);
20
- font-weight: normal;
21
- line-height: var(--src-lh-base);
22
-
23
- [srcIconPrefix] {
24
- color: var(--srcBannerIconColor);
25
- }
26
-
27
- p {
28
- margin: 0;
29
- }
30
-
31
- &--compact {
32
- --srcBannerPadding: 16px;
33
- --srcBannerIconMargin: 8px;
34
- }
35
-
36
- &--info {
37
- --srcBannerBackgroundColor: #e8f0fd;
38
- --srcBannerBorderColor: transparent;
39
- --srcBannerIconColor: #2463bc;
40
- }
41
-
42
- &--success {
43
- --srcBannerBackgroundColor: var(--src-color-green-50);
44
- --srcBannerBorderColor: var(--src-color-green-500);
45
- --srcBannerIconColor: var(--src-color-green-500);
46
- }
47
-
48
- &--critical {
49
- --srcBannerBackgroundColor: var(--src-color-bg-critical-subdued);
50
- --srcBannerBorderColor: var(--src-color-border-critical-strong);
51
- --srcBannerIconColor: var(--src-color-icon-critical);
52
- }
53
-
54
- &--warning {
55
- --srcBannerBackgroundColor: var(--src-color-yellow-50);
56
- --srcBannerBorderColor: var(--src-color-yellow-700);
57
- --srcBannerIconColor: var(--src-color-yellow-700);
58
- }
59
- }
60
-
61
- .src-banner__icon {
62
- margin-right: var(--srcBannerIconMargin, 8px);
63
- color: var(--srcBannerIconColor);
64
- }
65
-
66
- .src-banner__close {
67
- position: absolute;
68
- top: 16px;
69
- right: 16px;
70
- margin-left: auto;
71
-
72
- button.src-icon-button {
73
- --srcButtonBgColor: transparent;
74
- }
75
- }
@@ -1,25 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- input,
5
- ViewEncapsulation,
6
- } from '@angular/core';
7
- import { NgClass } from '@angular/common';
8
- import {
9
- SourceBannerType,
10
- SourceBannerTypeValues,
11
- } from '../constants/sourceBannerType';
12
-
13
- @Component({
14
- selector: 'src-banner',
15
- templateUrl: './source-banner.component.html',
16
- styleUrls: ['./source-banner.component.scss'],
17
- imports: [NgClass],
18
- encapsulation: ViewEncapsulation.None,
19
- changeDetection: ChangeDetectionStrategy.OnPush,
20
- })
21
- export class SourceBannerComponent {
22
- type = input<SourceBannerTypeValues>(SourceBannerType.DEFAULT);
23
- isCompact = input(false);
24
- testID = input('', { alias: 'data-testid' });
25
- }
@@ -1,10 +0,0 @@
1
- export const SourceBannerType = {
2
- DEFAULT: 'default',
3
- INFO: 'info',
4
- SUCCESS: 'success',
5
- WARNING: 'warning',
6
- CRITICAL: 'critical',
7
- } as const;
8
-
9
- export type SourceBannerTypeValues =
10
- (typeof SourceBannerType)[keyof typeof SourceBannerType];
@@ -1,44 +0,0 @@
1
- <button
2
- [type]="type"
3
- class="src-button"
4
- [ngClass]="classes"
5
- [attr.form]="formID"
6
- (click)="handleClick($event)"
7
- (submit)="handleSubmit($event)"
8
- [disabled]="isDisabled"
9
- [attr.data-testid]="testID()"
10
- >
11
- <span [style.opacity]="isLoading ? 0 : 1">
12
- @if (iconPrefix) {
13
- <span class="src-button__icon">
14
- <ng-content select="[srcIconPrefix]"></ng-content>
15
- </span>
16
- }
17
-
18
- <ng-content></ng-content>
19
-
20
- @if (hasDisclosure) {
21
- <svg
22
- class="disclosure-icon"
23
- width="8"
24
- height="5"
25
- viewBox="0 0 8 5"
26
- fill="none"
27
- xmlns="http://www.w3.org/2000/svg"
28
- >
29
- <path
30
- d="M3.40573 4.3L0.805725 1.7C0.489058 1.38333 0.418392 1.021 0.593725 0.613C0.768392 0.204333 1.08073 0 1.53073 0H6.68072C7.13072 0 7.44306 0.204333 7.61772 0.613C7.79306 1.021 7.72239 1.38333 7.40573 1.7L4.80572 4.3C4.70572 4.4 4.59739 4.475 4.48073 4.525C4.36406 4.575 4.23906 4.6 4.10573 4.6C3.97239 4.6 3.84739 4.575 3.73073 4.525C3.61406 4.475 3.50573 4.4 3.40573 4.3Z"
31
- fill="currentColor"
32
- />
33
- </svg>
34
- }
35
- </span>
36
- @if (isLoading) {
37
- <src-loading
38
- [size]="16"
39
- [progressStrokeColor]="'#6B7280'"
40
- [strokeWidth]="2"
41
- [data-testid]="testID() + '-loading-state'"
42
- ></src-loading>
43
- }
44
- </button>