@fremtind/jokul 0.45.3 → 0.47.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.
Files changed (120) hide show
  1. package/build/build-stats.html +1 -1
  2. package/build/cjs/components/cookie-consent/CookieConsent.cjs +1 -1
  3. package/build/cjs/components/cookie-consent/CookieConsent.cjs.map +1 -1
  4. package/build/cjs/components/cookie-consent/CookieConsentContext.cjs +1 -1
  5. package/build/cjs/components/cookie-consent/CookieConsentContext.cjs.map +1 -1
  6. package/build/cjs/components/cookie-consent/cookieConsentUtils.cjs +1 -1
  7. package/build/cjs/components/cookie-consent/cookieConsentUtils.cjs.map +1 -1
  8. package/build/cjs/components/cookie-consent/cookieConsentUtils.d.cts +2 -1
  9. package/build/cjs/components/cookie-consent/types.d.cts +2 -0
  10. package/build/cjs/components/feedback/Feedback.cjs.map +1 -1
  11. package/build/cjs/components/feedback/Feedback.d.cts +1 -1
  12. package/build/cjs/components/feedback/feedbackContext.cjs.map +1 -1
  13. package/build/cjs/components/feedback/feedbackContext.d.cts +1 -1
  14. package/build/cjs/components/feedback/questions/AddonQuestion.cjs +1 -1
  15. package/build/cjs/components/feedback/questions/AddonQuestion.cjs.map +1 -1
  16. package/build/cjs/components/feedback/questions/TextQuestion.cjs +1 -1
  17. package/build/cjs/components/feedback/questions/TextQuestion.cjs.map +1 -1
  18. package/build/cjs/components/feedback/utils.cjs +1 -1
  19. package/build/cjs/components/feedback/utils.cjs.map +1 -1
  20. package/build/cjs/components/index.cjs +1 -1
  21. package/build/cjs/components/index.d.cts +1 -0
  22. package/build/cjs/components/{text-input → text-area}/BaseTextArea.cjs +1 -1
  23. package/build/{es/components/text-input/BaseTextArea.js.map → cjs/components/text-area/BaseTextArea.cjs.map} +1 -1
  24. package/build/{es/components/text-input/TextArea.js.map → cjs/components/text-area/TextArea.cjs.map} +1 -1
  25. package/build/cjs/components/text-area/index.cjs +2 -0
  26. package/build/cjs/components/text-area/index.cjs.map +1 -0
  27. package/build/cjs/components/text-area/index.d.cts +3 -0
  28. package/build/cjs/components/text-area/types.cjs +2 -0
  29. package/build/cjs/components/text-area/types.cjs.map +1 -0
  30. package/build/cjs/components/text-area/types.d.cts +28 -0
  31. package/build/cjs/components/text-input/index.cjs +1 -1
  32. package/build/cjs/components/text-input/index.d.cts +1 -3
  33. package/build/cjs/components/text-input/types.d.cts +1 -27
  34. package/build/cjs/index.cjs +1 -1
  35. package/build/es/components/cookie-consent/CookieConsent.js +1 -1
  36. package/build/es/components/cookie-consent/CookieConsent.js.map +1 -1
  37. package/build/es/components/cookie-consent/CookieConsentContext.js +1 -1
  38. package/build/es/components/cookie-consent/CookieConsentContext.js.map +1 -1
  39. package/build/es/components/cookie-consent/cookieConsentUtils.d.ts +2 -1
  40. package/build/es/components/cookie-consent/cookieConsentUtils.js +1 -1
  41. package/build/es/components/cookie-consent/cookieConsentUtils.js.map +1 -1
  42. package/build/es/components/cookie-consent/types.d.ts +2 -0
  43. package/build/es/components/feedback/Feedback.d.ts +1 -1
  44. package/build/es/components/feedback/Feedback.js.map +1 -1
  45. package/build/es/components/feedback/feedbackContext.d.ts +1 -1
  46. package/build/es/components/feedback/feedbackContext.js.map +1 -1
  47. package/build/es/components/feedback/questions/AddonQuestion.js +1 -1
  48. package/build/es/components/feedback/questions/AddonQuestion.js.map +1 -1
  49. package/build/es/components/feedback/questions/TextQuestion.js +1 -1
  50. package/build/es/components/feedback/questions/TextQuestion.js.map +1 -1
  51. package/build/es/components/feedback/utils.js +1 -1
  52. package/build/es/components/feedback/utils.js.map +1 -1
  53. package/build/es/components/index.d.ts +1 -0
  54. package/build/es/components/index.js +1 -1
  55. package/build/es/components/{text-input → text-area}/BaseTextArea.js +1 -1
  56. package/build/es/components/text-area/BaseTextArea.js.map +1 -0
  57. package/build/es/components/text-area/TextArea.js.map +1 -0
  58. package/build/es/components/text-area/index.d.ts +3 -0
  59. package/build/es/components/text-area/index.js +2 -0
  60. package/build/es/components/text-area/index.js.map +1 -0
  61. package/build/es/components/text-area/types.d.ts +28 -0
  62. package/build/es/components/text-area/types.js +2 -0
  63. package/build/es/components/text-area/types.js.map +1 -0
  64. package/build/es/components/text-input/index.d.ts +1 -3
  65. package/build/es/components/text-input/index.js +1 -1
  66. package/build/es/components/text-input/types.d.ts +1 -27
  67. package/build/es/index.js +1 -1
  68. package/package.json +13 -2
  69. package/styles/components/button/button.css +2 -2
  70. package/styles/components/button/button.min.css +1 -1
  71. package/styles/components/checkbox/checkbox.css +4 -4
  72. package/styles/components/checkbox/checkbox.min.css +1 -1
  73. package/styles/components/checkbox-panel/checkbox-panel.css +2 -2
  74. package/styles/components/checkbox-panel/checkbox-panel.min.css +1 -1
  75. package/styles/components/countdown/countdown.css +2 -2
  76. package/styles/components/countdown/countdown.min.css +1 -1
  77. package/styles/components/feedback/feedback.css +2 -2
  78. package/styles/components/feedback/feedback.min.css +1 -1
  79. package/styles/components/input-group/input-group.css +2 -2
  80. package/styles/components/input-group/input-group.min.css +1 -1
  81. package/styles/components/loader/loader.css +6 -6
  82. package/styles/components/loader/loader.min.css +1 -1
  83. package/styles/components/loader/skeleton-loader.css +5 -5
  84. package/styles/components/loader/skeleton-loader.min.css +1 -1
  85. package/styles/components/message/message.css +2 -2
  86. package/styles/components/message/message.min.css +1 -1
  87. package/styles/components/progress-bar/progress-bar.css +1 -1
  88. package/styles/components/progress-bar/progress-bar.min.css +1 -1
  89. package/styles/components/radio-button/radio-button.css +2 -2
  90. package/styles/components/radio-button/radio-button.min.css +1 -1
  91. package/styles/components/radio-panel/radio-panel.css +2 -2
  92. package/styles/components/radio-panel/radio-panel.min.css +1 -1
  93. package/styles/components/system-message/system-message.css +2 -2
  94. package/styles/components/system-message/system-message.min.css +1 -1
  95. package/styles/components/text-area/_index.scss +5 -0
  96. package/styles/components/text-area/text-area.css +415 -0
  97. package/styles/components/text-area/text-area.min.css +1 -0
  98. package/styles/components/text-area/text-area.scss +123 -0
  99. package/styles/components/text-input/text-input.css +0 -232
  100. package/styles/components/text-input/text-input.min.css +1 -1
  101. package/styles/components/text-input/text-input.scss +3 -362
  102. package/styles/components/toast/toast.css +4 -4
  103. package/styles/components/toast/toast.min.css +1 -1
  104. package/styles/shared/input/shared-input-styles.css +106 -0
  105. package/styles/shared/input/shared-input-styles.min.css +1 -0
  106. package/styles/shared/input/shared-input-styles.scss +251 -0
  107. package/styles/styles.css +347 -270
  108. package/styles/styles.min.css +1 -1
  109. package/styles/styles.scss +1 -0
  110. package/build/cjs/components/text-input/BaseTextArea.cjs.map +0 -1
  111. package/build/cjs/components/text-input/TextArea.cjs.map +0 -1
  112. package/styles/components/text-input/development/index.css +0 -12
  113. package/styles/components/text-input/development/index.min.css +0 -1
  114. package/styles/components/text-input/development/index.scss +0 -16
  115. /package/build/cjs/components/{text-input → text-area}/BaseTextArea.d.cts +0 -0
  116. /package/build/cjs/components/{text-input → text-area}/TextArea.cjs +0 -0
  117. /package/build/cjs/components/{text-input → text-area}/TextArea.d.cts +0 -0
  118. /package/build/es/components/{text-input → text-area}/BaseTextArea.d.ts +0 -0
  119. /package/build/es/components/{text-input → text-area}/TextArea.d.ts +0 -0
  120. /package/build/es/components/{text-input → text-area}/TextArea.js +0 -0
@@ -185,14 +185,14 @@
185
185
 
186
186
  .jkl-toast[data-animation=entering],
187
187
  .jkl-toast[data-animation=queued] {
188
- animation: jkl-entering-uphyht7 200ms ease-out forwards;
188
+ animation: jkl-entering-ufj529t 200ms ease-out forwards;
189
189
  }
190
190
 
191
191
  .jkl-toast[data-animation=exiting] {
192
- animation: jkl-exiting-uphyhu5 150ms ease-in forwards;
192
+ animation: jkl-exiting-ufj52a8 150ms ease-in forwards;
193
193
  }
194
194
 
195
- @keyframes jkl-entering-uphyht7 {
195
+ @keyframes jkl-entering-ufj529t {
196
196
  from {
197
197
  opacity: 0;
198
198
  transform: translate3d(0, 50%, 0);
@@ -202,7 +202,7 @@
202
202
  transform: translate3d(0, 0, 0);
203
203
  }
204
204
  }
205
- @keyframes jkl-exiting-uphyhu5 {
205
+ @keyframes jkl-exiting-ufj52a8 {
206
206
  from {
207
207
  opacity: 1;
208
208
  transform: translate3d(0, 0, 0);
@@ -1 +1 @@
1
- :root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-toast-padding:calc(var(--jkl-unit-10)*2)}@media (width >= 0) and (max-width:679px){:root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-toast-padding:calc(var(--jkl-unit-10)*1.5)}}[data-density=compact],[data-layout-density=compact]{--jkl-toast-padding:0.5rem}.jkl-toast-region{background:#0000;bottom:calc(var(--jkl-unit-10)*3);display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;width:100%;z-index:10000}.jkl-toast-region__toasts{align-items:center;display:flex;flex-direction:column;gap:calc(var(--jkl-unit-10)*2);min-width:18rem;pointer-events:auto}.jkl-toast-region--left{justify-content:flex-start;left:calc(var(--jkl-unit-10)*3)}.jkl-toast{--background-color:var(--jkl-color-background-container-high);--text-color:var(--jkl-color-text-default);align-items:start;background-color:var(--background-color);border-radius:4px;box-sizing:border-box;color:var(--text-color);display:grid;font-size:1.125rem;font-weight:400;grid-template-areas:"progress progress progress" "icon content dismiss";grid-template-columns:auto 1fr auto;line-height:1.75rem;max-width:min(30rem,85vw);overflow:hidden;padding:var(--jkl-toast-padding);padding-top:0;width:100%;--jkl-icon-weight:300}@media (min-width:680px){.jkl-toast{font-size:1.25rem;font-weight:400;line-height:2rem;--jkl-icon-weight:300}}.jkl-toast__progress{grid-area:progress;margin-bottom:calc(var(--jkl-unit-10)*2);margin-inline:calc(var(--jkl-toast-padding)*-1)}.jkl-toast__progress .jkl-countdown{--bar-color:var(--text-color);--track-color:#0000;border-radius:0}.jkl-toast__icon{grid-area:icon;margin-right:calc(var(--jkl-unit-10)*1.5)}@media screen and (forced-colors:active){.jkl-toast__icon,.jkl-toast__icon path,.jkl-toast__icon svg{stroke:CanvasText}}.jkl-toast__content{grid-area:content}.jkl-toast__message{margin-top:-.125rem}.jkl-toast__title{font-size:1.125rem;font-weight:700;line-height:1.5rem;margin:0 0 calc(var(--jkl-unit-10)*.5) 0;--jkl-icon-weight:500}@media (min-width:680px){.jkl-toast__title{font-size:1.3125rem;font-weight:700;line-height:1.75rem;--jkl-icon-weight:500}}.jkl-toast__title~.jkl-toast__message{margin-top:0}.jkl-toast__dismiss-button{background-color:initial;color:inherit;cursor:pointer;grid-area:dismiss;justify-self:end;margin-left:var(--jkl-toast-gap);padding:0;position:relative}@media screen and (forced-colors:active){.jkl-toast__dismiss-button,.jkl-toast__dismiss-button path,.jkl-toast__dismiss-button svg{stroke:ButtonText}.jkl-toast__dismiss-button{background-color:ButtonFace}}.jkl-toast__dismiss-button:after{--tap-increment:-0.75rem;border-radius:.1875rem;content:"";inset:var(--tap-increment) var(--tap-increment) var(--tap-increment) var(--tap-increment);position:absolute}.jkl-toast--error,.jkl-toast--info,.jkl-toast--success,.jkl-toast--warning{--text-color:var(--jkl-color-text-on-alert)}.jkl-toast--info{--background-color:var(--jkl-color-background-alert-info)}.jkl-toast--warning{--background-color:var(--jkl-color-background-alert-warning)}.jkl-toast--error{--background-color:var(--jkl-color-background-alert-error)}.jkl-toast--success{--background-color:var(--jkl-color-background-alert-success)}@media screen and (forced-colors:active){.jkl-toast{border:2px solid CanvasText}.jkl-toast--info{border-style:dotted}.jkl-toast--warning{border-style:dashed}.jkl-toast--error{border-style:double;border-width:4px}}.jkl-toast[data-animation=entering],.jkl-toast[data-animation=queued]{animation:jkl-entering-uphyht7 .2s ease-out forwards}.jkl-toast[data-animation=exiting]{animation:jkl-exiting-uphyhu5 .15s ease-in forwards}@keyframes jkl-entering-uphyht7{0%{opacity:0;transform:translate3d(0,50%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes jkl-exiting-uphyhu5{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,50%,0)}}
1
+ :root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-toast-padding:calc(var(--jkl-unit-10)*2)}@media (width >= 0) and (max-width:679px){:root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-toast-padding:calc(var(--jkl-unit-10)*1.5)}}[data-density=compact],[data-layout-density=compact]{--jkl-toast-padding:0.5rem}.jkl-toast-region{background:#0000;bottom:calc(var(--jkl-unit-10)*3);display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;width:100%;z-index:10000}.jkl-toast-region__toasts{align-items:center;display:flex;flex-direction:column;gap:calc(var(--jkl-unit-10)*2);min-width:18rem;pointer-events:auto}.jkl-toast-region--left{justify-content:flex-start;left:calc(var(--jkl-unit-10)*3)}.jkl-toast{--background-color:var(--jkl-color-background-container-high);--text-color:var(--jkl-color-text-default);align-items:start;background-color:var(--background-color);border-radius:4px;box-sizing:border-box;color:var(--text-color);display:grid;font-size:1.125rem;font-weight:400;grid-template-areas:"progress progress progress" "icon content dismiss";grid-template-columns:auto 1fr auto;line-height:1.75rem;max-width:min(30rem,85vw);overflow:hidden;padding:var(--jkl-toast-padding);padding-top:0;width:100%;--jkl-icon-weight:300}@media (min-width:680px){.jkl-toast{font-size:1.25rem;font-weight:400;line-height:2rem;--jkl-icon-weight:300}}.jkl-toast__progress{grid-area:progress;margin-bottom:calc(var(--jkl-unit-10)*2);margin-inline:calc(var(--jkl-toast-padding)*-1)}.jkl-toast__progress .jkl-countdown{--bar-color:var(--text-color);--track-color:#0000;border-radius:0}.jkl-toast__icon{grid-area:icon;margin-right:calc(var(--jkl-unit-10)*1.5)}@media screen and (forced-colors:active){.jkl-toast__icon,.jkl-toast__icon path,.jkl-toast__icon svg{stroke:CanvasText}}.jkl-toast__content{grid-area:content}.jkl-toast__message{margin-top:-.125rem}.jkl-toast__title{font-size:1.125rem;font-weight:700;line-height:1.5rem;margin:0 0 calc(var(--jkl-unit-10)*.5) 0;--jkl-icon-weight:500}@media (min-width:680px){.jkl-toast__title{font-size:1.3125rem;font-weight:700;line-height:1.75rem;--jkl-icon-weight:500}}.jkl-toast__title~.jkl-toast__message{margin-top:0}.jkl-toast__dismiss-button{background-color:initial;color:inherit;cursor:pointer;grid-area:dismiss;justify-self:end;margin-left:var(--jkl-toast-gap);padding:0;position:relative}@media screen and (forced-colors:active){.jkl-toast__dismiss-button,.jkl-toast__dismiss-button path,.jkl-toast__dismiss-button svg{stroke:ButtonText}.jkl-toast__dismiss-button{background-color:ButtonFace}}.jkl-toast__dismiss-button:after{--tap-increment:-0.75rem;border-radius:.1875rem;content:"";inset:var(--tap-increment) var(--tap-increment) var(--tap-increment) var(--tap-increment);position:absolute}.jkl-toast--error,.jkl-toast--info,.jkl-toast--success,.jkl-toast--warning{--text-color:var(--jkl-color-text-on-alert)}.jkl-toast--info{--background-color:var(--jkl-color-background-alert-info)}.jkl-toast--warning{--background-color:var(--jkl-color-background-alert-warning)}.jkl-toast--error{--background-color:var(--jkl-color-background-alert-error)}.jkl-toast--success{--background-color:var(--jkl-color-background-alert-success)}@media screen and (forced-colors:active){.jkl-toast{border:2px solid CanvasText}.jkl-toast--info{border-style:dotted}.jkl-toast--warning{border-style:dashed}.jkl-toast--error{border-style:double;border-width:4px}}.jkl-toast[data-animation=entering],.jkl-toast[data-animation=queued]{animation:jkl-entering-ufj529t .2s ease-out forwards}.jkl-toast[data-animation=exiting]{animation:jkl-exiting-ufj52a8 .15s ease-in forwards}@keyframes jkl-entering-ufj529t{0%{opacity:0;transform:translate3d(0,50%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes jkl-exiting-ufj52a8{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,50%,0)}}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Do not edit directly
3
+ * Generated on Wed, 18 Dec 2024 12:25:37 GMT
4
+ */
5
+ @media screen and (prefers-color-scheme: light) {
6
+ :root {
7
+ --jkl-text-input-border-color: #636060;
8
+ --jkl-text-input-text-color: #1b1917;
9
+ --jkl-text-input-placeholder-color: #636060;
10
+ --jkl-text-input-unit-color: #1b1917;
11
+ --jkl-text-input-background-color: #ffffff;
12
+ --jkl-text-input-focus-color: #1b1917;
13
+ --jkl-text-input-error-background-color: #f6b3b3;
14
+ --jkl-text-input-error-text-color: #1b1917;
15
+ --jkl-text-input-error-placeholder-color: #636060;
16
+ --jkl-text-input-selection-color: rgba(27, 25, 23, 0.2);
17
+ --jkl-text-input-error-selection-color: rgba(27, 25, 23, 0.2);
18
+ --jkl-text-area-counter-count-color: #636060;
19
+ }
20
+ }
21
+ [data-theme=light] {
22
+ --jkl-text-input-border-color: #636060;
23
+ --jkl-text-input-text-color: #1b1917;
24
+ --jkl-text-input-placeholder-color: #636060;
25
+ --jkl-text-input-unit-color: #1b1917;
26
+ --jkl-text-input-background-color: #ffffff;
27
+ --jkl-text-input-focus-color: #1b1917;
28
+ --jkl-text-input-error-background-color: #f6b3b3;
29
+ --jkl-text-input-error-text-color: #1b1917;
30
+ --jkl-text-input-error-placeholder-color: #636060;
31
+ --jkl-text-input-selection-color: rgba(27, 25, 23, 0.2);
32
+ --jkl-text-input-error-selection-color: rgba(27, 25, 23, 0.2);
33
+ --jkl-text-area-counter-count-color: #636060;
34
+ }
35
+
36
+ @media screen and (prefers-color-scheme: dark) {
37
+ :root {
38
+ --jkl-text-input-border-color: #c8c5c3;
39
+ --jkl-text-input-text-color: #f9f9f9;
40
+ --jkl-text-input-placeholder-color: #c8c5c3;
41
+ --jkl-text-input-unit-color: #f9f9f9;
42
+ --jkl-text-input-background-color: #313030;
43
+ --jkl-text-input-focus-color: #f9f9f9;
44
+ --jkl-text-input-selection-color: rgba(249, 249, 249, 0.25);
45
+ --jkl-text-input-error-background-color: #f6b3b3;
46
+ --jkl-text-input-error-text-color: #1b1917;
47
+ --jkl-text-input-error-placeholder-color: #636060;
48
+ --jkl-text-input-error-selection-color: rgba(27, 25, 23, 0.2);
49
+ --jkl-text-area-counter-count-color: #c8c5c3;
50
+ }
51
+ }
52
+ [data-theme=dark] {
53
+ --jkl-text-input-border-color: #c8c5c3;
54
+ --jkl-text-input-text-color: #f9f9f9;
55
+ --jkl-text-input-placeholder-color: #c8c5c3;
56
+ --jkl-text-input-unit-color: #f9f9f9;
57
+ --jkl-text-input-background-color: #313030;
58
+ --jkl-text-input-focus-color: #f9f9f9;
59
+ --jkl-text-input-selection-color: rgba(249, 249, 249, 0.25);
60
+ --jkl-text-input-error-background-color: #f6b3b3;
61
+ --jkl-text-input-error-text-color: #1b1917;
62
+ --jkl-text-input-error-placeholder-color: #636060;
63
+ --jkl-text-input-error-selection-color: rgba(27, 25, 23, 0.2);
64
+ --jkl-text-area-counter-count-color: #c8c5c3;
65
+ }
66
+
67
+ :root,
68
+ [data-layout-density=comfortable],
69
+ [data-density=comfortable] {
70
+ --jkl-text-input-font-size: var(--jkl-body-font-size);
71
+ --jkl-text-input-line-height: var(--jkl-body-line-height);
72
+ --jkl-text-input-font-weight: var(--jkl-body-font-weight);
73
+ --jkl-text-input-height: 3rem;
74
+ --jkl-text-input-vertical-padding: 0.5rem;
75
+ --jkl-text-input-horizontal-padding: 0.75rem;
76
+ --jkl-text-input-padding: var(--jkl-text-input-vertical-padding)
77
+ var(--jkl-text-input-horizontal-padding);
78
+ --jkl-text-input-action-button-size: 3rem;
79
+ --jkl-text-input-action-button-icon-size: 1.25rem;
80
+ --jkl-text-input-action-button-padding: 0.5rem 0;
81
+ --jkl-text-input-action-button-focus-position: 0.375rem;
82
+ }
83
+ @media (width >= 0) and (max-width: 679px) {
84
+ :root,
85
+ [data-layout-density=comfortable],
86
+ [data-density=comfortable] {
87
+ --jkl-text-input-height: 2.75rem;
88
+ --jkl-text-input-action-button-size: 2.75rem;
89
+ }
90
+ }
91
+
92
+ [data-layout-density=compact],
93
+ [data-density=compact] {
94
+ --jkl-text-input-font-size: var(--jkl-small-font-size);
95
+ --jkl-text-input-line-height: var(--jkl-small-line-height);
96
+ --jkl-text-input-font-weight: var(--jkl-small-font-weight);
97
+ --jkl-text-input-height: 2rem;
98
+ --jkl-text-input-vertical-padding: 0.25rem;
99
+ --jkl-text-input-horizontal-padding: 0.5rem;
100
+ --jkl-text-input-padding: var(--jkl-text-input-vertical-padding)
101
+ var(--jkl-text-input-horizontal-padding);
102
+ --jkl-text-input-action-button-size: 2rem;
103
+ --jkl-text-input-action-button-icon-size: 1.125rem;
104
+ --jkl-text-input-action-button-padding: 0;
105
+ --jkl-text-input-action-button-focus-position: 0;
106
+ }
@@ -0,0 +1 @@
1
+ @media screen and (prefers-color-scheme:light){:root{--jkl-text-input-border-color:#636060;--jkl-text-input-text-color:#1b1917;--jkl-text-input-placeholder-color:#636060;--jkl-text-input-unit-color:#1b1917;--jkl-text-input-background-color:#fff;--jkl-text-input-focus-color:#1b1917;--jkl-text-input-error-background-color:#f6b3b3;--jkl-text-input-error-text-color:#1b1917;--jkl-text-input-error-placeholder-color:#636060;--jkl-text-input-selection-color:#1b191733;--jkl-text-input-error-selection-color:#1b191733;--jkl-text-area-counter-count-color:#636060}}[data-theme=light]{--jkl-text-input-border-color:#636060;--jkl-text-input-text-color:#1b1917;--jkl-text-input-placeholder-color:#636060;--jkl-text-input-unit-color:#1b1917;--jkl-text-input-background-color:#fff;--jkl-text-input-focus-color:#1b1917;--jkl-text-input-error-background-color:#f6b3b3;--jkl-text-input-error-text-color:#1b1917;--jkl-text-input-error-placeholder-color:#636060;--jkl-text-input-selection-color:#1b191733;--jkl-text-input-error-selection-color:#1b191733;--jkl-text-area-counter-count-color:#636060}@media screen and (prefers-color-scheme:dark){:root{--jkl-text-input-border-color:#c8c5c3;--jkl-text-input-text-color:#f9f9f9;--jkl-text-input-placeholder-color:#c8c5c3;--jkl-text-input-unit-color:#f9f9f9;--jkl-text-input-background-color:#313030;--jkl-text-input-focus-color:#f9f9f9;--jkl-text-input-selection-color:#f9f9f940;--jkl-text-input-error-background-color:#f6b3b3;--jkl-text-input-error-text-color:#1b1917;--jkl-text-input-error-placeholder-color:#636060;--jkl-text-input-error-selection-color:#1b191733;--jkl-text-area-counter-count-color:#c8c5c3}}[data-theme=dark]{--jkl-text-input-border-color:#c8c5c3;--jkl-text-input-text-color:#f9f9f9;--jkl-text-input-placeholder-color:#c8c5c3;--jkl-text-input-unit-color:#f9f9f9;--jkl-text-input-background-color:#313030;--jkl-text-input-focus-color:#f9f9f9;--jkl-text-input-selection-color:#f9f9f940;--jkl-text-input-error-background-color:#f6b3b3;--jkl-text-input-error-text-color:#1b1917;--jkl-text-input-error-placeholder-color:#636060;--jkl-text-input-error-selection-color:#1b191733;--jkl-text-area-counter-count-color:#c8c5c3}:root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-text-input-font-size:var(--jkl-body-font-size);--jkl-text-input-line-height:var(--jkl-body-line-height);--jkl-text-input-font-weight:var(--jkl-body-font-weight);--jkl-text-input-height:3rem;--jkl-text-input-vertical-padding:0.5rem;--jkl-text-input-horizontal-padding:0.75rem;--jkl-text-input-padding:var(--jkl-text-input-vertical-padding) var(--jkl-text-input-horizontal-padding);--jkl-text-input-action-button-size:3rem;--jkl-text-input-action-button-icon-size:1.25rem;--jkl-text-input-action-button-padding:0.5rem 0;--jkl-text-input-action-button-focus-position:0.375rem}@media (width >= 0) and (max-width:679px){:root,[data-density=comfortable],[data-layout-density=comfortable]{--jkl-text-input-height:2.75rem;--jkl-text-input-action-button-size:2.75rem}}[data-density=compact],[data-layout-density=compact]{--jkl-text-input-font-size:var(--jkl-small-font-size);--jkl-text-input-line-height:var(--jkl-small-line-height);--jkl-text-input-font-weight:var(--jkl-small-font-weight);--jkl-text-input-height:2rem;--jkl-text-input-vertical-padding:0.25rem;--jkl-text-input-horizontal-padding:0.5rem;--jkl-text-input-padding:var(--jkl-text-input-vertical-padding) var(--jkl-text-input-horizontal-padding);--jkl-text-input-action-button-size:2rem;--jkl-text-input-action-button-icon-size:1.125rem;--jkl-text-input-action-button-padding:0;--jkl-text-input-action-button-focus-position:0}
@@ -0,0 +1,251 @@
1
+ @use "sass:color";
2
+ @use "../../core/jkl";
3
+
4
+ $_text-input-height: jkl.rem(48px);
5
+ $_text-input-height--mobile: jkl.rem(44px);
6
+ $_text-input-height--compact: jkl.rem(32px);
7
+ $_text-input-vertical-padding: jkl.$spacing-xs;
8
+ $_text-input-vertical-padding--compact: jkl.$spacing-2xs;
9
+ $_text-input-horizontal-padding: jkl.$spacing-s;
10
+ $_text-input-horizontal-padding--compact: jkl.$spacing-xs;
11
+
12
+ $_action-button-size: jkl.rem(48px);
13
+ $_action-button-size--mobile: jkl.rem(44px);
14
+ $_action-button-size--compact: jkl.rem(32px);
15
+ $_action-button-icon-size: jkl.rem(20px);
16
+ $_action-button-icon-size--compact: jkl.rem(18px);
17
+ $_action-button-padding: jkl.$spacing-xs 0;
18
+ $_action-button-padding--compact: 0;
19
+ $_action-button-focus-position: jkl.rem(6px);
20
+ $_action-button-focus-position--compact: 0;
21
+
22
+ $_text-input-focus-color: jkl.$color-granitt;
23
+ $_text-input-selection-color: color.scale(
24
+ $color: $_text-input-focus-color,
25
+ $alpha: -80%,
26
+ );
27
+
28
+ $_text-input-focus-color--inverted: jkl.$color-snohvit;
29
+ $_text-input-selection-color--inverted: color.scale(
30
+ $color: $_text-input-focus-color--inverted,
31
+ $alpha: -75%,
32
+ );
33
+
34
+ @include jkl.light-mode-variables {
35
+ --jkl-text-input-border-color: #{jkl.$color-stein};
36
+ --jkl-text-input-text-color: #{jkl.$color-granitt};
37
+ --jkl-text-input-placeholder-color: #{jkl.$color-stein};
38
+ --jkl-text-input-unit-color: #{jkl.$color-granitt};
39
+ --jkl-text-input-background-color: #{jkl.$color-hvit};
40
+ --jkl-text-input-focus-color: #{$_text-input-focus-color};
41
+ --jkl-text-input-error-background-color: #{jkl.$color-feil};
42
+ --jkl-text-input-error-text-color: #{jkl.$color-granitt};
43
+ --jkl-text-input-error-placeholder-color: #{jkl.$color-stein};
44
+ --jkl-text-input-selection-color: #{$_text-input-selection-color};
45
+ --jkl-text-input-error-selection-color: #{$_text-input-selection-color};
46
+ --jkl-text-area-counter-count-color: #{jkl.$color-stein};
47
+ }
48
+
49
+ @include jkl.dark-mode-variables {
50
+ --jkl-text-input-border-color: #{jkl.$color-svaberg};
51
+ --jkl-text-input-text-color: #{jkl.$color-snohvit};
52
+ --jkl-text-input-placeholder-color: #{jkl.$color-svaberg};
53
+ --jkl-text-input-unit-color: #{jkl.$color-snohvit};
54
+ --jkl-text-input-background-color: #{jkl.$color-skifer};
55
+ --jkl-text-input-focus-color: #{$_text-input-focus-color--inverted};
56
+ --jkl-text-input-selection-color: #{$_text-input-selection-color--inverted};
57
+ --jkl-text-input-error-background-color: #{jkl.$color-feil};
58
+ --jkl-text-input-error-text-color: #{jkl.$color-granitt};
59
+ --jkl-text-input-error-placeholder-color: #{jkl.$color-stein};
60
+ --jkl-text-input-error-selection-color: #{$_text-input-selection-color};
61
+ --jkl-text-area-counter-count-color: #{jkl.$color-svaberg};
62
+ }
63
+
64
+ @include jkl.comfortable-density-variables {
65
+ @include jkl.declare-font-variables("jkl-text-input", "body");
66
+
67
+ --jkl-text-input-height: #{$_text-input-height};
68
+ --jkl-text-input-vertical-padding: #{$_text-input-vertical-padding};
69
+ --jkl-text-input-horizontal-padding: #{$_text-input-horizontal-padding};
70
+ --jkl-text-input-padding: var(--jkl-text-input-vertical-padding)
71
+ var(--jkl-text-input-horizontal-padding);
72
+ --jkl-text-input-action-button-size: #{$_action-button-size};
73
+ --jkl-text-input-action-button-icon-size: #{$_action-button-icon-size};
74
+ --jkl-text-input-action-button-padding: #{$_action-button-padding};
75
+ --jkl-text-input-action-button-focus-position: #{$_action-button-focus-position};
76
+
77
+ @include jkl.small-device {
78
+ --jkl-text-input-height: #{$_text-input-height--mobile};
79
+ --jkl-text-input-action-button-size: #{$_action-button-size--mobile};
80
+ }
81
+ }
82
+
83
+ @include jkl.compact-density-variables {
84
+ @include jkl.declare-font-variables("jkl-text-input", "small");
85
+
86
+ --jkl-text-input-height: #{$_text-input-height--compact};
87
+ --jkl-text-input-vertical-padding: #{$_text-input-vertical-padding--compact};
88
+ --jkl-text-input-horizontal-padding: #{$_text-input-horizontal-padding--compact};
89
+ --jkl-text-input-padding: var(--jkl-text-input-vertical-padding)
90
+ var(--jkl-text-input-horizontal-padding);
91
+ --jkl-text-input-action-button-size: #{$_action-button-size--compact};
92
+ --jkl-text-input-action-button-icon-size: #{$_action-button-icon-size--compact};
93
+ --jkl-text-input-action-button-padding: #{$_action-button-padding--compact};
94
+ --jkl-text-input-action-button-focus-position: #{$_action-button-focus-position--compact};
95
+ }
96
+
97
+ @mixin wrapper-styles {
98
+ border-radius: jkl.rem(3px);
99
+ box-sizing: border-box;
100
+ max-width: 100%;
101
+
102
+ position: relative;
103
+ display: flex;
104
+ align-items: center;
105
+ height: var(--jkl-text-input-height);
106
+
107
+ @include jkl.use-font-variables("jkl-text-input");
108
+ @include jkl.motion;
109
+ transition-property: color, box-shadow, background-color;
110
+
111
+ color: var(--jkl-text-input-text-color);
112
+ box-shadow: inset 0 0 0 jkl.rem(1px) var(--jkl-text-input-border-color),
113
+ 0 0 0 jkl.rem(1px) transparent;
114
+ background-color: transparent;
115
+
116
+ &[data-invalid="true"] {
117
+ background-color: var(--jkl-text-input-error-background-color);
118
+ color: var(--jkl-text-input-error-text-color);
119
+ }
120
+
121
+ &:hover {
122
+ box-shadow: inset 0 0 0 jkl.rem(1px) var(--jkl-text-input-focus-color),
123
+ 0 0 0 jkl.rem(1px) var(--jkl-text-input-focus-color);
124
+ border-color: var(--jkl-text-input-focus-color);
125
+
126
+ @include jkl.forced-colors-mode {
127
+ border: jkl.rem(2px) solid ButtonText;
128
+ }
129
+ }
130
+
131
+ &:has(:active) {
132
+ background-color: var(--jkl-text-input-background-color);
133
+ }
134
+
135
+ @include jkl.keyboard-navigation {
136
+ &:has(.jkl-text-input__input:focus-visible),
137
+ &:has(.jkl-text-area__text-area:focus-visible) {
138
+ @include jkl.focus-outline;
139
+ }
140
+ }
141
+
142
+ > .jkl-icon-button:focus-visible {
143
+ @include jkl.focus-outline($offset: -8px);
144
+
145
+ @include jkl.forced-colors-mode {
146
+ --jkl-color-border-action: ButtonText;
147
+ }
148
+ }
149
+
150
+ > .jkl-text-input-action-button {
151
+ flex-shrink: 0;
152
+ display: flex;
153
+ box-sizing: border-box;
154
+ align-items: center;
155
+ justify-content: center;
156
+ padding: var(--jkl-text-input-action-button-padding);
157
+ height: var(--jkl-text-input-action-button-size);
158
+ width: var(--jkl-text-input-action-button-size);
159
+
160
+ // Unngå for langt mellomrom mellom ikon og teksten i feltet
161
+ margin-inline-start: calc(
162
+ var(--jkl-text-input-horizontal-padding) * -1
163
+ );
164
+
165
+ .jkl-icon-button__icon {
166
+ height: var(--jkl-text-input-action-button-icon-size);
167
+ width: var(--jkl-text-input-action-button-icon-size);
168
+ }
169
+
170
+ &:hover {
171
+ color: var(--jkl-text-input-focus-color);
172
+
173
+ @include jkl.forced-colors-mode {
174
+ border: jkl.rem(2px) inset ButtonText;
175
+ }
176
+ }
177
+ }
178
+
179
+ @include jkl.forced-colors-mode {
180
+ border: jkl.rem(2px) inset ButtonText;
181
+ }
182
+ }
183
+
184
+ @mixin input-styles {
185
+ background: none;
186
+ -webkit-appearance: none;
187
+ color: var(--jkl-color);
188
+
189
+ @include jkl.use-font-variables("jkl-text-input");
190
+ @include jkl.reset-outline;
191
+ @include jkl.remove-inner-outer-button;
192
+
193
+ @include jkl.forced-colors-mode {
194
+ outline: none;
195
+ border: none;
196
+
197
+ &:focus-visible {
198
+ outline: none;
199
+ }
200
+ }
201
+
202
+ // Placeholder text style
203
+ &::placeholder {
204
+ opacity: 1;
205
+ color: var(--jkl-text-input-placeholder-color);
206
+ }
207
+
208
+ // Color of text selection
209
+ &::selection {
210
+ background-color: var(--jkl-text-input-selection-color);
211
+
212
+ [data-theme="dark"] & {
213
+ background-color: var(--jkl-text-input-selection-color);
214
+ }
215
+ }
216
+
217
+ // Invalid state
218
+ &[aria-invalid="true"] {
219
+ color: var(--jkl-text-input-error-text-color);
220
+
221
+ &::placeholder {
222
+ color: var(--jkl-text-input-error-placeholder-color);
223
+ }
224
+
225
+ // Color of text selection
226
+ &::selection {
227
+ background-color: var(--jkl-text-input-error-selection-color);
228
+ }
229
+
230
+ & ~ .jkl-text-input-action-button {
231
+ color: var(--jkl-color-text-on-alert);
232
+
233
+ &:hover {
234
+ color: var(--jkl-text-input-error-text-color);
235
+ }
236
+
237
+ &:focus {
238
+ @include jkl.keyboard-navigation {
239
+ &::after {
240
+ box-shadow: inset 0 0 0 jkl.rem(2px)
241
+ var(--jkl-text-input-error-text-color);
242
+ }
243
+ }
244
+ }
245
+ }
246
+
247
+ & ~ .jkl-text-input__unit {
248
+ color: var(--jkl-text-input-error-text-color);
249
+ }
250
+ }
251
+ }