@fristil/designsystem 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +121 -0
- package/README.md +22 -9
- package/dist/components/frittstaende/connection-status/connection-status.d.ts +28 -0
- package/dist/components/frittstaende/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/frittstaende/connection-status/connection-status.js +22 -0
- package/dist/components/frittstaende/connection-status/connection-status.js.map +1 -0
- package/dist/components/frittstaende/connection-status/fs-connection-status.d.ts +54 -0
- package/dist/components/frittstaende/connection-status/fs-connection-status.d.ts.map +1 -0
- package/dist/components/frittstaende/connection-status/fs-connection-status.js +123 -0
- package/dist/components/frittstaende/connection-status/fs-connection-status.js.map +1 -0
- package/dist/components/frittstaende/session-timeout/fs-session-timeout.d.ts +56 -0
- package/dist/components/frittstaende/session-timeout/fs-session-timeout.d.ts.map +1 -0
- package/dist/components/frittstaende/session-timeout/fs-session-timeout.js +179 -0
- package/dist/components/frittstaende/session-timeout/fs-session-timeout.js.map +1 -0
- package/dist/components/frittstaende/session-timeout/session-timeout.d.ts +28 -0
- package/dist/components/frittstaende/session-timeout/session-timeout.d.ts.map +1 -0
- package/dist/components/frittstaende/session-timeout/session-timeout.js +22 -0
- package/dist/components/frittstaende/session-timeout/session-timeout.js.map +1 -0
- package/dist/components/frittstaende/toast/fs-toast.d.ts +16 -22
- package/dist/components/frittstaende/toast/fs-toast.d.ts.map +1 -1
- package/dist/components/frittstaende/toast/fs-toast.js +38 -27
- package/dist/components/frittstaende/toast/fs-toast.js.map +1 -1
- package/dist/components/frittstaende/toast/toast.d.ts +34 -0
- package/dist/components/frittstaende/toast/toast.d.ts.map +1 -0
- package/dist/components/frittstaende/toast/toast.js +26 -0
- package/dist/components/frittstaende/toast/toast.js.map +1 -0
- package/dist/components/ramme/error-summary/error-summary.d.ts +39 -0
- package/dist/components/ramme/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/ramme/error-summary/error-summary.js +31 -0
- package/dist/components/ramme/error-summary/error-summary.js.map +1 -0
- package/dist/components/ramme/error-summary/fs-error-summary.d.ts +16 -42
- package/dist/components/ramme/error-summary/fs-error-summary.d.ts.map +1 -1
- package/dist/components/ramme/error-summary/fs-error-summary.js +57 -92
- package/dist/components/ramme/error-summary/fs-error-summary.js.map +1 -1
- package/dist/components/ramme/field/field-core.d.ts +31 -0
- package/dist/components/ramme/field/field-core.d.ts.map +1 -1
- package/dist/components/ramme/field/field-core.js +31 -0
- package/dist/components/ramme/field/field-core.js.map +1 -1
- package/dist/components/ramme/field/fs-field.d.ts +38 -40
- package/dist/components/ramme/field/fs-field.d.ts.map +1 -1
- package/dist/components/ramme/field/fs-field.js +127 -54
- package/dist/components/ramme/field/fs-field.js.map +1 -1
- package/dist/components/ramme/popover/fs-popover.d.ts +20 -27
- package/dist/components/ramme/popover/fs-popover.d.ts.map +1 -1
- package/dist/components/ramme/popover/fs-popover.js +68 -54
- package/dist/components/ramme/popover/fs-popover.js.map +1 -1
- package/dist/components/ramme/popover/popover.d.ts +43 -0
- package/dist/components/ramme/popover/popover.d.ts.map +1 -0
- package/dist/components/ramme/popover/popover.js +49 -0
- package/dist/components/ramme/popover/popover.js.map +1 -0
- package/dist/components/ramme/suggestion/fs-suggestion.d.ts +75 -0
- package/dist/components/ramme/suggestion/fs-suggestion.d.ts.map +1 -0
- package/dist/components/ramme/suggestion/fs-suggestion.js +232 -0
- package/dist/components/ramme/suggestion/fs-suggestion.js.map +1 -0
- package/dist/components/ramme/suggestion/suggestion.d.ts +97 -0
- package/dist/components/ramme/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/ramme/suggestion/suggestion.js +79 -0
- package/dist/components/ramme/suggestion/suggestion.js.map +1 -0
- package/dist/components/ramme/tabs/fs-tabs.d.ts +31 -36
- package/dist/components/ramme/tabs/fs-tabs.d.ts.map +1 -1
- package/dist/components/ramme/tabs/fs-tabs.js +62 -84
- package/dist/components/ramme/tabs/fs-tabs.js.map +1 -1
- package/dist/components/ramme/tabs/tabs.d.ts +50 -0
- package/dist/components/ramme/tabs/tabs.d.ts.map +1 -0
- package/dist/components/ramme/tabs/tabs.js +54 -0
- package/dist/components/ramme/tabs/tabs.js.map +1 -0
- package/dist/fs.d.ts +94 -0
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +42 -0
- package/dist/fs.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/jsx/react.d.ts +35 -50
- package/dist/jsx/react.d.ts.map +1 -1
- package/dist/react.d.ts +142 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +71 -2
- package/dist/react.js.map +1 -1
- package/package.json +16 -25
- package/src/components/frittstaende/connection-status/connection-status.css +33 -0
- package/src/components/frittstaende/connection-status/connection-status.ts +41 -0
- package/src/components/frittstaende/connection-status/fs-connection-status.ts +144 -0
- package/src/components/frittstaende/session-timeout/fs-session-timeout.ts +212 -0
- package/src/components/frittstaende/session-timeout/session-timeout.css +43 -0
- package/src/components/frittstaende/session-timeout/session-timeout.ts +42 -0
- package/src/components/frittstaende/toast/fs-toast.ts +39 -30
- package/src/components/frittstaende/toast/toast.ts +45 -0
- package/src/components/ramme/error-summary/error-summary.ts +55 -0
- package/src/components/ramme/error-summary/fs-error-summary.ts +62 -119
- package/src/components/ramme/field/field-core.ts +32 -0
- package/src/components/ramme/field/fs-field.ts +144 -61
- package/src/components/ramme/popover/fs-popover.ts +78 -72
- package/src/components/ramme/popover/popover.ts +79 -0
- package/src/components/ramme/suggestion/fs-suggestion.ts +265 -0
- package/src/components/ramme/suggestion/suggestion.ts +105 -0
- package/src/components/ramme/tabs/fs-tabs.ts +67 -98
- package/src/components/ramme/tabs/tabs.ts +104 -0
- package/dist/components/frittstaende/calendar/fs-calendar.d.ts +0 -52
- package/dist/components/frittstaende/calendar/fs-calendar.d.ts.map +0 -1
- package/dist/components/frittstaende/calendar/fs-calendar.js +0 -462
- package/dist/components/frittstaende/calendar/fs-calendar.js.map +0 -1
- package/dist/components/frittstaende/date-field/fs-date-field.d.ts +0 -110
- package/dist/components/frittstaende/date-field/fs-date-field.d.ts.map +0 -1
- package/dist/components/frittstaende/date-field/fs-date-field.js +0 -264
- package/dist/components/frittstaende/date-field/fs-date-field.js.map +0 -1
- package/dist/components/frittstaende/suggestion/fs-suggestion.d.ts +0 -133
- package/dist/components/frittstaende/suggestion/fs-suggestion.d.ts.map +0 -1
- package/dist/components/frittstaende/suggestion/fs-suggestion.js +0 -280
- package/dist/components/frittstaende/suggestion/fs-suggestion.js.map +0 -1
- package/src/components/frittstaende/calendar/fs-calendar.ts +0 -525
- package/src/components/frittstaende/date-field/date-field.css +0 -54
- package/src/components/frittstaende/date-field/fs-date-field.ts +0 -309
- package/src/components/frittstaende/suggestion/fs-suggestion.ts +0 -333
- /package/src/components/{frittstaende → ramme}/suggestion/suggestion.css +0 -0
package/dist/index.js
CHANGED
|
@@ -33,15 +33,22 @@ export { tag } from "./components/css/tag/tag.js";
|
|
|
33
33
|
export { textarea } from "./components/css/textarea/textarea.js";
|
|
34
34
|
export { toggleGroup } from "./components/css/toggle-group/toggle-group.js";
|
|
35
35
|
export { tooltip } from "./components/css/tooltip/tooltip.js";
|
|
36
|
-
export * from "./components/frittstaende/
|
|
37
|
-
export * from "./components/frittstaende/
|
|
38
|
-
export * from "./components/frittstaende/
|
|
36
|
+
export * from "./components/frittstaende/connection-status/connection-status.js";
|
|
37
|
+
export * from "./components/frittstaende/connection-status/fs-connection-status.js";
|
|
38
|
+
export * from "./components/frittstaende/session-timeout/fs-session-timeout.js";
|
|
39
|
+
export * from "./components/frittstaende/session-timeout/session-timeout.js";
|
|
39
40
|
export * from "./components/frittstaende/toast/fs-toast.js";
|
|
41
|
+
export * from "./components/frittstaende/toast/toast.js";
|
|
42
|
+
export * from "./components/ramme/error-summary/error-summary.js";
|
|
40
43
|
export * from "./components/ramme/error-summary/fs-error-summary.js";
|
|
41
44
|
export * from "./components/ramme/field/field-core.js";
|
|
42
45
|
export * from "./components/ramme/field/fs-field.js";
|
|
43
46
|
export * from "./components/ramme/popover/fs-popover.js";
|
|
47
|
+
export * from "./components/ramme/popover/popover.js";
|
|
48
|
+
export * from "./components/ramme/suggestion/fs-suggestion.js";
|
|
49
|
+
export * from "./components/ramme/suggestion/suggestion.js";
|
|
44
50
|
export * from "./components/ramme/tabs/fs-tabs.js";
|
|
51
|
+
export * from "./components/ramme/tabs/tabs.js";
|
|
45
52
|
export { setAttributes } from "./dom.js";
|
|
46
53
|
export { fs } from "./fs.js";
|
|
47
54
|
export * from "./tokens/tokens.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAMnE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AAOvD,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAM1D,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AAMzE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAM1D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AAKpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAM1D,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAM7D,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAOrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AAKxE,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAA;AAMxE,OAAO,EAAE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};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
/**
|
|
51
|
+
* `<fs-tabs>` har ingen attributter.
|
|
52
|
+
*
|
|
53
|
+
* Hvilken fane som er valgt står i markupen serveren sendte, som
|
|
54
|
+
* `aria-selected` på fanen og `hidden` på panelene. Komponenten leser det
|
|
55
|
+
* derfra i stedet for å ha sin egen `selected`, slik at de to aldri kan si
|
|
56
|
+
* hver sin ting.
|
|
57
|
+
*/
|
|
58
|
+
type FsTabsAttributes = HTMLAttributes<HTMLElement>;
|
|
56
59
|
type FsErrorSummaryAttributes = HTMLAttributes<HTMLElement> & {
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Flytt fokus hit når boksen kommer til syne. Standard: på.
|
|
62
|
+
* Sett `"false"` for å la være.
|
|
63
|
+
*/
|
|
64
|
+
autofocus?: "false";
|
|
61
65
|
};
|
|
62
66
|
type FsSuggestionAttributes = HTMLAttributes<HTMLElement> & {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"control-id"?: string;
|
|
70
|
-
"described-by"?: string;
|
|
71
|
-
"no-results-text"?: string;
|
|
72
|
-
invalid?: Flag;
|
|
73
|
-
required?: Flag;
|
|
74
|
-
optional?: Flag;
|
|
75
|
-
disabled?: Flag;
|
|
76
|
-
open?: Flag;
|
|
67
|
+
/**
|
|
68
|
+
* Slår av filtreringen på klienten. Bruk den når serveren sender lista på
|
|
69
|
+
* nytt mens brukeren skriver, som i en Datastar-app: da er det serveren som
|
|
70
|
+
* bestemmer hva som vises.
|
|
71
|
+
*/
|
|
72
|
+
"server-filtered"?: Flag;
|
|
77
73
|
};
|
|
78
74
|
type FsPopoverAttributes = HTMLAttributes<HTMLElement> & {
|
|
79
75
|
open?: Flag;
|
|
80
76
|
/** Hvilken kant panelet henger fra. */
|
|
81
77
|
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
82
78
|
};
|
|
79
|
+
type FsSessionTimeoutAttributes = HTMLAttributes<HTMLElement> & {
|
|
80
|
+
/** Sekunder uten aktivitet før varselet kommer. */
|
|
81
|
+
"warn-at"?: number;
|
|
82
|
+
/** Sekunder uten aktivitet før økten er ute. */
|
|
83
|
+
"expires-at"?: number;
|
|
84
|
+
};
|
|
85
|
+
type FsConnectionStatusAttributes = HTMLAttributes<HTMLElement> & {
|
|
86
|
+
/** Teksten når forbindelsen er borte. */
|
|
87
|
+
"offline-text"?: string;
|
|
88
|
+
/** Teksten når den kommer tilbake. */
|
|
89
|
+
"online-text"?: string;
|
|
90
|
+
};
|
|
83
91
|
type FsToastAttributes = HTMLAttributes<HTMLElement> & {
|
|
84
92
|
/** Millisekunder før meldingene forsvinner. */
|
|
85
93
|
duration?: number;
|
|
86
94
|
/** Tekst som sier hva regionen er. */
|
|
87
95
|
label?: string;
|
|
88
96
|
};
|
|
89
|
-
type FsCalendarAttributes = HTMLAttributes<HTMLElement> & {
|
|
90
|
-
/** Valgt dato som `ÅÅÅÅ-MM-DD`. */
|
|
91
|
-
value?: string;
|
|
92
|
-
open?: Flag;
|
|
93
|
-
disabled?: Flag;
|
|
94
|
-
"trigger-hidden"?: Flag;
|
|
95
|
-
};
|
|
96
|
-
type FsDateFieldAttributes = HTMLAttributes<HTMLElement> & {
|
|
97
|
-
label?: string;
|
|
98
|
-
/** Datoen som `ÅÅÅÅ-MM-DD`, alltid ISO. */
|
|
99
|
-
value?: string;
|
|
100
|
-
name?: string;
|
|
101
|
-
placeholder?: string;
|
|
102
|
-
"help-text"?: string;
|
|
103
|
-
"error-text"?: string;
|
|
104
|
-
"control-id"?: string;
|
|
105
|
-
"described-by"?: string;
|
|
106
|
-
invalid?: Flag;
|
|
107
|
-
required?: Flag;
|
|
108
|
-
optional?: Flag;
|
|
109
|
-
disabled?: Flag;
|
|
110
|
-
readonly?: Flag;
|
|
111
|
-
};
|
|
112
97
|
declare module "react" {
|
|
113
98
|
namespace JSX {
|
|
114
99
|
interface IntrinsicElements {
|
|
@@ -117,11 +102,11 @@ declare module "react" {
|
|
|
117
102
|
"fs-popover": FsPopoverAttributes;
|
|
118
103
|
"fs-suggestion": FsSuggestionAttributes;
|
|
119
104
|
"fs-tabs": FsTabsAttributes;
|
|
105
|
+
"fs-session-timeout": FsSessionTimeoutAttributes;
|
|
106
|
+
"fs-connection-status": FsConnectionStatusAttributes;
|
|
120
107
|
"fs-toast": FsToastAttributes;
|
|
121
|
-
"fs-calendar": FsCalendarAttributes;
|
|
122
|
-
"fs-date-field": FsDateFieldAttributes;
|
|
123
108
|
}
|
|
124
109
|
}
|
|
125
110
|
}
|
|
126
|
-
export type {
|
|
111
|
+
export type { FsConnectionStatusAttributes, FsErrorSummaryAttributes, FsFieldAttributes, FsPopoverAttributes, FsSessionTimeoutAttributes, FsSuggestionAttributes, FsTabsAttributes, FsToastAttributes, };
|
|
127
112
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/jsx/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/jsx/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,KAAK,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAE5B,KAAK,iBAAiB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACrD,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc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SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,4BAA4B,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAChE,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,KAAK,iBAAiB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACrD,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,kBAAkB,EAAE,wBAAwB,CAAA;YAC5C,UAAU,EAAE,iBAAiB,CAAA;YAC7B,YAAY,EAAE,mBAAmB,CAAA;YACjC,eAAe,EAAE,sBAAsB,CAAA;YACvC,SAAS,EAAE,gBAAgB,CAAA;YAC3B,oBAAoB,EAAE,0BAA0B,CAAA;YAChD,sBAAsB,EAAE,4BAA4B,CAAA;YACpD,UAAU,EAAE,iBAAiB,CAAA;SAC9B;KACF;CACF;AAED,YAAY,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,CAAA"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { toast } from "./components/frittstaende/toast/toast.js";
|
|
2
|
+
import { errorSummary } from "./components/ramme/error-summary/error-summary.js";
|
|
1
3
|
import { type FieldOptions } from "./components/ramme/field/field-core.js";
|
|
4
|
+
import { popover } from "./components/ramme/popover/popover.js";
|
|
5
|
+
import { suggestion } from "./components/ramme/suggestion/suggestion.js";
|
|
6
|
+
import { tabs } from "./components/ramme/tabs/tabs.js";
|
|
2
7
|
import { setAttributes } from "./dom.js";
|
|
3
8
|
/**
|
|
4
9
|
* Samme API som `fs`, men med `className` og `htmlFor`.
|
|
@@ -24,7 +29,7 @@ import { setAttributes } from "./dom.js";
|
|
|
24
29
|
*/
|
|
25
30
|
/** Gir nøklene navnene React forventer. */
|
|
26
31
|
export type ReactAttributes<T> = {
|
|
27
|
-
[K in keyof T as K extends "class" ? "className" : K extends "for" ? "htmlFor" : K]: T[K];
|
|
32
|
+
[K in keyof T as K extends "class" ? "className" : K extends "for" ? "htmlFor" : K extends "tabindex" ? "tabIndex" : K]: T[K];
|
|
28
33
|
};
|
|
29
34
|
export declare function toReactAttributes<T extends Record<string, unknown>>(attributes: T): ReactAttributes<T>;
|
|
30
35
|
export declare const fs: {
|
|
@@ -198,6 +203,142 @@ export declare const fs: {
|
|
|
198
203
|
};
|
|
199
204
|
state: import("./index.js").FieldState;
|
|
200
205
|
};
|
|
206
|
+
/**
|
|
207
|
+
* De sammensatte byggerne gir ett attributtsett per element, og hvert sett
|
|
208
|
+
* må døpes om for seg. `container` har `tabindex`, fanene har både
|
|
209
|
+
* `tabindex` og `class`.
|
|
210
|
+
*/
|
|
211
|
+
readonly errorSummary: (options?: Parameters<typeof errorSummary>[0]) => {
|
|
212
|
+
container: ReactAttributes<{
|
|
213
|
+
class: typeof import("./index.js").ERROR_SUMMARY_CLASS;
|
|
214
|
+
role: "alert";
|
|
215
|
+
tabindex: "-1";
|
|
216
|
+
id?: string;
|
|
217
|
+
hidden?: true;
|
|
218
|
+
}>;
|
|
219
|
+
title: ReactAttributes<{
|
|
220
|
+
class: typeof import("./index.js").ERROR_SUMMARY_TITLE_CLASS;
|
|
221
|
+
}>;
|
|
222
|
+
};
|
|
223
|
+
readonly popover: (options: Parameters<typeof popover>[0]) => {
|
|
224
|
+
host: {
|
|
225
|
+
open?: "";
|
|
226
|
+
"data-preserve-attr": "open";
|
|
227
|
+
};
|
|
228
|
+
trigger: ReactAttributes<{
|
|
229
|
+
slot: "trigger";
|
|
230
|
+
"aria-expanded": "true" | "false";
|
|
231
|
+
"aria-controls": string;
|
|
232
|
+
"data-preserve-attr": "aria-expanded";
|
|
233
|
+
}>;
|
|
234
|
+
panel: ReactAttributes<{
|
|
235
|
+
class: typeof import("./index.js").POPOVER_CLASS;
|
|
236
|
+
id: string;
|
|
237
|
+
popover: "manual";
|
|
238
|
+
"data-preserve-attr": "style";
|
|
239
|
+
}>;
|
|
240
|
+
};
|
|
241
|
+
readonly tabs: (options: Parameters<typeof tabs>[0]) => {
|
|
242
|
+
list: ReactAttributes<{
|
|
243
|
+
class: typeof import("./index.js").TABS_LIST_CLASS;
|
|
244
|
+
role: "tablist";
|
|
245
|
+
"aria-label"?: string;
|
|
246
|
+
}>;
|
|
247
|
+
tabs: ReactAttributes<{
|
|
248
|
+
id: string;
|
|
249
|
+
role: "tab";
|
|
250
|
+
type: "button";
|
|
251
|
+
"aria-selected": "true" | "false";
|
|
252
|
+
"aria-controls": string;
|
|
253
|
+
tabindex: "0" | "-1";
|
|
254
|
+
"data-preserve-attr": "aria-selected tabindex";
|
|
255
|
+
}>[];
|
|
256
|
+
panels: ReactAttributes<{
|
|
257
|
+
id: string;
|
|
258
|
+
class: typeof import("./index.js").TABS_PANEL_CLASS;
|
|
259
|
+
role: "tabpanel";
|
|
260
|
+
"aria-labelledby": string;
|
|
261
|
+
tabindex: "0";
|
|
262
|
+
hidden?: true;
|
|
263
|
+
"data-preserve-attr": "hidden";
|
|
264
|
+
}>[];
|
|
265
|
+
};
|
|
266
|
+
readonly suggestion: (options: Parameters<typeof suggestion>[0]) => {
|
|
267
|
+
label: ReactAttributes<{
|
|
268
|
+
class: "fs-label";
|
|
269
|
+
for: string;
|
|
270
|
+
"data-required"?: import("./index.js").RequiredMarker;
|
|
271
|
+
"data-optional"?: "";
|
|
272
|
+
"aria-disabled"?: "true";
|
|
273
|
+
}>;
|
|
274
|
+
field: ReactAttributes<{
|
|
275
|
+
class: "fs-suggestion__field";
|
|
276
|
+
}>;
|
|
277
|
+
control: ReactAttributes<{
|
|
278
|
+
class: "fs-input";
|
|
279
|
+
type: "text";
|
|
280
|
+
role: "combobox";
|
|
281
|
+
autocomplete: "off";
|
|
282
|
+
"aria-expanded": "true" | "false";
|
|
283
|
+
"aria-controls": string;
|
|
284
|
+
"aria-describedby": string;
|
|
285
|
+
"aria-autocomplete": "list";
|
|
286
|
+
"aria-activedescendant": string | undefined;
|
|
287
|
+
"data-preserve-attr": "aria-expanded aria-activedescendant";
|
|
288
|
+
id: string;
|
|
289
|
+
"aria-invalid"?: "true";
|
|
290
|
+
"data-state"?: "invalid";
|
|
291
|
+
disabled?: true;
|
|
292
|
+
}>;
|
|
293
|
+
list: ReactAttributes<{
|
|
294
|
+
class: "fs-suggestion__list";
|
|
295
|
+
id: string;
|
|
296
|
+
role: "listbox";
|
|
297
|
+
hidden: true | undefined;
|
|
298
|
+
"data-preserve-attr": "hidden";
|
|
299
|
+
}>;
|
|
300
|
+
options: ReactAttributes<{
|
|
301
|
+
class: "fs-suggestion__option";
|
|
302
|
+
id: string;
|
|
303
|
+
role: "option";
|
|
304
|
+
"aria-selected": "true" | "false";
|
|
305
|
+
"data-preserve-attr": "aria-selected hidden";
|
|
306
|
+
}>[];
|
|
307
|
+
empty: ReactAttributes<{
|
|
308
|
+
class: "fs-suggestion__empty";
|
|
309
|
+
}>;
|
|
310
|
+
status: ReactAttributes<{
|
|
311
|
+
class: "fs-sr-only";
|
|
312
|
+
id: string;
|
|
313
|
+
role: "status";
|
|
314
|
+
"aria-live": "polite";
|
|
315
|
+
"data-ignore-morph": "";
|
|
316
|
+
}>;
|
|
317
|
+
help: {
|
|
318
|
+
id: string;
|
|
319
|
+
};
|
|
320
|
+
error: {
|
|
321
|
+
id: string;
|
|
322
|
+
hidden?: true;
|
|
323
|
+
};
|
|
324
|
+
state: "default" | "success" | "invalid";
|
|
325
|
+
};
|
|
326
|
+
readonly toast: (options?: Parameters<typeof toast>[0]) => {
|
|
327
|
+
region: {
|
|
328
|
+
role: "status";
|
|
329
|
+
"aria-live": "polite";
|
|
330
|
+
"aria-label": string;
|
|
331
|
+
"data-ignore-morph": "";
|
|
332
|
+
};
|
|
333
|
+
toast: ReactAttributes<{
|
|
334
|
+
class: typeof import("./index.js").TOAST_CLASS;
|
|
335
|
+
}>;
|
|
336
|
+
close: ReactAttributes<{
|
|
337
|
+
class: typeof import("./index.js").TOAST_CLOSE_CLASS;
|
|
338
|
+
}>;
|
|
339
|
+
};
|
|
340
|
+
readonly sessionTimeout: ((options?: import("./index.js").SessionTimeoutOptions | undefined) => ReactAttributes<import("./index.js").SessionTimeoutAttributes>) & (({ warnAt, expiresAt, }?: import("./index.js").SessionTimeoutOptions) => import("./index.js").SessionTimeoutAttributes);
|
|
341
|
+
readonly connectionStatus: ((options?: import("./index.js").ConnectionStatusOptions | undefined) => ReactAttributes<import("./index.js").ConnectionStatusAttributes>) & (({ offlineText, onlineText, }?: import("./index.js").ConnectionStatusOptions) => import("./index.js").ConnectionStatusAttributes);
|
|
201
342
|
readonly setAttributes: typeof setAttributes;
|
|
202
343
|
readonly states: readonly ["default", "invalid", "success"];
|
|
203
344
|
readonly isState: (value: string) => value is "default" | "success" | "invalid";
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAA;AAChF,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAA;AACxE,OAAO,EAAE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CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;CAkBpC,CAAA"}
|
package/dist/react.js
CHANGED
|
@@ -33,13 +33,31 @@ import { tag } from "./components/css/tag/tag.js";
|
|
|
33
33
|
import { textarea } from "./components/css/textarea/textarea.js";
|
|
34
34
|
import { toggleGroup } from "./components/css/toggle-group/toggle-group.js";
|
|
35
35
|
import { tooltip } from "./components/css/tooltip/tooltip.js";
|
|
36
|
+
import { connectionStatus } from "./components/frittstaende/connection-status/connection-status.js";
|
|
37
|
+
import { sessionTimeout } from "./components/frittstaende/session-timeout/session-timeout.js";
|
|
38
|
+
import { toast } from "./components/frittstaende/toast/toast.js";
|
|
39
|
+
import { errorSummary } from "./components/ramme/error-summary/error-summary.js";
|
|
36
40
|
import { computeFieldAttributes, } from "./components/ramme/field/field-core.js";
|
|
41
|
+
import { popover } from "./components/ramme/popover/popover.js";
|
|
42
|
+
import { suggestion } from "./components/ramme/suggestion/suggestion.js";
|
|
43
|
+
import { tabs } from "./components/ramme/tabs/tabs.js";
|
|
37
44
|
import { setAttributes } from "./dom.js";
|
|
45
|
+
/**
|
|
46
|
+
* Attributtene som heter noe annet i React.
|
|
47
|
+
*
|
|
48
|
+
* `tabindex` kom med de sammensatte byggerne: feiloppsummeringen skal kunne
|
|
49
|
+
* få fokus, og bare den valgte fanen er en tabbestopp. Uten omdøpingen
|
|
50
|
+
* advarer React om hver eneste av dem.
|
|
51
|
+
*/
|
|
52
|
+
const NAVN = {
|
|
53
|
+
class: "className",
|
|
54
|
+
for: "htmlFor",
|
|
55
|
+
tabindex: "tabIndex",
|
|
56
|
+
};
|
|
38
57
|
export function toReactAttributes(attributes) {
|
|
39
58
|
const result = {};
|
|
40
59
|
for (const [name, value] of Object.entries(attributes)) {
|
|
41
|
-
result[name
|
|
42
|
-
value;
|
|
60
|
+
result[NAVN[name] ?? name] = value;
|
|
43
61
|
}
|
|
44
62
|
return result;
|
|
45
63
|
}
|
|
@@ -100,6 +118,57 @@ export const fs = {
|
|
|
100
118
|
const field = computeFieldAttributes(options);
|
|
101
119
|
return { ...field, label: toReactAttributes(field.label) };
|
|
102
120
|
},
|
|
121
|
+
/**
|
|
122
|
+
* De sammensatte byggerne gir ett attributtsett per element, og hvert sett
|
|
123
|
+
* må døpes om for seg. `container` har `tabindex`, fanene har både
|
|
124
|
+
* `tabindex` og `class`.
|
|
125
|
+
*/
|
|
126
|
+
errorSummary: (options = {}) => {
|
|
127
|
+
const boks = errorSummary(options);
|
|
128
|
+
return {
|
|
129
|
+
container: toReactAttributes(boks.container),
|
|
130
|
+
title: toReactAttributes(boks.title),
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
popover: (options) => {
|
|
134
|
+
const boks = popover(options);
|
|
135
|
+
return {
|
|
136
|
+
host: boks.host,
|
|
137
|
+
trigger: toReactAttributes(boks.trigger),
|
|
138
|
+
panel: toReactAttributes(boks.panel),
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
tabs: (options) => {
|
|
142
|
+
const faner = tabs(options);
|
|
143
|
+
return {
|
|
144
|
+
list: toReactAttributes(faner.list),
|
|
145
|
+
tabs: faner.tabs.map(toReactAttributes),
|
|
146
|
+
panels: faner.panels.map(toReactAttributes),
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
suggestion: (options) => {
|
|
150
|
+
const forslag = suggestion(options);
|
|
151
|
+
return {
|
|
152
|
+
...forslag,
|
|
153
|
+
label: toReactAttributes(forslag.label),
|
|
154
|
+
field: toReactAttributes(forslag.field),
|
|
155
|
+
control: toReactAttributes(forslag.control),
|
|
156
|
+
list: toReactAttributes(forslag.list),
|
|
157
|
+
options: forslag.options.map(toReactAttributes),
|
|
158
|
+
empty: toReactAttributes(forslag.empty),
|
|
159
|
+
status: toReactAttributes(forslag.status),
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
toast: (options = {}) => {
|
|
163
|
+
const varsler = toast(options);
|
|
164
|
+
return {
|
|
165
|
+
region: varsler.region,
|
|
166
|
+
toast: toReactAttributes(varsler.toast),
|
|
167
|
+
close: toReactAttributes(varsler.close),
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
sessionTimeout: forReact(sessionTimeout),
|
|
171
|
+
connectionStatus: forReact(connectionStatus),
|
|
103
172
|
setAttributes,
|
|
104
173
|
states: fieldStates,
|
|
105
174
|
isState: isFieldState,
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAAO,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,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;SACxC,CAAA;IACH,CAAC;IAED,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC;IACxC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAE5C,aAAa;IAEb,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,gBAAgB;CAClB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fristil/designsystem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Rammeverksuavhengig designsystem: tokens, CSS-komponenter og web components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MarkusAugust",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"custom-elements",
|
|
21
21
|
"css",
|
|
22
22
|
"design-tokens",
|
|
23
|
-
"lit",
|
|
24
23
|
"accessibility",
|
|
25
24
|
"universell-utforming"
|
|
26
25
|
],
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
"./file-upload.css": "./src/components/css/file-upload/file-upload.css",
|
|
46
45
|
"./popover.css": "./src/components/ramme/popover/popover.css",
|
|
47
46
|
"./toast.css": "./src/components/frittstaende/toast/toast.css",
|
|
48
|
-
"./suggestion.css": "./src/components/
|
|
47
|
+
"./suggestion.css": "./src/components/ramme/suggestion/suggestion.css",
|
|
49
48
|
"./checkbox.css": "./src/components/css/checkbox/checkbox.css",
|
|
50
49
|
"./radio.css": "./src/components/css/radio/radio.css",
|
|
51
50
|
"./switch.css": "./src/components/css/switch/switch.css",
|
|
@@ -64,7 +63,6 @@
|
|
|
64
63
|
"./field.css": "./src/components/ramme/field/field.css",
|
|
65
64
|
"./tabs.css": "./src/components/ramme/tabs/tabs.css",
|
|
66
65
|
"./error-summary.css": "./src/components/ramme/error-summary/error-summary.css",
|
|
67
|
-
"./date-field.css": "./src/components/frittstaende/date-field/date-field.css",
|
|
68
66
|
"./label": {
|
|
69
67
|
"types": "./dist/components/css/label/label.d.ts",
|
|
70
68
|
"import": "./dist/components/css/label/label.js"
|
|
@@ -89,10 +87,6 @@
|
|
|
89
87
|
"types": "./dist/components/css/error-text/error-text.d.ts",
|
|
90
88
|
"import": "./dist/components/css/error-text/error-text.js"
|
|
91
89
|
},
|
|
92
|
-
"./calendar": {
|
|
93
|
-
"types": "./dist/components/frittstaende/calendar/fs-calendar.d.ts",
|
|
94
|
-
"import": "./dist/components/frittstaende/calendar/fs-calendar.js"
|
|
95
|
-
},
|
|
96
90
|
"./field": {
|
|
97
91
|
"types": "./dist/components/ramme/field/fs-field.d.ts",
|
|
98
92
|
"import": "./dist/components/ramme/field/fs-field.js"
|
|
@@ -105,10 +99,6 @@
|
|
|
105
99
|
"types": "./dist/components/ramme/error-summary/fs-error-summary.d.ts",
|
|
106
100
|
"import": "./dist/components/ramme/error-summary/fs-error-summary.js"
|
|
107
101
|
},
|
|
108
|
-
"./date-field": {
|
|
109
|
-
"types": "./dist/components/frittstaende/date-field/fs-date-field.d.ts",
|
|
110
|
-
"import": "./dist/components/frittstaende/date-field/fs-date-field.js"
|
|
111
|
-
},
|
|
112
102
|
"./button": {
|
|
113
103
|
"types": "./dist/components/css/button/button.d.ts",
|
|
114
104
|
"import": "./dist/components/css/button/button.js"
|
|
@@ -151,8 +141,8 @@
|
|
|
151
141
|
"import": "./dist/components/frittstaende/toast/fs-toast.js"
|
|
152
142
|
},
|
|
153
143
|
"./suggestion": {
|
|
154
|
-
"types": "./dist/components/
|
|
155
|
-
"import": "./dist/components/
|
|
144
|
+
"types": "./dist/components/ramme/suggestion/fs-suggestion.d.ts",
|
|
145
|
+
"import": "./dist/components/ramme/suggestion/fs-suggestion.js"
|
|
156
146
|
},
|
|
157
147
|
"./checkbox": {
|
|
158
148
|
"types": "./dist/components/css/checkbox/checkbox.d.ts",
|
|
@@ -280,7 +270,17 @@
|
|
|
280
270
|
"./paragraph": {
|
|
281
271
|
"types": "./dist/components/css/paragraph/paragraph.d.ts",
|
|
282
272
|
"import": "./dist/components/css/paragraph/paragraph.js"
|
|
283
|
-
}
|
|
273
|
+
},
|
|
274
|
+
"./session-timeout": {
|
|
275
|
+
"types": "./dist/components/frittstaende/session-timeout/fs-session-timeout.d.ts",
|
|
276
|
+
"import": "./dist/components/frittstaende/session-timeout/fs-session-timeout.js"
|
|
277
|
+
},
|
|
278
|
+
"./session-timeout.css": "./src/components/frittstaende/session-timeout/session-timeout.css",
|
|
279
|
+
"./connection-status": {
|
|
280
|
+
"types": "./dist/components/frittstaende/connection-status/fs-connection-status.d.ts",
|
|
281
|
+
"import": "./dist/components/frittstaende/connection-status/fs-connection-status.js"
|
|
282
|
+
},
|
|
283
|
+
"./connection-status.css": "./src/components/frittstaende/connection-status/connection-status.css"
|
|
284
284
|
},
|
|
285
285
|
"files": [
|
|
286
286
|
"dist",
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
},
|
|
298
298
|
"scripts": {
|
|
299
299
|
"generate": "bun scripts/generate-tokens.ts",
|
|
300
|
-
"build": "bun run generate && tsc -b --force && bun run sjekk:eksport && bun run sjekk:cli && bun run sjekk:versjon && bun run sjekk:pakke",
|
|
300
|
+
"build": "bun run generate && rm -rf dist && tsc -b --force && bun run sjekk:eksport && bun run sjekk:cli && bun run sjekk:versjon && bun run sjekk:pakke",
|
|
301
301
|
"typecheck": "tsc --noEmit",
|
|
302
302
|
"typecheck:tests": "tsc --noEmit -p tsconfig.tests.json",
|
|
303
303
|
"test:browser": "vitest --config vitest.config.ts --run",
|
|
@@ -310,21 +310,12 @@
|
|
|
310
310
|
"sjekk:pakke": "publint",
|
|
311
311
|
"prepublishOnly": "bun run build"
|
|
312
312
|
},
|
|
313
|
-
"peerDependencies": {
|
|
314
|
-
"lit": ">=3.0.0"
|
|
315
|
-
},
|
|
316
|
-
"peerDependenciesMeta": {
|
|
317
|
-
"lit": {
|
|
318
|
-
"optional": true
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
313
|
"devDependencies": {
|
|
322
314
|
"@types/node": "24.12.4",
|
|
323
315
|
"@types/react": "19",
|
|
324
316
|
"@vitest/browser": "4.1.7",
|
|
325
317
|
"@vitest/browser-playwright": "^4.1.7",
|
|
326
318
|
"axe-core": "^4.13.0",
|
|
327
|
-
"lit": "3.3.3",
|
|
328
319
|
"playwright": "1.60.0",
|
|
329
320
|
"publint": "^0.3.24",
|
|
330
321
|
"tailwindcss": "4.3.0",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer fristil {
|
|
2
|
+
fs-connection-status {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.fs-connection-status__bar {
|
|
7
|
+
position: fixed;
|
|
8
|
+
inset-block-start: 0;
|
|
9
|
+
inset-inline: 0;
|
|
10
|
+
z-index: var(--fs-connection-status-layer, 1000);
|
|
11
|
+
padding: var(--fs-connection-status-padding, var(--size-2) var(--size-4));
|
|
12
|
+
font-size: var(--font-size-s);
|
|
13
|
+
line-height: 1.4;
|
|
14
|
+
text-align: center;
|
|
15
|
+
color: var(--semantic-danger-foreground);
|
|
16
|
+
background: var(--semantic-danger-background);
|
|
17
|
+
border-block-end: 1px solid var(--semantic-danger-foreground);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.fs-connection-status__bar[data-state="online"] {
|
|
21
|
+
color: var(--semantic-success-foreground);
|
|
22
|
+
background: var(--semantic-success-background);
|
|
23
|
+
border-block-end-color: var(--semantic-success-foreground);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Høykontrastmodus fjerner egne farger og bakgrunner. Uten en ramme ville
|
|
27
|
+
linja vært usynlig, og det er nettopp den som sier at noe er galt. */
|
|
28
|
+
@media (forced-colors: active) {
|
|
29
|
+
.fs-connection-status__bar {
|
|
30
|
+
border: 2px solid CanvasText;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { attributes } from "../../css/shared.js"
|
|
2
|
+
|
|
3
|
+
export const CONNECTION_STATUS_CLASS = "fs-connection-status" as const
|
|
4
|
+
export const CONNECTION_STATUS_BAR_CLASS = "fs-connection-status__bar" as const
|
|
5
|
+
|
|
6
|
+
export type ConnectionStatusOptions = {
|
|
7
|
+
/** Teksten når forbindelsen er borte. */
|
|
8
|
+
offlineText?: string
|
|
9
|
+
/** Teksten når den kommer tilbake. Vises en kort stund. */
|
|
10
|
+
onlineText?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type ConnectionStatusAttributes = {
|
|
14
|
+
class: typeof CONNECTION_STATUS_CLASS
|
|
15
|
+
"offline-text"?: string
|
|
16
|
+
"online-text"?: string
|
|
17
|
+
"data-ignore-morph": ""
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Attributtene for linja som sier fra at forbindelsen er borte.
|
|
22
|
+
*
|
|
23
|
+
* Serveren kan per definisjon ikke fortelle deg at den er utilgjengelig. Er
|
|
24
|
+
* den nede, kommer det ingenting derfra å rendre. Derfor eier komponenten
|
|
25
|
+
* alt innholdet, og `data-ignore-morph` hindrer at en senere patch river det
|
|
26
|
+
* bort i det øyeblikket forbindelsen er tilbake.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* <fs-connection-status {...fs.connectionStatus()} />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const connectionStatus = ({
|
|
33
|
+
offlineText,
|
|
34
|
+
onlineText,
|
|
35
|
+
}: ConnectionStatusOptions = {}): ConnectionStatusAttributes =>
|
|
36
|
+
attributes({
|
|
37
|
+
class: CONNECTION_STATUS_CLASS,
|
|
38
|
+
"offline-text": offlineText,
|
|
39
|
+
"online-text": onlineText,
|
|
40
|
+
"data-ignore-morph": "" as const,
|
|
41
|
+
})
|