@midas-ds/components 1.0.2
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/Breadcrumbs.css +1 -0
- package/Button-CCevm2s3.js +183 -0
- package/Button.css +1 -0
- package/ButtonGroup.css +1 -0
- package/CHANGELOG.md +76 -0
- package/Card.css +1 -0
- package/Checkbox-CllWDBxF.js +405 -0
- package/Checkbox.css +1 -0
- package/Collection-B3xUVWPF.js +483 -0
- package/ComboBox.css +1 -0
- package/DatePicker.css +1 -0
- package/Dialog-CLTyYwkS.js +1889 -0
- package/DragAndDrop-OTN7La7U.js +42 -0
- package/Dropdown.css +1 -0
- package/FileUpload.css +1 -0
- package/Flex.css +1 -0
- package/Flex.module-CpoxBzQX.js +37 -0
- package/FocusScope-BR0SJ-cZ.js +512 -0
- package/Form-DXLoQL91.js +240 -0
- package/Grid.css +1 -0
- package/Grid.module-Ia0e9Dix.js +36 -0
- package/Group-DPMuN3h8.js +44 -0
- package/Hidden-BQWDvze4.js +37 -0
- package/InfoBanner.css +1 -0
- package/Label-C18A_4Z5.js +69 -0
- package/Layout.css +1 -0
- package/Link-BU1h3K2a.js +77 -0
- package/Link.css +1 -0
- package/LinkButton.css +1 -0
- package/ListBox-D21tdwTs.js +463 -0
- package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
- package/Logo.css +1 -0
- package/Modal.css +1 -0
- package/MultiSelect.css +1 -0
- package/PressResponder-DP8ZDNGy.js +31 -0
- package/README.md +7 -0
- package/RSPContexts-EOiWkKOf.js +11 -0
- package/Radio.css +1 -0
- package/SearchField.css +1 -0
- package/Select.css +1 -0
- package/SelectionManager-D4WtKtey.js +988 -0
- package/Separator-DLUHK9vv.js +48 -0
- package/Spinner.css +1 -0
- package/Table.css +1 -0
- package/Tabs.css +1 -0
- package/Tag-CEd6WWSc.js +725 -0
- package/Tag.css +1 -0
- package/Text-DGLaY3HR.js +17 -0
- package/TextArea.css +1 -0
- package/TextField-C_hq9WeT.js +226 -0
- package/TextField.css +1 -0
- package/TextField.module-Cwq1FAm7.js +141 -0
- package/Toast.css +1 -0
- package/VisuallyHidden-B_XzVvlX.js +39 -0
- package/accordion/Accordion.d.ts +13 -0
- package/accordion/AccordionContent.d.ts +3 -0
- package/accordion/AccordionItem.d.ts +3 -0
- package/accordion/AccordionTagContext.d.ts +3 -0
- package/accordion/AccordionTrigger.d.ts +3 -0
- package/accordion/index.d.ts +5 -0
- package/breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/breadcrumbs/index.d.ts +1 -0
- package/button/Button.d.ts +41 -0
- package/button/ButtonGroup.d.ts +12 -0
- package/button/index.d.ts +2 -0
- package/card/Card.d.ts +34 -0
- package/card/index.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -0
- package/checkbox/CheckboxGroup.d.ts +10 -0
- package/checkbox/index.d.ts +2 -0
- package/chevron-down-Cd1bkzXT.js +13 -0
- package/chevron-right-DBMc9VMi.js +23 -0
- package/clsx-OuTLNxxd.js +16 -0
- package/combobox/ComboBox.d.ts +12 -0
- package/combobox/index.d.ts +1 -0
- package/context-ScOIq_Gu.js +80 -0
- package/createLucideIcon-DeWljiyi.js +79 -0
- package/date-picker/DatePicker.d.ts +14 -0
- package/date-picker/index.d.ts +2 -0
- package/dropdown/Dropdown.d.ts +8 -0
- package/dropdown/index.d.ts +1 -0
- package/file-upload/FileUpload.d.ts +11 -0
- package/file-upload/index.d.ts +1 -0
- package/flex/Flex.d.ts +17 -0
- package/flex/FlexItem.d.ts +15 -0
- package/flex/index.d.ts +2 -0
- package/grid/Grid.d.ts +16 -0
- package/grid/GridItem.d.ts +7 -0
- package/grid/index.d.ts +2 -0
- package/index-CEg5vZQH.js +132 -0
- package/index-CgfokhRq.js +674 -0
- package/index-CorR1LBD.js +3122 -0
- package/index-Dl1Q-tbj.js +26984 -0
- package/index.css +1 -0
- package/index.d.ts +29 -0
- package/index.js +114 -0
- package/index10.js +4 -0
- package/index11.js +5 -0
- package/index12.js +4 -0
- package/index13.js +4 -0
- package/index14.js +4 -0
- package/index15.js +6 -0
- package/index16.js +6 -0
- package/index17.js +6 -0
- package/index18.js +4 -0
- package/index19.js +6 -0
- package/index2.js +8 -0
- package/index20.js +6 -0
- package/index21.js +4 -0
- package/index22.js +5 -0
- package/index23.js +5 -0
- package/index24.js +5 -0
- package/index25.js +6 -0
- package/index26.js +6 -0
- package/index27.js +6 -0
- package/index28.js +4 -0
- package/index29.js +12 -0
- package/index3.js +8 -0
- package/index30.js +20 -0
- package/index31.js +22 -0
- package/index32.js +14 -0
- package/index33.js +11 -0
- package/index34.js +31 -0
- package/index35.js +8 -0
- package/index36.js +9 -0
- package/index37.js +19 -0
- package/index38.js +9 -0
- package/index39.js +9 -0
- package/index4.js +4 -0
- package/index40.js +16 -0
- package/index41.js +16 -0
- package/index42.js +31 -0
- package/index43.js +16 -0
- package/index44.js +6 -0
- package/index45.js +53 -0
- package/index46.js +18 -0
- package/index47.js +27 -0
- package/index48.js +18 -0
- package/index49.js +21 -0
- package/index5.js +5 -0
- package/index50.js +49 -0
- package/index51.js +5 -0
- package/index52.js +25 -0
- package/index53.js +18 -0
- package/index54.js +9 -0
- package/index55.js +25 -0
- package/index56.js +18 -0
- package/index57.js +11 -0
- package/index58.js +12 -0
- package/index59.js +15 -0
- package/index6.js +4 -0
- package/index60.js +9 -0
- package/index61.js +9 -0
- package/index62.js +19 -0
- package/index63.js +22 -0
- package/index64.js +61 -0
- package/index65.js +15 -0
- package/index66.js +11 -0
- package/index67.js +63 -0
- package/index68.js +85 -0
- package/index69.js +74 -0
- package/index7.js +9 -0
- package/index70.js +24 -0
- package/index71.js +69 -0
- package/index72.js +80 -0
- package/index73.js +140 -0
- package/index74.js +70 -0
- package/index75.js +42 -0
- package/index76.js +82 -0
- package/index77.js +71 -0
- package/index78.js +104 -0
- package/index79.js +274 -0
- package/index8.js +4 -0
- package/index80.js +724 -0
- package/index81.js +491 -0
- package/index82.js +317 -0
- package/index83.js +391 -0
- package/index84.js +254 -0
- package/index85.js +1364 -0
- package/index86.js +1009 -0
- package/index87.js +388 -0
- package/index88.js +2105 -0
- package/index89.js +2371 -0
- package/index9.js +5 -0
- package/index90.js +6834 -0
- package/index91.js +17 -0
- package/index92.js +14 -0
- package/index93.js +6 -0
- package/index94.js +9 -0
- package/info-banner/InfoBanner.d.ts +21 -0
- package/info-banner/index.d.ts +1 -0
- package/intlStrings-Cd44R5hT.js +278 -0
- package/layout/Layout.d.ts +51 -0
- package/layout/index.d.ts +1 -0
- package/link/Link.d.ts +13 -0
- package/link/index.d.ts +1 -0
- package/link-button/LinkButton.d.ts +18 -0
- package/link-button/index.d.ts +1 -0
- package/logo/Logo.d.ts +16 -0
- package/logo/index.d.ts +1 -0
- package/modal/Modal.d.ts +13 -0
- package/modal/index.d.ts +1 -0
- package/multi-select/MultiSelect.d.ts +28 -0
- package/multi-select/index.d.ts +1 -0
- package/package.json +29 -0
- package/radio/Radio.d.ts +20 -0
- package/radio/index.d.ts +1 -0
- package/react.esm-D8HpDGKP.js +11060 -0
- package/search-field/SearchField.d.ts +13 -0
- package/search-field/index.d.ts +1 -0
- package/select/Select.d.ts +11 -0
- package/select/index.d.ts +1 -0
- package/spinner/Spinner.d.ts +11 -0
- package/spinner/index.d.ts +1 -0
- package/table/Table.d.ts +12 -0
- package/table/index.d.ts +1 -0
- package/tabs/Tabs.d.ts +12 -0
- package/tabs/index.d.ts +1 -0
- package/tag/Tag.d.ts +11 -0
- package/tag/index.d.ts +1 -0
- package/textarea/TextArea.d.ts +20 -0
- package/textarea/index.d.ts +1 -0
- package/textfield/TextField.d.ts +16 -0
- package/textfield/index.d.ts +3 -0
- package/theme/index.d.ts +138 -0
- package/theme/tokens.d.ts +135 -0
- package/toast/Toast.d.ts +25 -0
- package/toast/index.d.ts +1 -0
- package/tokens-CjXmpXTi.js +160 -0
- package/triangle-alert-1OYl9KWz.js +56 -0
- package/useControlledState-S_TYcV_c.js +45 -0
- package/useDescription-D4_zk_sA.js +32 -0
- package/useFilter-BnJDBCkt.js +35 -0
- package/useFocusRing-D97-G3fT.js +1324 -0
- package/useFocusable-C-N9wcwm.js +56 -0
- package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
- package/useHasTabbableChild-DeuCnGGv.js +34 -0
- package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
- package/useListState-DSOTbsL3.js +119 -0
- package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
- package/useSingleSelectListState-CmX9_L5H.js +34 -0
- package/useUpdateEffect-Dtz-i14F.js +12 -0
- package/x-JK7i-TQC.js +14 -0
package/clsx-OuTLNxxd.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as c
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComboBoxProps as AriaComboBoxProps, ListBoxItemProps, ValidationResult } from 'react-aria-components';
|
|
3
|
+
export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<T>, 'children'> {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
7
|
+
items?: Iterable<T>;
|
|
8
|
+
children: React.ReactNode | ((item: T) => React.ReactNode);
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ComboBox<T extends object>({ label, description, errorMessage, children, items, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function ComboBoxItem(props: ListBoxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComboBox, ComboBoxItem } from './ComboBox';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import l, { useState as i, useEffect as d, useContext as $ } from "react";
|
|
2
|
+
import { g as u } from "./useFocusRing-D97-G3fT.js";
|
|
3
|
+
const s = /* @__PURE__ */ new Set([
|
|
4
|
+
"Arab",
|
|
5
|
+
"Syrc",
|
|
6
|
+
"Samr",
|
|
7
|
+
"Mand",
|
|
8
|
+
"Thaa",
|
|
9
|
+
"Mend",
|
|
10
|
+
"Nkoo",
|
|
11
|
+
"Adlm",
|
|
12
|
+
"Rohg",
|
|
13
|
+
"Hebr"
|
|
14
|
+
]), b = /* @__PURE__ */ new Set([
|
|
15
|
+
"ae",
|
|
16
|
+
"ar",
|
|
17
|
+
"arc",
|
|
18
|
+
"bcc",
|
|
19
|
+
"bqi",
|
|
20
|
+
"ckb",
|
|
21
|
+
"dv",
|
|
22
|
+
"fa",
|
|
23
|
+
"glk",
|
|
24
|
+
"he",
|
|
25
|
+
"ku",
|
|
26
|
+
"mzn",
|
|
27
|
+
"nqo",
|
|
28
|
+
"pnb",
|
|
29
|
+
"ps",
|
|
30
|
+
"sd",
|
|
31
|
+
"ug",
|
|
32
|
+
"ur",
|
|
33
|
+
"yi"
|
|
34
|
+
]);
|
|
35
|
+
function g(e) {
|
|
36
|
+
if (Intl.Locale) {
|
|
37
|
+
let t = new Intl.Locale(e).maximize(), r = typeof t.getTextInfo == "function" ? t.getTextInfo() : t.textInfo;
|
|
38
|
+
if (r) return r.direction === "rtl";
|
|
39
|
+
if (t.script) return s.has(t.script);
|
|
40
|
+
}
|
|
41
|
+
let n = e.split("-")[0];
|
|
42
|
+
return b.has(n);
|
|
43
|
+
}
|
|
44
|
+
const p = Symbol.for("react-aria.i18n.locale");
|
|
45
|
+
function c() {
|
|
46
|
+
let e = typeof window < "u" && window[p] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
47
|
+
try {
|
|
48
|
+
Intl.DateTimeFormat.supportedLocalesOf([
|
|
49
|
+
e
|
|
50
|
+
]);
|
|
51
|
+
} catch {
|
|
52
|
+
e = "en-US";
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
locale: e,
|
|
56
|
+
direction: g(e) ? "rtl" : "ltr"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
let o = c(), a = /* @__PURE__ */ new Set();
|
|
60
|
+
function f() {
|
|
61
|
+
o = c();
|
|
62
|
+
for (let e of a) e(o);
|
|
63
|
+
}
|
|
64
|
+
function x() {
|
|
65
|
+
let e = u(), [n, t] = i(o);
|
|
66
|
+
return d(() => (a.size === 0 && window.addEventListener("languagechange", f), a.add(t), () => {
|
|
67
|
+
a.delete(t), a.size === 0 && window.removeEventListener("languagechange", f);
|
|
68
|
+
}), []), e ? {
|
|
69
|
+
locale: "en-US",
|
|
70
|
+
direction: "ltr"
|
|
71
|
+
} : n;
|
|
72
|
+
}
|
|
73
|
+
const S = /* @__PURE__ */ l.createContext(null);
|
|
74
|
+
function L() {
|
|
75
|
+
let e = x();
|
|
76
|
+
return $(S) || e;
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
L as $
|
|
80
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { forwardRef as c, createElement as a } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.453.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const p = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), i = (...e) => e.filter((r, t, o) => !!r && o.indexOf(r) === t).join(" ");
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.453.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
var f = {
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
width: 24,
|
|
18
|
+
height: 24,
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
fill: "none",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeWidth: 2,
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round"
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @license lucide-react v0.453.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/
|
|
32
|
+
const g = c(
|
|
33
|
+
({
|
|
34
|
+
color: e = "currentColor",
|
|
35
|
+
size: r = 24,
|
|
36
|
+
strokeWidth: t = 2,
|
|
37
|
+
absoluteStrokeWidth: o,
|
|
38
|
+
className: s = "",
|
|
39
|
+
children: n,
|
|
40
|
+
iconNode: u,
|
|
41
|
+
...l
|
|
42
|
+
}, d) => a(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
ref: d,
|
|
46
|
+
...f,
|
|
47
|
+
width: r,
|
|
48
|
+
height: r,
|
|
49
|
+
stroke: e,
|
|
50
|
+
strokeWidth: o ? Number(t) * 24 / Number(r) : t,
|
|
51
|
+
className: i("lucide", s),
|
|
52
|
+
...l
|
|
53
|
+
},
|
|
54
|
+
[
|
|
55
|
+
...u.map(([m, w]) => a(m, w)),
|
|
56
|
+
...Array.isArray(n) ? n : [n]
|
|
57
|
+
]
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
/**
|
|
61
|
+
* @license lucide-react v0.453.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/
|
|
66
|
+
const C = (e, r) => {
|
|
67
|
+
const t = c(
|
|
68
|
+
({ className: o, ...s }, n) => a(g, {
|
|
69
|
+
ref: n,
|
|
70
|
+
iconNode: r,
|
|
71
|
+
className: i(`lucide-${p(e)}`, o),
|
|
72
|
+
...s
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
return t.displayName = `${e}`, t;
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
C as c
|
|
79
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DatePickerProps, DateRangePickerProps, DateValue, ValidationResult } from 'react-aria-components';
|
|
2
|
+
interface MidasDateRangePickerProps<T extends DateValue> extends DateRangePickerProps<T> {
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
6
|
+
}
|
|
7
|
+
export declare const DateRangePicker: <T extends DateValue>({ label, description, errorMessage, ...props }: MidasDateRangePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface MidasDatePickerProps<T extends DateValue> extends DatePickerProps<T> {
|
|
9
|
+
label?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
12
|
+
}
|
|
13
|
+
export declare const DatePicker: <T extends DateValue>({ label, description, errorMessage, ...props }: MidasDatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MenuItemProps, MenuProps, MenuTriggerProps } from 'react-aria-components';
|
|
2
|
+
interface MidasMenuButtonProps<T> extends MenuProps<T>, Omit<MenuTriggerProps, 'children'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Dropdown<T extends object>({ label, title, children, ...props }: MidasMenuButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function DropdownItem(props: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dropdown, DropdownItem } from './Dropdown';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileTriggerProps as AriaFileTriggerProps } from 'react-aria-components';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface FileTriggerProps extends AriaFileTriggerProps {
|
|
4
|
+
/** Label for the file upload button */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Additional description field */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Use DropZone version */
|
|
9
|
+
dropzone?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const FileUpload: React.FC<FileTriggerProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileUpload } from './FileUpload';
|
package/flex/Flex.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface FlexProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Removes outer margins for nested use. First Flex on a page should have outer margins. */
|
|
5
|
+
fluid?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Grid based on display: flex;
|
|
9
|
+
* Calculates breakpoints and distributes columns according to MV specifications
|
|
10
|
+
*
|
|
11
|
+
* ### Children
|
|
12
|
+
* Use FlexItem to manage each column.
|
|
13
|
+
* FlexItem accepts values of 1 through 12 and auto.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link: https://migrationsverket.se/components/flex}
|
|
16
|
+
*/
|
|
17
|
+
export declare const Flex: React.FC<FlexProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface FlexItemProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Column size and behaviour */
|
|
5
|
+
col?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
6
|
+
/** Additional spacing between columns */
|
|
7
|
+
offset?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Columns based on display: flex;
|
|
11
|
+
* FlexItem accepts values of 1 through 12 and auto.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link: https://migrationsverket.se/components/flex}
|
|
14
|
+
*/
|
|
15
|
+
export declare const FlexItem: React.FC<FlexItemProps>;
|
package/flex/index.d.ts
ADDED
package/grid/Grid.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface GridProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Removes outer margins for nested use. First Flex on a page should have outer margins. */
|
|
5
|
+
fluid?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Grid based on display: grid;
|
|
9
|
+
* Calculates breakpoints and distributes columns according to MV specifications
|
|
10
|
+
*
|
|
11
|
+
* ### Children
|
|
12
|
+
* Use GridItem to manage each column.
|
|
13
|
+
* GridItem accepts values of 1 through 12 and auto.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Grid: React.FC<GridProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridItemProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Column size and behaviour */
|
|
5
|
+
col?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
6
|
+
}
|
|
7
|
+
export declare const GridItem: React.FC<GridItemProps>;
|
package/grid/index.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import V from "react";
|
|
2
|
+
var R = { exports: {} }, w = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* use-sync-external-store-shim.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var A;
|
|
13
|
+
function G() {
|
|
14
|
+
if (A) return w;
|
|
15
|
+
A = 1;
|
|
16
|
+
var r = V;
|
|
17
|
+
function O(t, o) {
|
|
18
|
+
return t === o && (t !== 0 || 1 / t === 1 / o) || t !== t && o !== o;
|
|
19
|
+
}
|
|
20
|
+
var p = typeof Object.is == "function" ? Object.is : O, h = r.useState, y = r.useEffect, v = r.useLayoutEffect, m = r.useDebugValue;
|
|
21
|
+
function L(t, o) {
|
|
22
|
+
var a = o(), S = h({ inst: { value: a, getSnapshot: o } }), i = S[0].inst, d = S[1];
|
|
23
|
+
return v(function() {
|
|
24
|
+
i.value = a, i.getSnapshot = o, f(i) && d({ inst: i });
|
|
25
|
+
}, [t, a, o]), y(function() {
|
|
26
|
+
return f(i) && d({ inst: i }), t(function() {
|
|
27
|
+
f(i) && d({ inst: i });
|
|
28
|
+
});
|
|
29
|
+
}, [t]), m(a), a;
|
|
30
|
+
}
|
|
31
|
+
function f(t) {
|
|
32
|
+
var o = t.getSnapshot;
|
|
33
|
+
t = t.value;
|
|
34
|
+
try {
|
|
35
|
+
var a = o();
|
|
36
|
+
return !p(t, a);
|
|
37
|
+
} catch {
|
|
38
|
+
return !0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function g(t, o) {
|
|
42
|
+
return o();
|
|
43
|
+
}
|
|
44
|
+
var E = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : L;
|
|
45
|
+
return w.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : E, w;
|
|
46
|
+
}
|
|
47
|
+
var T = {};
|
|
48
|
+
/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim.development.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/
|
|
57
|
+
var D;
|
|
58
|
+
function B() {
|
|
59
|
+
return D || (D = 1, process.env.NODE_ENV !== "production" && function() {
|
|
60
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
61
|
+
var r = V, O = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
62
|
+
function p(n) {
|
|
63
|
+
{
|
|
64
|
+
for (var e = arguments.length, s = new Array(e > 1 ? e - 1 : 0), u = 1; u < e; u++)
|
|
65
|
+
s[u - 1] = arguments[u];
|
|
66
|
+
h("error", n, s);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function h(n, e, s) {
|
|
70
|
+
{
|
|
71
|
+
var u = O.ReactDebugCurrentFrame, l = u.getStackAddendum();
|
|
72
|
+
l !== "" && (e += "%s", s = s.concat([l]));
|
|
73
|
+
var _ = s.map(function(c) {
|
|
74
|
+
return String(c);
|
|
75
|
+
});
|
|
76
|
+
_.unshift("Warning: " + e), Function.prototype.apply.call(console[n], console, _);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function y(n, e) {
|
|
80
|
+
return n === e && (n !== 0 || 1 / n === 1 / e) || n !== n && e !== e;
|
|
81
|
+
}
|
|
82
|
+
var v = typeof Object.is == "function" ? Object.is : y, m = r.useState, L = r.useEffect, f = r.useLayoutEffect, g = r.useDebugValue, E = !1, t = !1;
|
|
83
|
+
function o(n, e, s) {
|
|
84
|
+
E || r.startTransition !== void 0 && (E = !0, p("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
85
|
+
var u = e();
|
|
86
|
+
if (!t) {
|
|
87
|
+
var l = e();
|
|
88
|
+
v(u, l) || (p("The result of getSnapshot should be cached to avoid an infinite loop"), t = !0);
|
|
89
|
+
}
|
|
90
|
+
var _ = m({
|
|
91
|
+
inst: {
|
|
92
|
+
value: u,
|
|
93
|
+
getSnapshot: e
|
|
94
|
+
}
|
|
95
|
+
}), c = _[0].inst, x = _[1];
|
|
96
|
+
return f(function() {
|
|
97
|
+
c.value = u, c.getSnapshot = e, a(c) && x({
|
|
98
|
+
inst: c
|
|
99
|
+
});
|
|
100
|
+
}, [n, u, e]), L(function() {
|
|
101
|
+
a(c) && x({
|
|
102
|
+
inst: c
|
|
103
|
+
});
|
|
104
|
+
var U = function() {
|
|
105
|
+
a(c) && x({
|
|
106
|
+
inst: c
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
return n(U);
|
|
110
|
+
}, [n]), g(u), u;
|
|
111
|
+
}
|
|
112
|
+
function a(n) {
|
|
113
|
+
var e = n.getSnapshot, s = n.value;
|
|
114
|
+
try {
|
|
115
|
+
var u = e();
|
|
116
|
+
return !v(s, u);
|
|
117
|
+
} catch {
|
|
118
|
+
return !0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function S(n, e, s) {
|
|
122
|
+
return e();
|
|
123
|
+
}
|
|
124
|
+
var i = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", d = !i, C = d ? S : o, I = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : C;
|
|
125
|
+
T.useSyncExternalStore = I, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
126
|
+
}()), T;
|
|
127
|
+
}
|
|
128
|
+
process.env.NODE_ENV === "production" ? R.exports = G() : R.exports = B();
|
|
129
|
+
var H = R.exports;
|
|
130
|
+
export {
|
|
131
|
+
H as s
|
|
132
|
+
};
|