@staffbase/design 18.3.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/LICENSE +202 -0
- package/dist/components.css +2 -0
- package/dist/components.d.ts +1 -0
- package/dist/fonts/epilogue.css +63 -0
- package/dist/fonts/files/Epilogue-Bold.woff2 +0 -0
- package/dist/fonts/files/Epilogue-BoldItalic.woff2 +0 -0
- package/dist/fonts/files/Epilogue-Italic.woff2 +0 -0
- package/dist/fonts/files/Epilogue-Medium.woff2 +0 -0
- package/dist/fonts/files/Epilogue-MediumItalic.woff2 +0 -0
- package/dist/fonts/files/Epilogue-Regular.woff2 +0 -0
- package/dist/fonts/files/Epilogue-SemiBold.woff2 +0 -0
- package/dist/fonts/files/Epilogue-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts/files/inter-cyrillic-ext-variable.woff2 +0 -0
- package/dist/fonts/files/inter-cyrillic-variable.woff2 +0 -0
- package/dist/fonts/files/inter-greek-ext-variable.woff2 +0 -0
- package/dist/fonts/files/inter-greek-variable.woff2 +0 -0
- package/dist/fonts/files/inter-latin-ext-variable.woff2 +0 -0
- package/dist/fonts/files/inter-latin-variable.woff2 +0 -0
- package/dist/fonts/files/inter-vietnamese-variable.woff2 +0 -0
- package/dist/fonts/inter.css +65 -0
- package/dist/hooks.cjs +31 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.ts +18 -0
- package/dist/hooks.js +28 -0
- package/dist/hooks.js.map +1 -0
- package/dist/main.cjs +11993 -0
- package/dist/main.cjs.map +1 -0
- package/dist/main.d.ts +2205 -0
- package/dist/main.js +11646 -0
- package/dist/main.js.map +1 -0
- package/dist/theme.css +481 -0
- package/dist/tokens/component.css +47 -0
- package/dist/tokens/primitive.css +191 -0
- package/dist/tokens/semantic.css +274 -0
- package/package.json +102 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Inter var cyrillic */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'Inter';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-display: swap;
|
|
6
|
+
font-weight: 100 900;
|
|
7
|
+
src: url('./files/inter-cyrillic-variable.woff2') format('woff2');
|
|
8
|
+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
9
|
+
}
|
|
10
|
+
/* Inter var cyrillic-ext */
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'Inter';
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-display: swap;
|
|
15
|
+
font-weight: 100 900;
|
|
16
|
+
src: url('./files/inter-cyrillic-ext-variable.woff2') format('woff2');
|
|
17
|
+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
18
|
+
}
|
|
19
|
+
/* Inter var greek */
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: 'Inter';
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-display: swap;
|
|
24
|
+
font-weight: 100 900;
|
|
25
|
+
src: url('./files/inter-greek-variable.woff2') format('woff2');
|
|
26
|
+
unicode-range: U+0370-03FF;
|
|
27
|
+
}
|
|
28
|
+
/* Inter var greek-ext */
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: 'Inter';
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-display: swap;
|
|
33
|
+
font-weight: 100 900;
|
|
34
|
+
src: url('./files/inter-greek-ext-variable.woff2') format('woff2');
|
|
35
|
+
unicode-range: U+1F00-1FFF;
|
|
36
|
+
}
|
|
37
|
+
/* Inter var latin */
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: 'Inter';
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-display: swap;
|
|
42
|
+
font-weight: 100 900;
|
|
43
|
+
src: url('./files/inter-latin-variable.woff2') format('woff2');
|
|
44
|
+
unicode-range:
|
|
45
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
|
|
46
|
+
U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
47
|
+
}
|
|
48
|
+
/* Inter var latin-ext */
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: 'Inter';
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-display: swap;
|
|
53
|
+
font-weight: 100 900;
|
|
54
|
+
src: url('./files/inter-latin-ext-variable.woff2') format('woff2');
|
|
55
|
+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
56
|
+
}
|
|
57
|
+
/* Inter var vietnamese */
|
|
58
|
+
@font-face {
|
|
59
|
+
font-family: 'Inter';
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-display: swap;
|
|
62
|
+
font-weight: 100 900;
|
|
63
|
+
src: url('./files/inter-vietnamese-variable.woff2') format('woff2');
|
|
64
|
+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
|
65
|
+
}
|
package/dist/hooks.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./main.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
//#region src/hooks/date-time/useFormatDateTime.ts
|
|
5
|
+
var useFormatDateTime = (locale, dateStyle, timeStyle) => {
|
|
6
|
+
return (0, react.useMemo)(() => new Intl.DateTimeFormat(locale, {
|
|
7
|
+
dateStyle,
|
|
8
|
+
timeStyle
|
|
9
|
+
}), [
|
|
10
|
+
locale,
|
|
11
|
+
dateStyle,
|
|
12
|
+
timeStyle
|
|
13
|
+
]);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/hooks/date-time/useFormatRelativeTime.ts
|
|
17
|
+
var useFormatRelativeTime = (locale) => {
|
|
18
|
+
const formatter = (0, react.useMemo)(() => new Intl.RelativeTimeFormat(locale, { numeric: "auto" }), [locale]);
|
|
19
|
+
return (0, react.useCallback)((duration) => {
|
|
20
|
+
if (duration.years) return formatter.format(duration.years, "year");
|
|
21
|
+
if (duration.months) return formatter.format(duration.months, "month");
|
|
22
|
+
if (duration.weeks) return formatter.format(duration.weeks, "week");
|
|
23
|
+
if (duration.days) return formatter.format(duration.days, "day");
|
|
24
|
+
return formatter.format(0, "day");
|
|
25
|
+
}, [formatter]);
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.useFormatDateTime = useFormatDateTime;
|
|
29
|
+
exports.useFormatRelativeTime = useFormatRelativeTime;
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=hooks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.cjs","names":[],"sources":["../src/hooks/date-time/useFormatDateTime.ts","../src/hooks/date-time/useFormatRelativeTime.ts"],"sourcesContent":["import {useMemo} from 'react';\n\nimport type {LocaleArgument} from './types';\n\ntype DateStyle = Extract<Intl.DateTimeFormatOptions['dateStyle'], 'short' | 'medium' | 'long'>;\ntype TimeStyle = Extract<Intl.DateTimeFormatOptions['timeStyle'], 'short' | 'medium'>;\n\nexport const useFormatDateTime = (\n locale: LocaleArgument,\n dateStyle: DateStyle | undefined,\n timeStyle: TimeStyle | undefined,\n) => {\n return useMemo(() => new Intl.DateTimeFormat(locale, {dateStyle, timeStyle}), [locale, dateStyle, timeStyle]);\n};\n","import {useCallback, useMemo} from 'react';\n\nimport type {LocaleArgument} from './types';\n\ntype Duration = {\n years?: number;\n months?: number;\n weeks?: number;\n days?: number;\n};\n\nexport const useFormatRelativeTime = (locale: LocaleArgument) => {\n const formatter = useMemo(() => new Intl.RelativeTimeFormat(locale, {numeric: 'auto'}), [locale]);\n\n return useCallback(\n (duration: Duration) => {\n if (duration.years) {\n return formatter.format(duration.years, 'year');\n }\n if (duration.months) {\n return formatter.format(duration.months, 'month');\n }\n if (duration.weeks) {\n return formatter.format(duration.weeks, 'week');\n }\n if (duration.days) {\n return formatter.format(duration.days, 'day');\n }\n return formatter.format(0, 'day');\n },\n [formatter],\n );\n};\n"],"mappings":";;;;AAOA,IAAa,qBACX,QACA,WACA,cACG;AACH,SAAA,GAAA,MAAA,eAAqB,IAAI,KAAK,eAAe,QAAQ;EAAC;EAAW;EAAU,CAAC,EAAE;EAAC;EAAQ;EAAW;EAAU,CAAC;;;;ACD/G,IAAa,yBAAyB,WAA2B;CAC/D,MAAM,aAAA,GAAA,MAAA,eAA0B,IAAI,KAAK,mBAAmB,QAAQ,EAAC,SAAS,QAAO,CAAC,EAAE,CAAC,OAAO,CAAC;AAEjG,SAAA,GAAA,MAAA,cACG,aAAuB;AACtB,MAAI,SAAS,MACX,QAAO,UAAU,OAAO,SAAS,OAAO,OAAO;AAEjD,MAAI,SAAS,OACX,QAAO,UAAU,OAAO,SAAS,QAAQ,QAAQ;AAEnD,MAAI,SAAS,MACX,QAAO,UAAU,OAAO,SAAS,OAAO,OAAO;AAEjD,MAAI,SAAS,KACX,QAAO,UAAU,OAAO,SAAS,MAAM,MAAM;AAE/C,SAAO,UAAU,OAAO,GAAG,MAAM;IAEnC,CAAC,UAAU,CACZ"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type DateStyle = Extract<Intl.DateTimeFormatOptions['dateStyle'], 'short' | 'medium' | 'long'>;
|
|
2
|
+
|
|
3
|
+
declare type Duration = {
|
|
4
|
+
years?: number;
|
|
5
|
+
months?: number;
|
|
6
|
+
weeks?: number;
|
|
7
|
+
days?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare type LocaleArgument = string | readonly string[] | Intl.Locale | readonly Intl.Locale[];
|
|
11
|
+
|
|
12
|
+
declare type TimeStyle = Extract<Intl.DateTimeFormatOptions['timeStyle'], 'short' | 'medium'>;
|
|
13
|
+
|
|
14
|
+
export declare const useFormatDateTime: (locale: LocaleArgument, dateStyle: DateStyle | undefined, timeStyle: TimeStyle | undefined) => Intl.DateTimeFormat;
|
|
15
|
+
|
|
16
|
+
export declare const useFormatRelativeTime: (locale: LocaleArgument) => (duration: Duration) => string;
|
|
17
|
+
|
|
18
|
+
export { }
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
|
+
//#region src/hooks/date-time/useFormatDateTime.ts
|
|
3
|
+
var useFormatDateTime = (locale, dateStyle, timeStyle) => {
|
|
4
|
+
return useMemo(() => new Intl.DateTimeFormat(locale, {
|
|
5
|
+
dateStyle,
|
|
6
|
+
timeStyle
|
|
7
|
+
}), [
|
|
8
|
+
locale,
|
|
9
|
+
dateStyle,
|
|
10
|
+
timeStyle
|
|
11
|
+
]);
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/hooks/date-time/useFormatRelativeTime.ts
|
|
15
|
+
var useFormatRelativeTime = (locale) => {
|
|
16
|
+
const formatter = useMemo(() => new Intl.RelativeTimeFormat(locale, { numeric: "auto" }), [locale]);
|
|
17
|
+
return useCallback((duration) => {
|
|
18
|
+
if (duration.years) return formatter.format(duration.years, "year");
|
|
19
|
+
if (duration.months) return formatter.format(duration.months, "month");
|
|
20
|
+
if (duration.weeks) return formatter.format(duration.weeks, "week");
|
|
21
|
+
if (duration.days) return formatter.format(duration.days, "day");
|
|
22
|
+
return formatter.format(0, "day");
|
|
23
|
+
}, [formatter]);
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useFormatDateTime, useFormatRelativeTime };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","names":[],"sources":["../src/hooks/date-time/useFormatDateTime.ts","../src/hooks/date-time/useFormatRelativeTime.ts"],"sourcesContent":["import {useMemo} from 'react';\n\nimport type {LocaleArgument} from './types';\n\ntype DateStyle = Extract<Intl.DateTimeFormatOptions['dateStyle'], 'short' | 'medium' | 'long'>;\ntype TimeStyle = Extract<Intl.DateTimeFormatOptions['timeStyle'], 'short' | 'medium'>;\n\nexport const useFormatDateTime = (\n locale: LocaleArgument,\n dateStyle: DateStyle | undefined,\n timeStyle: TimeStyle | undefined,\n) => {\n return useMemo(() => new Intl.DateTimeFormat(locale, {dateStyle, timeStyle}), [locale, dateStyle, timeStyle]);\n};\n","import {useCallback, useMemo} from 'react';\n\nimport type {LocaleArgument} from './types';\n\ntype Duration = {\n years?: number;\n months?: number;\n weeks?: number;\n days?: number;\n};\n\nexport const useFormatRelativeTime = (locale: LocaleArgument) => {\n const formatter = useMemo(() => new Intl.RelativeTimeFormat(locale, {numeric: 'auto'}), [locale]);\n\n return useCallback(\n (duration: Duration) => {\n if (duration.years) {\n return formatter.format(duration.years, 'year');\n }\n if (duration.months) {\n return formatter.format(duration.months, 'month');\n }\n if (duration.weeks) {\n return formatter.format(duration.weeks, 'week');\n }\n if (duration.days) {\n return formatter.format(duration.days, 'day');\n }\n return formatter.format(0, 'day');\n },\n [formatter],\n );\n};\n"],"mappings":";;AAOA,IAAa,qBACX,QACA,WACA,cACG;AACH,QAAO,cAAc,IAAI,KAAK,eAAe,QAAQ;EAAC;EAAW;EAAU,CAAC,EAAE;EAAC;EAAQ;EAAW;EAAU,CAAC;;;;ACD/G,IAAa,yBAAyB,WAA2B;CAC/D,MAAM,YAAY,cAAc,IAAI,KAAK,mBAAmB,QAAQ,EAAC,SAAS,QAAO,CAAC,EAAE,CAAC,OAAO,CAAC;AAEjG,QAAO,aACJ,aAAuB;AACtB,MAAI,SAAS,MACX,QAAO,UAAU,OAAO,SAAS,OAAO,OAAO;AAEjD,MAAI,SAAS,OACX,QAAO,UAAU,OAAO,SAAS,QAAQ,QAAQ;AAEnD,MAAI,SAAS,MACX,QAAO,UAAU,OAAO,SAAS,OAAO,OAAO;AAEjD,MAAI,SAAS,KACX,QAAO,UAAU,OAAO,SAAS,MAAM,MAAM;AAE/C,SAAO,UAAU,OAAO,GAAG,MAAM;IAEnC,CAAC,UAAU,CACZ"}
|