@helsenorge/designsystem-react 3.1.4 → 3.2.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +551 -590
- package/Checkbox.js +1 -1
- package/Checkbox.js.map +1 -1
- package/Input.js +1 -1
- package/Input.js.map +1 -1
- package/Label.js +2 -0
- package/Label.js.map +1 -0
- package/Panel.js +1 -1
- package/Panel.js.map +1 -1
- package/README.md +0 -8
- package/RadioButton.js +1 -1
- package/RadioButton.js.map +1 -1
- package/Select.js +1 -1
- package/Select.js.map +1 -1
- package/StatusDot.js +1 -1
- package/StatusDot.js.map +1 -1
- package/Textarea.js +1 -1
- package/Textarea.js.map +1 -1
- package/components/Button/componentdata.json +1 -1
- package/components/Checkbox/Checkbox.d.ts +3 -3
- package/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/components/Checkbox/componentdata.json +1 -1
- package/components/Checkbox/index.js +1 -1
- package/components/Checkbox/styles.module.scss +223 -59
- package/components/Checkbox/styles.module.scss.d.ts +25 -3
- package/components/Dropdown/componentdata.json +1 -1
- package/components/ErrorWrapper/componentdata.json +1 -1
- package/components/Expander/componentdata.json +1 -1
- package/components/FormExample/FormExample.d.ts.map +1 -1
- package/components/FormExample/index.js +3 -3
- package/components/FormExample/index.js.map +1 -1
- package/components/FormGroup/index.js +1 -1
- package/components/HelpBubbleExample/componentdata.json +1 -1
- package/components/HighlightBox/componentdata.json +1 -1
- package/components/Input/Input.d.ts +2 -8
- package/components/Input/Input.d.ts.map +1 -1
- package/components/Input/componentdata.json +1 -1
- package/components/Input/index.js +1 -1
- package/components/Input/styles.module.scss.d.ts +0 -3
- package/components/Label/Label.d.ts +41 -0
- package/components/Label/Label.d.ts.map +1 -0
- package/components/Label/SubLabel.d.ts +17 -0
- package/components/Label/SubLabel.d.ts.map +1 -0
- package/components/Label/componentdata.json +1 -0
- package/components/Label/index.d.ts +5 -0
- package/components/Label/index.d.ts.map +1 -0
- package/components/Label/index.js +2 -0
- package/components/Label/index.js.map +1 -0
- package/components/Label/styles.module.scss +66 -0
- package/components/Label/styles.module.scss.d.ts +17 -0
- package/components/Panel/Panel.d.ts +2 -0
- package/components/Panel/Panel.d.ts.map +1 -1
- package/components/Panel/componentdata.json +1 -1
- package/components/Panel/styles.module.scss +65 -2
- package/components/Panel/styles.module.scss.d.ts +7 -0
- package/components/PopMenu/componentdata.json +1 -1
- package/components/RadioButton/RadioButton.d.ts +3 -3
- package/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/components/RadioButton/componentdata.json +1 -1
- package/components/RadioButton/index.js +1 -1
- package/components/RadioButton/styles.module.scss +228 -52
- package/components/RadioButton/styles.module.scss.d.ts +15 -3
- package/components/Select/Select.d.ts +2 -2
- package/components/Select/Select.d.ts.map +1 -1
- package/components/Select/componentdata.json +1 -1
- package/components/Select/index.js +1 -1
- package/components/Select/styles.module.scss +0 -22
- package/components/Select/styles.module.scss.d.ts +0 -3
- package/components/ServiceMessage/ServiceMessage.d.ts.map +1 -1
- package/components/ServiceMessage/index.js +1 -1
- package/components/ServiceMessage/index.js.map +1 -1
- package/components/ServiceMessage/styles.module.scss +18 -0
- package/components/ServiceMessage/styles.module.scss.d.ts +4 -0
- package/components/StatusDot/StatusDot.d.ts +9 -0
- package/components/StatusDot/StatusDot.d.ts.map +1 -1
- package/components/StatusDot/componentdata.json +1 -1
- package/components/StatusDot/index.js +1 -1
- package/components/StatusDot/styles.module.scss +14 -3
- package/components/StatusDot/styles.module.scss.d.ts +1 -0
- package/components/Step/componentdata.json +1 -1
- package/components/Table/Table.d.ts.map +1 -1
- package/components/Table/TableBody/TableBody.d.ts +1 -1
- package/components/Table/TableBody/TableBody.d.ts.map +1 -1
- package/components/Table/TableCell/TableCell.d.ts +1 -1
- package/components/Table/TableCell/TableCell.d.ts.map +1 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.d.ts.map +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCell.d.ts +2 -2
- package/components/Table/TableExpanderCell/TableExpanderCell.d.ts.map +1 -1
- package/components/Table/TableHead/TableHead.d.ts +1 -1
- package/components/Table/TableHead/TableHead.d.ts.map +1 -1
- package/components/Table/TableHeadCell/TableHeadCell.d.ts +1 -1
- package/components/Table/TableHeadCell/TableHeadCell.d.ts.map +1 -1
- package/components/Table/TableRow/componentdata.json +1 -1
- package/components/Table/index.js +1 -1
- package/components/Table/index.js.map +1 -1
- package/components/Table/styles.module.scss +0 -2
- package/components/Table/utils.d.ts +8 -0
- package/components/Table/utils.d.ts.map +1 -1
- package/components/Tag/componentdata.json +1 -1
- package/components/Textarea/Textarea.d.ts +2 -6
- package/components/Textarea/Textarea.d.ts.map +1 -1
- package/components/Textarea/componentdata.json +1 -1
- package/components/Textarea/index.js +1 -1
- package/components/Textarea/styles.module.scss.d.ts +0 -3
- package/components/Tooltip/TooltipWord/styles.module.scss +4 -1
- package/components/Tooltip/componentdata.json +1 -1
- package/components/TooltipExample/componentdata.json +1 -1
- package/components/Validation/index.js +1 -1
- package/constants.d.ts +2 -0
- package/constants.d.ts.map +1 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/hooks/usePseudoClasses.d.ts +12 -0
- package/hooks/usePseudoClasses.d.ts.map +1 -0
- package/hooks/usePseudoClasses.js +2 -0
- package/hooks/usePseudoClasses.js.map +1 -0
- package/package.json +1 -1
- package/scss/_input.scss +6 -28
- package/scss/_spacers.scss +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"
|
|
1
|
+
{"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"string & ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i tooltip","name":"description","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"
|
|
1
|
+
{"props":{"children":{"defaultValue":null,"description":"Ordet som skal ha en tilhørende tooltip","name":"children","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"string & ReactNode"}},"description":{"defaultValue":null,"description":"Teksten som skal vises i tooltip","name":"description","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":true,"type":{"name":"ReactNode"}},"testId":{"defaultValue":null,"description":"Valgfri test-id","name":"testId","parent":{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"},"declarations":[{"fileName":"designsystem/src/components/Tooltip/Tooltip.tsx","name":"TooltipProps"}],"required":false,"type":{"name":"string"}}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as t}from"../../Validation.js";import{a as
|
|
1
|
+
import{V as t}from"../../Validation.js";import{a as Y}from"../../Validation.js";import"react";import"classnames";import"../../constants.js";import"../../FormGroup.js";import"../../utils/component.js";import"../../Checkbox.js";import"../../hooks/usePseudoClasses.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/grid.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Icon.js";import"../../hooks/useUuid.js";import"../Icons/Check.js";import"../../Label.js";import"../../Spacer.js";import"../Spacer/styles.module.scss";import"../Label/styles.module.scss";import"../../StatusDot.js";import"../../hooks/useBreakpoint.js";import"../Icons/Attachment.js";import"../Icons/Group.js";import"../Icons/NoAccess.js";import"../Icons/Undo.js";import"../StatusDot/styles.module.scss";import"../Checkbox/styles.module.scss";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../../FormLayout.js";import"../FormLayout/styles.module.scss";import"../../Input.js";import"../../MaxCharacters.js";import"../MaxCharacters/styles.module.scss";import"../Input/styles.module.scss";import"../../RadioButton.js";import"../RadioButton/styles.module.scss";import"../../Select.js";import"../Icons/ChevronDown.js";import"../Select/styles.module.scss";import"../../Title.js";import"../Title/styles.module.scss";import"../FormGroup/styles.module.scss";import"./styles.module.scss";export{Y as Validation,t as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/constants.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export declare enum AnalyticsId {
|
|
|
68
68
|
HighlightBox = "highlight-box",
|
|
69
69
|
Icon = "icon",
|
|
70
70
|
Input = "input",
|
|
71
|
+
Label = "label",
|
|
71
72
|
Link = "link",
|
|
72
73
|
LinkList = "link-list",
|
|
73
74
|
List = "list",
|
|
@@ -86,6 +87,7 @@ export declare enum AnalyticsId {
|
|
|
86
87
|
Slider = "slider",
|
|
87
88
|
Spacer = "spacer",
|
|
88
89
|
StatusDot = "status-dot",
|
|
90
|
+
Sublabel = "sublabel",
|
|
89
91
|
Table = "table",
|
|
90
92
|
Tag = "tag",
|
|
91
93
|
TagList = "tag-list",
|
package/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;CACb;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;IACf,eAAe,QAAQ;CACxB;AAED,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAA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,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,iBAAiB,uBAAuB;IACxC,KAAK,UAAU;IACf,SAAS,eAAe;IACxB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,SAAS,eAAe;IACxB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,aAAa;IACpB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ"}
|
package/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(e||{}),o=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(o||{});const
|
|
1
|
+
var e=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(e||{}),o=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(o||{});const g=12;var p=(r=>(r.onwhite="onwhite",r.ongrey="ongrey",r.onblueberry="onblueberry",r.ondark="ondark",r.oninvalid="oninvalid",r))(p||{}),a=(r=>(r.normal="normal",r.bigform="bigform",r))(a||{}),u=(r=>(r.AnchorLink="anchor-link",r.Avatar="avatar",r.Badge="badge",r.Button="button",r.Checkbox="checkbox",r.Close="close",r.Dropdown="dropdown",r.Duolist="duolist",r.Expander="expander",r.ExpanderList="expander-list",r.ExpanderListExpander="expander-list-expander",r.ExpanderHierarchy="expander-hierarchy",r.ExpanderHierarchyExpander="expander-hierarchy-expander",r.FormGroup="form-group",r.FormLayout="form-layout",r.HelpBubble="help-bubble",r.HighlightBox="highlight-box",r.Icon="icon",r.Input="input",r.Label="label",r.Link="link",r.LinkList="link-list",r.List="list",r.Loader="loader",r.Logo="logo",r.Modal="modal",r.NotificationPanel="notification-panel",r.Panel="panel",r.PanelList="panel-list",r.PopMenu="pop-menu",r.PopOver="pop-over",r.Portal="portal",r.Stepper="stepper",r.RadioButton="radio-button",r.Select="select",r.Slider="slider",r.Spacer="spacer",r.StatusDot="status-dot",r.Sublabel="sublabel",r.Table="table",r.Tag="tag",r.TagList="tag-list",r.Textarea="textarea",r.Tile="tile",r.Title="title",r.Tooltip="tooltip",r.Validation="validation",r))(u||{}),l=(r=>(r.Enter="Enter",r.Escape="Escape",r.ArrowDown="ArrowDown",r.ArrowUp="ArrowUp",r.Home="Home",r.End="End",r))(l||{});export{g as AVERAGE_CHARACTER_WIDTH_PX,u as AnalyticsId,p as FormMode,a as FormVariant,e as IconSize,l as KeyboardEventKey,o as ZIndex};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
package/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n Expander = 'expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n Stepper = 'stepper',\n RadioButton = 'radio-button',\n Select = 'select',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,EAAV,EAAA,UACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,GAAT,EAAA,SANUA,IAAAA,GAAA,CAAA,CAAA,EASAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,IAAR,EAAA,QACAA,EAAAA,EAAA,gBAAkB,GAAlB,EAAA,kBAFUA,IAAAA,GAAA,CAAA,CAAA,EAKL,MAAMC,EAA6B,GAyC9B,IAAAC,GAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,UAAY,YALFA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,cACbA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,aAAe,gBACfA,EAAA,qBAAuB,yBACvBA,EAAA,kBAAoB,qBACpBA,EAAA,0BAA4B,8BAC5BA,EAAA,UAAY,aACZA,EAAA,WAAa,cACbA,EAAA,WAAa,cACbA,EAAA,aAAe,gBACfA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,SAAW,YACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,kBAAoB,qBACpBA,EAAA,MAAQ,QACRA,EAAA,UAAY,aACZA,EAAA,QAAU,WACVA,EAAA,QAAU,WACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,YAAc,eACdA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,aACZA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,QAAU,WACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,WAAa,
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n Expander = 'expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Label = 'label',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n Stepper = 'stepper',\n RadioButton = 'radio-button',\n Select = 'select',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Sublabel = 'sublabel',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY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,WACVA,EAAA,QAAU,WACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,YAAc,eACdA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,aACZA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,QAAU,WACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,WAAa,aA/CHA,IAAAA,GAAA,CAAA,CAAA,EAkDAC,GAAAA,IACVA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MANIA,IAAAA,GAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Få vite når et element hovres over eller mottar fokus.
|
|
4
|
+
* @param ref Element som skal observeres
|
|
5
|
+
* @returns Objekt med ref og om objekt er hovered/focused
|
|
6
|
+
*/
|
|
7
|
+
export declare const usePseudoClasses: <T extends HTMLElement | SVGElement>(ref?: RefObject<T> | null | undefined) => {
|
|
8
|
+
refObject: RefObject<T>;
|
|
9
|
+
isHovered: boolean;
|
|
10
|
+
isFocused: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=usePseudoClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePseudoClasses.d.ts","sourceRoot":"","sources":["../../src/hooks/usePseudoClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;eAEY,OAAO;eAAa,OAAO;CAyBnE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useRef as I,useState as L,useEffect as p}from"react";const M=t=>{const e=t||I(null),[h,s]=L(!1),[F,n]=L(!1);return p(()=>{var a,d,v,i;const r=()=>s(!0),u=()=>s(!1),o=()=>n(!0),c=()=>n(!1);return(a=e.current)==null||a.addEventListener("mouseenter",r),(d=e.current)==null||d.addEventListener("mouseleave",u),(v=e.current)==null||v.addEventListener("focusin",o),(i=e.current)==null||i.addEventListener("focusout",c),()=>{var l,f,m,E;(l=e.current)==null||l.removeEventListener("mouseenter",r),(f=e.current)==null||f.removeEventListener("mouseleave",u),(m=e.current)==null||m.removeEventListener("focusin",o),(E=e.current)==null||E.removeEventListener("focusout",c)}},[e]),{refObject:e,isHovered:h,isFocused:F}};export{M as usePseudoClasses};
|
|
2
|
+
//# sourceMappingURL=usePseudoClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePseudoClasses.js","sources":["../../src/hooks/usePseudoClasses.ts"],"sourcesContent":["import { useRef, useEffect, useState, RefObject } from 'react';\n\n/**\n * Få vite når et element hovres over eller mottar fokus.\n * @param ref Element som skal observeres\n * @returns Objekt med ref og om objekt er hovered/focused\n */\nexport const usePseudoClasses = <T extends HTMLElement | SVGElement>(\n ref?: RefObject<T> | null\n): { refObject: RefObject<T>; isHovered: boolean; isFocused: boolean } => {\n const refObject = ref ? ref : useRef<T>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n useEffect(() => {\n const handleMouseEnter = (): void => setIsHovered(true);\n const handleMouseLeave = (): void => setIsHovered(false);\n const handleFocusIn = (): void => setIsFocused(true);\n const handleFocusOut = (): void => setIsFocused(false);\n\n refObject.current?.addEventListener('mouseenter', handleMouseEnter);\n refObject.current?.addEventListener('mouseleave', handleMouseLeave);\n refObject.current?.addEventListener('focusin', handleFocusIn);\n refObject.current?.addEventListener('focusout', handleFocusOut);\n\n return (): void => {\n refObject.current?.removeEventListener('mouseenter', handleMouseEnter);\n refObject.current?.removeEventListener('mouseleave', handleMouseLeave);\n refObject.current?.removeEventListener('focusin', handleFocusIn);\n refObject.current?.removeEventListener('focusout', handleFocusOut);\n };\n }, [refObject]);\n\n return { refObject, isHovered, isFocused };\n};\n"],"names":["usePseudoClasses","ref","refObject","useRef","isHovered","setIsHovered","useState","isFocused","setIsFocused","useEffect","handleMouseEnter","handleMouseLeave","handleFocusIn","handleFocusOut","_a","_b","_c","_d"],"mappings":"4DAOa,MAAAA,EACXC,GACwE,CACxE,MAAMC,EAAYD,GAAYE,EAAU,IAAI,EACtC,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAC1C,CAACC,EAAWC,CAAY,EAAIF,EAAS,EAAK,EAEhD,OAAAG,EAAU,IAAM,aACR,MAAAC,EAAmB,IAAYL,EAAa,EAAI,EAChDM,EAAmB,IAAYN,EAAa,EAAK,EACjDO,EAAgB,IAAYJ,EAAa,EAAI,EAC7CK,EAAiB,IAAYL,EAAa,EAAK,EAE3C,OAAAM,EAAAZ,EAAA,UAAA,MAAAY,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAb,EAAA,UAAA,MAAAa,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAd,EAAA,UAAA,MAAAc,EAAS,iBAAiB,UAAWJ,IACrCK,EAAAf,EAAA,UAAA,MAAAe,EAAS,iBAAiB,WAAYJ,GAEzC,IAAY,cACPC,EAAAZ,EAAA,UAAA,MAAAY,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAb,EAAA,UAAA,MAAAa,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAd,EAAA,UAAA,MAAAc,EAAS,oBAAoB,UAAWJ,IACxCK,EAAAf,EAAA,UAAA,MAAAe,EAAS,oBAAoB,WAAYJ,EAAc,CACnE,EACC,CAACX,CAAS,CAAC,EAEP,CAAE,UAAAA,EAAW,UAAAE,EAAW,UAAAG,EACjC"}
|
package/package.json
CHANGED
package/scss/_input.scss
CHANGED
|
@@ -2,28 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
@mixin input-wrapper {
|
|
4
4
|
width: 100%;
|
|
5
|
-
|
|
6
|
-
&__label-wrapper {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
line-height: getSpacer(m);
|
|
10
|
-
font-size: $font-size-sm;
|
|
11
|
-
font-weight: 600;
|
|
12
|
-
padding-bottom: getSpacer(xs);
|
|
13
|
-
|
|
14
|
-
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
15
|
-
line-height: getSpacer(l);
|
|
16
|
-
font-size: $font-size-md;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&--on-dark {
|
|
20
|
-
color: $white;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&__after-label-children {
|
|
25
|
-
padding-left: 0.75rem;
|
|
26
|
-
}
|
|
27
5
|
}
|
|
28
6
|
|
|
29
7
|
@mixin content-wrapper {
|
|
@@ -54,6 +32,12 @@
|
|
|
54
32
|
}
|
|
55
33
|
}
|
|
56
34
|
|
|
35
|
+
&:focus-within {
|
|
36
|
+
background: $white;
|
|
37
|
+
border-color: $neutral900;
|
|
38
|
+
box-shadow: 0 0 0 2px $neutral900;
|
|
39
|
+
}
|
|
40
|
+
|
|
57
41
|
&:hover {
|
|
58
42
|
background: $neutral50;
|
|
59
43
|
border-color: $neutral700;
|
|
@@ -65,12 +49,6 @@
|
|
|
65
49
|
}
|
|
66
50
|
}
|
|
67
51
|
|
|
68
|
-
&:focus-within {
|
|
69
|
-
background: $white;
|
|
70
|
-
border-color: $neutral900;
|
|
71
|
-
box-shadow: 0 0 0 2px $neutral900;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
52
|
&--on-blueberry {
|
|
75
53
|
border-color: $blueberry500;
|
|
76
54
|
|