@ukho/admiralty-core 0.4.6 → 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/dist/admiralty/admiralty.esm.js +1 -1
- package/dist/admiralty/admiralty.esm.js.map +1 -1
- package/dist/admiralty/p-20c06ebe.entry.js +2 -0
- package/dist/admiralty/p-20c06ebe.entry.js.map +1 -0
- package/dist/admiralty/{p-27286b0d.entry.js → p-3e91e95a.entry.js} +2 -2
- package/dist/admiralty/p-3e91e95a.entry.js.map +1 -0
- package/dist/admiralty/p-40bc8d7f.entry.js +2 -0
- package/dist/admiralty/p-40bc8d7f.entry.js.map +1 -0
- package/dist/admiralty/{p-f43f9ff4.entry.js → p-620e0985.entry.js} +2 -2
- package/dist/admiralty/{p-f43f9ff4.entry.js.map → p-620e0985.entry.js.map} +1 -1
- package/dist/admiralty/p-b5beb563.entry.js +2 -0
- package/dist/admiralty/p-b5beb563.entry.js.map +1 -0
- package/dist/cjs/admiralty-hint_3.cjs.entry.js +4 -4
- package/dist/cjs/admiralty-hint_3.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-input.cjs.entry.js +2 -2
- package/dist/cjs/admiralty-input.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/admiralty-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-select.cjs.entry.js +5 -5
- package/dist/cjs/admiralty-select.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-textarea.cjs.entry.js +1 -1
- package/dist/cjs/admiralty-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +1 -1
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/input.spec.js +8 -8
- package/dist/collection/components/input/input.spec.js.map +1 -1
- package/dist/collection/components/input-invalid/input-invalid.e2e.js +10 -0
- package/dist/collection/components/input-invalid/input-invalid.e2e.js.map +1 -0
- package/dist/collection/components/{input-error/input-error.js → input-invalid/input-invalid.js} +6 -6
- package/dist/collection/components/input-invalid/input-invalid.js.map +1 -0
- package/dist/collection/components/input-invalid/input-invalid.spec.js +19 -0
- package/dist/collection/components/input-invalid/input-invalid.spec.js.map +1 -0
- package/dist/collection/components/radio-group/radio-group.js +1 -1
- package/dist/collection/components/radio-group/radio-group.js.map +1 -1
- package/dist/collection/components/radio-group/radio-group.spec.js +3 -3
- package/dist/collection/components/radio-group/radio-group.spec.js.map +1 -1
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +10 -10
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/select/select.spec.js +10 -5
- package/dist/collection/components/select/select.spec.js.map +1 -1
- package/dist/collection/components/textarea/textarea.js +1 -1
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/components/textarea/textarea.spec.js +7 -3
- package/dist/collection/components/textarea/textarea.spec.js.map +1 -1
- package/dist/components/admiralty-input-invalid.d.ts +11 -0
- package/dist/components/admiralty-input-invalid.js +8 -0
- package/dist/components/admiralty-input-invalid.js.map +1 -0
- package/dist/components/admiralty-radio-group.js +4 -4
- package/dist/components/admiralty-radio-group.js.map +1 -1
- package/dist/components/admiralty-select.js +10 -10
- package/dist/components/admiralty-select.js.map +1 -1
- package/dist/components/admiralty-textarea.js +4 -4
- package/dist/components/admiralty-textarea.js.map +1 -1
- package/dist/components/admiralty-type-ahead.js +3 -3
- package/dist/components/{input-error.js → input-invalid.js} +9 -9
- package/dist/components/input-invalid.js.map +1 -0
- package/dist/components/input.js +5 -5
- package/dist/components/input.js.map +1 -1
- package/dist/esm/admiralty-hint_3.entry.js +4 -4
- package/dist/esm/admiralty-hint_3.entry.js.map +1 -1
- package/dist/esm/admiralty-input.entry.js +2 -2
- package/dist/esm/admiralty-input.entry.js.map +1 -1
- package/dist/esm/admiralty-radio-group.entry.js +1 -1
- package/dist/esm/admiralty-radio-group.entry.js.map +1 -1
- package/dist/esm/admiralty-select.entry.js +5 -5
- package/dist/esm/admiralty-select.entry.js.map +1 -1
- package/dist/esm/admiralty-textarea.entry.js +1 -1
- package/dist/esm/admiralty-textarea.entry.js.map +1 -1
- package/dist/esm/admiralty.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/input-invalid/input-invalid.d.ts +7 -0
- package/dist/types/components/select/select.d.ts +4 -4
- package/dist/types/components.d.ts +21 -21
- package/package.json +11 -11
- package/dist/admiralty/p-27286b0d.entry.js.map +0 -1
- package/dist/admiralty/p-5d46659e.entry.js +0 -2
- package/dist/admiralty/p-5d46659e.entry.js.map +0 -1
- package/dist/admiralty/p-869d7709.entry.js +0 -2
- package/dist/admiralty/p-869d7709.entry.js.map +0 -1
- package/dist/admiralty/p-c027f79d.entry.js +0 -2
- package/dist/admiralty/p-c027f79d.entry.js.map +0 -1
- package/dist/collection/components/input-error/input-error.e2e.js +0 -10
- package/dist/collection/components/input-error/input-error.e2e.js.map +0 -1
- package/dist/collection/components/input-error/input-error.js.map +0 -1
- package/dist/collection/components/input-error/input-error.spec.js +0 -19
- package/dist/collection/components/input-error/input-error.spec.js.map +0 -1
- package/dist/components/admiralty-input-error.d.ts +0 -11
- package/dist/components/admiralty-input-error.js +0 -8
- package/dist/components/admiralty-input-error.js.map +0 -1
- package/dist/components/input-error.js.map +0 -1
- package/dist/types/components/input-error/input-error.d.ts +0 -7
- /package/dist/collection/components/{input-error/input-error.css → input-invalid/input-invalid.css} +0 -0
|
@@ -307,7 +307,7 @@ export namespace Components {
|
|
|
307
307
|
*/
|
|
308
308
|
"width": number;
|
|
309
309
|
}
|
|
310
|
-
interface
|
|
310
|
+
interface AdmiraltyInputInvalid {
|
|
311
311
|
}
|
|
312
312
|
interface AdmiraltyLabel {
|
|
313
313
|
/**
|
|
@@ -426,17 +426,17 @@ export namespace Components {
|
|
|
426
426
|
*/
|
|
427
427
|
"disabled": boolean;
|
|
428
428
|
/**
|
|
429
|
-
*
|
|
429
|
+
* The text that will be used as a field label.
|
|
430
430
|
*/
|
|
431
|
-
"
|
|
431
|
+
"hint": string;
|
|
432
432
|
/**
|
|
433
|
-
*
|
|
433
|
+
* Whether to show that the select is in an invalid state.
|
|
434
434
|
*/
|
|
435
|
-
"
|
|
435
|
+
"invalid": boolean;
|
|
436
436
|
/**
|
|
437
|
-
* The
|
|
437
|
+
* The message to show when the select is invalid.
|
|
438
438
|
*/
|
|
439
|
-
"
|
|
439
|
+
"invalidMessage": string;
|
|
440
440
|
/**
|
|
441
441
|
* The text that will be used as a field label.
|
|
442
442
|
*/
|
|
@@ -779,11 +779,11 @@ declare global {
|
|
|
779
779
|
prototype: HTMLAdmiraltyInputElement;
|
|
780
780
|
new (): HTMLAdmiraltyInputElement;
|
|
781
781
|
};
|
|
782
|
-
interface
|
|
782
|
+
interface HTMLAdmiraltyInputInvalidElement extends Components.AdmiraltyInputInvalid, HTMLStencilElement {
|
|
783
783
|
}
|
|
784
|
-
var
|
|
785
|
-
prototype:
|
|
786
|
-
new ():
|
|
784
|
+
var HTMLAdmiraltyInputInvalidElement: {
|
|
785
|
+
prototype: HTMLAdmiraltyInputInvalidElement;
|
|
786
|
+
new (): HTMLAdmiraltyInputInvalidElement;
|
|
787
787
|
};
|
|
788
788
|
interface HTMLAdmiraltyLabelElement extends Components.AdmiraltyLabel, HTMLStencilElement {
|
|
789
789
|
}
|
|
@@ -968,7 +968,7 @@ declare global {
|
|
|
968
968
|
"admiralty-hr": HTMLAdmiraltyHrElement;
|
|
969
969
|
"admiralty-icon": HTMLAdmiraltyIconElement;
|
|
970
970
|
"admiralty-input": HTMLAdmiraltyInputElement;
|
|
971
|
-
"admiralty-input-
|
|
971
|
+
"admiralty-input-invalid": HTMLAdmiraltyInputInvalidElement;
|
|
972
972
|
"admiralty-label": HTMLAdmiraltyLabelElement;
|
|
973
973
|
"admiralty-link": HTMLAdmiraltyLinkElement;
|
|
974
974
|
"admiralty-paginator": HTMLAdmiraltyPaginatorElement;
|
|
@@ -1337,7 +1337,7 @@ declare namespace LocalJSX {
|
|
|
1337
1337
|
*/
|
|
1338
1338
|
"width"?: number;
|
|
1339
1339
|
}
|
|
1340
|
-
interface
|
|
1340
|
+
interface AdmiraltyInputInvalid {
|
|
1341
1341
|
}
|
|
1342
1342
|
interface AdmiraltyLabel {
|
|
1343
1343
|
/**
|
|
@@ -1479,17 +1479,17 @@ declare namespace LocalJSX {
|
|
|
1479
1479
|
*/
|
|
1480
1480
|
"disabled"?: boolean;
|
|
1481
1481
|
/**
|
|
1482
|
-
*
|
|
1482
|
+
* The text that will be used as a field label.
|
|
1483
1483
|
*/
|
|
1484
|
-
"
|
|
1484
|
+
"hint"?: string;
|
|
1485
1485
|
/**
|
|
1486
|
-
*
|
|
1486
|
+
* Whether to show that the select is in an invalid state.
|
|
1487
1487
|
*/
|
|
1488
|
-
"
|
|
1488
|
+
"invalid"?: boolean;
|
|
1489
1489
|
/**
|
|
1490
|
-
* The
|
|
1490
|
+
* The message to show when the select is invalid.
|
|
1491
1491
|
*/
|
|
1492
|
-
"
|
|
1492
|
+
"invalidMessage"?: string;
|
|
1493
1493
|
/**
|
|
1494
1494
|
* The text that will be used as a field label.
|
|
1495
1495
|
*/
|
|
@@ -1684,7 +1684,7 @@ declare namespace LocalJSX {
|
|
|
1684
1684
|
"admiralty-hr": AdmiraltyHr;
|
|
1685
1685
|
"admiralty-icon": AdmiraltyIcon;
|
|
1686
1686
|
"admiralty-input": AdmiraltyInput;
|
|
1687
|
-
"admiralty-input-
|
|
1687
|
+
"admiralty-input-invalid": AdmiraltyInputInvalid;
|
|
1688
1688
|
"admiralty-label": AdmiraltyLabel;
|
|
1689
1689
|
"admiralty-link": AdmiraltyLink;
|
|
1690
1690
|
"admiralty-paginator": AdmiraltyPaginator;
|
|
@@ -1741,7 +1741,7 @@ declare module "@stencil/core" {
|
|
|
1741
1741
|
* and checkbox.
|
|
1742
1742
|
*/
|
|
1743
1743
|
"admiralty-input": LocalJSX.AdmiraltyInput & JSXBase.HTMLAttributes<HTMLAdmiraltyInputElement>;
|
|
1744
|
-
"admiralty-input-
|
|
1744
|
+
"admiralty-input-invalid": LocalJSX.AdmiraltyInputInvalid & JSXBase.HTMLAttributes<HTMLAdmiraltyInputInvalidElement>;
|
|
1745
1745
|
"admiralty-label": LocalJSX.AdmiraltyLabel & JSXBase.HTMLAttributes<HTMLAdmiraltyLabelElement>;
|
|
1746
1746
|
"admiralty-link": LocalJSX.AdmiraltyLink & JSXBase.HTMLAttributes<HTMLAdmiraltyLinkElement>;
|
|
1747
1747
|
"admiralty-paginator": LocalJSX.AdmiraltyPaginator & JSXBase.HTMLAttributes<HTMLAdmiraltyPaginatorElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukho/admiralty-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"@stencil/angular-output-target": "^0.7.1",
|
|
44
44
|
"@stencil/core": "^3.4.2",
|
|
45
45
|
"@stencil/sass": "^3.0.5",
|
|
46
|
-
"@storybook/addon-a11y": "^7.
|
|
47
|
-
"@storybook/addon-actions": "^7.
|
|
48
|
-
"@storybook/addon-essentials": "^7.
|
|
49
|
-
"@storybook/addon-links": "^7.
|
|
50
|
-
"@storybook/web-components": "^7.
|
|
51
|
-
"@storybook/web-components-vite": "^7.
|
|
46
|
+
"@storybook/addon-a11y": "^7.4.0",
|
|
47
|
+
"@storybook/addon-actions": "^7.4.0",
|
|
48
|
+
"@storybook/addon-essentials": "^7.4.0",
|
|
49
|
+
"@storybook/addon-links": "^7.4.0",
|
|
50
|
+
"@storybook/web-components": "^7.4.0",
|
|
51
|
+
"@storybook/web-components-vite": "^7.4.0",
|
|
52
52
|
"@types/jest": "^27.5.2",
|
|
53
53
|
"@types/node": "^18.17.0",
|
|
54
54
|
"clean-css-cli": "^5.6.2",
|
|
55
|
-
"concurrently": "^8.2.
|
|
55
|
+
"concurrently": "^8.2.1",
|
|
56
56
|
"jest": "^27.5.1",
|
|
57
57
|
"jest-cli": "^27.5.1",
|
|
58
58
|
"jest-environment-node": "^27.5.1",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"sass": "^1.64.1",
|
|
64
|
-
"storybook": "^7.
|
|
65
|
-
"vite": "^4.4.
|
|
64
|
+
"storybook": "^7.4.0",
|
|
65
|
+
"vite": "^4.4.9"
|
|
66
66
|
},
|
|
67
67
|
"license": "MIT",
|
|
68
68
|
"url": "https://github.com/UKHO/admiralty-design-system",
|
|
69
69
|
"repository": "git://github.com/UKHO/admiralty-design-system.git",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "d8bb509acdd6a493625ac0ffd9c93006168f595c"
|
|
71
71
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["textareaCss","textareaIds","TextareaComponent","this","inputId","onBlur","textareaBlur","emit","onInput","ev","input","target","value","valueChanged","nativeInput","nativeTextArea","getValue","admiraltyInput","toString","render","h","Host","class","label","for","disabled","hint","ref","textArea","invalid","style","width","maxWidth","id","maxLength","invalidMessage"],"sources":["./src/components/textarea/textarea.scss?tag=admiralty-textarea&encapsulation=scoped","./src/components/textarea/textarea.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\n@use \"../../scss/base/responsive\";\n@use \"../../scss/base/typography\";\n@use \"../../scss/vars/typography\" as typography-vars;\n\n\n.text-area-container {\n textarea {\n display: block;\n position: relative;\n width: 100%;\n min-height: 170px;\n border: 2px solid colours.$colour-text;\n color: colours.$colour-text;\n padding: 12px 18px;\n outline: none;\n resize: vertical;\n overflow: auto;\n box-sizing: border-box;\n vertical-align: top;\n\n background-color: colours.$colour-white;\n\n &:focus-visible {\n outline: 3px solid colours.$colour-utility-focus;\n box-shadow: colours.$colour-text inset 0 0 0 2px;\n }\n\n &.invalid {\n border-color: colours.$colour-utility-error;\n\n &:focus-visible {\n border-color: unset;\n outline: 3px solid colours.$colour-utility-focus;\n }\n }\n\n &.disabled {\n color: colours.$colour-textinput-text-disabled;\n border-color: colours.$colour-textinput-border-disabled;\n background: colours.$colour-white;\n }\n }\n}\n","import { Component, Host, h, Prop, Event, EventEmitter, Watch } from '@stencil/core';\nimport { TextAreaChangeEventDetail } from './textarea.interface';\n\nlet textareaIds = 0;\n\n@Component({\n tag: 'admiralty-textarea',\n styleUrl: 'textarea.scss',\n scoped: true,\n})\nexport class TextareaComponent {\n private inputId = `admiralty-textarea-${textareaIds++}`;\n\n private nativeTextArea?: HTMLTextAreaElement;\n\n /**\n * The label which will be used as a placeholder in the unfilled state, and as a field label in the filled state.\n */\n @Prop() label: string = '';\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * The maximum width for the input field.\n */\n @Prop() width?: number;\n\n /**\n * The maximum string length for the input field.\n */\n @Prop() maxLength?: number;\n\n /**\n * This dictates whether the form field is disabled.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Whether to show the input in an invalid state\n */\n @Prop() invalid: boolean = false;\n\n /**\n * The message to show when the input is invalid\n */\n @Prop() invalidMessage: string;\n\n /**\n * Event is fired when the form control loses focus\n * @event textareaBlur\n */\n @Event({ eventName: 'textareaBlur' }) textareaBlur: EventEmitter<any>;\n\n /**\n * Event is fired when the form control changes\n * @event admiraltyChange\n */\n @Event() admiraltyInput: EventEmitter<TextAreaChangeEventDetail>;\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Update the native textarea element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeTextArea;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.admiraltyInput.emit({ value: this.value == null ? this.getValue() : this.value.toString() });\n }\n\n private onBlur = () => {\n this.textareaBlur.emit();\n };\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n };\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n render() {\n const value = this.getValue();\n return (\n <Host>\n <div class=\"text-area-container\">\n {this.label ? (\n <admiralty-label for={this.inputId} disabled={this.disabled}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? <admiralty-hint disabled={this.disabled}>{this.hint}</admiralty-hint> : null}\n <textarea\n ref={textArea => (this.nativeTextArea = textArea)}\n class={{ disabled: this.disabled, invalid: this.invalid }}\n style={this.width ? { maxWidth: `${this.width}px` } : {}}\n id={this.inputId}\n value={value}\n maxLength={this.maxLength}\n onInput={this.onInput}\n onBlur={this.onBlur}\n ></textarea>\n {this.invalid && this.invalidMessage ? <admiralty-input-error>{this.invalidMessage}</admiralty-input-error> : null}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAc,g+ICGpB,IAAIC,EAAc,E,MAOLC,EAAiB,M,mHACpBC,KAAAC,QAAU,sBAAsBH,MAqEhCE,KAAAE,OAAS,KACfF,KAAKG,aAAaC,MAAM,EAGlBJ,KAAAK,QAAWC,IACjB,MAAMC,EAAQD,EAAGE,OACjB,GAAID,EAAO,CACTP,KAAKS,MAAQF,EAAME,OAAS,E,cArER,G,gFAoBI,M,aAKD,M,yCAsB+B,E,CAMhDC,eACR,MAAMC,EAAcX,KAAKY,eACzB,MAAMH,EAAQT,KAAKa,WACnB,GAAIF,GAAeA,EAAYF,QAAUA,EAAO,CAC9CE,EAAYF,MAAQA,C,CAEtBT,KAAKc,eAAeV,KAAK,CAAEK,MAAOT,KAAKS,OAAS,KAAOT,KAAKa,WAAab,KAAKS,MAAMM,Y,CAc9EF,WACN,cAAcb,KAAKS,QAAU,SAAWT,KAAKS,MAAMM,YAAcf,KAAKS,OAAS,IAAIM,U,CAGrFC,SACE,MAAMP,EAAQT,KAAKa,WACnB,OACEI,EAACC,EAAI,KACHD,EAAA,OAAKE,MAAM,uBACRnB,KAAKoB,MACJH,EAAA,mBAAiBI,IAAKrB,KAAKC,QAASqB,SAAUtB,KAAKsB,UAChDtB,KAAKoB,OAEN,KACHpB,KAAKuB,KAAON,EAAA,kBAAgBK,SAAUtB,KAAKsB,UAAWtB,KAAKuB,MAAyB,KACrFN,EAAA,YACEO,IAAKC,GAAazB,KAAKY,eAAiBa,EACxCN,MAAO,CAAEG,SAAUtB,KAAKsB,SAAUI,QAAS1B,KAAK0B,SAChDC,MAAO3B,KAAK4B,MAAQ,CAAEC,SAAU,GAAG7B,KAAK4B,WAAc,GACtDE,GAAI9B,KAAKC,QACTQ,MAAOA,EACPsB,UAAW/B,KAAK+B,UAChB1B,QAASL,KAAKK,QACdH,OAAQF,KAAKE,SAEdF,KAAK0B,SAAW1B,KAAKgC,eAAiBf,EAAA,6BAAwBjB,KAAKgC,gBAA0C,M"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i,g as l}from"./p-a2b7bb90.js";const a='.disabled.sc-admiralty-select{color:#adadad}.select-wrapper.sc-admiralty-select{position:relative}admiralty-icon.sc-admiralty-select{font-size:24px;font-weight:normal;pointer-events:none;position:absolute;right:12px;top:12px}select.sc-admiralty-select{appearance:none;background-color:#ffffff;border:2px solid #333333;box-sizing:border-box;color:#333333;font-family:"JohnstonITC", Helvetica, sans-serif;font-size:18px;line-height:24px;margin-bottom:6px;position:relative;font-weight:300;padding:12px;width:100%}select.error.sc-admiralty-select{border-color:#e20d0d}select.sc-admiralty-select:focus-visible{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 2px #333333}select.disabled.sc-admiralty-select{border-color:#adadad}';const r=class{constructor(s){t(this,s);this.admiraltyChange=e(this,"admiraltyChange",7);this.admiraltyBlur=e(this,"admiraltyBlur",7);this.id=`admiralty-select-${++o}`;this.disabled=false;this.error=false;this.errorHint=null;this.hint=null;this.label="Choose a colour";this.width=undefined;this.value=""}valueChanged(){const t=this.nativeInput;const e=this.getValue();if(t&&t.value!==e){t.value=e}this.admiraltyChange.emit({value:this.value==null?this.getValue():this.value.toString()})}getValue(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()}handleSelect(t){const e=t.target;if(e){this.value=e.value||""}}handleBlur(t){this.admiraltyBlur.emit()}selectOption(){const t=this.el.querySelectorAll("option");t.forEach((t=>{t.selected=t.value===this.getValue()}))}componentWillRender(){this.selectOption()}render(){const{disabled:t,error:e,errorHint:l,hint:a,id:r,label:o}=this;const n=t?"disabled":"";return s(i,null,s("div",{class:`admiralty-select ${n}`},s("admiralty-label",{disabled:this.disabled,for:r},o),a?s("admiralty-hint",{disabled:this.disabled},a):null,s("div",{class:"select-wrapper",style:this.width?{maxWidth:`${this.width}px`}:{}},s("select",{ref:t=>this.nativeInput=t,id:r,class:{"admiralty-form-control":true,error:e,disabled:t},"aria-disabled":t?"true":"false","aria-label":o,onChange:t=>this.handleSelect(t),onBlur:t=>this.handleBlur(t),disabled:t},s("slot",null)),s("admiralty-icon",{class:`select-down-icon ${n}`,"icon-name":"angle-down"})),this.error?s("admiralty-input-error",null,l):""))}get el(){return l(this)}static get watchers(){return{value:["valueChanged"]}}};let o=0;r.style=a;export{r as admiralty_select};
|
|
2
|
-
//# sourceMappingURL=p-5d46659e.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["selectCss","SelectComponent","this","id","nextId","valueChanged","nativeSelect","nativeInput","value","getValue","admiraltyChange","emit","toString","handleSelect","event","select","target","handleBlur","_event","admiraltyBlur","selectOption","options","el","querySelectorAll","forEach","option","selected","componentWillRender","render","disabled","error","errorHint","hint","label","disabledClass","h","Host","class","for","style","width","maxWidth","ref","onChange","onBlur"],"sources":["./src/components/select/select.scss?tag=admiralty-select&encapsulation=scoped","./src/components/select/select.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\n@use \"../../scss/vars/typography\";\n\n.disabled {\n color: colours.$colour-textinput-text-disabled;\n}\n\n.select-wrapper {\n position: relative;\n}\n\nadmiralty-icon {\n font-size: 24px;\n font-weight: typography.$font-weight-medium;\n pointer-events: none;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n\n\nselect {\n appearance: none;\n background-color: colours.$colour-white;\n border: 2px solid colours.$colour-text;\n box-sizing: border-box;\n color: colours.$colour-text;\n font-family: typography.$font-family;\n font-size: typography.$font-size-normal;\n line-height: 24px;\n margin-bottom: 6px;\n position: relative;\n font-weight: typography.$font-weight-light;\n padding: 12px;\n width: 100%;\n\n &.error {\n border-color: colours.$colour-utility-error;\n }\n\n &:focus-visible {\n outline: 3px solid colours.$colour-utility-focus;\n box-shadow: inset 0 0 0 2px colours.$colour-text;\n }\n\n &.disabled {\n border-color: colours.$colour-textinput-text-disabled;\n }\n}\n\n\n","import { Component, Event, Prop, Element, EventEmitter, h, Host, Watch } from '@stencil/core';\nimport { SelectChangeEventDetail } from './select.interface';\n\n@Component({\n tag: 'admiralty-select',\n styleUrl: 'select.scss',\n scoped: true,\n})\nexport class SelectComponent {\n @Element() el?: HTMLElement;\n private nativeInput?: HTMLSelectElement;\n id: string = `admiralty-select-${++nextId}`;\n /**\n * If `true`, the user cannot interact with the select.\n */\n @Prop() disabled: boolean = false;\n /**\n * If 'true', the 'error' class is added to suggest an error\n */\n @Prop() error: boolean = false;\n /**\n * The hint that is used to inform the user of an error (displayed below the select box)\n */\n @Prop() errorHint: string = null;\n /**\n * The text that will be used as a field label.\n */\n @Prop() hint: string = null;\n /**\n * The text that will be used as a field label.\n */\n @Prop() label: string = 'Choose a colour';\n /**\n * The maximum width (px) for the input field.\n */\n @Prop() width?: number;\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyChange: EventEmitter<SelectChangeEventDetail>;\n /**\n * Emitted when the component loses focus.\n */\n @Event() admiraltyBlur: EventEmitter<void>;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n @Watch('value')\n protected valueChanged() {\n const nativeSelect = this.nativeInput;\n const value = this.getValue();\n if (nativeSelect && nativeSelect.value !== value) {\n nativeSelect.value = value;\n }\n this.admiraltyChange.emit({ value: this.value == null ? this.getValue() : this.value.toString() });\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n handleSelect(event: Event) {\n const select = event.target as HTMLSelectElement | null;\n if (select) {\n this.value = select.value || '';\n }\n }\n\n handleBlur(_event: FocusEvent): void {\n this.admiraltyBlur.emit();\n }\n\n selectOption() {\n const options = this.el.querySelectorAll('option');\n options.forEach(option => {\n option.selected = option.value === this.getValue();\n });\n }\n\n componentWillRender() {\n this.selectOption();\n }\n\n render() {\n const { disabled, error, errorHint, hint, id, label } = this;\n const disabledClass = disabled ? 'disabled' : '';\n return (\n <Host>\n <div class={`admiralty-select ${disabledClass}`}>\n <admiralty-label disabled={this.disabled} for={id}>\n {label}\n </admiralty-label>\n {hint ? <admiralty-hint disabled={this.disabled}>{hint}</admiralty-hint> : null}\n <div class=\"select-wrapper\" style={this.width ? { maxWidth: `${this.width}px` } : {}}>\n <select\n ref={select => (this.nativeInput = select)}\n id={id}\n class={{ 'admiralty-form-control': true, 'error': error, 'disabled': disabled }}\n aria-disabled={disabled ? 'true' : 'false'}\n aria-label={label}\n onChange={event => this.handleSelect(event)}\n onBlur={event => this.handleBlur(event)}\n disabled={disabled}\n >\n <slot></slot>\n </select>\n <admiralty-icon class={`select-down-icon ${disabledClass}`} icon-name=\"angle-down\"></admiralty-icon>\n </div>\n {this.error ? <admiralty-input-error>{errorHint}</admiralty-input-error> : ''}\n </div>\n </Host>\n );\n }\n}\n\nlet nextId = 0;\n"],"mappings":"gEAAA,MAAMA,EAAY,utB,MCQLC,EAAe,M,uHAG1BC,KAAAC,GAAa,sBAAsBC,I,cAIP,M,WAIH,M,eAIG,K,UAIL,K,WAIC,kB,gCAiBkC,E,CAGhDC,eACR,MAAMC,EAAeJ,KAAKK,YAC1B,MAAMC,EAAQN,KAAKO,WACnB,GAAIH,GAAgBA,EAAaE,QAAUA,EAAO,CAChDF,EAAaE,MAAQA,C,CAEvBN,KAAKQ,gBAAgBC,KAAK,CAAEH,MAAON,KAAKM,OAAS,KAAON,KAAKO,WAAaP,KAAKM,MAAMI,Y,CAG/EH,WACN,cAAcP,KAAKM,QAAU,SAAWN,KAAKM,MAAMI,YAAcV,KAAKM,OAAS,IAAII,U,CAGrFC,aAAaC,GACX,MAAMC,EAASD,EAAME,OACrB,GAAID,EAAQ,CACVb,KAAKM,MAAQO,EAAOP,OAAS,E,EAIjCS,WAAWC,GACThB,KAAKiB,cAAcR,M,CAGrBS,eACE,MAAMC,EAAUnB,KAAKoB,GAAGC,iBAAiB,UACzCF,EAAQG,SAAQC,IACdA,EAAOC,SAAWD,EAAOjB,QAAUN,KAAKO,UAAU,G,CAItDkB,sBACEzB,KAAKkB,c,CAGPQ,SACE,MAAMC,SAAEA,EAAQC,MAAEA,EAAKC,UAAEA,EAASC,KAAEA,EAAI7B,GAAEA,EAAE8B,MAAEA,GAAU/B,KACxD,MAAMgC,EAAgBL,EAAW,WAAa,GAC9C,OACEM,EAACC,EAAI,KACHD,EAAA,OAAKE,MAAO,oBAAoBH,KAC9BC,EAAA,mBAAiBN,SAAU3B,KAAK2B,SAAUS,IAAKnC,GAC5C8B,GAEFD,EAAOG,EAAA,kBAAgBN,SAAU3B,KAAK2B,UAAWG,GAAyB,KAC3EG,EAAA,OAAKE,MAAM,iBAAiBE,MAAOrC,KAAKsC,MAAQ,CAAEC,SAAU,GAAGvC,KAAKsC,WAAc,IAChFL,EAAA,UACEO,IAAK3B,GAAWb,KAAKK,YAAcQ,EACnCZ,GAAIA,EACJkC,MAAO,CAAE,yBAA0B,KAAMP,MAASA,EAAOD,SAAYA,GAAU,gBAChEA,EAAW,OAAS,QAAO,aAC9BI,EACZU,SAAU7B,GAASZ,KAAKW,aAAaC,GACrC8B,OAAQ9B,GAASZ,KAAKe,WAAWH,GACjCe,SAAUA,GAEVM,EAAA,cAEFA,EAAA,kBAAgBE,MAAO,oBAAoBH,IAAe,YAAY,gBAEvEhC,KAAK4B,MAAQK,EAAA,6BAAwBJ,GAAqC,I,gFAOrF,IAAI3B,EAAS,E"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-a2b7bb90.js";const n=".text-input-container.sc-admiralty-input{display:flex;flex-direction:column}.text-input-container.sc-admiralty-input input.sc-admiralty-input{background-color:#ffffff;border-color:#333333;border-width:2px;border-style:solid;color:#333333;font-size:18px;line-height:24px;font-weight:300;padding:12px}.text-input-container.sc-admiralty-input input.sc-admiralty-input:focus{outline-offset:unset;outline:3px solid #ffdd00;box-shadow:#333333 inset 0 0 0 2px}.text-input-container.sc-admiralty-input input.invalid.sc-admiralty-input{border-color:#e20d0d}.text-input-container.sc-admiralty-input input.invalid.sc-admiralty-input:focus-visible{border-color:unset;outline:3px solid #ffdd00}.text-input-container.sc-admiralty-input input.disabled.sc-admiralty-input{color:#adadad;border-color:#adadad;background:#ffffff}.text-input-container.sc-admiralty-input admiralty-input-error.sc-admiralty-input{margin-top:6px}";const e=class{constructor(s){t(this,s);this.admiraltyInput=i(this,"admiraltyInput",7);this.inputId=`admiralty-input-${++a}`;this.onInput=t=>{const i=t.target;if(i){this.value=i.value||""}};this.name=this.inputId;this.label=undefined;this.hint=undefined;this.disabled=false;this.type="text";this.placeholder=undefined;this.width=undefined;this.maxLength=undefined;this.required=false;this.invalid=false;this.invalidMessage=undefined;this.autocomplete="off";this.value=""}valueChanged(){const t=this.nativeInput;const i=this.getValue();if(t&&t.value!==i){t.value=i}this.admiraltyInput.emit({value:this.value==null?this.getValue():this.value.toString()})}getValue(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()}render(){const t=this.getValue();return s("div",{class:"text-input-container"},this.label?s("admiralty-label",{disabled:this.disabled,for:this.inputId},this.label):null,this.hint?s("admiralty-hint",{disabled:this.disabled},this.hint):null,s("input",{ref:t=>this.nativeInput=t,class:{disabled:this.disabled,invalid:this.invalid},disabled:this.disabled,id:this.inputId,name:this.name,type:this.type,value:t,maxLength:this.maxLength,onInput:this.onInput,placeholder:this.placeholder,autoComplete:this.autocomplete,required:this.required,style:{maxWidth:this.width?`${this.width}px`:null}}),s("admiralty-input-error",{style:{visibility:this.invalid&&this.invalidMessage?"visible":"hidden"}},this.invalidMessage))}static get watchers(){return{value:["valueChanged"]}}};let a=0;e.style=n;export{e as admiralty_input};
|
|
2
|
-
//# sourceMappingURL=p-869d7709.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["inputCss","InputComponent","this","inputId","nextId","onInput","ev","input","target","value","valueChanged","nativeInput","getValue","admiraltyInput","emit","toString","render","h","class","label","disabled","for","hint","ref","invalid","id","name","type","maxLength","placeholder","autoComplete","autocomplete","required","style","maxWidth","width","visibility","invalidMessage"],"sources":["./src/components/input/input.scss?tag=admiralty-input&encapsulation=scoped","./src/components/input/input.tsx"],"sourcesContent":["@use '../../scss/vars/colours';\n@use '../../scss/vars/typography';\n\n.text-input-container {\n display: flex;\n flex-direction: column;\n\n input {\n background-color: colours.$colour-white;\n border-color: colours.$colour-text;\n border-width: 2px;\n border-style: solid;\n color: colours.$colour-text;\n font-size: 18px;\n line-height: 24px;\n font-weight: typography.$font-weight-light;\n\n padding: 12px;\n\n &:focus {\n outline-offset: unset;\n outline: 3px solid colours.$colour-utility-focus;\n box-shadow: colours.$colour-text inset 0 0 0 2px;\n }\n\n &.invalid {\n border-color: colours.$colour-utility-error;\n\n &:focus-visible {\n border-color: unset;\n outline: 3px solid colours.$colour-utility-focus;\n }\n }\n\n &.disabled {\n color: colours.$colour-textinput-text-disabled;\n border-color: colours.$colour-textinput-border-disabled;\n background: colours.$colour-white;\n }\n }\n\n admiralty-input-error {\n margin-top: 6px;\n }\n}\n","import { Component, ComponentInterface, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\nimport { InputChangeEventDetail } from './input.interface';\n\n/**\n * Once this component works, review whether a form field component should be created so\n * that shared properties such as `label`, `hint`, `disabled` etc. can be defined once.\n * Examples of similar components that can extend that base component are area, select\n * and checkbox.\n */\n\n@Component({\n tag: 'admiralty-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class InputComponent implements ComponentInterface {\n inputId: string = `admiralty-input-${++nextId}`;\n\n private nativeInput?: HTMLInputElement;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * The label which will be used above the input to describe the input.\n */\n @Prop() label: string;\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * This dictates whether the form field is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The input type, options are: `text | date | time | email | password | tel | url`\n */\n @Prop() type: 'text' | 'date' | 'time' | 'email' | 'password' | 'tel' | 'url' = 'text';\n\n /**\n * The placeholder text to show in the input\n */\n @Prop() placeholder: string;\n\n /**\n * The maximum width for the input field.\n */\n @Prop() width: number;\n\n /**\n * The maximum string length for the input field.\n */\n @Prop() maxLength?: number;\n\n /**\n * This dictates whether the input is required or not\n */\n @Prop() required: boolean = false;\n\n /**\n * Whether to show the input in an invalid state\n */\n @Prop() invalid: boolean = false;\n\n /**\n * The message to show when the input is invalid\n */\n @Prop() invalidMessage: string;\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: string = 'off';\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyInput: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.admiraltyInput.emit({ value: this.value == null ? this.getValue() : this.value.toString() });\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n };\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n render() {\n const value = this.getValue();\n return (\n <div class=\"text-input-container\">\n {this.label ? (\n <admiralty-label disabled={this.disabled} for={this.inputId}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? <admiralty-hint disabled={this.disabled}>{this.hint}</admiralty-hint> : null}\n <input\n ref={input => (this.nativeInput = input)}\n class={{ disabled: this.disabled, invalid: this.invalid }}\n disabled={this.disabled}\n id={this.inputId}\n name={this.name}\n type={this.type}\n value={value}\n maxLength={this.maxLength}\n onInput={this.onInput}\n placeholder={this.placeholder}\n autoComplete={this.autocomplete}\n required={this.required}\n style={{\n maxWidth: this.width ? `${this.width}px` : null,\n }}\n />\n <admiralty-input-error style={{ visibility: this.invalid && this.invalidMessage ? 'visible' : 'hidden' }}>{this.invalidMessage}</admiralty-input-error>\n </div>\n );\n }\n}\nlet nextId = 0;\n"],"mappings":"kDAAA,MAAMA,EAAW,84B,MCeJC,EAAc,M,wEACzBC,KAAAC,QAAkB,qBAAqBC,IAuF/BF,KAAAG,QAAWC,IACjB,MAAMC,EAAQD,EAAGE,OACjB,GAAID,EAAO,CACTL,KAAKO,MAAQF,EAAME,OAAS,E,aAnFTP,KAAKC,Q,uDAeT,M,UAK6D,O,uFAoBpD,M,aAKD,M,gDAUI,M,WAK2B,E,CAWhDO,eACR,MAAMC,EAAcT,KAAKS,YACzB,MAAMF,EAAQP,KAAKU,WACnB,GAAID,GAAeA,EAAYF,QAAUA,EAAO,CAC9CE,EAAYF,MAAQA,C,CAEtBP,KAAKW,eAAeC,KAAK,CAAEL,MAAOP,KAAKO,OAAS,KAAOP,KAAKU,WAAaV,KAAKO,MAAMM,Y,CAU9EH,WACN,cAAcV,KAAKO,QAAU,SAAWP,KAAKO,MAAMM,YAAcb,KAAKO,OAAS,IAAIM,U,CAGrFC,SACE,MAAMP,EAAQP,KAAKU,WACnB,OACEK,EAAA,OAAKC,MAAM,wBACRhB,KAAKiB,MACJF,EAAA,mBAAiBG,SAAUlB,KAAKkB,SAAUC,IAAKnB,KAAKC,SACjDD,KAAKiB,OAEN,KACHjB,KAAKoB,KAAOL,EAAA,kBAAgBG,SAAUlB,KAAKkB,UAAWlB,KAAKoB,MAAyB,KACrFL,EAAA,SACEM,IAAKhB,GAAUL,KAAKS,YAAcJ,EAClCW,MAAO,CAAEE,SAAUlB,KAAKkB,SAAUI,QAAStB,KAAKsB,SAChDJ,SAAUlB,KAAKkB,SACfK,GAAIvB,KAAKC,QACTuB,KAAMxB,KAAKwB,KACXC,KAAMzB,KAAKyB,KACXlB,MAAOA,EACPmB,UAAW1B,KAAK0B,UAChBvB,QAASH,KAAKG,QACdwB,YAAa3B,KAAK2B,YAClBC,aAAc5B,KAAK6B,aACnBC,SAAU9B,KAAK8B,SACfC,MAAO,CACLC,SAAUhC,KAAKiC,MAAQ,GAAGjC,KAAKiC,UAAY,QAG/ClB,EAAA,yBAAuBgB,MAAO,CAAEG,WAAYlC,KAAKsB,SAAWtB,KAAKmC,eAAiB,UAAY,WAAanC,KAAKmC,gB,wDAKxH,IAAIjC,EAAS,E"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as a,h as r,H as l}from"./p-a2b7bb90.js";import{a as t}from"./p-7151aba4.js";const s="p.sc-admiralty-hint{margin-top:0;margin-bottom:6px;display:block;font-weight:300}p.disabled.sc-admiralty-hint{color:#adadad}";const i=class{constructor(r){a(this,r);this.disabled=undefined}render(){return r("p",{class:{disabled:this.disabled}},r("slot",null))}};i.style=s;const n=".sc-admiralty-input-error-h{display:flex;align-items:center}admiralty-icon.sc-admiralty-input-error{color:#e20d0d}p.sc-admiralty-input-error{margin:0;color:#e20d0d}";const o=class{constructor(r){a(this,r)}render(){return r(l,null,r("admiralty-icon",{"icon-name":t.iconName,class:"error-icon"}),r("p",null,r("slot",null)))}};o.style=n;const d="label.sc-admiralty-label{margin-bottom:6px;display:inline-block;font-weight:normal}label.disabled.sc-admiralty-label{color:#adadad}";const e=class{constructor(r){a(this,r);this.disabled=undefined;this.for=undefined}render(){return r("label",{htmlFor:this.for,class:{disabled:this.disabled}},r("slot",null))}};e.style=d;export{i as admiralty_hint,o as admiralty_input_error,e as admiralty_label};
|
|
2
|
-
//# sourceMappingURL=p-c027f79d.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["hintCss","HintComponent","render","h","class","disabled","this","inputErrorCss","InputError","Host","faExclamation","iconName","labelCss","LabelComponent","htmlFor","for"],"sources":["./src/components/hint/hint.scss?tag=admiralty-hint&encapsulation=scoped","./src/components/hint/hint.tsx","./src/components/input-error/input-error.scss?tag=admiralty-input-error&encapsulation=scoped","./src/components/input-error/input-error.tsx","./src/components/label/label.scss?tag=admiralty-label&encapsulation=scoped","./src/components/label/label.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\n@use \"../../scss/vars/typography\";\n\np {\n margin-top: 0;\n margin-bottom: 6px;\n display: block;\n font-weight: typography.$font-weight-light;\n\n &.disabled {\n color: colours.$colour-textinput-text-disabled;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * @slot - The hint content should be placed in the slot e.g.\n * `<admiralty-hint>Enter your full name</admiralty-hint>`\n */\n@Component({\n tag: 'admiralty-hint',\n styleUrl: 'hint.scss',\n scoped: true,\n})\nexport class HintComponent {\n /**\n * The disabled option can be used to disable the component.\n */\n @Prop() disabled: boolean;\n\n render() {\n return (\n <p class={{ disabled: this.disabled }}>\n <slot></slot>\n </p>\n );\n }\n}\n","@use '../../scss/vars/colours';\n\n:host {\n display: flex;\n align-items: center;\n}\n\nadmiralty-icon {\n color: colours.$colour-utility-error;\n}\n\np {\n margin: 0;\n color: colours.$colour-utility-error;\n}\n\n","import { Component, h, Host } from '@stencil/core';\nimport { faExclamation } from '@fortawesome/free-solid-svg-icons';\n\n/**\n * @slot - The error content should be placed in the slot e.g.\n * `<admiralty-input-error>This field is required</admiralty-input-error>`\n */\n@Component({\n tag: 'admiralty-input-error',\n styleUrl: 'input-error.scss',\n scoped: true,\n})\nexport class InputError {\n render() {\n return (\n <Host>\n <admiralty-icon icon-name={faExclamation.iconName} class=\"error-icon\"></admiralty-icon>\n <p>\n <slot></slot>\n </p>\n </Host>\n );\n }\n}\n","@use \"../../scss/vars/colours\";\n@use \"../../scss/vars/typography\";\n\nlabel {\n margin-bottom: 6px;\n display: inline-block;\n font-weight: typography.$font-weight-medium;\n\n &.disabled {\n color: colours.$colour-textinput-text-disabled;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * @slot - The label content should be placed in the slot e.g.\n * `<admiralty-label>First Name</admiralty-label>`\n */\n@Component({\n tag: 'admiralty-label',\n styleUrl: 'label.scss',\n scoped: true,\n})\nexport class LabelComponent {\n /**\n * The disabled option can be used to disable the component.\n */\n @Prop() disabled: boolean;\n\n /**\n * The id of the input the label is attached to\n */\n @Prop() for: string;\n\n render() {\n return (\n <label htmlFor={this.for} class={{ disabled: this.disabled }}>\n <slot></slot>\n </label>\n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAU,+H,MCWHC,EAAa,M,iDAMxBC,SACE,OACEC,EAAA,KAAGC,MAAO,CAAEC,SAAUC,KAAKD,WACzBF,EAAA,a,aCpBR,MAAMI,EAAgB,uK,MCYTC,EAAU,M,yBACrBN,SACE,OACEC,EAACM,EAAI,KACHN,EAAA,8BAA2BO,EAAcC,SAAUP,MAAM,eACzDD,EAAA,SACEA,EAAA,c,aClBV,MAAMS,EAAW,sI,MCWJC,EAAc,M,oEAWzBX,SACE,OACEC,EAAA,SAAOW,QAASR,KAAKS,IAAKX,MAAO,CAAEC,SAAUC,KAAKD,WAChDF,EAAA,a"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
-
describe('admiralty-input-error', () => {
|
|
3
|
-
it('renders', async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent('<admiralty-input-error></admiralty-input-error>');
|
|
6
|
-
const element = await page.find('admiralty-input-error');
|
|
7
|
-
expect(element).toHaveClass('hydrated');
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=input-error.e2e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-error.e2e.js","sourceRoot":"","sources":["../../../src/components/input-error/input-error.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;EACrC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,iDAAiD,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACzD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('admiralty-input-error', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<admiralty-input-error></admiralty-input-error>');\n\n const element = await page.find('admiralty-input-error');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-error.js","sourceRoot":"","sources":["../../../src/components/input-error/input-error.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE;;;GAGG;AAMH,MAAM,OAAO,UAAU;EACrB,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,mCAA2B,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAC,YAAY,GAAkB;MACvF;QACE,eAAa,CACX,CACC,CACR,CAAC;EACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host } from '@stencil/core';\nimport { faExclamation } from '@fortawesome/free-solid-svg-icons';\n\n/**\n * @slot - The error content should be placed in the slot e.g.\n * `<admiralty-input-error>This field is required</admiralty-input-error>`\n */\n@Component({\n tag: 'admiralty-input-error',\n styleUrl: 'input-error.scss',\n scoped: true,\n})\nexport class InputError {\n render() {\n return (\n <Host>\n <admiralty-icon icon-name={faExclamation.iconName} class=\"error-icon\"></admiralty-icon>\n <p>\n <slot></slot>\n </p>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
-
import { InputError } from './input-error';
|
|
3
|
-
describe('input-error', () => {
|
|
4
|
-
it('renders', async () => {
|
|
5
|
-
const page = await newSpecPage({
|
|
6
|
-
components: [InputError],
|
|
7
|
-
html: `<admiralty-input-error>Test</admiralty-input-error>`,
|
|
8
|
-
});
|
|
9
|
-
expect(page.root).toEqualHtml(`
|
|
10
|
-
<admiralty-input-error>
|
|
11
|
-
<admiralty-icon class="error-icon" icon-name="exclamation"></admiralty-icon>
|
|
12
|
-
<p>
|
|
13
|
-
Test
|
|
14
|
-
</p>
|
|
15
|
-
</admiralty-input-error>
|
|
16
|
-
`);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=input-error.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-error.spec.js","sourceRoot":"","sources":["../../../src/components/input-error/input-error.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;EAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,UAAU,CAAC;MACxB,IAAI,EAAE,qDAAqD;KAC5D,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;KAO7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { InputError } from './input-error';\n\ndescribe('input-error', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [InputError],\n html: `<admiralty-input-error>Test</admiralty-input-error>`,\n });\n expect(page.root).toEqualHtml(`\n <admiralty-input-error>\n <admiralty-icon class=\"error-icon\" icon-name=\"exclamation\"></admiralty-icon>\n <p>\n Test\n </p>\n</admiralty-input-error>\n `);\n });\n});\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface AdmiraltyInputError extends Components.AdmiraltyInputError, HTMLElement {}
|
|
4
|
-
export const AdmiraltyInputError: {
|
|
5
|
-
prototype: AdmiraltyInputError;
|
|
6
|
-
new (): AdmiraltyInputError;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as InputError, d as defineCustomElement$1 } from './input-error.js';
|
|
2
|
-
|
|
3
|
-
const AdmiraltyInputError = InputError;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { AdmiraltyInputError, defineCustomElement };
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=admiralty-input-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"admiralty-input-error.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"input-error.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,sKAAsK;;MCY/K,UAAU;;;;;EACrB,MAAM;IACJ,QACE,EAAC,IAAI,QACH,mCAA2B,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAC,YAAY,GAAkB,EACvF,aACE,eAAa,CACX,CACC,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/input-error/input-error.scss?tag=admiralty-input-error&encapsulation=scoped","./src/components/input-error/input-error.tsx"],"sourcesContent":["@use '../../scss/vars/colours';\n\n:host {\n display: flex;\n align-items: center;\n}\n\nadmiralty-icon {\n color: colours.$colour-utility-error;\n}\n\np {\n margin: 0;\n color: colours.$colour-utility-error;\n}\n\n","import { Component, h, Host } from '@stencil/core';\nimport { faExclamation } from '@fortawesome/free-solid-svg-icons';\n\n/**\n * @slot - The error content should be placed in the slot e.g.\n * `<admiralty-input-error>This field is required</admiralty-input-error>`\n */\n@Component({\n tag: 'admiralty-input-error',\n styleUrl: 'input-error.scss',\n scoped: true,\n})\nexport class InputError {\n render() {\n return (\n <Host>\n <admiralty-icon icon-name={faExclamation.iconName} class=\"error-icon\"></admiralty-icon>\n <p>\n <slot></slot>\n </p>\n </Host>\n );\n }\n}\n"],"version":3}
|
/package/dist/collection/components/{input-error/input-error.css → input-invalid/input-invalid.css}
RENAMED
|
File without changes
|