@iamgld/ui 0.0.1 → 1.0.1

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 (58) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +15 -52
  3. package/fesm2022/iamgld-ui.mjs +834 -0
  4. package/fesm2022/iamgld-ui.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/components/buttons/button/button.component.d.ts +13 -0
  7. package/lib/components/buttons/index.d.ts +1 -0
  8. package/lib/components/controls/index.d.ts +9 -0
  9. package/lib/components/controls/input/input.component.d.ts +25 -0
  10. package/lib/components/controls/input-date/input-date.component.d.ts +23 -0
  11. package/lib/components/controls/input-error/input-error.component.d.ts +9 -0
  12. package/lib/components/controls/input-hint/input-hint.component.d.ts +5 -0
  13. package/lib/components/controls/radio-button/radio-button.component.d.ts +17 -0
  14. package/lib/components/controls/radio-group/radio-group.component.d.ts +27 -0
  15. package/lib/components/controls/select/select.component.d.ts +31 -0
  16. package/lib/components/controls/select-option/select-option.component.d.ts +14 -0
  17. package/lib/components/controls/textarea/textarea.component.d.ts +25 -0
  18. package/lib/components/icon/icon.component.d.ts +23 -0
  19. package/lib/components/index.d.ts +2 -0
  20. package/lib/models/controls/index.d.ts +3 -0
  21. package/lib/models/controls/input.model.d.ts +2 -0
  22. package/lib/models/controls/radio.model.d.ts +4 -0
  23. package/lib/models/controls/select.model.d.ts +4 -0
  24. package/lib/models/icon/icon.model.d.ts +14 -0
  25. package/lib/models/index.d.ts +2 -0
  26. package/lib/utils/date/date.util.d.ts +5 -0
  27. package/lib/utils/index.d.ts +2 -0
  28. package/lib/utils/string/string.util.d.ts +1 -0
  29. package/lib/validators/index.d.ts +9 -0
  30. package/lib/validators/is-date/is-date.validator.d.ts +2 -0
  31. package/lib/validators/is-document/is-document.validator.d.ts +6 -0
  32. package/lib/validators/is-email/is-email.validator.d.ts +2 -0
  33. package/lib/validators/is-form-select-item/is-form-select-item.validator.d.ts +2 -0
  34. package/lib/validators/is-license-plate/is-license-plate.validator.d.ts +4 -0
  35. package/lib/validators/is-natural-number/is-natural-number.validator.d.ts +2 -0
  36. package/lib/validators/minimum-age/minimum-age.validator.d.ts +4 -0
  37. package/lib/validators/must-match/must-match.validator.d.ts +6 -0
  38. package/lib/validators/must-unmatch/must-unmatch.validator.d.ts +6 -0
  39. package/package.json +14 -4
  40. package/public/styles/layers/_setting.scss +8 -4
  41. package/public-api.d.ts +3 -0
  42. package/.storybook/main.ts +0 -16
  43. package/.storybook/preview.ts +0 -14
  44. package/.storybook/tsconfig.json +0 -12
  45. package/.storybook/typings.d.ts +0 -4
  46. package/eslint.config.js +0 -34
  47. package/ng-package.json +0 -10
  48. package/src/lib/components/buttons/button/button.component.html +0 -10
  49. package/src/lib/components/buttons/button/button.component.scss +0 -128
  50. package/src/lib/components/buttons/button/button.component.spec.ts +0 -21
  51. package/src/lib/components/buttons/button/button.component.stories.ts +0 -91
  52. package/src/lib/components/buttons/button/button.component.ts +0 -29
  53. package/src/lib/components/buttons/index.ts +0 -1
  54. package/src/lib/components/index.ts +0 -1
  55. package/src/public-api.ts +0 -6
  56. package/tsconfig.lib.json +0 -15
  57. package/tsconfig.lib.prod.json +0 -11
  58. package/tsconfig.spec.json +0 -11
@@ -0,0 +1,6 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare function mustMatchValidator({ controlName, mustMatchControlName, errorMessage, }: {
3
+ controlName: string;
4
+ mustMatchControlName: string;
5
+ errorMessage: string;
6
+ }): ValidatorFn;
@@ -0,0 +1,6 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare function mustUnmatchValidator({ controlName, mustUnmatchControlName, errorMessage, }: {
3
+ controlName: string;
4
+ mustUnmatchControlName: string;
5
+ errorMessage: string;
6
+ }): ValidatorFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamgld/ui",
3
- "version": "0.0.1",
3
+ "version": "1.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,6 +11,16 @@
11
11
  "dependencies": {
12
12
  "tslib": "2.3.0"
13
13
  },
14
- "sideEffects": false
15
- }
16
-
14
+ "sideEffects": false,
15
+ "module": "fesm2022/iamgld-ui.mjs",
16
+ "typings": "index.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./fesm2022/iamgld-ui.mjs"
24
+ }
25
+ }
26
+ }
@@ -83,15 +83,16 @@
83
83
  --gld-orange: #f97315;
84
84
  --gld-orange-transparent--010: #{rgba(#f97315, 0.1)};
85
85
  --gld-orange-transparent--020: #{rgba(#f97315, 0.2)};
86
- --gld-orange-transparent--020: #{rgba(#f97315, 0.3)};
86
+ --gld-orange-transparent--030: #{rgba(#f97315, 0.3)};
87
87
  --gld-pink: #ec4899;
88
88
  --gld-pink-transparent--010: #{rgba(#ec4899, 0.1)};
89
89
  --gld-pink-transparent--020: #{rgba(#ec4899, 0.2)};
90
90
  --gld-pink-transparent--030: #{rgba(#ec4899, 0.3)};
91
91
  --gld-gray: #b5b5b5;
92
- --gld-gray-transparent--015: #{rgba(#b5b5b5, 0.15)};
92
+ --gld-gray-transparent--010: #{rgba(#b5b5b5, 0.1)};
93
+ --gld-gray-transparent--020: #{rgba(#b5b5b5, 0.2)};
93
94
  --gld-gray-transparent--050: #{rgba(#b5b5b5, 0.5)};
94
- --gld-gray-transparent--075: #{rgba(#b5b5b5, 0.75)};
95
+ --gld-gray-transparent--060: #{rgba(#b5b5b5, 0.6)};
95
96
  --gld-white: #fff;
96
97
  --gld-whitelight: #f9fafb;
97
98
  --gld-whitelight-transparent--090: #{rgba(#f9fafb, 0.9)};
@@ -105,13 +106,16 @@
105
106
  --gld-darkblue-transparent--070: #{rgba(#101827, 0.7)};
106
107
  --gld-darkblue-transparent--060: #{rgba(#101827, 0.6)};
107
108
  --gld-darkblue-transparent--030: #{rgba(#101827, 0.3)};
109
+ --gld-darkblue-transparent--010: #{rgba(#101827, 0.1)};
108
110
 
109
111
  // Borders
110
- --gld-border-size: 1px;
112
+ --gld-border-size: 2px;
113
+
111
114
  // Animations
112
115
  --gld-animation-time--150: 150ms;
113
116
  --gld-animation-time--250: 250ms;
114
117
  --gld-animation-time--10s: 10s;
118
+
115
119
  // General
116
120
  --gld-max-width: 1280px;
117
121
  --gld-navbar-height: 50px;
@@ -0,0 +1,3 @@
1
+ export * from './lib/components';
2
+ export * from './lib/validators';
3
+ export * from './lib/utils';
@@ -1,16 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/angular'
2
-
3
- const config: StorybookConfig = {
4
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
- addons: [
6
- '@storybook/addon-onboarding',
7
- '@storybook/addon-essentials',
8
- '@chromatic-com/storybook',
9
- '@storybook/addon-interactions',
10
- ],
11
- framework: {
12
- name: '@storybook/angular',
13
- options: {},
14
- },
15
- }
16
- export default config
@@ -1,14 +0,0 @@
1
- import type { Preview } from '@storybook/angular'
2
-
3
- const preview: Preview = {
4
- parameters: {
5
- controls: {
6
- matchers: {
7
- color: /(background|color)$/i,
8
- date: /Date$/i,
9
- },
10
- },
11
- },
12
- }
13
-
14
- export default preview
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "../tsconfig.lib.json",
3
- "compilerOptions": {
4
- "types": ["node"],
5
- "allowSyntheticDefaultImports": true,
6
- "resolveJsonModule": true
7
- },
8
- "exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
9
- "include": ["../src/**/*.stories.*", "./preview.ts"],
10
- "files": ["./typings.d.ts"]
11
- }
12
-
@@ -1,4 +0,0 @@
1
- declare module '*.md' {
2
- const content: string;
3
- export default content;
4
- }
package/eslint.config.js DELETED
@@ -1,34 +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
- extends: [],
10
- rules: {
11
- '@angular-eslint/directive-selector': [
12
- 'error',
13
- {
14
- type: 'attribute',
15
- prefix: 'gld',
16
- style: 'camelCase',
17
- },
18
- ],
19
- '@angular-eslint/component-selector': [
20
- 'error',
21
- {
22
- type: 'element',
23
- prefix: 'gld',
24
- style: 'kebab-case',
25
- },
26
- ],
27
- },
28
- },
29
- {
30
- files: ['**/*.html'],
31
- rules: {},
32
- },
33
- )
34
-
package/ng-package.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/iamgld-ui",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- },
7
- "inlineStyleLanguage": "scss",
8
- "assets": ["./public/**"]
9
- }
10
-
@@ -1,10 +0,0 @@
1
- <button
2
- id="{{ name() }}"
3
- attr.aria-label="{{ name() }}"
4
- class="Button Button--{{ color() }} Button--{{ size() }}"
5
- [class.Button--disable]="disable()"
6
- (click)="emitClick()">
7
- <span>
8
- <ng-content />
9
- </span>
10
- </button>
@@ -1,128 +0,0 @@
1
- // @use 'styles';
2
-
3
- .Button {
4
- --color: initial;
5
- --border-color: initial;
6
- --border: var(--gld-border-size) solid var(--border-color);
7
- --background: initial;
8
- --background--hover: initial;
9
- --box-shadow-size: 2px;
10
- --box-shadow-size--hover: 0;
11
- --padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);
12
- --radius: var(--gld-radius--xxs);
13
- --font-size: var(--gld-font-size--normal);
14
- --font: 600 var(--font-size) var(--gld-font--poppins);
15
-
16
- outline: none;
17
- border: var(--border);
18
- padding: var(--padding);
19
- border-radius: var(--radius);
20
- font: var(--font);
21
- cursor: pointer;
22
- width: inherit;
23
- color: var(--color);
24
- background: var(--background);
25
- box-shadow: 0 var(--box-shadow-size) 0 0;
26
- display: inline-flex;
27
- align-items: center;
28
- justify-content: center;
29
- gap: var(--gld-spacing--xxxs);
30
- will-change: background, color;
31
- transition:
32
- background var(--gld-animation-time--150),
33
- box-shadow var(--gld-animation-time--150),
34
- color var(--gld-animation-time--150);
35
-
36
- &:hover,
37
- &:focus {
38
- --background: var(--background--hover);
39
- --box-shadow-size: var(--box-shadow-size--hover);
40
- }
41
-
42
- span {
43
- text-transform: capitalize;
44
- user-select: none;
45
- }
46
-
47
- &--pink {
48
- --color: var(--gld-pink);
49
- --border-color: var(--gld-pink);
50
- --background: var(--gld-pink-transparent--010);
51
- --background--hover: var(--gld-pink-transparent--020);
52
- }
53
-
54
- &--purple {
55
- --color: var(--gld-purple);
56
- --border-color: var(--gld-purple);
57
- --background: var(--gld-purple-transparent--010);
58
- --background--hover: var(--gld-purple-transparent--020);
59
- }
60
-
61
- &--mustard {
62
- --color: var(--gld-mustard);
63
- --border-color: var(--gld-mustard);
64
- --background: var(--gld-mustard-transparent--010);
65
- --background--hover: var(--gld-mustard-transparent--020);
66
- }
67
-
68
- &--orange {
69
- --color: var(--gld-orange);
70
- --border-color: var(--gld-orange);
71
- --background: var(--gld-orange-transparent--010);
72
- --background--hover: var(--gld-orange-transparent--020);
73
- }
74
-
75
- &--blue {
76
- --color: var(--gld-blue);
77
- --border-color: var(--gld-blue);
78
- --background: var(--gld-blue-transparent--010);
79
- --background--hover: var(--gld-blue-transparent--020);
80
- }
81
-
82
- &--red {
83
- --color: var(--gld-red);
84
- --border-color: var(--gld-red);
85
- --background: var(--gld-red-transparent--010);
86
- --background--hover: var(--gld-red-transparent--020);
87
- }
88
-
89
- &--green {
90
- --color: var(--gld-green);
91
- --border-color: var(--gld-green);
92
- --background: var(--gld-green-transparent--010);
93
- --background--hover: var(--gld-green-transparent--020);
94
- }
95
-
96
- &--tiny {
97
- --font-size: var(--gld-font-size--small);
98
- --padding: var(--gld-spacing--xxxs) var(--gld-spacing--xxs);
99
- }
100
-
101
- &--small {
102
- --font-size: var(--gld-font-size--small);
103
- --padding: var(--gld-spacing--xxs);
104
- }
105
-
106
- &--normal {
107
- --font-size: var(--gld-font-size--normal);
108
- --padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);
109
- }
110
-
111
- &--medium {
112
- --padding: var(--gld-spacing--xs) var(--gld-spacing--m);
113
- }
114
-
115
- &--large {
116
- --font-size: var(--gld-font-size--heading-three);
117
- --padding: var(--gld-spacing--xs) var(--gld-spacing--l);
118
- }
119
-
120
- &--disable {
121
- --color: var(--gld-gray-transparent--075);
122
- --border-color: var(--gld-gray-transparent--075);
123
- --background: var(--gld-gray-transparent--015);
124
- --background--hover: var(--gld-gray-transparent--015);
125
- pointer-events: none;
126
- cursor: not-allowed;
127
- }
128
- }
@@ -1,21 +0,0 @@
1
- import { type ComponentFixture, TestBed } from '@angular/core/testing'
2
-
3
- import { ButtonComponent } from './button.component'
4
-
5
- describe('ButtonComponent', () => {
6
- let component: ButtonComponent
7
- let fixture: ComponentFixture<ButtonComponent>
8
-
9
- beforeEach(() => {
10
- TestBed.configureTestingModule({
11
- imports: [ButtonComponent],
12
- })
13
- fixture = TestBed.createComponent(ButtonComponent)
14
- component = fixture.componentInstance
15
- fixture.detectChanges()
16
- })
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy()
20
- })
21
- })
@@ -1,91 +0,0 @@
1
- // Storybook Imports
2
- import { Meta, StoryObj } from '@storybook/angular'
3
- import { fn } from '@storybook/test'
4
- // This Component Imports
5
- import { ButtonComponent } from './button.component'
6
-
7
- const meta: Meta<ButtonComponent> = {
8
- title: 'buttons/button',
9
- component: ButtonComponent,
10
- tags: ['autodocs'],
11
- argTypes: {
12
- name: {
13
- description: 'Required name',
14
- control: {
15
- type: 'text',
16
- accept: 'string',
17
- },
18
- table: {
19
- type: { summary: 'Name' },
20
- defaultValue: { summary: 'button name' },
21
- },
22
- },
23
- color: {
24
- description: 'Supported colors',
25
- control: {
26
- type: 'select',
27
- accept: 'string',
28
- },
29
- options: ['pink', 'purple', 'mustard', 'orange', 'red', 'blue', 'green'],
30
- table: {
31
- type: { summary: 'ButtonColor' },
32
- defaultValue: { summary: 'pink' },
33
- },
34
- },
35
- size: {
36
- description: 'Supported sizes',
37
- control: {
38
- type: 'select',
39
- accept: 'string',
40
- },
41
- options: ['tiny', 'small', 'normal', 'medium', 'large'],
42
- table: {
43
- type: { summary: 'ButtonSize' },
44
- defaultValue: { summary: 'normal' },
45
- },
46
- },
47
- disable: {
48
- control: {
49
- type: 'boolean',
50
- accept: 'boolean',
51
- },
52
- table: {
53
- type: { summary: 'boolean' },
54
- defaultValue: { summary: 'false' },
55
- },
56
- },
57
- clicked: {
58
- table: {
59
- type: { summary: 'function' },
60
- defaultValue: { summary: '() => void' },
61
- },
62
- },
63
- },
64
- args: {
65
- name: 'button',
66
- color: 'pink',
67
- size: 'normal',
68
- disable: false,
69
- clicked: fn(),
70
- },
71
- parameters: {},
72
- render: (args) => ({
73
- props: {
74
- ...args,
75
- ngContent: 'Button',
76
- },
77
- template: `
78
- <gld-button [name]="name" [color]="color" [size]="size" [disable]="disable">
79
- {{ ngContent }}
80
- </gld-button>`,
81
- }),
82
- }
83
-
84
- export default meta
85
- type Story = StoryObj<ButtonComponent>
86
-
87
- export const Pink: Story = {
88
- args: {
89
- color: 'pink',
90
- },
91
- }
@@ -1,29 +0,0 @@
1
- // Angular Imports
2
- import { ChangeDetectionStrategy, Component, booleanAttribute, input, output } from '@angular/core'
3
-
4
- @Component({
5
- selector: 'gld-button',
6
- templateUrl: './button.component.html',
7
- styleUrl: './button.component.scss',
8
- imports: [],
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- })
11
- export class ButtonComponent {
12
- name = input.required<string>()
13
- disable = input<boolean, string | boolean>(false, { transform: booleanAttribute })
14
- // hasIcon = input<boolean, string | boolean>(false, { transform: booleanAttribute })
15
- // icon = input<Icons>(Icons.addLine)
16
- // iconSize = input<keyof typeof IconsSize>(IconsSize.small)
17
- // iconMoveTopToBottom = input<number, string | number>(0, { transform: numberAttribute })
18
- // iconMoveLeftToRight = input<number, string | number>(0, { transform: numberAttribute })
19
- color = input<ButtonColor>('pink')
20
- size = input<ButtonSize>('normal')
21
- clicked = output<void>()
22
-
23
- emitClick() {
24
- if (!this.disable()) this.clicked.emit()
25
- }
26
- }
27
-
28
- export type ButtonColor = 'pink' | 'purple' | 'mustard' | 'orange' | 'red' | 'blue' | 'green'
29
- export type ButtonSize = 'tiny' | 'small' | 'normal' | 'medium' | 'large'
@@ -1 +0,0 @@
1
- export * from './button/button.component'
@@ -1 +0,0 @@
1
- export * from './buttons'
package/src/public-api.ts DELETED
@@ -1,6 +0,0 @@
1
- /*
2
- * Public API Surface of iamgld-ui
3
- */
4
-
5
- export * from './lib/components'
6
-
package/tsconfig.lib.json DELETED
@@ -1,15 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../out-tsc/lib",
7
- "declaration": true,
8
- "declarationMap": true,
9
- "inlineSources": true,
10
- "types": []
11
- },
12
- "exclude": [
13
- "**/*.spec.ts"
14
- ]
15
- }
@@ -1,11 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "./tsconfig.lib.json",
5
- "compilerOptions": {
6
- "declarationMap": false
7
- },
8
- "angularCompilerOptions": {
9
- "compilationMode": "partial"
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../out-tsc/spec",
7
- "types": []
8
- },
9
- "include": ["**/*.spec.ts", "**/*.d.ts"]
10
- }
11
-