@nordhealth/components 1.0.0-beta.15 → 1.0.0-beta.16
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/custom-elements.json +76 -76
- package/lib/Checkbox.js +1 -1
- package/lib/Checkbox.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.js.map +1 -1
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -4660,6 +4660,82 @@
|
|
|
4660
4660
|
],
|
|
4661
4661
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the fieldset component when you need to create a relationship between multiple form inputs.\n- It is especially important to use with a group of radio components.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use with a checkbox component when there is **only one** checkbox. For example, when accepting terms and conditions.\n\n</div>\n\n-------\n\n## Content guidelines\n\nFieldset label should be clear, accurate and predictable. It should help the user to understand how the items in the fieldset are grouped together, or what kind of choice the user is making:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Choose</div>\n\nWhen writing fieldset labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick A Color</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick a color.</div>\n\nDo not use colons in fieldset label:\n\n<div class=\"n-usage n-usage-do\">Payment details</div>\n<div class=\"n-usage n-usage-dont\">Payment details:</div>\n\n-------\n\n## Additional considerations\n\n- A label (which becomes to `<legend>` inside the fieldset) is always required.\n- Hint text can be used to offer further information or explanation for an option.\n"
|
|
4662
4662
|
},
|
|
4663
|
+
{
|
|
4664
|
+
"kind": "javascript-module",
|
|
4665
|
+
"path": "src/header/Header.ts",
|
|
4666
|
+
"declarations": [
|
|
4667
|
+
{
|
|
4668
|
+
"kind": "class",
|
|
4669
|
+
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4670
|
+
"name": "Header",
|
|
4671
|
+
"slots": [
|
|
4672
|
+
{
|
|
4673
|
+
"description": "The header content.",
|
|
4674
|
+
"name": ""
|
|
4675
|
+
},
|
|
4676
|
+
{
|
|
4677
|
+
"description": "Optional slot for buttons, toggles, etc.",
|
|
4678
|
+
"name": "action"
|
|
4679
|
+
}
|
|
4680
|
+
],
|
|
4681
|
+
"members": [
|
|
4682
|
+
{
|
|
4683
|
+
"kind": "field",
|
|
4684
|
+
"name": "actionSlot",
|
|
4685
|
+
"privacy": "private",
|
|
4686
|
+
"default": "new SlotController(this, \"action\")"
|
|
4687
|
+
},
|
|
4688
|
+
{
|
|
4689
|
+
"kind": "field",
|
|
4690
|
+
"name": "_warningLogged",
|
|
4691
|
+
"type": {
|
|
4692
|
+
"text": "boolean"
|
|
4693
|
+
},
|
|
4694
|
+
"privacy": "private",
|
|
4695
|
+
"static": true,
|
|
4696
|
+
"default": "false",
|
|
4697
|
+
"inheritedFrom": {
|
|
4698
|
+
"name": "DraftComponentMixin",
|
|
4699
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
],
|
|
4703
|
+
"mixins": [
|
|
4704
|
+
{
|
|
4705
|
+
"name": "DraftComponentMixin",
|
|
4706
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4707
|
+
}
|
|
4708
|
+
],
|
|
4709
|
+
"superclass": {
|
|
4710
|
+
"name": "LitElement",
|
|
4711
|
+
"package": "lit"
|
|
4712
|
+
},
|
|
4713
|
+
"status": "draft",
|
|
4714
|
+
"category": "structure",
|
|
4715
|
+
"tagName": "nord-header",
|
|
4716
|
+
"customElement": true
|
|
4717
|
+
}
|
|
4718
|
+
],
|
|
4719
|
+
"exports": [
|
|
4720
|
+
{
|
|
4721
|
+
"kind": "js",
|
|
4722
|
+
"name": "default",
|
|
4723
|
+
"declaration": {
|
|
4724
|
+
"name": "Header",
|
|
4725
|
+
"module": "src/header/Header.ts"
|
|
4726
|
+
}
|
|
4727
|
+
},
|
|
4728
|
+
{
|
|
4729
|
+
"kind": "custom-element-definition",
|
|
4730
|
+
"name": "nord-header",
|
|
4731
|
+
"declaration": {
|
|
4732
|
+
"name": "Header",
|
|
4733
|
+
"module": "src/header/Header.ts"
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
],
|
|
4737
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
|
|
4738
|
+
},
|
|
4663
4739
|
{
|
|
4664
4740
|
"kind": "javascript-module",
|
|
4665
4741
|
"path": "src/icon/Icon.ts",
|
|
@@ -4895,82 +4971,6 @@
|
|
|
4895
4971
|
],
|
|
4896
4972
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide additional meaning in addition to a text label.\n- Use to help users who have difficulties with reading and attention.\n- Use in places where text label doesn’t fit (remember to add an accessible label for the icon).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for decorative purposes alone.\n- Don’t use when a button’s action is already clear based on the text label.\n- Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Icon components are hidden from assistive technologies by default.\n- Use `label` property to give an accessible label for the icon and to make it visible to assistive technologies.\n"
|
|
4897
4973
|
},
|
|
4898
|
-
{
|
|
4899
|
-
"kind": "javascript-module",
|
|
4900
|
-
"path": "src/header/Header.ts",
|
|
4901
|
-
"declarations": [
|
|
4902
|
-
{
|
|
4903
|
-
"kind": "class",
|
|
4904
|
-
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4905
|
-
"name": "Header",
|
|
4906
|
-
"slots": [
|
|
4907
|
-
{
|
|
4908
|
-
"description": "The header content.",
|
|
4909
|
-
"name": ""
|
|
4910
|
-
},
|
|
4911
|
-
{
|
|
4912
|
-
"description": "Optional slot for buttons, toggles, etc.",
|
|
4913
|
-
"name": "action"
|
|
4914
|
-
}
|
|
4915
|
-
],
|
|
4916
|
-
"members": [
|
|
4917
|
-
{
|
|
4918
|
-
"kind": "field",
|
|
4919
|
-
"name": "actionSlot",
|
|
4920
|
-
"privacy": "private",
|
|
4921
|
-
"default": "new SlotController(this, \"action\")"
|
|
4922
|
-
},
|
|
4923
|
-
{
|
|
4924
|
-
"kind": "field",
|
|
4925
|
-
"name": "_warningLogged",
|
|
4926
|
-
"type": {
|
|
4927
|
-
"text": "boolean"
|
|
4928
|
-
},
|
|
4929
|
-
"privacy": "private",
|
|
4930
|
-
"static": true,
|
|
4931
|
-
"default": "false",
|
|
4932
|
-
"inheritedFrom": {
|
|
4933
|
-
"name": "DraftComponentMixin",
|
|
4934
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4935
|
-
}
|
|
4936
|
-
}
|
|
4937
|
-
],
|
|
4938
|
-
"mixins": [
|
|
4939
|
-
{
|
|
4940
|
-
"name": "DraftComponentMixin",
|
|
4941
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4942
|
-
}
|
|
4943
|
-
],
|
|
4944
|
-
"superclass": {
|
|
4945
|
-
"name": "LitElement",
|
|
4946
|
-
"package": "lit"
|
|
4947
|
-
},
|
|
4948
|
-
"status": "draft",
|
|
4949
|
-
"category": "structure",
|
|
4950
|
-
"tagName": "nord-header",
|
|
4951
|
-
"customElement": true
|
|
4952
|
-
}
|
|
4953
|
-
],
|
|
4954
|
-
"exports": [
|
|
4955
|
-
{
|
|
4956
|
-
"kind": "js",
|
|
4957
|
-
"name": "default",
|
|
4958
|
-
"declaration": {
|
|
4959
|
-
"name": "Header",
|
|
4960
|
-
"module": "src/header/Header.ts"
|
|
4961
|
-
}
|
|
4962
|
-
},
|
|
4963
|
-
{
|
|
4964
|
-
"kind": "custom-element-definition",
|
|
4965
|
-
"name": "nord-header",
|
|
4966
|
-
"declaration": {
|
|
4967
|
-
"name": "Header",
|
|
4968
|
-
"module": "src/header/Header.ts"
|
|
4969
|
-
}
|
|
4970
|
-
}
|
|
4971
|
-
],
|
|
4972
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
|
|
4973
|
-
},
|
|
4974
4974
|
{
|
|
4975
4975
|
"kind": "javascript-module",
|
|
4976
4976
|
"path": "src/input/Input.ts",
|
package/lib/Checkbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,n as r}from"./query-assigned-elements-37b095c4.js";import{r as o,$ as n,s as c}from"./lit-element-9646ab7e.js";import{e as a}from"./property-03f59dce.js";import{l as i}from"./if-defined-2a4c6dbc.js";import{n as t}from"./ref-eb5cfa10.js";import s from"./Icon.js";import{F as l}from"./FocusableMixin-98e13999.js";import{F as d}from"./FormAssociatedMixin-bfbbe389.js";import{I as p}from"./InputMixin-94d15730.js";import{s as b}from"./Component-6762b5eb.js";import{s as h}from"./FormField-b1c18e6e.js";import"./directive-helpers-e7b6bf4b.js";import"./directive-de55b00a.js";import"./state-70f38ceb.js";import"./unsafe-html-4da54dd2.js";import"./SlotController-5bfc47d1.js";import"./events-731d0007.js";import"./VisuallyHidden.js";var v=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M41.86 131.25a23.982 23.982 0 0 1-18.494-8.666L2.254 95.746a10.5 10.5 0 1 1 16.492-12.992l21 26.6a2.24 2.24 0 0 0 2.212.882 3.038 3.038 0 0 0 2.38-1.148l76.958-96.39a10.5 10.5 0 1 1 16.408 13.104L60.606 122.29A24.038 24.038 0 0 1 42 131.25z"/></svg>',title:"interface-checked-small",tags:"nordicon interface checked small symbol checkmark done ready"});const u=o`:host{display:inline-block;font-size:var(--n-font-size-m)}.n-flex{display:flex}.n-expand{flex:1}.n-input-container{position:relative}input{--n-checkbox-size:calc(var(--n-space-m) * 1.25);--n-checkbox-accent-color:var(--n-color-accent);-moz-appearance:none;-webkit-appearance:none;appearance:none;border:1px solid var(--n-checkbox-border-color,var(--n-color-border-hover));border-radius:var(--n-border-radius-s);display:block;inline-size:var(--n-checkbox-size);block-size:var(--n-checkbox-size);cursor:pointer}input:checked{--n-checkbox-border-color:var(--n-color-accent);background:var(--n-checkbox-accent-color)}input[aria-invalid]{--n-checkbox-accent-color:var(--n-color-status-danger);--n-checkbox-border-color:var(--n-checkbox-accent-color)}input:focus-visible{outline:0!important}input:focus{outline:0!important;box-shadow:0 0 0 1px var(--n-color-surface),0 0 0 3px var(--n-color-accent)}input:active{opacity:.8}:host([disabled]) label{color:var(--n-color-text-weaker);cursor:default}:host([disabled]) input{--n-checkbox-accent-color:var(--n-color-border-strong);--n-checkbox-border-color:var(--n-checkbox-accent-color);background:var(--n-checkbox-accent-color);cursor:default;opacity:1}nord-icon{display:none;position:absolute;color:var(--n-color-text-on-accent);inset-inline-start:calc(var(--n-space-s)/ 2);inset-block-start:calc(var(--n-space-s)/ 2);z-index:var(--n-index-default);pointer-events:none}input:checked+nord-icon{display:block}.n-label-container{padding-block-end:0}label{-webkit-user-select:none;user-select:none;font-weight:var(--n-font-weight)!important;line-height:var(--n-line-height-l);padding-inline-start:var(--n-space-s);cursor:pointer}.n-hint{padding-inline-start:var(--n-space-s)}.n-error{margin-block-start:calc(var(--n-space-s)/ 2);padding-inline-start:var(--n-space-s)}`;s.registerIcon(v);let m=class extends(d(p(l(c)))){constructor(){super(...arguments),this.checked=!1}get formValue(){return this.checked?this.value||"on":void 0}render(){return n`<div class="n-flex"><div class="n-input-container"><input ${t(this.focusableRef)} class="n-input" id="${this.inputId}" type="checkbox" name="${i(this.name)}" .value="${this.value}"
|
|
1
|
+
import{_ as e,n as r}from"./query-assigned-elements-37b095c4.js";import{r as o,$ as n,s as c}from"./lit-element-9646ab7e.js";import{e as a}from"./property-03f59dce.js";import{l as i}from"./if-defined-2a4c6dbc.js";import{n as t}from"./ref-eb5cfa10.js";import s from"./Icon.js";import{F as l}from"./FocusableMixin-98e13999.js";import{F as d}from"./FormAssociatedMixin-bfbbe389.js";import{I as p}from"./InputMixin-94d15730.js";import{s as b}from"./Component-6762b5eb.js";import{s as h}from"./FormField-b1c18e6e.js";import"./directive-helpers-e7b6bf4b.js";import"./directive-de55b00a.js";import"./state-70f38ceb.js";import"./unsafe-html-4da54dd2.js";import"./SlotController-5bfc47d1.js";import"./events-731d0007.js";import"./VisuallyHidden.js";var v=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M41.86 131.25a23.982 23.982 0 0 1-18.494-8.666L2.254 95.746a10.5 10.5 0 1 1 16.492-12.992l21 26.6a2.24 2.24 0 0 0 2.212.882 3.038 3.038 0 0 0 2.38-1.148l76.958-96.39a10.5 10.5 0 1 1 16.408 13.104L60.606 122.29A24.038 24.038 0 0 1 42 131.25z"/></svg>',title:"interface-checked-small",tags:"nordicon interface checked small symbol checkmark done ready"});const u=o`:host{display:inline-block;font-size:var(--n-font-size-m)}.n-flex{display:flex}.n-expand{flex:1}.n-input-container{position:relative}input{--n-checkbox-size:calc(var(--n-space-m) * 1.25);--n-checkbox-accent-color:var(--n-color-accent);-moz-appearance:none;-webkit-appearance:none;appearance:none;border:1px solid var(--n-checkbox-border-color,var(--n-color-border-hover));border-radius:var(--n-border-radius-s);display:block;inline-size:var(--n-checkbox-size);block-size:var(--n-checkbox-size);cursor:pointer}input:checked{--n-checkbox-border-color:var(--n-color-accent);background:var(--n-checkbox-accent-color)}input[aria-invalid]{--n-checkbox-accent-color:var(--n-color-status-danger);--n-checkbox-border-color:var(--n-checkbox-accent-color)}input:focus-visible{outline:0!important}input:focus{outline:0!important;box-shadow:0 0 0 1px var(--n-color-surface),0 0 0 3px var(--n-color-accent)}input:active{opacity:.8}:host([disabled]) label{color:var(--n-color-text-weaker);cursor:default}:host([disabled]) input{--n-checkbox-accent-color:var(--n-color-border-strong);--n-checkbox-border-color:var(--n-checkbox-accent-color);background:var(--n-checkbox-accent-color);cursor:default;opacity:1}nord-icon{display:none;position:absolute;color:var(--n-color-text-on-accent);inset-inline-start:calc(var(--n-space-s)/ 2);inset-block-start:calc(var(--n-space-s)/ 2);z-index:var(--n-index-default);pointer-events:none}input:checked+nord-icon{display:block}.n-label-container{padding-block-end:0}label{-webkit-user-select:none;user-select:none;font-weight:var(--n-font-weight)!important;line-height:var(--n-line-height-l);padding-inline-start:var(--n-space-s);cursor:pointer}.n-hint{padding-inline-start:var(--n-space-s)}.n-error{margin-block-start:calc(var(--n-space-s)/ 2);padding-inline-start:var(--n-space-s)}`;s.registerIcon(v);let m=class extends(d(p(l(c)))){constructor(){super(...arguments),this.checked=!1}get formValue(){return this.checked?this.value||"on":void 0}render(){return n`<div class="n-flex"><div class="n-input-container"><input ${t(this.focusableRef)} class="n-input" id="${this.inputId}" type="checkbox" name="${i(this.name)}" .value="${this.value}" .checked="${this.checked}" ?disabled="${this.disabled}" ?required="${this.required}" aria-describedby="${i(this.getDescribedBy())}" aria-invalid="${i(this.getInvalid())}" @change="${this.handleChange}"><nord-icon name="interface-checked-small" size="s"></nord-icon></div><div class="n-expand">${this.renderLabel()} ${this.renderError()}</div></div>`}handleChange(e){const r=e.target;this.checked=r.checked,super.handleChange(e)}};m.styles=[b,h,u],e([a({type:Boolean})],m.prototype,"checked",void 0),m=e([r("nord-checkbox")],m);var f=m;export{f as default};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
package/lib/Checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../icons/lib/assets/interface-checked-small.js","../src/checkbox/Checkbox.ts"],"sourcesContent":["export default '<svg viewBox=\"0 0 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M41.86 131.25a23.982 23.982 0 0 1-18.494-8.666L2.254 95.746a10.5 10.5 0 1 1 16.492-12.992l21 26.6a2.24 2.24 0 0 0 2.212.882 3.038 3.038 0 0 0 2.38-1.148l76.958-96.39a10.5 10.5 0 1 1 16.408 13.104L60.606 122.29A24.038 24.038 0 0 1 42 131.25z\"/></svg>'\nexport const title = \"interface-checked-small\"\nexport const tags = \"nordicon interface checked small symbol checkmark done ready\"\n","import { html, LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\nimport * as checkedIcon from \"@nordhealth/icons/lib/assets/interface-checked-small.js\"\n\nimport Icon from \"../icon/Icon.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport style from \"./Checkbox.css\"\n\nIcon.registerIcon(checkedIcon)\n\n/**\n * Checkboxes allow user to choose one or more options from a limited set of options.\n * If you have more than 10 options, please use Select component instead.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n */\n@customElement(\"nord-checkbox\")\nexport default class Checkbox extends FormAssociatedMixin(InputMixin(FocusableMixin(LitElement))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || \"on\" : undefined\n }\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ type: Boolean }) checked: boolean = false\n\n render() {\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../icons/lib/assets/interface-checked-small.js","../src/checkbox/Checkbox.ts"],"sourcesContent":["export default '<svg viewBox=\"0 0 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M41.86 131.25a23.982 23.982 0 0 1-18.494-8.666L2.254 95.746a10.5 10.5 0 1 1 16.492-12.992l21 26.6a2.24 2.24 0 0 0 2.212.882 3.038 3.038 0 0 0 2.38-1.148l76.958-96.39a10.5 10.5 0 1 1 16.408 13.104L60.606 122.29A24.038 24.038 0 0 1 42 131.25z\"/></svg>'\nexport const title = \"interface-checked-small\"\nexport const tags = \"nordicon interface checked small symbol checkmark done ready\"\n","import { html, LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\nimport * as checkedIcon from \"@nordhealth/icons/lib/assets/interface-checked-small.js\"\n\nimport Icon from \"../icon/Icon.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport style from \"./Checkbox.css\"\n\nIcon.registerIcon(checkedIcon)\n\n/**\n * Checkboxes allow user to choose one or more options from a limited set of options.\n * If you have more than 10 options, please use Select component instead.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n */\n@customElement(\"nord-checkbox\")\nexport default class Checkbox extends FormAssociatedMixin(InputMixin(FocusableMixin(LitElement))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || \"on\" : undefined\n }\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ type: Boolean }) checked: boolean = false\n\n render() {\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n @change=${this.handleChange}\n />\n <nord-icon name=\"interface-checked-small\" size=\"s\"></nord-icon>\n </div>\n <div class=\"n-expand\">${this.renderLabel()} ${this.renderError()}</div>\n </div>\n `\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n super.handleChange(e)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-checkbox\": Checkbox\n }\n}\n"],"names":["Icon","registerIcon","checkedIcon","Checkbox","FormAssociatedMixin","InputMixin","FocusableMixin","LitElement","constructor","this","formValue","checked","value","undefined","render","html","ref","focusableRef","inputId","ifDefined","name","disabled","required","getDescribedBy","getInvalid","handleChange","renderLabel","renderError","e","target","super","componentStyle","formFieldStyle","style","__decorate","property","type","Boolean","customElement"],"mappings":"gxBAAe,6VACM,+BACD,w1DCapBA,EAAKC,aAAaC,GAalB,IAAqBC,EAArB,cAAsCC,EAAoBC,EAAWC,EAAeC,MAApFC,kCAU+BC,cAAmB,EAPzBC,gBACrB,OAAOD,KAAKE,QAAUF,KAAKG,OAAS,UAAOC,EAQ7CC,SACE,OAAOC,CAAI,6DAIDC,EAAIP,KAAKQ,qCAENR,KAAKS,kCAEHC,EAAUV,KAAKW,kBACbX,KAAKG,oBACHH,KAAKE,uBACJF,KAAKY,wBACLZ,KAAKa,+BACEH,EAAUV,KAAKc,oCACnBJ,EAAUV,KAAKe,2BACpBf,KAAKgB,4GAIKhB,KAAKiB,iBAAiBjB,KAAKkB,4BAK/CF,aAAaG,GACrB,MAAMC,EAASD,EAAEC,OACjBpB,KAAKE,QAAUkB,EAAOlB,QACtBmB,MAAML,aAAaG,KAvCdzB,SAAS,CAAC4B,EAAgBC,EAAgBC,GASpBC,GAA5BC,EAAS,CAAEC,KAAMC,yCAVClC,KADpBmC,EAAc,kBACMnC,SAAAA"}
|
package/lib/Layout.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as n,n as t}from"./query-assigned-elements-37b095c4.js";import{r as a,$ as e,s as o}from"./lit-element-9646ab7e.js";import{D as i}from"./DraftComponentMixin-9e4b7b34.js";import{s}from"./Component-6762b5eb.js";const
|
|
1
|
+
import{_ as n,n as t}from"./query-assigned-elements-37b095c4.js";import{r as a,$ as e,s as o}from"./lit-element-9646ab7e.js";import{D as i}from"./DraftComponentMixin-9e4b7b34.js";import{s}from"./Component-6762b5eb.js";const r=a`:host{--n-nav-width:250px;background:var(--n-color-background);font-size:var(--n-font-size-m);color:var(--n-color-text)}.n-layout-main,.n-layout-nav{background:var(--n-color-background);inset-block-start:0;min-block-size:100%;position:absolute}.n-layout-nav{position:fixed;transition:transform .3s ease;user-select:none;inline-size:var(--n-nav-width);z-index:2;inset-block-start:0;inset-inline-start:0;inset-block-end:0}@media (max-width:768px){.n-layout-nav{transform:translateX(-100%)}}.n-layout-main{inset-inline-end:0;z-index:1;transition:width .2s ease;inline-size:calc(100% - var(--n-nav-width))}@media (max-width:768px){.n-layout-main{inline-size:100%}}main{padding:var(--n-space-l)}::slotted(a){color:var(--n-color-text-link);text-decoration:underline}::slotted(a:hover){text-decoration:none}`;let l=class extends(i(o)){render(){return e`<div class="n-layout"><div class="n-layout-nav"><slot name="nav"></slot></div><div class="n-layout-main"><slot name="header"></slot><main><slot></slot></main></div></div>`}};l.styles=[s,r],l=n([t("nord-layout")],l);var d=l;export{d as default};
|
|
2
2
|
//# sourceMappingURL=Layout.js.map
|
package/lib/Layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sources":["../src/layout/Layout.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Layout.css\"\n\n/**\n * Layout component is used to create the main layout of an app. Layout\n * currently comes with one main configuration: two-column.\n *\n * @status draft\n * @category structure\n * @slot - The default main section content.\n * @slot nav - Used to place content inside the navigation sidebar.\n * @slot header - Used to place content inside the header section.\n */\n@customElement(\"nord-layout\")\nexport default class Layout extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-layout\">\n <div class=\"n-layout-nav\">\n <slot name=\"nav\"></slot>\n </div>\n <div class=\"n-layout-main\">\n <slot name=\"header\"></slot>\n <main>\n <slot></slot>\n </main>\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-layout\": Layout\n }\n}\n"],"names":["Layout","DraftComponentMixin","LitElement","render","html","componentStyle","style","customElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layout.js","sources":["../src/layout/Layout.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Layout.css\"\n\n/**\n * Layout component is used to create the main layout of an app. Layout\n * currently comes with one main configuration: two-column.\n *\n * @status draft\n * @category structure\n * @slot - The default main section content.\n * @slot nav - Used to place content inside the navigation sidebar.\n * @slot header - Used to place content inside the header section.\n */\n@customElement(\"nord-layout\")\nexport default class Layout extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-layout\">\n <div class=\"n-layout-nav\">\n <slot name=\"nav\"></slot>\n </div>\n <div class=\"n-layout-main\">\n <slot name=\"header\"></slot>\n <main>\n <slot></slot>\n </main>\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-layout\": Layout\n }\n}\n"],"names":["Layout","DraftComponentMixin","LitElement","render","html","componentStyle","style","customElement"],"mappings":"sgCAkBA,IAAqBA,EAArB,cAAoCC,EAAoBC,IAGtDC,SACE,OAAOC,CAAI,+KAHNJ,SAAS,CAACK,EAAgBC,GADdN,KADpBO,EAAc,gBACMP,SAAAA"}
|