@folkehelseinstituttet/designsystem 0.34.0 → 0.36.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/ai-tooling/SKILL.md +34 -0
- package/custom-elements.json +1 -13604
- package/fhi-body.manifest.json +1 -0
- package/fhi-button.manifest.json +1 -0
- package/fhi-checkbox.manifest.json +1 -0
- package/fhi-date-input.js.map +1 -1
- package/fhi-date-input.manifest.json +1 -0
- package/fhi-display.js.map +1 -1
- package/fhi-display.manifest.json +1 -0
- package/fhi-flex.manifest.json +1 -0
- package/fhi-grid.manifest.json +1 -0
- package/fhi-headline.js.map +1 -1
- package/fhi-headline.manifest.json +1 -0
- package/fhi-icon-arrow-down-left.manifest.json +1 -0
- package/fhi-icon-arrow-down-right.manifest.json +1 -0
- package/fhi-icon-arrow-down.manifest.json +1 -0
- package/fhi-icon-arrow-left.manifest.json +1 -0
- package/fhi-icon-arrow-right-left.manifest.json +1 -0
- package/fhi-icon-arrow-right.manifest.json +1 -0
- package/fhi-icon-arrow-up-down.manifest.json +1 -0
- package/fhi-icon-arrow-up-left.manifest.json +1 -0
- package/fhi-icon-arrow-up-right.manifest.json +1 -0
- package/fhi-icon-arrow-up.manifest.json +1 -0
- package/fhi-icon-bell.manifest.json +1 -0
- package/fhi-icon-calendar-clock.manifest.json +1 -0
- package/fhi-icon-calendar.manifest.json +1 -0
- package/fhi-icon-chart-bar-stacked.manifest.json +1 -0
- package/fhi-icon-chart-bar.manifest.json +1 -0
- package/fhi-icon-chart-column-stacked.manifest.json +1 -0
- package/fhi-icon-chart-column.manifest.json +1 -0
- package/fhi-icon-chart-line.manifest.json +1 -0
- package/fhi-icon-chart-no-axes-combined.manifest.json +1 -0
- package/fhi-icon-chart-pie.manifest.json +1 -0
- package/fhi-icon-check.manifest.json +1 -0
- package/fhi-icon-chevron-down.manifest.json +1 -0
- package/fhi-icon-chevron-left.manifest.json +1 -0
- package/fhi-icon-chevron-right.manifest.json +1 -0
- package/fhi-icon-chevron-up.manifest.json +1 -0
- package/fhi-icon-chevrons-down.manifest.json +1 -0
- package/fhi-icon-chevrons-left.manifest.json +1 -0
- package/fhi-icon-chevrons-right.manifest.json +1 -0
- package/fhi-icon-chevrons-up.manifest.json +1 -0
- package/fhi-icon-circle-arrow-down.manifest.json +1 -0
- package/fhi-icon-circle-arrow-left.manifest.json +1 -0
- package/fhi-icon-circle-arrow-right.manifest.json +1 -0
- package/fhi-icon-circle-arrow-up.manifest.json +1 -0
- package/fhi-icon-circle-check-big.manifest.json +1 -0
- package/fhi-icon-circle-check.manifest.json +1 -0
- package/fhi-icon-circle-chevron-down.manifest.json +1 -0
- package/fhi-icon-circle-chevron-left.manifest.json +1 -0
- package/fhi-icon-circle-chevron-right.manifest.json +1 -0
- package/fhi-icon-circle-chevron-up.manifest.json +1 -0
- package/fhi-icon-circle-exclamation.manifest.json +1 -0
- package/fhi-icon-circle-info.manifest.json +1 -0
- package/fhi-icon-circle-minus.manifest.json +1 -0
- package/fhi-icon-circle-plus.manifest.json +1 -0
- package/fhi-icon-circle-question.manifest.json +1 -0
- package/fhi-icon-circle-x.manifest.json +1 -0
- package/fhi-icon-circle.manifest.json +1 -0
- package/fhi-icon-clock.manifest.json +1 -0
- package/fhi-icon-copy.manifest.json +1 -0
- package/fhi-icon-download.manifest.json +1 -0
- package/fhi-icon-ellipsis-vertical.manifest.json +1 -0
- package/fhi-icon-ellipsis.manifest.json +1 -0
- package/fhi-icon-exclamation.manifest.json +1 -0
- package/fhi-icon-expand.manifest.json +1 -0
- package/fhi-icon-external-link.manifest.json +1 -0
- package/fhi-icon-eye-off.manifest.json +1 -0
- package/fhi-icon-eye.manifest.json +1 -0
- package/fhi-icon-file.manifest.json +1 -0
- package/fhi-icon-filter.manifest.json +1 -0
- package/fhi-icon-folder.manifest.json +1 -0
- package/fhi-icon-gear.manifest.json +1 -0
- package/fhi-icon-grid-9-dots.manifest.json +1 -0
- package/fhi-icon-grip-horizontal.manifest.json +1 -0
- package/fhi-icon-grip-vertical.manifest.json +1 -0
- package/fhi-icon-history.manifest.json +1 -0
- package/fhi-icon-info.manifest.json +1 -0
- package/fhi-icon-link-2-off.manifest.json +1 -0
- package/fhi-icon-link-2.manifest.json +1 -0
- package/fhi-icon-link.manifest.json +1 -0
- package/fhi-icon-lock-open.manifest.json +1 -0
- package/fhi-icon-lock.manifest.json +1 -0
- package/fhi-icon-log-in.manifest.json +1 -0
- package/fhi-icon-log-out.manifest.json +1 -0
- package/fhi-icon-mail.manifest.json +1 -0
- package/fhi-icon-map-pin.manifest.json +1 -0
- package/fhi-icon-menu.manifest.json +1 -0
- package/fhi-icon-message.manifest.json +1 -0
- package/fhi-icon-minus.manifest.json +1 -0
- package/fhi-icon-octagon-alert.manifest.json +1 -0
- package/fhi-icon-paperclip.manifest.json +1 -0
- package/fhi-icon-pencil.manifest.json +1 -0
- package/fhi-icon-phone.manifest.json +1 -0
- package/fhi-icon-pin-off.manifest.json +1 -0
- package/fhi-icon-pin.manifest.json +1 -0
- package/fhi-icon-plus.manifest.json +1 -0
- package/fhi-icon-printer.manifest.json +1 -0
- package/fhi-icon-question.manifest.json +1 -0
- package/fhi-icon-refresh.manifest.json +1 -0
- package/fhi-icon-rotate-left.manifest.json +1 -0
- package/fhi-icon-rotate-right.manifest.json +1 -0
- package/fhi-icon-search.manifest.json +1 -0
- package/fhi-icon-send.manifest.json +1 -0
- package/fhi-icon-share.manifest.json +1 -0
- package/fhi-icon-sheet.manifest.json +1 -0
- package/fhi-icon-square-check-big.manifest.json +1 -0
- package/fhi-icon-square-check.manifest.json +1 -0
- package/fhi-icon-square-pen.manifest.json +1 -0
- package/fhi-icon-square-x.manifest.json +1 -0
- package/fhi-icon-square.manifest.json +1 -0
- package/fhi-icon-trash.manifest.json +1 -0
- package/fhi-icon-triangle-alert.manifest.json +1 -0
- package/fhi-icon-upload.manifest.json +1 -0
- package/fhi-icon-user.manifest.json +1 -0
- package/fhi-icon-x.manifest.json +1 -0
- package/fhi-label.manifest.json +1 -0
- package/fhi-modal-dialog.manifest.json +1 -0
- package/fhi-radio.manifest.json +1 -0
- package/fhi-tag.manifest.json +1 -0
- package/fhi-text-input.js +133 -58
- package/fhi-text-input.js.map +1 -1
- package/fhi-text-input.manifest.json +1 -0
- package/fhi-title.js.map +1 -1
- package/fhi-title.manifest.json +1 -0
- package/fhi-tooltip.manifest.json +1 -0
- package/package.json +1 -1
- package/web-types.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-rotate-right.component.ts","declarations":[{"kind":"class","description":"## FhiIconRotateRight\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconRotateRight","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-rotate-right","customElement":true},{"kind":"variable","name":"FhiIconRotateRightSelector","type":{"text":"string"},"default":"\"fhi-icon-rotate-right\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-search.component.ts","declarations":[{"kind":"class","description":"## FhiIconSearch\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSearch","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-search","customElement":true},{"kind":"variable","name":"FhiIconSearchSelector","type":{"text":"string"},"default":"\"fhi-icon-search\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-send.component.ts","declarations":[{"kind":"class","description":"## FhiIconSend\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSend","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-send","customElement":true},{"kind":"variable","name":"FhiIconSendSelector","type":{"text":"string"},"default":"\"fhi-icon-send\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-share.component.ts","declarations":[{"kind":"class","description":"## FhiIconShare\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconShare","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-share","customElement":true},{"kind":"variable","name":"FhiIconShareSelector","type":{"text":"string"},"default":"\"fhi-icon-share\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-sheet.component.ts","declarations":[{"kind":"class","description":"## FhiIconSheet\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSheet","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-sheet","customElement":true},{"kind":"variable","name":"FhiIconSheetSelector","type":{"text":"string"},"default":"\"fhi-icon-sheet\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-square-check-big.component.ts","declarations":[{"kind":"class","description":"## FhiIconSquareCheckBig\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSquareCheckBig","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-square-check-big","customElement":true},{"kind":"variable","name":"FhiIconSquareCheckBigSelector","type":{"text":"string"},"default":"\"fhi-icon-square-check-big\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-square-check.component.ts","declarations":[{"kind":"class","description":"## FhiIconSquareCheck\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSquareCheck","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-square-check","customElement":true},{"kind":"variable","name":"FhiIconSquareCheckSelector","type":{"text":"string"},"default":"\"fhi-icon-square-check\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-square-pen.component.ts","declarations":[{"kind":"class","description":"## FhiIconSquarePen\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSquarePen","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-square-pen","customElement":true},{"kind":"variable","name":"FhiIconSquarePenSelector","type":{"text":"string"},"default":"\"fhi-icon-square-pen\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-square-x.component.ts","declarations":[{"kind":"class","description":"## FhiIconSquareX\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSquareX","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-square-x","customElement":true},{"kind":"variable","name":"FhiIconSquareXSelector","type":{"text":"string"},"default":"\"fhi-icon-square-x\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-square.component.ts","declarations":[{"kind":"class","description":"## FhiIconSquare\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconSquare","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-square","customElement":true},{"kind":"variable","name":"FhiIconSquareSelector","type":{"text":"string"},"default":"\"fhi-icon-square\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-trash.component.ts","declarations":[{"kind":"class","description":"## FhiIconTrash\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconTrash","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-trash","customElement":true},{"kind":"variable","name":"FhiIconTrashSelector","type":{"text":"string"},"default":"\"fhi-icon-trash\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-triangle-alert.component.ts","declarations":[{"kind":"class","description":"## FhiIconTriangleAlert\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconTriangleAlert","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-triangle-alert","customElement":true},{"kind":"variable","name":"FhiIconTriangleAlertSelector","type":{"text":"string"},"default":"\"fhi-icon-triangle-alert\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-upload.component.ts","declarations":[{"kind":"class","description":"## FhiIconUpload\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconUpload","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-upload","customElement":true},{"kind":"variable","name":"FhiIconUploadSelector","type":{"text":"string"},"default":"\"fhi-icon-upload\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-user.component.ts","declarations":[{"kind":"class","description":"## FhiIconUser\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconUser","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-user","customElement":true},{"kind":"variable","name":"FhiIconUserSelector","type":{"text":"string"},"default":"\"fhi-icon-user\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/icons/fhi-icon-x.component.ts","declarations":[{"kind":"class","description":"## FhiIconX\n\nhttps://designsystem.fhi.no/?path=/docs/ikoner--docs","name":"FhiIconX","members":[{"kind":"field","name":"_size","type":{"text":"string"},"privacy":"private","readonly":true},{"kind":"field","name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"default":"\"currentcolor\"","description":"Sets the color for the icon.\nShould preferably be a color token. See [Color Tokens](https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs)","fieldName":"color"},{"name":"size","type":{"text":"'xsmall' | 'small' | 'medium' | 'large' | number | string"},"default":"'medium'","description":"Sets the size of the icon. Can be one of the predefined sizes, a number value, rem or px.\nNumber values are treated as px.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-icon-x","customElement":true},{"kind":"variable","name":"FhiIconXSelector","type":{"text":"string"},"default":"\"fhi-icon-x\""}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/typography/fhi-label/fhi-label.component.ts","declarations":[{"kind":"class","description":"## FHI Label\n\nhttps://designsystem.fhi.no/?path=/story/komponenter-typography-label--preview\n\nThe `<fhi-label>` component is used to display label text in accordance with the FHI Design System guidelines.\nUse this component instead of the standard HTML `<label>` element to ensure consistent styling across your application.","name":"FhiLabel","slots":[{"description":"The content of the fhi-label component. This should be pure text.","name":""}],"members":[{"kind":"field","name":"color","type":{"text":"string"},"description":"Sets color of the given text. It supports any valid CSS color value (e.g. hex, rgb, rgba, hsl, hsla, color names).\n\nIt is recommended to use Design Tokens for colors defined in the FHI Design System.\nSee: https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs\n\nExample:\n```html\n <fhi-label color=\"var(--fhi-color-primary-text-default)\">\n This text will be in the primary text color.\n </fhi-label>\n```","attribute":"color"},{"kind":"field","name":"size","type":{"text":"'large' | 'medium' | 'small'"},"default":"'medium'","description":"Sets the font size of the given text.","reflects":true,"attribute":"size"}],"attributes":[{"name":"color","type":{"text":"string"},"description":"Sets color of the given text. It supports any valid CSS color value (e.g. hex, rgb, rgba, hsl, hsla, color names).\n\nIt is recommended to use Design Tokens for colors defined in the FHI Design System.\nSee: https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs\n\nExample:\n```html\n <fhi-label color=\"var(--fhi-color-primary-text-default)\">\n This text will be in the primary text color.\n </fhi-label>\n```","fieldName":"color"},{"name":"size","type":{"text":"'large' | 'medium' | 'small'"},"default":"'medium'","description":"Sets the font size of the given text.","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-label","customElement":true},{"kind":"variable","name":"FhiLabelSelector","type":{"text":"string"},"default":"'fhi-label'"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/fhi-modal-dialog/fhi-modal-dialog.component.ts","declarations":[{"kind":"class","description":"## FHI Modal Dialog\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-modal-dialog--docs\n\nThe `fhi-modal-dialog` component is used to display important information or prompt the user for input in a modal window.\nIt overlays the main content and usually requires user interaction before returning to the underlying page.","name":"FhiModalDialog","slots":[{"description":"The main content of the dialog. Typically contains text or form elements.","name":"body"},{"description":"The footer content of the dialog, typically containing action buttons.","name":"footer"}],"members":[{"kind":"field","name":"_bodyOverflowStyle","type":{"text":"string"},"privacy":"private","default":"''"},{"kind":"field","name":"_dialog","type":{"text":"HTMLDialogElement"},"privacy":"private"},{"kind":"method","name":"_dispatchCloseEvent","privacy":"private"},{"kind":"method","name":"_dispatchToggleEvent","privacy":"private"},{"kind":"method","name":"_focusDialog","privacy":"private"},{"kind":"field","name":"_footer","type":{"text":"HTMLElement"},"privacy":"private"},{"kind":"field","name":"_footerSlot","type":{"text":"HTMLSlotElement"},"privacy":"private"},{"kind":"method","name":"_handleCloseButtonClick","privacy":"private"},{"kind":"method","name":"_handleDialogContentMouseDown","privacy":"private"},{"kind":"method","name":"_handleDialogMouseUp","privacy":"private","parameters":[{"name":"event","type":{"text":"MouseEvent"}}]},{"kind":"method","name":"_handleFooterSlotChange","privacy":"private"},{"kind":"field","name":"_mouseDownInsideDialog","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"method","name":"_toggleFooter","privacy":"private"},{"kind":"field","name":"_triggerElement","type":{"text":"HTMLElement | null"},"privacy":"private","default":"null"},{"kind":"method","name":"close","privacy":"public","description":"Programmatically closes the dialog.\nYou can also close the dialog by instead setting the `open` property to `false`."},{"kind":"field","name":"closeButtonLabel","type":{"text":"string"},"default":"''","description":"Label for the close button.","attribute":"close-button-label"},{"kind":"method","name":"handleKeyPress","privacy":"private","parameters":[{"name":"event","type":{"text":"KeyboardEvent"}}]},{"kind":"field","name":"heading","type":{"text":"string"},"default":"''","description":"The heading text of the dialog. This is displayed at the top of the dialog.","attribute":"heading"},{"kind":"field","name":"open","type":{"text":"boolean"},"default":"false","description":"Decides whether the dialog is open or closed.\nBy setting this property to true, the dialog will be shown. Setting it to false will close the dialog.\n\nThis property is reflected as an attribute and will therefor also change if the user toggles the dialog or\nif you use the `show()` and `close()` methods.","reflects":true,"attribute":"open"},{"kind":"method","name":"show","privacy":"public","description":"Programmatically opens the dialog.\nYou can also open the dialog by instead setting the `open` property to `true`."},{"kind":"field","name":"size","type":{"text":"'small' | 'medium'"},"default":"'medium'","description":"`}","attribute":"size","reflects":true}],"events":[{"name":"close","type":{"text":"Event"},"description":"Standard DOM event with the type `close`\nThis event is fired whenever the dialog is closed."},{"name":"toggle","type":{"text":"Event"},"description":"Standard DOM event with the type `toggle`\nThis event is fired whenever the dialog is opened or closed."}],"attributes":[{"name":"close-button-label","type":{"text":"string"},"default":"''","description":"Label for the close button.","fieldName":"closeButtonLabel"},{"name":"heading","type":{"text":"string"},"default":"''","description":"The heading text of the dialog. This is displayed at the top of the dialog.","fieldName":"heading"},{"name":"open","type":{"text":"boolean"},"default":"false","description":"Decides whether the dialog is open or closed.\nBy setting this property to true, the dialog will be shown. Setting it to false will close the dialog.\n\nThis property is reflected as an attribute and will therefor also change if the user toggles the dialog or\nif you use the `show()` and `close()` methods.","fieldName":"open"},{"name":"size","type":{"text":"'small' | 'medium'"},"default":"'medium'","description":"`}","fieldName":"size"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-modal-dialog","customElement":true},{"kind":"variable","name":"FhiModalDialogSelector","type":{"text":"string"},"default":"'fhi-modal-dialog'"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/fhi-radio/fhi-radio.component.ts","declarations":[{"kind":"class","description":"## FHI Radio\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-radio--docs\n\nThe `<fhi-radio>` component represents a single radio button.\nIt should be used within a group of options, allowing users to select one option from a set.","name":"FhiRadio","members":[{"kind":"method","name":"_dispatchChangeEvent","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"method","name":"_dispatchInputEvent","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"method","name":"_getRadioGroup","privacy":"private"},{"kind":"field","name":"_groupRoot","type":{"text":"Document | HTMLFormElement"},"privacy":"private","default":"document"},{"kind":"method","name":"_handleChange","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"_handleInput","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"_handleKeyDown","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"KeyboardEvent"}}]},{"kind":"field","name":"_input","type":{"text":"HTMLInputElement"},"privacy":"private"},{"kind":"field","name":"_internals","type":{"text":"ElementInternals"},"privacy":"private"},{"kind":"method","name":"_setFocusOnInput","privacy":"private"},{"kind":"method","name":"_SetTabbableRadios","privacy":"private"},{"kind":"method","name":"_updateFormValue","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"field","name":"checked","type":{"text":"boolean"},"default":"false","description":"Whether the radio button is checked or not.","attribute":"checked"},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the radio. This changes its appearance and makes it non-interactive.","reflects":true,"attribute":"disabled"},{"kind":"field","name":"formAssociated","type":{"text":"boolean"},"static":true,"readonly":true,"default":"true"},{"kind":"method","name":"formResetCallback","privacy":"public","return":{"type":{"text":"void"}}},{"kind":"field","name":"label","type":{"text":"string"},"default":"undefined","description":"The text label assigned to and displayed next to the radio.\nYou should always provide a label.","attribute":"label"},{"kind":"field","name":"name","type":{"text":"string"},"default":"undefined","description":"The name of the radio. This is submitted with the form data as a `key` when the checkbox is checked.\nAll `<fhi-radio>` components with the same name belong to the same group.","reflects":true,"attribute":"name"},{"kind":"field","name":"status","type":{"text":"'error' | undefined"},"default":"undefined","description":"Sets the visual status of the radio. There is currently only one status available: `error`.\nThe `error` status is used to indicate that there is an issue with the radio, such as a required radio not being checked.","reflects":true,"attribute":"status"},{"kind":"method","name":"uncheckGroupMembers","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"field","name":"value","type":{"text":"string"},"default":"'on'","description":"The value of the radio. This is submitted with the form data as a `value` when the radio is checked.","attribute":"value"}],"events":[{"name":"change","type":{"text":"Event"},"description":"Standard DOM event with the type `change`.\nThis event is dispatched when the radio is checked or unchecked."},{"name":"input","type":{"text":"Event"},"description":"Standard DOM event with the type `input`.\nThis event is dispatched when the radio is checked or unchecked."}],"attributes":[{"name":"checked","type":{"text":"boolean"},"default":"false","description":"Whether the radio button is checked or not.","fieldName":"checked"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the radio. This changes its appearance and makes it non-interactive.","fieldName":"disabled"},{"name":"label","type":{"text":"string"},"default":"undefined","description":"The text label assigned to and displayed next to the radio.\nYou should always provide a label.","fieldName":"label"},{"name":"name","type":{"text":"string"},"default":"undefined","description":"The name of the radio. This is submitted with the form data as a `key` when the checkbox is checked.\nAll `<fhi-radio>` components with the same name belong to the same group.","fieldName":"name"},{"name":"status","type":{"text":"'error' | undefined"},"default":"undefined","description":"Sets the visual status of the radio. There is currently only one status available: `error`.\nThe `error` status is used to indicate that there is an issue with the radio, such as a required radio not being checked.","fieldName":"status"},{"name":"value","type":{"text":"string"},"default":"'on'","description":"The value of the radio. This is submitted with the form data as a `value` when the radio is checked.","fieldName":"value"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-radio","customElement":true},{"kind":"variable","name":"FhiRadioSelector","type":{"text":"string"},"default":"'fhi-radio'"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/fhi-tag/fhi-tag.component.ts","declarations":[{"kind":"class","description":"## FHI Tag\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-tag--docs\n\nThe `<fhi-tag>` component is used to create non-interactive tags in accordance with the FHI Design System guidelines.","name":"FhiTag","slots":[{"description":"The content of the tag. This should be pure text with, or without, an icon.","name":""}],"members":[{"kind":"method","name":"_handleSlotChange","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"field","name":"color","type":{"text":"'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info'"},"default":"'neutral'","description":"Sets the color of the tag.","reflects":true,"attribute":"color"}],"attributes":[{"name":"color","type":{"text":"'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info'"},"default":"'neutral'","description":"Sets the color of the tag.","fieldName":"color"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-tag","customElement":true},{"kind":"variable","name":"FhiTagSelector","type":{"text":"string"},"default":"'fhi-tag'"}]}
|
package/fhi-text-input.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as c, n as a, a as g, b as s, t as u } from "./property-DGdAXcEz.js";
|
|
2
2
|
import { e as y } from "./query-NJDNu0-P.js";
|
|
3
3
|
import { o as d } from "./if-defined-BW6N1yuF.js";
|
|
4
|
-
var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, r = (
|
|
5
|
-
for (var
|
|
6
|
-
(
|
|
7
|
-
return l &&
|
|
4
|
+
var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, r = (t, e, i, l) => {
|
|
5
|
+
for (var n = l > 1 ? void 0 : l ? f(e, i) : e, p = t.length - 1, h; p >= 0; p--)
|
|
6
|
+
(h = t[p]) && (n = (l ? h(e, i, n) : h(n)) || n);
|
|
7
|
+
return l && n && v(e, i, n), n;
|
|
8
8
|
};
|
|
9
9
|
const b = "fhi-text-input";
|
|
10
|
-
let
|
|
10
|
+
let o = class extends g {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(), this.label = void 0, this.message = void 0, this.helpText = void 0, this.placeholder = void 0, this.status = void 0, this.readonly = !1, this.disabled = !1, this._name = void 0, this._value = "", this._internals = this.attachInternals();
|
|
13
13
|
}
|
|
14
14
|
get name() {
|
|
15
15
|
return this._name;
|
|
16
16
|
}
|
|
17
|
-
set name(
|
|
18
|
-
const
|
|
19
|
-
this._name =
|
|
17
|
+
set name(t) {
|
|
18
|
+
const e = this._name;
|
|
19
|
+
this._name = t, this.requestUpdate("name", e), this._internals.setFormValue(this._value);
|
|
20
20
|
}
|
|
21
21
|
get value() {
|
|
22
22
|
return this._value;
|
|
23
23
|
}
|
|
24
|
-
set value(
|
|
25
|
-
const
|
|
26
|
-
this._value =
|
|
24
|
+
set value(t) {
|
|
25
|
+
const e = this._value;
|
|
26
|
+
this._value = t, this.requestUpdate("value", e), this._internals.setFormValue(this._value);
|
|
27
27
|
}
|
|
28
28
|
connectedCallback() {
|
|
29
29
|
super.connectedCallback(), this._internals.setFormValue(this.value);
|
|
@@ -44,39 +44,63 @@ let t = class extends u {
|
|
|
44
44
|
})
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
handleChange(
|
|
48
|
-
|
|
47
|
+
handleChange(t) {
|
|
48
|
+
t.stopPropagation(), this._dispatchChangeEvent();
|
|
49
49
|
}
|
|
50
|
-
handleInput(
|
|
51
|
-
this.value = this._input.value, this._internals.setFormValue(this.value),
|
|
50
|
+
handleInput(t) {
|
|
51
|
+
this.value = this._input.value, this._internals.setFormValue(this.value), t.stopPropagation(), this._dispatchInputEvent();
|
|
52
52
|
}
|
|
53
|
-
handleKeyDown(
|
|
54
|
-
|
|
53
|
+
handleKeyDown(t) {
|
|
54
|
+
t.key === "Enter" && this._internals.form && this._internals.form.requestSubmit();
|
|
55
55
|
}
|
|
56
56
|
formResetCallback() {
|
|
57
57
|
this.value = this.getAttribute("value") || "", this._internals.setFormValue(this.value);
|
|
58
58
|
}
|
|
59
|
+
_handleStartSlotChange(t) {
|
|
60
|
+
const e = t.target.assignedNodes()[0];
|
|
61
|
+
if (e.nodeType === Node.ELEMENT_NODE && e.tagName.toLowerCase().startsWith("fhi-icon")) {
|
|
62
|
+
const i = e;
|
|
63
|
+
this._input.style.paddingLeft = "var(--fhi-spacing-500)", i.setAttribute("size", "1.5rem");
|
|
64
|
+
} else
|
|
65
|
+
console.error(
|
|
66
|
+
"Ivalid slot input. Fhi-text-input only accepts FHI Designsystem icons."
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
_handleEndSlotChange(t) {
|
|
70
|
+
const e = t.target.assignedNodes()[0];
|
|
71
|
+
if (e.nodeType === Node.ELEMENT_NODE && e.tagName.toLowerCase().startsWith("fhi-icon")) {
|
|
72
|
+
const i = e;
|
|
73
|
+
this._input.style.paddingRight = "var(--fhi-spacing-500)", i.setAttribute("size", "1.5rem");
|
|
74
|
+
} else
|
|
75
|
+
console.error(
|
|
76
|
+
"Ivalid slot input. Fhi-text-input only accepts FHI Designsystem icons."
|
|
77
|
+
);
|
|
78
|
+
}
|
|
59
79
|
render() {
|
|
60
|
-
return
|
|
61
|
-
${this.label &&
|
|
62
|
-
${this.helpText ?
|
|
63
|
-
<input
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
return s`
|
|
81
|
+
${this.label && s`<label for="input-element">${this.label}</label>`}
|
|
82
|
+
${this.helpText ? s`<p class="help-text">${this.helpText}</p>` : ""}
|
|
83
|
+
<div class="input-container">
|
|
84
|
+
<input
|
|
85
|
+
id="input-element"
|
|
86
|
+
name=${d(this.name)}
|
|
87
|
+
placeholder=${d(this.placeholder)}
|
|
88
|
+
.value=${this.value}
|
|
89
|
+
?readonly=${this.readonly}
|
|
90
|
+
?disabled=${this.disabled}
|
|
91
|
+
@change=${this.handleChange}
|
|
92
|
+
@input=${this.handleInput}
|
|
93
|
+
@keydown=${this.handleKeyDown}
|
|
94
|
+
/>
|
|
95
|
+
<slot name="start" @slotchange=${this._handleStartSlotChange}> </slot>
|
|
96
|
+
<slot name="end" @slotchange=${this._handleEndSlotChange}> </slot>
|
|
97
|
+
</div>
|
|
98
|
+
${this.message ? s`<p class="message">${this.message}</p>` : ""}
|
|
75
99
|
`;
|
|
76
100
|
}
|
|
77
101
|
};
|
|
78
|
-
|
|
79
|
-
|
|
102
|
+
o.formAssociated = !0;
|
|
103
|
+
o.styles = c`
|
|
80
104
|
:host {
|
|
81
105
|
--typography-font-family: var(--fhi-font-family-default);
|
|
82
106
|
|
|
@@ -195,6 +219,7 @@ t.styles = g`
|
|
|
195
219
|
|
|
196
220
|
input {
|
|
197
221
|
box-sizing: border-box;
|
|
222
|
+
flex: 1 1 auto;
|
|
198
223
|
height: var(--dimension-input-height);
|
|
199
224
|
border: var(--dimension-input-border-width) solid
|
|
200
225
|
var(--color-input-border);
|
|
@@ -222,6 +247,18 @@ t.styles = g`
|
|
|
222
247
|
}
|
|
223
248
|
}
|
|
224
249
|
|
|
250
|
+
slot[name='start'] {
|
|
251
|
+
color: var(--fhi-color-neutral-text-subtle);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
input:not([disabled]):not([readonly]):hover ~ slot[name='start'] {
|
|
255
|
+
color: var(--fhi-color-accent-text-subtle);
|
|
256
|
+
}
|
|
257
|
+
input:not([disabled]):not([readonly]):active ~ slot[name='start'],
|
|
258
|
+
input:not([disabled]):not([readonly]):focus ~ slot[name='start'] {
|
|
259
|
+
color: var(--fhi-color-accent-text-default);
|
|
260
|
+
}
|
|
261
|
+
|
|
225
262
|
.message {
|
|
226
263
|
margin: var(--dimension-message-margin-top) 0 0 0;
|
|
227
264
|
color: var(--color-message-text);
|
|
@@ -239,6 +276,34 @@ t.styles = g`
|
|
|
239
276
|
letter-spacing: var(--typography-help-text-letter-spacing);
|
|
240
277
|
margin: 0 0 var(--dimension-help-text-margin-bottom) 0;
|
|
241
278
|
}
|
|
279
|
+
|
|
280
|
+
.input-container {
|
|
281
|
+
position: relative;
|
|
282
|
+
display: flex;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
slot[name='start'] {
|
|
286
|
+
display: block;
|
|
287
|
+
position: absolute;
|
|
288
|
+
left: 0;
|
|
289
|
+
top: 50%;
|
|
290
|
+
transform: translateY(-50%);
|
|
291
|
+
margin-left: 8px;
|
|
292
|
+
height: fit-content;
|
|
293
|
+
pointer-events: none;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
slot[name='end'] {
|
|
297
|
+
display: block;
|
|
298
|
+
position: absolute;
|
|
299
|
+
right: 0;
|
|
300
|
+
top: 50%;
|
|
301
|
+
transform: translateY(-50%);
|
|
302
|
+
margin-right: 8px;
|
|
303
|
+
height: fit-content;
|
|
304
|
+
pointer-events: none;
|
|
305
|
+
color: var(--fhi-color-neutral-text-subtle);
|
|
306
|
+
}
|
|
242
307
|
}
|
|
243
308
|
|
|
244
309
|
:host([disabled]) {
|
|
@@ -281,43 +346,53 @@ t.styles = g`
|
|
|
281
346
|
.help-text {
|
|
282
347
|
color: var(--color-help-text-text-error);
|
|
283
348
|
}
|
|
349
|
+
slot[name='start'] {
|
|
350
|
+
color: var(--fhi-color-danger-text-subtle);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
input:hover ~ slot[name='start'] {
|
|
354
|
+
color: var(--fhi-color-danger-text-subtle);
|
|
355
|
+
}
|
|
356
|
+
input:focus ~ slot[name='start'] {
|
|
357
|
+
color: var(--fhi-color-danger-text-subtle);
|
|
358
|
+
}
|
|
284
359
|
}
|
|
285
360
|
`;
|
|
286
361
|
r([
|
|
287
|
-
|
|
288
|
-
],
|
|
362
|
+
a({ type: String })
|
|
363
|
+
], o.prototype, "label", 2);
|
|
289
364
|
r([
|
|
290
|
-
|
|
291
|
-
],
|
|
365
|
+
a({ type: String })
|
|
366
|
+
], o.prototype, "message", 2);
|
|
292
367
|
r([
|
|
293
|
-
|
|
294
|
-
],
|
|
368
|
+
a({ type: String, attribute: "help-text" })
|
|
369
|
+
], o.prototype, "helpText", 2);
|
|
295
370
|
r([
|
|
296
|
-
|
|
297
|
-
],
|
|
371
|
+
a({ type: String })
|
|
372
|
+
], o.prototype, "placeholder", 2);
|
|
298
373
|
r([
|
|
299
|
-
|
|
300
|
-
],
|
|
374
|
+
a({ type: String, reflect: !0 })
|
|
375
|
+
], o.prototype, "status", 2);
|
|
301
376
|
r([
|
|
302
|
-
|
|
303
|
-
],
|
|
377
|
+
a({ type: Boolean, reflect: !0 })
|
|
378
|
+
], o.prototype, "readonly", 2);
|
|
304
379
|
r([
|
|
305
|
-
|
|
306
|
-
],
|
|
380
|
+
a({ type: Boolean, reflect: !0 })
|
|
381
|
+
], o.prototype, "disabled", 2);
|
|
307
382
|
r([
|
|
308
383
|
y("#input-element")
|
|
309
|
-
],
|
|
384
|
+
], o.prototype, "_input", 2);
|
|
310
385
|
r([
|
|
311
|
-
|
|
312
|
-
],
|
|
386
|
+
a({ type: String, reflect: !0 })
|
|
387
|
+
], o.prototype, "name", 1);
|
|
313
388
|
r([
|
|
314
|
-
|
|
315
|
-
],
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
],
|
|
389
|
+
a({ type: String })
|
|
390
|
+
], o.prototype, "value", 1);
|
|
391
|
+
o = r([
|
|
392
|
+
u(b)
|
|
393
|
+
], o);
|
|
319
394
|
export {
|
|
320
|
-
|
|
395
|
+
o as FhiTextInput,
|
|
321
396
|
b as FhiTextInputSelector
|
|
322
397
|
};
|
|
323
398
|
//# sourceMappingURL=fhi-text-input.js.map
|
package/fhi-text-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fhi-text-input.js","sources":["../../src/components/fhi-text-input/fhi-text-input.component.ts"],"sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nexport const FhiTextInputSelector = 'fhi-text-input';\n\n/**\n * ## FHI Text Input\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-text-input--docs}\n *\n * The `<fhi-text-input>` component is used to collect user input in forms.\n * It provides a labeled input field with optional placeholder text, status indication, and a message area for additional information or validation feedback.\n *\n * @tag fhi-text-input\n * @element fhi-text-input\n */\n@customElement(FhiTextInputSelector)\nexport class FhiTextInput extends LitElement {\n static readonly formAssociated = true;\n\n /**\n * The text that labels the input field.\n * An input field should always have a label to ensure accessibility.\n * @type {string}\n */\n @property({ type: String }) label?: string = undefined;\n\n /**\n * The message shown beneath the input field.\n * This is often used to provide additional information or feedback to the user.\n * @type {string}\n */\n @property({ type: String }) message?: string = undefined;\n\n /**\n * The message shown above the input field.\n * This is often used to provide additional information to the user.\n * @type {string}\n */\n @property({ type: String, attribute: 'help-text' }) helpText?: string =\n undefined;\n\n /**\n * Sets the placeholder text for the input field.\n * This text is displayed when the input field is empty, providing a hint to the user about the expected input.\n * @type {string}\n */\n @property({ type: String }) placeholder?: string = undefined;\n\n /**\n * Sets the visual status of the input. There is currently only one status available: `error`.\n *\n * The `error` status is used to indicate that there is an issue with the input, such as invalid or missing data.\n * @reflect\n * @type {'error'}\n */\n @property({ type: String, reflect: true }) status?: 'error' = undefined;\n\n /**\n * Sets the input to read-only. A read-only field cannot be modified by the user but may be submitted with the form.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) readonly? = false;\n\n /**\n * Disables the input. This changes its appearance and makes it non-interactive.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) disabled? = false;\n\n @query('#input-element')\n private _input!: HTMLInputElement;\n\n private _name?: string = undefined;\n\n /**\n * The name of the input. This is submitted with the form data as a `key`.\n *\n * This attribute conforms with the standard HTML `name` attribute for input fields.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name}\n *\n * @reflect\n * @type {string}\n */\n @property({ type: String, reflect: true })\n get name(): string | undefined {\n return this._name;\n }\n set name(newName: string) {\n const oldName = this._name;\n this._name = newName;\n this.requestUpdate('name', oldName);\n this._internals.setFormValue(this._value);\n }\n\n private _value: string = '';\n\n /**\n * The default value of the input field.\n *\n * You can fetch the current value of the text input by accessing this property directly on the component instance, or by listening for the `change` or `input` events which are dispatched whenever the value changes.\n *\n * This attribute conforms with the standard HTML `value` attribute for input fields.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value}\n *\n * @type {string}\n */\n @property({ type: String })\n get value(): string {\n return this._value;\n }\n\n set value(newValue: string) {\n const oldValue = this._value;\n this._value = newValue;\n this.requestUpdate('value', oldValue);\n this._internals.setFormValue(this._value);\n }\n\n private _internals: ElementInternals;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this._internals.setFormValue(this.value);\n }\n\n private _dispatchChangeEvent(): void {\n /**\n * @type {Event} - Standard DOM event with the type `change`.\n * This event is dispatched when the value of the input changes.\n */\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _dispatchInputEvent(): void {\n /**\n * @type {Event} - Standard DOM event with the type `input`.\n * This event is dispatched when the value of the input changes.\n */\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private handleChange(event: Event): void {\n event.stopPropagation();\n this._dispatchChangeEvent();\n }\n\n private handleInput(event: Event): void {\n this.value = this._input.value;\n this._internals.setFormValue(this.value);\n\n event.stopPropagation();\n this._dispatchInputEvent();\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && this._internals.form) {\n this._internals.form!.requestSubmit();\n }\n }\n\n public formResetCallback(): void {\n this.value = this.getAttribute('value') || '';\n this._internals.setFormValue(this.value);\n }\n\n render() {\n return html`\n ${this.label && html`<label for=\"input-element\">${this.label}</label>`}\n ${this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ''}\n <input\n id=\"input-element\"\n name=${ifDefined(this.name)}\n placeholder=${ifDefined(this.placeholder)}\n .value=${this.value}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @keydown=${this.handleKeyDown}\n />\n ${this.message ? html`<p class=\"message\">${this.message}</p>` : ''}\n `;\n }\n\n static styles = css`\n :host {\n --typography-font-family: var(--fhi-font-family-default);\n\n --opacity-disabled: var(--fhi-opacity-disabled);\n\n /* label */\n --color-label-text: var(--fhi-color-neutral-text-default);\n --color-label-text-error: var(--fhi-color-danger-text-default);\n\n --typography-label-font-weight: var(\n --fhi-typography-label-small-font-weight\n );\n --typography-label-font-size: var(--fhi-typography-label-small-font-size);\n --typography-label-line-height: var(\n --fhi-typography-label-small-line-height\n );\n --typography-label-letter-spacing: var(\n --fhi-typography-label-small-letter-spacing\n );\n --dimension-label-margin-bottom: var(--fhi-spacing-050);\n\n /* input */\n --color-input-placeholder: var(--fhi-color-neutral-base-default);\n --color-input-text: var(--fhi-color-neutral-text-default);\n --color-input-text-error: var(--fhi-color-danger-text-default);\n --color-input-background: var(--fhi-color-neutral-background-default);\n --color-input-background-active: var(\n --fhi-color-accent-background-default\n );\n --color-input-background-hover: var(--fhi-color-accent-background-subtle);\n --color-input-background-error: var(\n --fhi-color-danger-background-default\n );\n --color-input-border: var(--fhi-color-neutral-border-default);\n --color-input-border-hover: var(--fhi-color-accent-border-default);\n --color-input-border-active: var(--fhi-color-accent-border-strong);\n --color-input-border-error: var(--fhi-color-danger-border-strong);\n --color-input-border-disabled: var(--fhi-color-neutral-border-default);\n\n --typography-input-font-weight: var(\n --fhi-typography-body-medium-font-weight\n );\n --typography-input-font-size: var(--fhi-typography-body-medium-font-size);\n --typography-input-line-height: var(\n --fhi-typography-body-medium-line-height\n );\n --typography-input-letter-spacing: var(\n --fhi-typography-body-medium-letter-spacing\n );\n\n --dimension-input-border-width: var(--fhi-dimension-border-width);\n\n --dimension-input-height: var(--fhi-spacing-500);\n --dimension-input-border-radius: var(--fhi-border-radius-050);\n --dimension-input-padding-left: var(--fhi-spacing-150);\n --dimension-input-padding-right: var(--fhi-spacing-150);\n\n --motion-input-transition: all var(--fhi-motion-ease-default)\n var(--fhi-motion-duration-quick);\n\n /* message */\n --color-message-text: var(--fhi-color-neutral-text-default);\n --color-message-text-error: var(--fhi-color-danger-text-subtle);\n\n --typography-message-font-weight: var(\n --fhi-typography-body-small-font-weight\n );\n --typography-message-font-size: var(\n --fhi-typography-body-small-font-size\n );\n --typography-message-line-height: var(\n --fhi-typography-body-small-line-height\n );\n --typography-message-letter-spacing: var(\n --fhi-typography-body-small-letter-spacing\n );\n\n --dimension-message-margin-top: var(--fhi-spacing-050);\n\n /* help-text */\n --color-help-text-text: var(--fhi-color-neutral-text-subtle);\n --color-help-text-text-error: var(--fhi-color-danger-text-default);\n --typography-help-text-font-weight: var(\n --fhi-typography-body-small-font-weight\n );\n --typography-help-text-font-size: var(\n --fhi-typography-body-small-font-size\n );\n --typography-help-text-line-height: var(\n --fhi-typography-body-small-line-height\n );\n --typography-help-text-letter-spacing: var(\n --fhi-typography-body-small-letter-spacing\n );\n --dimension-help-text-margin-bottom: var(--fhi-spacing-050);\n }\n\n :host {\n display: flex;\n flex-direction: column;\n font-family: var(--typography-font-family);\n -webkit-font-smoothing: antialiased;\n\n label {\n font-weight: var(--typography-label-font-weight);\n font-size: var(--typography-label-font-size);\n line-height: var(--typography-label-line-height);\n letter-spacing: var(--typography-label-letter-spacing);\n color: var(--color-label-text);\n margin: 0 0 var(--dimension-label-margin-bottom) 0;\n }\n\n label:has(+ p) {\n margin: 0 0 0 0;\n }\n\n input {\n box-sizing: border-box;\n height: var(--dimension-input-height);\n border: var(--dimension-input-border-width) solid\n var(--color-input-border);\n border-radius: var(--dimension-input-border-radius);\n padding: 0 var(--dimension-input-padding-right) 0\n var(--dimension-input-padding-left);\n color: var(--color-input-text);\n background-color: var(--color-input-background);\n font-family: var(--typography-font-family);\n font-weight: var(--typography-input-font-weight);\n font-size: var(--typography-input-font-size);\n line-height: var(--typography-input-line-height);\n letter-spacing: var(--typography-input-letter-spacing);\n transition: var(--motion-input-transition);\n &:hover {\n border-color: var(--color-input-border-hover);\n background-color: var(--color-input-background-hover);\n }\n &:focus {\n border-color: var(--color-input-border-active);\n background-color: var(--color-input-background-active);\n }\n &::placeholder {\n color: var(--color-input-placeholder);\n }\n }\n\n .message {\n margin: var(--dimension-message-margin-top) 0 0 0;\n color: var(--color-message-text);\n font-weight: var(--typography-message-font-weight);\n font-size: var(--typography-message-font-size);\n line-height: var(--typography-message-line-height);\n letter-spacing: var(--typography-message-letter-spacing);\n }\n\n .help-text {\n color: var(--color-help-text-text);\n font-weight: var(--typography-help-text-font-weight);\n font-size: var(--typography-help-text-font-size);\n line-height: var(--typography-help-text-line-height);\n letter-spacing: var(--typography-help-text-letter-spacing);\n margin: 0 0 var(--dimension-help-text-margin-bottom) 0;\n }\n }\n\n :host([disabled]) {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n label,\n input {\n cursor: not-allowed;\n }\n input {\n &:hover {\n border-color: var(--color-input-border);\n background-color: var(--color-input-background);\n }\n }\n }\n\n :host([readonly]:not([disabled])) {\n input {\n border: unset;\n border-radius: unset;\n background-color: unset;\n border-left: var(--dimension-input-border-width) solid\n var(--color-input-border);\n }\n }\n\n :host([status='error']:not([disabled]):not([readonly])) {\n label {\n color: var(--color-label-text-error);\n }\n input {\n border-color: var(--color-input-border-error);\n background-color: var(--color-input-background-error);\n color: var(--color-input-text-error);\n }\n .message {\n color: var(--color-message-text-error);\n }\n .help-text {\n color: var(--color-help-text-text-error);\n }\n }\n `;\n}\n"],"names":["FhiTextInputSelector","FhiTextInput","LitElement","newName","oldName","newValue","oldValue","event","html","ifDefined","css","__decorateClass","property","query","customElement"],"mappings":";;;;;;;;AAIO,MAAMA,IAAuB;AAc7B,IAAMC,IAAN,cAA2BC,EAAW;AAAA,EA0G3C,cAAc;AACZ,UAAA,GAnG0B,KAAA,QAAiB,QAOjB,KAAA,UAAmB,QAOK,KAAA,WAClD,QAO0B,KAAA,cAAuB,QASR,KAAA,SAAmB,QAOlB,KAAA,WAAY,IAOZ,KAAA,WAAY,IAKxD,KAAQ,QAAiB,QAsBzB,KAAQ,SAAiB,IA4BvB,KAAK,aAAa,KAAK,gBAAA;AAAA,EACzB;AAAA,EAvCA,IAAI,OAA2B;AAC7B,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,KAAKC,GAAiB;AACxB,UAAMC,IAAU,KAAK;AACrB,SAAK,QAAQD,GAC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X,EA8CiC,WAAA,YAAA,CAAA;AAOAU,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GArD/BX,EAqDiC,WAAA,YAAA,CAAA;AAGpCU,EAAA;AAAA,EADPE,EAAM,gBAAgB;AAAA,GAvDZZ,EAwDH,WAAA,UAAA,CAAA;AAcJU,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArE9BX,EAsEP,WAAA,QAAA,CAAA;AAuBAU,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5FfX,EA6FP,WAAA,SAAA,CAAA;AA7FOA,IAANU,EAAA;AAAA,EADNG,EAAcd,CAAoB;AAAA,GACtBC,CAAA;"}
|
|
1
|
+
{"version":3,"file":"fhi-text-input.js","sources":["../../src/components/fhi-text-input/fhi-text-input.component.ts"],"sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nexport const FhiTextInputSelector = 'fhi-text-input';\n\n/**\n * ## FHI Text Input\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-text-input--docs}\n *\n * The `<fhi-text-input>` component is used to collect user input in forms.\n * It provides a labeled input field with optional placeholder text, status indication, and a message area for additional information or validation feedback.\n *\n * @tag fhi-text-input\n * @element fhi-text-input\n */\n@customElement(FhiTextInputSelector)\nexport class FhiTextInput extends LitElement {\n static readonly formAssociated = true;\n\n /**\n * The text that labels the input field.\n * An input field should always have a label to ensure accessibility.\n * @type {string}\n */\n @property({ type: String }) label?: string = undefined;\n\n /**\n * The message shown beneath the input field.\n * This is often used to provide additional information or feedback to the user.\n * @type {string}\n */\n @property({ type: String }) message?: string = undefined;\n\n /**\n * The message shown above the input field.\n * This is often used to provide additional information to the user.\n * @type {string}\n */\n @property({ type: String, attribute: 'help-text' }) helpText?: string =\n undefined;\n\n /**\n * Sets the placeholder text for the input field.\n * This text is displayed when the input field is empty, providing a hint to the user about the expected input.\n * @type {string}\n */\n @property({ type: String }) placeholder?: string = undefined;\n\n /**\n * Sets the visual status of the input. There is currently only one status available: `error`.\n *\n * The `error` status is used to indicate that there is an issue with the input, such as invalid or missing data.\n * @reflect\n * @type {'error'}\n */\n @property({ type: String, reflect: true }) status?: 'error' = undefined;\n\n /**\n * Sets the input to read-only. A read-only field cannot be modified by the user but may be submitted with the form.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) readonly? = false;\n\n /**\n * Disables the input. This changes its appearance and makes it non-interactive.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) disabled? = false;\n\n @query('#input-element')\n private _input!: HTMLInputElement;\n\n private _name?: string = undefined;\n\n /**\n * The name of the input. This is submitted with the form data as a `key`.\n *\n * This attribute conforms with the standard HTML `name` attribute for input fields.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name}\n *\n * @reflect\n * @type {string}\n */\n @property({ type: String, reflect: true })\n get name(): string | undefined {\n return this._name;\n }\n set name(newName: string) {\n const oldName = this._name;\n this._name = newName;\n this.requestUpdate('name', oldName);\n this._internals.setFormValue(this._value);\n }\n\n private _value: string = '';\n\n /**\n * The default value of the input field.\n *\n * You can fetch the current value of the text input by accessing this property directly on the component instance, or by listening for the `change` or `input` events which are dispatched whenever the value changes.\n *\n * This attribute conforms with the standard HTML `value` attribute for input fields.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value}\n *\n * @type {string}\n */\n @property({ type: String })\n get value(): string {\n return this._value;\n }\n\n set value(newValue: string) {\n const oldValue = this._value;\n this._value = newValue;\n this.requestUpdate('value', oldValue);\n this._internals.setFormValue(this._value);\n }\n\n private _internals: ElementInternals;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this._internals.setFormValue(this.value);\n }\n\n private _dispatchChangeEvent(): void {\n /**\n * @type {Event} - Standard DOM event with the type `change`.\n * This event is dispatched when the value of the input changes.\n */\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _dispatchInputEvent(): void {\n /**\n * @type {Event} - Standard DOM event with the type `input`.\n * This event is dispatched when the value of the input changes.\n */\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private handleChange(event: Event): void {\n event.stopPropagation();\n this._dispatchChangeEvent();\n }\n\n private handleInput(event: Event): void {\n this.value = this._input.value;\n this._internals.setFormValue(this.value);\n\n event.stopPropagation();\n this._dispatchInputEvent();\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && this._internals.form) {\n this._internals.form!.requestSubmit();\n }\n }\n\n public formResetCallback(): void {\n this.value = this.getAttribute('value') || '';\n this._internals.setFormValue(this.value);\n }\n\n private _handleStartSlotChange(event: Event): void {\n const iconNode: Node = (event.target as HTMLSlotElement).assignedNodes()[0];\n if (\n iconNode.nodeType === Node.ELEMENT_NODE &&\n (iconNode as Element).tagName.toLowerCase().startsWith('fhi-icon')\n ) {\n const icon = iconNode as HTMLElement;\n this._input.style.paddingLeft = 'var(--fhi-spacing-500)';\n icon.setAttribute('size', '1.5rem');\n } else {\n console.error(\n 'Ivalid slot input. Fhi-text-input only accepts FHI Designsystem icons.',\n );\n }\n }\n\n private _handleEndSlotChange(event: Event): void {\n const iconNode: Node = (event.target as HTMLSlotElement).assignedNodes()[0];\n\n if (\n iconNode.nodeType === Node.ELEMENT_NODE &&\n (iconNode as Element).tagName.toLowerCase().startsWith('fhi-icon')\n ) {\n const icon = iconNode as HTMLElement;\n this._input.style.paddingRight = 'var(--fhi-spacing-500)';\n icon.setAttribute('size', '1.5rem');\n } else {\n console.error(\n 'Ivalid slot input. Fhi-text-input only accepts FHI Designsystem icons.',\n );\n }\n }\n\n render() {\n return html`\n ${this.label && html`<label for=\"input-element\">${this.label}</label>`}\n ${this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ''}\n <div class=\"input-container\">\n <input\n id=\"input-element\"\n name=${ifDefined(this.name)}\n placeholder=${ifDefined(this.placeholder)}\n .value=${this.value}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @keydown=${this.handleKeyDown}\n />\n <slot name=\"start\" @slotchange=${this._handleStartSlotChange}> </slot>\n <slot name=\"end\" @slotchange=${this._handleEndSlotChange}> </slot>\n </div>\n ${this.message ? html`<p class=\"message\">${this.message}</p>` : ''}\n `;\n }\n\n static styles = css`\n :host {\n --typography-font-family: var(--fhi-font-family-default);\n\n --opacity-disabled: var(--fhi-opacity-disabled);\n\n /* label */\n --color-label-text: var(--fhi-color-neutral-text-default);\n --color-label-text-error: var(--fhi-color-danger-text-default);\n\n --typography-label-font-weight: var(\n --fhi-typography-label-small-font-weight\n );\n --typography-label-font-size: var(--fhi-typography-label-small-font-size);\n --typography-label-line-height: var(\n --fhi-typography-label-small-line-height\n );\n --typography-label-letter-spacing: var(\n --fhi-typography-label-small-letter-spacing\n );\n --dimension-label-margin-bottom: var(--fhi-spacing-050);\n\n /* input */\n --color-input-placeholder: var(--fhi-color-neutral-base-default);\n --color-input-text: var(--fhi-color-neutral-text-default);\n --color-input-text-error: var(--fhi-color-danger-text-default);\n --color-input-background: var(--fhi-color-neutral-background-default);\n --color-input-background-active: var(\n --fhi-color-accent-background-default\n );\n --color-input-background-hover: var(--fhi-color-accent-background-subtle);\n --color-input-background-error: var(\n --fhi-color-danger-background-default\n );\n --color-input-border: var(--fhi-color-neutral-border-default);\n --color-input-border-hover: var(--fhi-color-accent-border-default);\n --color-input-border-active: var(--fhi-color-accent-border-strong);\n --color-input-border-error: var(--fhi-color-danger-border-strong);\n --color-input-border-disabled: var(--fhi-color-neutral-border-default);\n\n --typography-input-font-weight: var(\n --fhi-typography-body-medium-font-weight\n );\n --typography-input-font-size: var(--fhi-typography-body-medium-font-size);\n --typography-input-line-height: var(\n --fhi-typography-body-medium-line-height\n );\n --typography-input-letter-spacing: var(\n --fhi-typography-body-medium-letter-spacing\n );\n\n --dimension-input-border-width: var(--fhi-dimension-border-width);\n\n --dimension-input-height: var(--fhi-spacing-500);\n --dimension-input-border-radius: var(--fhi-border-radius-050);\n --dimension-input-padding-left: var(--fhi-spacing-150);\n --dimension-input-padding-right: var(--fhi-spacing-150);\n\n --motion-input-transition: all var(--fhi-motion-ease-default)\n var(--fhi-motion-duration-quick);\n\n /* message */\n --color-message-text: var(--fhi-color-neutral-text-default);\n --color-message-text-error: var(--fhi-color-danger-text-subtle);\n\n --typography-message-font-weight: var(\n --fhi-typography-body-small-font-weight\n );\n --typography-message-font-size: var(\n --fhi-typography-body-small-font-size\n );\n --typography-message-line-height: var(\n --fhi-typography-body-small-line-height\n );\n --typography-message-letter-spacing: var(\n --fhi-typography-body-small-letter-spacing\n );\n\n --dimension-message-margin-top: var(--fhi-spacing-050);\n\n /* help-text */\n --color-help-text-text: var(--fhi-color-neutral-text-subtle);\n --color-help-text-text-error: var(--fhi-color-danger-text-default);\n --typography-help-text-font-weight: var(\n --fhi-typography-body-small-font-weight\n );\n --typography-help-text-font-size: var(\n --fhi-typography-body-small-font-size\n );\n --typography-help-text-line-height: var(\n --fhi-typography-body-small-line-height\n );\n --typography-help-text-letter-spacing: var(\n --fhi-typography-body-small-letter-spacing\n );\n --dimension-help-text-margin-bottom: var(--fhi-spacing-050);\n }\n\n :host {\n display: flex;\n flex-direction: column;\n font-family: var(--typography-font-family);\n -webkit-font-smoothing: antialiased;\n\n label {\n font-weight: var(--typography-label-font-weight);\n font-size: var(--typography-label-font-size);\n line-height: var(--typography-label-line-height);\n letter-spacing: var(--typography-label-letter-spacing);\n color: var(--color-label-text);\n margin: 0 0 var(--dimension-label-margin-bottom) 0;\n }\n\n label:has(+ p) {\n margin: 0 0 0 0;\n }\n\n input {\n box-sizing: border-box;\n flex: 1 1 auto;\n height: var(--dimension-input-height);\n border: var(--dimension-input-border-width) solid\n var(--color-input-border);\n border-radius: var(--dimension-input-border-radius);\n padding: 0 var(--dimension-input-padding-right) 0\n var(--dimension-input-padding-left);\n color: var(--color-input-text);\n background-color: var(--color-input-background);\n font-family: var(--typography-font-family);\n font-weight: var(--typography-input-font-weight);\n font-size: var(--typography-input-font-size);\n line-height: var(--typography-input-line-height);\n letter-spacing: var(--typography-input-letter-spacing);\n transition: var(--motion-input-transition);\n &:hover {\n border-color: var(--color-input-border-hover);\n background-color: var(--color-input-background-hover);\n }\n &:focus {\n border-color: var(--color-input-border-active);\n background-color: var(--color-input-background-active);\n }\n &::placeholder {\n color: var(--color-input-placeholder);\n }\n }\n\n slot[name='start'] {\n color: var(--fhi-color-neutral-text-subtle);\n }\n\n input:not([disabled]):not([readonly]):hover ~ slot[name='start'] {\n color: var(--fhi-color-accent-text-subtle);\n }\n input:not([disabled]):not([readonly]):active ~ slot[name='start'],\n input:not([disabled]):not([readonly]):focus ~ slot[name='start'] {\n color: var(--fhi-color-accent-text-default);\n }\n\n .message {\n margin: var(--dimension-message-margin-top) 0 0 0;\n color: var(--color-message-text);\n font-weight: var(--typography-message-font-weight);\n font-size: var(--typography-message-font-size);\n line-height: var(--typography-message-line-height);\n letter-spacing: var(--typography-message-letter-spacing);\n }\n\n .help-text {\n color: var(--color-help-text-text);\n font-weight: var(--typography-help-text-font-weight);\n font-size: var(--typography-help-text-font-size);\n line-height: var(--typography-help-text-line-height);\n letter-spacing: var(--typography-help-text-letter-spacing);\n margin: 0 0 var(--dimension-help-text-margin-bottom) 0;\n }\n\n .input-container {\n position: relative;\n display: flex;\n }\n\n slot[name='start'] {\n display: block;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 8px;\n height: fit-content;\n pointer-events: none;\n }\n\n slot[name='end'] {\n display: block;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n margin-right: 8px;\n height: fit-content;\n pointer-events: none;\n color: var(--fhi-color-neutral-text-subtle);\n }\n }\n\n :host([disabled]) {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n label,\n input {\n cursor: not-allowed;\n }\n input {\n &:hover {\n border-color: var(--color-input-border);\n background-color: var(--color-input-background);\n }\n }\n }\n\n :host([readonly]:not([disabled])) {\n input {\n border: unset;\n border-radius: unset;\n background-color: unset;\n border-left: var(--dimension-input-border-width) solid\n var(--color-input-border);\n }\n }\n\n :host([status='error']:not([disabled]):not([readonly])) {\n label {\n color: var(--color-label-text-error);\n }\n input {\n border-color: var(--color-input-border-error);\n background-color: var(--color-input-background-error);\n color: var(--color-input-text-error);\n }\n .message {\n color: var(--color-message-text-error);\n }\n .help-text {\n color: var(--color-help-text-text-error);\n }\n slot[name='start'] {\n color: var(--fhi-color-danger-text-subtle);\n }\n\n input:hover ~ slot[name='start'] {\n color: var(--fhi-color-danger-text-subtle);\n }\n input:focus ~ slot[name='start'] {\n color: var(--fhi-color-danger-text-subtle);\n }\n }\n `;\n}\n"],"names":["FhiTextInputSelector","FhiTextInput","LitElement","newName","oldName","newValue","oldValue","event","iconNode","icon","html","ifDefined","css","__decorateClass","property","query","customElement"],"mappings":";;;;;;;;AAIO,MAAMA,IAAuB;AAc7B,IAAMC,IAAN,cAA2BC,EAAW;AAAA,EA0G3C,cAAc;AACZ,UAAA,GAnG0B,KAAA,QAAiB,QAOjB,KAAA,UAAmB,QAOK,KAAA,WAClD,QAO0B,KAAA,cAAuB,QASR,KAAA,SAAmB,QAOlB,KAAA,WAAY,IAOZ,KAAA,WAAY,IAKxD,KAAQ,QAAiB,QAsBzB,KAAQ,SAAiB,IA4BvB,KAAK,aAAa,KAAK,gBAAA;AAAA,EACzB;AAAA,EAvCA,IAAI,OAA2B;AAC7B,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,KAAKC,GAAiB;AACxB,UAAMC,IAAU,KAAK;AACrB,SAAK,QAAQD,GACb,KAAK,cAAc,QAAQC,CAAO,GAClC,KAAK,WAAW,aAAa,KAAK,MAAM;AAAA,EAC1C;A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EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArE9Bb,EAsEP,WAAA,QAAA,CAAA;AAuBAY,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5Ffb,EA6FP,WAAA,SAAA,CAAA;AA7FOA,IAANY,EAAA;AAAA,EADNG,EAAchB,CAAoB;AAAA,GACtBC,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/fhi-text-input/fhi-text-input.component.ts","declarations":[{"kind":"class","description":"## FHI Text Input\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-text-input--docs\n\nThe `<fhi-text-input>` component is used to collect user input in forms.\nIt provides a labeled input field with optional placeholder text, status indication, and a message area for additional information or validation feedback.","name":"FhiTextInput","members":[{"kind":"method","name":"_dispatchChangeEvent","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"method","name":"_dispatchInputEvent","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"method","name":"_handleEndSlotChange","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"_handleStartSlotChange","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"field","name":"_input","type":{"text":"HTMLInputElement"},"privacy":"private"},{"kind":"field","name":"_internals","type":{"text":"ElementInternals"},"privacy":"private"},{"kind":"field","name":"_name","type":{"text":"string | undefined"},"privacy":"private","default":"undefined"},{"kind":"field","name":"_value","type":{"text":"string"},"privacy":"private","default":"''"},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the input. This changes its appearance and makes it non-interactive.","reflects":true,"attribute":"disabled"},{"kind":"field","name":"formAssociated","type":{"text":"boolean"},"static":true,"readonly":true,"default":"true"},{"kind":"method","name":"formResetCallback","privacy":"public","return":{"type":{"text":"void"}}},{"kind":"method","name":"handleChange","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"handleInput","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"handleKeyDown","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"KeyboardEvent"}}]},{"kind":"field","name":"helpText","type":{"text":"string"},"default":"undefined","description":"The message shown above the input field.\nThis is often used to provide additional information to the user.","attribute":"help-text"},{"kind":"field","name":"label","type":{"text":"string"},"default":"undefined","description":"The text that labels the input field.\nAn input field should always have a label to ensure accessibility.","attribute":"label"},{"kind":"field","name":"message","type":{"text":"string"},"default":"undefined","description":"The message shown beneath the input field.\nThis is often used to provide additional information or feedback to the user.","attribute":"message"},{"kind":"field","name":"name","type":{"text":"string"},"description":"The name of the input. This is submitted with the form data as a `key`.\n\nThis attribute conforms with the standard HTML `name` attribute for input fields.\nSee: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name","reflects":true,"attribute":"name"},{"kind":"field","name":"placeholder","type":{"text":"string"},"default":"undefined","description":"Sets the placeholder text for the input field.\nThis text is displayed when the input field is empty, providing a hint to the user about the expected input.","attribute":"placeholder"},{"kind":"field","name":"readonly","type":{"text":"boolean"},"default":"false","description":"Sets the input to read-only. A read-only field cannot be modified by the user but may be submitted with the form.","reflects":true,"attribute":"readonly"},{"kind":"field","name":"status","type":{"text":"'error'"},"default":"undefined","description":"Sets the visual status of the input. There is currently only one status available: `error`.\n\nThe `error` status is used to indicate that there is an issue with the input, such as invalid or missing data.","reflects":true,"attribute":"status"},{"kind":"field","name":"value","type":{"text":"string"},"description":"The default value of the input field.\n\nYou can fetch the current value of the text input by accessing this property directly on the component instance, or by listening for the `change` or `input` events which are dispatched whenever the value changes.\n\nThis attribute conforms with the standard HTML `value` attribute for input fields.\nSee: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value","attribute":"value"}],"events":[{"name":"change","type":{"text":"Event"},"description":"Standard DOM event with the type `change`.\nThis event is dispatched when the value of the input changes."},{"name":"input","type":{"text":"Event"},"description":"Standard DOM event with the type `input`.\nThis event is dispatched when the value of the input changes."}],"attributes":[{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the input. This changes its appearance and makes it non-interactive.","fieldName":"disabled"},{"name":"help-text","type":{"text":"string"},"default":"undefined","description":"The message shown above the input field.\nThis is often used to provide additional information to the user.","fieldName":"helpText"},{"name":"label","type":{"text":"string"},"default":"undefined","description":"The text that labels the input field.\nAn input field should always have a label to ensure accessibility.","fieldName":"label"},{"name":"message","type":{"text":"string"},"default":"undefined","description":"The message shown beneath the input field.\nThis is often used to provide additional information or feedback to the user.","fieldName":"message"},{"name":"name","type":{"text":"string"},"description":"The name of the input. This is submitted with the form data as a `key`.\n\nThis attribute conforms with the standard HTML `name` attribute for input fields.\nSee: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name","fieldName":"name"},{"name":"placeholder","type":{"text":"string"},"default":"undefined","description":"Sets the placeholder text for the input field.\nThis text is displayed when the input field is empty, providing a hint to the user about the expected input.","fieldName":"placeholder"},{"name":"readonly","type":{"text":"boolean"},"default":"false","description":"Sets the input to read-only. A read-only field cannot be modified by the user but may be submitted with the form.","fieldName":"readonly"},{"name":"status","type":{"text":"'error'"},"default":"undefined","description":"Sets the visual status of the input. There is currently only one status available: `error`.\n\nThe `error` status is used to indicate that there is an issue with the input, such as invalid or missing data.","fieldName":"status"},{"name":"value","type":{"text":"string"},"description":"The default value of the input field.\n\nYou can fetch the current value of the text input by accessing this property directly on the component instance, or by listening for the `change` or `input` events which are dispatched whenever the value changes.\n\nThis attribute conforms with the standard HTML `value` attribute for input fields.\nSee: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value","fieldName":"value"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-text-input","customElement":true},{"kind":"variable","name":"FhiTextInputSelector","type":{"text":"string"},"default":"'fhi-text-input'"}]}
|