@smudi/designsystem 1.4.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/@smudi/assets/InterVariable.woff2 +0 -0
- package/@smudi/assets/UDI-red-logo.svg.js +4 -0
- package/@smudi/components/alert/alert.d.ts +6 -0
- package/@smudi/components/alert/alert.d.ts.map +1 -0
- package/@smudi/components/alert/alert.js +6 -0
- package/@smudi/components/avatar/avatar.d.ts +6 -0
- package/@smudi/components/avatar/avatar.d.ts.map +1 -0
- package/@smudi/components/avatar/avatar.js +6 -0
- package/@smudi/components/avatar-stack/avatar-stack.d.ts +6 -0
- package/@smudi/components/avatar-stack/avatar-stack.d.ts.map +1 -0
- package/@smudi/components/avatar-stack/avatar-stack.js +6 -0
- package/@smudi/components/badge/badge.d.ts +6 -0
- package/@smudi/components/badge/badge.d.ts.map +1 -0
- package/@smudi/components/badge/badge.js +6 -0
- package/@smudi/components/breadcrumbs/breadcrumbs.d.ts +6 -0
- package/@smudi/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/@smudi/components/breadcrumbs/breadcrumbs.js +6 -0
- package/@smudi/components/button/button.d.ts +8 -0
- package/@smudi/components/button/button.d.ts.map +1 -0
- package/@smudi/components/button/button.js +25 -0
- package/@smudi/components/card/card-icon-block.d.ts +6 -0
- package/@smudi/components/card/card-icon-block.d.ts.map +1 -0
- package/@smudi/components/card/card-icon-block.js +21 -0
- package/@smudi/components/card/card.d.ts +9 -0
- package/@smudi/components/card/card.d.ts.map +1 -0
- package/@smudi/components/card/card.js +8 -0
- package/@smudi/components/checkbox/checkbox.d.ts +6 -0
- package/@smudi/components/checkbox/checkbox.d.ts.map +1 -0
- package/@smudi/components/checkbox/checkbox.js +6 -0
- package/@smudi/components/chip/chip.d.ts +5 -0
- package/@smudi/components/chip/chip.d.ts.map +1 -0
- package/@smudi/components/chip/chip.js +9 -0
- package/@smudi/components/details/details.d.ts +6 -0
- package/@smudi/components/details/details.d.ts.map +1 -0
- package/@smudi/components/details/details.js +6 -0
- package/@smudi/components/dialog/dialog-section.d.ts +22 -0
- package/@smudi/components/dialog/dialog-section.d.ts.map +1 -0
- package/@smudi/components/dialog/dialog-section.js +20 -0
- package/@smudi/components/dialog/dialog.d.ts +9 -0
- package/@smudi/components/dialog/dialog.d.ts.map +1 -0
- package/@smudi/components/dialog/dialog.js +8 -0
- package/@smudi/components/divider/divider.d.ts +6 -0
- package/@smudi/components/divider/divider.d.ts.map +1 -0
- package/@smudi/components/divider/divider.js +6 -0
- package/@smudi/components/dropdown/dropdown-button.d.ts +30 -0
- package/@smudi/components/dropdown/dropdown-button.d.ts.map +1 -0
- package/@smudi/components/dropdown/dropdown-button.js +15 -0
- package/@smudi/components/dropdown/dropdown-context.d.ts +7 -0
- package/@smudi/components/dropdown/dropdown-context.d.ts.map +1 -0
- package/@smudi/components/dropdown/dropdown-context.js +12 -0
- package/@smudi/components/dropdown/dropdown-item.d.ts +10 -0
- package/@smudi/components/dropdown/dropdown-item.d.ts.map +1 -0
- package/@smudi/components/dropdown/dropdown-item.js +13 -0
- package/@smudi/components/dropdown/dropdown-list.d.ts +10 -0
- package/@smudi/components/dropdown/dropdown-list.d.ts.map +1 -0
- package/@smudi/components/dropdown/dropdown-list.js +13 -0
- package/@smudi/components/dropdown/dropdown.d.ts +20 -0
- package/@smudi/components/dropdown/dropdown.d.ts.map +1 -0
- package/@smudi/components/dropdown/dropdown.js +42 -0
- package/@smudi/components/error-summary/error-summary.d.ts +6 -0
- package/@smudi/components/error-summary/error-summary.d.ts.map +1 -0
- package/@smudi/components/error-summary/error-summary.js +6 -0
- package/@smudi/components/field/field.d.ts +6 -0
- package/@smudi/components/field/field.d.ts.map +1 -0
- package/@smudi/components/field/field.js +6 -0
- package/@smudi/components/fieldset/fieldset.d.ts +6 -0
- package/@smudi/components/fieldset/fieldset.d.ts.map +1 -0
- package/@smudi/components/fieldset/fieldset.js +6 -0
- package/@smudi/components/header/header-content.d.ts +4 -0
- package/@smudi/components/header/header-content.d.ts.map +1 -0
- package/@smudi/components/header/header-content.js +19 -0
- package/@smudi/components/header/header-divider.d.ts +4 -0
- package/@smudi/components/header/header-divider.d.ts.map +1 -0
- package/@smudi/components/header/header-divider.js +23 -0
- package/@smudi/components/header/header-menu/header-menu-button.d.ts +4 -0
- package/@smudi/components/header/header-menu/header-menu-button.d.ts.map +1 -0
- package/@smudi/components/header/header-menu/header-menu-button.js +39 -0
- package/@smudi/components/header/header-menu/header-menu-content.d.ts +4 -0
- package/@smudi/components/header/header-menu/header-menu-content.d.ts.map +1 -0
- package/@smudi/components/header/header-menu/header-menu-content.js +17 -0
- package/@smudi/components/header/header-menu/header-menu-group.d.ts +4 -0
- package/@smudi/components/header/header-menu/header-menu-group.d.ts.map +1 -0
- package/@smudi/components/header/header-menu/header-menu-group.js +19 -0
- package/@smudi/components/header/header-menu/header-menu-item.d.ts +12 -0
- package/@smudi/components/header/header-menu/header-menu-item.d.ts.map +1 -0
- package/@smudi/components/header/header-menu/header-menu-item.js +23 -0
- package/@smudi/components/header/header-menu/header-menu.d.ts +5 -0
- package/@smudi/components/header/header-menu/header-menu.d.ts.map +1 -0
- package/@smudi/components/header/header-menu/header-menu.js +69 -0
- package/@smudi/components/header/header-menu/index.d.ts +11 -0
- package/@smudi/components/header/header-menu/index.d.ts.map +1 -0
- package/@smudi/components/header/header-search/header-search-button.d.ts +9 -0
- package/@smudi/components/header/header-search/header-search-button.d.ts.map +1 -0
- package/@smudi/components/header/header-search/header-search-button.js +44 -0
- package/@smudi/components/header/header-search/header-search.d.ts +17 -0
- package/@smudi/components/header/header-search/header-search.d.ts.map +1 -0
- package/@smudi/components/header/header-search/header-search.js +69 -0
- package/@smudi/components/header/header-search/index.d.ts +5 -0
- package/@smudi/components/header/header-search/index.d.ts.map +1 -0
- package/@smudi/components/header/header.d.ts +55 -0
- package/@smudi/components/header/header.d.ts.map +1 -0
- package/@smudi/components/header/header.js +97 -0
- package/@smudi/components/header/index.d.ts +36 -0
- package/@smudi/components/header/index.d.ts.map +1 -0
- package/@smudi/components/header/index.js +34 -0
- package/@smudi/components/input/input.d.ts +6 -0
- package/@smudi/components/input/input.d.ts.map +1 -0
- package/@smudi/components/input/input.js +6 -0
- package/@smudi/components/layout-components/box-layouts/box-layout.d.ts +37 -0
- package/@smudi/components/layout-components/box-layouts/box-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/box-layouts/box-layout.js +70 -0
- package/@smudi/components/layout-components/box-layouts/box-layout.module.css.js +6 -0
- package/@smudi/components/layout-components/center-layouts/center-layout.d.ts +30 -0
- package/@smudi/components/layout-components/center-layouts/center-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/center-layouts/center-layout.js +31 -0
- package/@smudi/components/layout-components/center-layouts/center-layout.module.css.js +7 -0
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.d.ts +33 -0
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.js +35 -0
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.module.css.js +6 -0
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-align-css.d.ts +2 -0
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-align-css.d.ts.map +1 -0
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-justify-css.d.ts +2 -0
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-justify-css.d.ts.map +1 -0
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-align.type.d.ts +2 -0
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-align.type.d.ts.map +1 -0
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-justify.type.d.ts +2 -0
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-justify.type.d.ts.map +1 -0
- package/@smudi/components/layout-components/grid-layouts/grid-layout.d.ts +39 -0
- package/@smudi/components/layout-components/grid-layouts/grid-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/grid-layouts/grid-layout.js +40 -0
- package/@smudi/components/layout-components/grid-layouts/grid-layout.module.css.js +6 -0
- package/@smudi/components/layout-components/stack-layouts/stack-layout.d.ts +31 -0
- package/@smudi/components/layout-components/stack-layouts/stack-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/stack-layouts/stack-layout.js +46 -0
- package/@smudi/components/layout-components/stack-layouts/stack-layout.module.css.js +6 -0
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.d.ts +34 -0
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.d.ts.map +1 -0
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.js +41 -0
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.module.css.js +6 -0
- package/@smudi/components/link/link.d.ts +6 -0
- package/@smudi/components/link/link.d.ts.map +1 -0
- package/@smudi/components/link/link.js +6 -0
- package/@smudi/components/list/list.d.ts +5 -0
- package/@smudi/components/list/list.d.ts.map +1 -0
- package/@smudi/components/list/list.js +5 -0
- package/@smudi/components/pagination/pagination.d.ts +6 -0
- package/@smudi/components/pagination/pagination.d.ts.map +1 -0
- package/@smudi/components/pagination/pagination.js +6 -0
- package/@smudi/components/popover/popover.d.ts +6 -0
- package/@smudi/components/popover/popover.d.ts.map +1 -0
- package/@smudi/components/popover/popover.js +6 -0
- package/@smudi/components/radio/radio.d.ts +6 -0
- package/@smudi/components/radio/radio.d.ts.map +1 -0
- package/@smudi/components/radio/radio.js +6 -0
- package/@smudi/components/search/search.d.ts +6 -0
- package/@smudi/components/search/search.d.ts.map +1 -0
- package/@smudi/components/search/search.js +6 -0
- package/@smudi/components/select/select.d.ts +6 -0
- package/@smudi/components/select/select.d.ts.map +1 -0
- package/@smudi/components/select/select.js +9 -0
- package/@smudi/components/skeleton/skeleton.d.ts +6 -0
- package/@smudi/components/skeleton/skeleton.d.ts.map +1 -0
- package/@smudi/components/skeleton/skeleton.js +6 -0
- package/@smudi/components/skip-link/skip-link.d.ts +6 -0
- package/@smudi/components/skip-link/skip-link.d.ts.map +1 -0
- package/@smudi/components/skip-link/skip-link.js +6 -0
- package/@smudi/components/spinner/spinner.d.ts +6 -0
- package/@smudi/components/spinner/spinner.d.ts.map +1 -0
- package/@smudi/components/spinner/spinner.js +6 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.d.ts +9 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.d.ts.map +1 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.js +14 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.d.ts +4 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.d.ts.map +1 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.js +33 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.d.ts +37 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.d.ts.map +1 -0
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.js +102 -0
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.d.ts +21 -0
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.d.ts.map +1 -0
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.js +126 -0
- package/@smudi/components/suggestion/suggestion.d.ts +16 -0
- package/@smudi/components/suggestion/suggestion.d.ts.map +1 -0
- package/@smudi/components/suggestion/suggestion.js +13 -0
- package/@smudi/components/switch/switch.d.ts +6 -0
- package/@smudi/components/switch/switch.d.ts.map +1 -0
- package/@smudi/components/table/table.d.ts +6 -0
- package/@smudi/components/table/table.d.ts.map +1 -0
- package/@smudi/components/table/table.js +6 -0
- package/@smudi/components/tabs/tabs-content.d.ts +6 -0
- package/@smudi/components/tabs/tabs-content.d.ts.map +1 -0
- package/@smudi/components/tabs/tabs-content.js +6 -0
- package/@smudi/components/tabs/tabs-list.d.ts +6 -0
- package/@smudi/components/tabs/tabs-list.d.ts.map +1 -0
- package/@smudi/components/tabs/tabs-list.js +6 -0
- package/@smudi/components/tabs/tabs-trigger.d.ts +6 -0
- package/@smudi/components/tabs/tabs-trigger.d.ts.map +1 -0
- package/@smudi/components/tabs/tabs-trigger.js +6 -0
- package/@smudi/components/tabs/tabs.d.ts +6 -0
- package/@smudi/components/tabs/tabs.d.ts.map +1 -0
- package/@smudi/components/tabs/tabs.js +6 -0
- package/@smudi/components/tag/tag.d.ts +6 -0
- package/@smudi/components/tag/tag.d.ts.map +1 -0
- package/@smudi/components/tag/tag.js +6 -0
- package/@smudi/components/textarea/text-area.d.ts +6 -0
- package/@smudi/components/textarea/text-area.d.ts.map +1 -0
- package/@smudi/components/textarea/text-area.js +6 -0
- package/@smudi/components/textfield/textfield.d.ts +6 -0
- package/@smudi/components/textfield/textfield.d.ts.map +1 -0
- package/@smudi/components/textfield/textfield.js +6 -0
- package/@smudi/components/toast/toast.d.ts +39 -0
- package/@smudi/components/toast/toast.d.ts.map +1 -0
- package/@smudi/components/toast/toast.js +285 -0
- package/@smudi/components/toggle-group/toggle-group.d.ts +6 -0
- package/@smudi/components/toggle-group/toggle-group.d.ts.map +1 -0
- package/@smudi/components/toggle-group/toggle-group.js +7 -0
- package/@smudi/components/tooltip/tooltip.d.ts +6 -0
- package/@smudi/components/tooltip/tooltip.d.ts.map +1 -0
- package/@smudi/components/tooltip/tooltip.js +6 -0
- package/@smudi/components/typography/heading/heading.d.ts +6 -0
- package/@smudi/components/typography/heading/heading.d.ts.map +1 -0
- package/@smudi/components/typography/heading/heading.js +6 -0
- package/@smudi/components/typography/paragraph/paragraph.d.ts +6 -0
- package/@smudi/components/typography/paragraph/paragraph.d.ts.map +1 -0
- package/@smudi/components/typography/paragraph/paragraph.js +6 -0
- package/@smudi/components/utils/apply-inert-outside.d.ts +17 -0
- package/@smudi/components/utils/apply-inert-outside.d.ts.map +1 -0
- package/@smudi/components/utils/apply-inert-outside.js +12 -0
- package/@smudi/components/utils/class-names.d.ts +2 -0
- package/@smudi/components/utils/class-names.d.ts.map +1 -0
- package/@smudi/components/utils/class-names.js +6 -0
- package/@smudi/icons/generated/SmudiBiometryIcon.js +32 -0
- package/@smudi/icons/generated/SmudiFingerprintIcon.js +62 -0
- package/@smudi/icons/generated/SmudiFlagIcon.js +30 -0
- package/@smudi/icons/generated/SmudiScanIcon.js +30 -0
- package/@smudi/react.js +198 -0
- package/@smudi/smudi/icons/generated/SmudiBiometryIcon.d.ts +8 -0
- package/@smudi/smudi/icons/generated/SmudiBiometryIcon.d.ts.map +1 -0
- package/@smudi/smudi/icons/generated/SmudiFingerprintIcon.d.ts +8 -0
- package/@smudi/smudi/icons/generated/SmudiFingerprintIcon.d.ts.map +1 -0
- package/@smudi/smudi/icons/generated/SmudiFlagIcon.d.ts +8 -0
- package/@smudi/smudi/icons/generated/SmudiFlagIcon.d.ts.map +1 -0
- package/@smudi/smudi/icons/generated/SmudiScanIcon.d.ts +8 -0
- package/@smudi/smudi/icons/generated/SmudiScanIcon.d.ts.map +1 -0
- package/@smudi/smudi/icons/generated/index.d.ts +5 -0
- package/@smudi/smudi/icons/generated/index.d.ts.map +1 -0
- package/@smudi/smudi/icons/metadata.d.ts +32 -0
- package/@smudi/smudi/icons/metadata.d.ts.map +1 -0
- package/@smudi/smudi/react.d.ts +55 -0
- package/@smudi/smudi/react.d.ts.map +1 -0
- package/@smudi/styles.css +1 -0
- package/@smudi/types/modular-scale.type.d.ts +18 -0
- package/@smudi/types/modular-scale.type.d.ts.map +1 -0
- package/@smudi/types/polymorphic-component.type.d.ts +35 -0
- package/@smudi/types/polymorphic-component.type.d.ts.map +1 -0
- package/@smudi/types/utils/coerce-string-to-number.d.ts +4 -0
- package/@smudi/types/utils/coerce-string-to-number.d.ts.map +1 -0
- package/@smudi/types/utils/exclude-strict.d.ts +2 -0
- package/@smudi/types/utils/exclude-strict.d.ts.map +1 -0
- package/@smudi/types/utils/omit-strict.d.ts +2 -0
- package/@smudi/types/utils/omit-strict.d.ts.map +1 -0
- package/@smudi/utils/append-class-name.js +10 -0
- package/@smudi/utils/combine-refs.js +10 -0
- package/README.md +83 -0
- package/package.json +80 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { appendClassName as u } from "../../../utils/append-class-name.js";
|
|
3
|
+
import v from "./wrapper-layout.module.css.js";
|
|
4
|
+
const x = {
|
|
5
|
+
xs: "var(--ds-size-3)",
|
|
6
|
+
sm: "var(--ds-size-4)",
|
|
7
|
+
md: "var(--ds-size-6)",
|
|
8
|
+
lg: "var(--ds-size-8)"
|
|
9
|
+
}, W = (e) => e ? x[e] : void 0, L = (e) => {
|
|
10
|
+
const {
|
|
11
|
+
as: a = "div",
|
|
12
|
+
className: r = "",
|
|
13
|
+
gutter: t,
|
|
14
|
+
maxWidth: s,
|
|
15
|
+
variant: o = "none",
|
|
16
|
+
style: i,
|
|
17
|
+
children: n,
|
|
18
|
+
...m
|
|
19
|
+
} = e, p = u(
|
|
20
|
+
v["smudi-wrapper"],
|
|
21
|
+
r
|
|
22
|
+
), l = W(t), d = typeof s == "number" ? `${s}px` : s, c = {
|
|
23
|
+
"--gutter": l,
|
|
24
|
+
"--max-width": d,
|
|
25
|
+
...i
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ y(
|
|
28
|
+
a,
|
|
29
|
+
{
|
|
30
|
+
className: p,
|
|
31
|
+
style: c,
|
|
32
|
+
"data-variant": o,
|
|
33
|
+
...m,
|
|
34
|
+
children: n
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
L.displayName = "WrapperLayout";
|
|
39
|
+
export {
|
|
40
|
+
L as default
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../components/link/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEhF,KAAK,IAAI,GAAG,OAAO,QAAQ,CAAC;AAE5B,QAAA,MAAM,aAAa,EAAE,IAAe,CAAC;AAIrC,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../components/list/list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEhE,KAAK,IAAI,GAAG,OAAO,QAAQ,CAAC;AAE5B,QAAA,MAAM,aAAa,EAAE,IAAe,CAAC;AAErC,OAAO,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Pagination as PaginationRoot, PaginationProps } from '@digdir/designsystemet-react';
|
|
2
|
+
type Pagination = typeof PaginationRoot;
|
|
3
|
+
declare const PaginationComponent: Pagination;
|
|
4
|
+
export type { PaginationProps };
|
|
5
|
+
export { PaginationComponent as Pagination };
|
|
6
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../components/pagination/pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,UAAU,GAAG,OAAO,cAAc,CAAC;AAExC,QAAA,MAAM,mBAAmB,EAAE,UAA2B,CAAC;AAIvD,YAAY,EAAE,eAAe,EAAE,CAAC;AAChC,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Popover as PopoverRoot, PopoverProps } from '@digdir/designsystemet-react';
|
|
2
|
+
type Popover = typeof PopoverRoot;
|
|
3
|
+
declare const PopoverComponent: Popover;
|
|
4
|
+
export type { PopoverProps };
|
|
5
|
+
export { PopoverComponent as Popover };
|
|
6
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,OAAO,GAAG,OAAO,WAAW,CAAC;AAElC,QAAA,MAAM,gBAAgB,EAAE,OAAqB,CAAC;AAI9C,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../components/radio/radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,KAAK,UAAU,EAChB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,KAAK,GAAG,OAAO,SAAS,CAAC;AAE9B,QAAA,MAAM,cAAc,EAAE,KAAiB,CAAC;AAGxC,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../components/search/search.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,MAAM,GAAG,OAAO,UAAU,CAAC;AAEhC,QAAA,MAAM,eAAe,EAAE,MAAmB,CAAC;AAI3C,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../components/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,MAAM,GAAG,OAAO,UAAU,CAAC;AAEhC,QAAA,MAAM,eAAe,EAAE,MAGrB,CAAC;AAIH,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Skeleton as SkeletonRoot, SkeletonProps } from '@digdir/designsystemet-react';
|
|
2
|
+
type Skeleton = typeof SkeletonRoot;
|
|
3
|
+
declare const SkeletonComponent: Skeleton;
|
|
4
|
+
export type { SkeletonProps };
|
|
5
|
+
export { SkeletonComponent as Skeleton };
|
|
6
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,QAAQ,GAAG,OAAO,YAAY,CAAC;AAEpC,QAAA,MAAM,iBAAiB,EAAE,QAAuB,CAAC;AAIjD,YAAY,EAAE,aAAa,EAAE,CAAC;AAC9B,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SkipLink as SkipLinkRoot, SkipLinkProps } from '@digdir/designsystemet-react';
|
|
2
|
+
type SkipLink = typeof SkipLinkRoot;
|
|
3
|
+
declare const SkipLinkComponent: SkipLink;
|
|
4
|
+
export type { SkipLinkProps };
|
|
5
|
+
export { SkipLinkComponent as SkipLink };
|
|
6
|
+
//# sourceMappingURL=skip-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../components/skip-link/skip-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,QAAQ,GAAG,OAAO,YAAY,CAAC;AAEpC,QAAA,MAAM,iBAAiB,EAAE,QAAuB,CAAC;AAIjD,YAAY,EAAE,aAAa,EAAE,CAAC;AAC9B,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Spinner as SpinnerRoot, SpinnerProps } from '@digdir/designsystemet-react';
|
|
2
|
+
type Spinner = typeof SpinnerRoot;
|
|
3
|
+
declare const SpinnerComponent: Spinner;
|
|
4
|
+
export type { SpinnerProps };
|
|
5
|
+
export { SpinnerComponent as Spinner };
|
|
6
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,OAAO,GAAG,OAAO,WAAW,CAAC;AAElC,QAAA,MAAM,gBAAgB,EAAE,OAAqB,CAAC;AAI9C,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface SmudiSuggestionContextType {
|
|
2
|
+
showToggleAll?: boolean | string;
|
|
3
|
+
isAllSelected?: boolean;
|
|
4
|
+
toggleSelectAll: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const SmudiSuggestionContext: React.Context<SmudiSuggestionContextType>;
|
|
7
|
+
export declare function useSmudiSuggestion(): SmudiSuggestionContextType;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=smudi-suggestion-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smudi-suggestion-context.d.ts","sourceRoot":"","sources":["../../../../components/suggestion/smudi-suggestion/smudi-suggestion-context.tsx"],"names":[],"mappings":"AAEA,UAAU,0BAA0B;IAClC,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,sBAAsB,2CAElC,CAAC;AAEF,wBAAgB,kBAAkB,+BAOjC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext as e, useContext as n } from "react";
|
|
2
|
+
const o = e(
|
|
3
|
+
null
|
|
4
|
+
);
|
|
5
|
+
function i() {
|
|
6
|
+
const t = n(o);
|
|
7
|
+
if (!t)
|
|
8
|
+
throw new Error("useSmudiSuggestion must be used within Suggestion");
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as SmudiSuggestionContext,
|
|
13
|
+
i as useSmudiSuggestion
|
|
14
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SuggestionListProps } from '@digdir/designsystemet-react';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export declare const SmudiSuggestionList: ForwardRefExoticComponent<SuggestionListProps & RefAttributes<HTMLDataListElement>>;
|
|
4
|
+
//# sourceMappingURL=smudi-suggestion-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smudi-suggestion-list.d.ts","sourceRoot":"","sources":["../../../../components/suggestion/smudi-suggestion/smudi-suggestion-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,yBAAyB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7E,eAAO,MAAM,mBAAmB,EAAE,yBAAyB,CACzD,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CA+BzD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as a, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { EXPERIMENTAL_Suggestion as o, Divider as c } from "@digdir/designsystemet-react";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
|
+
import { useSmudiSuggestion as u } from "./smudi-suggestion-context.js";
|
|
5
|
+
import { INTERNAL_SELECT_ALL_MARKER_VALUE as p } from "./smudi-suggestion.js";
|
|
6
|
+
const f = d(
|
|
7
|
+
({ children: r, ...s }, m) => {
|
|
8
|
+
const { isAllSelected: t, toggleSelectAll: g, showToggleAll: e } = u();
|
|
9
|
+
return /* @__PURE__ */ i(o.List, { ...s, ref: m, children: [
|
|
10
|
+
e && /* @__PURE__ */ i(a, { children: [
|
|
11
|
+
/* @__PURE__ */ l(
|
|
12
|
+
o.Option,
|
|
13
|
+
{
|
|
14
|
+
"aria-selected": t,
|
|
15
|
+
selected: t,
|
|
16
|
+
className: "smudi-select-all",
|
|
17
|
+
onClick: (n) => {
|
|
18
|
+
n.preventDefault(), g();
|
|
19
|
+
},
|
|
20
|
+
value: p,
|
|
21
|
+
children: typeof e == "string" ? e : "Velg alle"
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ l(c, {})
|
|
25
|
+
] }),
|
|
26
|
+
r
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
f.displayName = "SuggestionList";
|
|
31
|
+
export {
|
|
32
|
+
f as SmudiSuggestionList
|
|
33
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SuggestionItem, SuggestionProps as DigDirSuggestionProps } from '@digdir/designsystemet-react';
|
|
3
|
+
export declare const INTERNAL_SELECT_ALL_MARKER_VALUE = "internal_select_all_marker";
|
|
4
|
+
type ToggleAllTypes = {
|
|
5
|
+
multiple: true;
|
|
6
|
+
showToggleAll: true | string;
|
|
7
|
+
items: SuggestionItem[];
|
|
8
|
+
selected?: (string | SuggestionItem)[] | null;
|
|
9
|
+
onSelectedChange?: (value: SuggestionItem[]) => void;
|
|
10
|
+
} | {
|
|
11
|
+
multiple: true;
|
|
12
|
+
showToggleAll?: false;
|
|
13
|
+
items?: SuggestionItem[];
|
|
14
|
+
selected?: (string | SuggestionItem)[] | null;
|
|
15
|
+
onSelectedChange?: (value: SuggestionItem[]) => void;
|
|
16
|
+
} | {
|
|
17
|
+
multiple?: false;
|
|
18
|
+
showToggleAll?: never;
|
|
19
|
+
items?: never;
|
|
20
|
+
selected?: string | SuggestionItem | null;
|
|
21
|
+
onSelectedChange?: (value: SuggestionItem) => void;
|
|
22
|
+
};
|
|
23
|
+
export type SuggestionComponentProps = {
|
|
24
|
+
/**
|
|
25
|
+
* When true the suggestion will show a "select all" toggle option.
|
|
26
|
+
* Defaults to the Norwegian text "Velg alle". Pass a string instead to
|
|
27
|
+
* override the label, e.g. "Velg alle destinasjoner".
|
|
28
|
+
*
|
|
29
|
+
* For the component to be able to emit all the items on toggling you
|
|
30
|
+
* must provide them in the item prop.
|
|
31
|
+
*/
|
|
32
|
+
showToggleAll?: boolean | string;
|
|
33
|
+
items?: SuggestionItem[];
|
|
34
|
+
} & Omit<DigDirSuggestionProps, "multiple" | "selected" | "onSelectedChange"> & ToggleAllTypes;
|
|
35
|
+
export declare const SmudiSuggestion: React.FC<SuggestionComponentProps>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=smudi-suggestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smudi-suggestion.d.ts","sourceRoot":"","sources":["../../../../components/suggestion/smudi-suggestion/smudi-suggestion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,eAAe,IAAI,qBAAqB,EAC9C,MAAM,8BAA8B,CAAC;AAKtC,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAE7E,KAAK,cAAc,GACf;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACtD,GACD;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACtD,GACD;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACpD,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B,GAAG,IAAI,CAAC,qBAAqB,EAAE,UAAU,GAAG,UAAU,GAAG,kBAAkB,CAAC,GAC3E,cAAc,CAAC;AAcjB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAkL9D,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as w } from "react";
|
|
3
|
+
import { EXPERIMENTAL_Suggestion as N } from "@digdir/designsystemet-react";
|
|
4
|
+
import { SmudiSuggestionContext as C } from "./smudi-suggestion-context.js";
|
|
5
|
+
const i = "internal_select_all_marker", F = (a) => /* @__PURE__ */ l("data", { className: "smudi-chip", children: /* @__PURE__ */ l("span", { className: "smudi-label", children: a.label }) }), I = N, q = ({
|
|
6
|
+
children: a,
|
|
7
|
+
renderSelected: v,
|
|
8
|
+
selected: r,
|
|
9
|
+
multiple: o,
|
|
10
|
+
items: g,
|
|
11
|
+
showToggleAll: E,
|
|
12
|
+
onSelectedChange: s,
|
|
13
|
+
onClickCapture: S,
|
|
14
|
+
...y
|
|
15
|
+
}) => {
|
|
16
|
+
const p = m(null), c = m(!1), A = o === !0 && Array.isArray(r) ? new Set(
|
|
17
|
+
r.map(
|
|
18
|
+
(t) => typeof t == "string" ? t : t?.value
|
|
19
|
+
)
|
|
20
|
+
) : null, f = o === !0 && !!g?.length && !!A && g.every((t) => A.has(t.value)), L = o && Array.isArray(r) ? f ? [
|
|
21
|
+
...r,
|
|
22
|
+
{
|
|
23
|
+
label: i,
|
|
24
|
+
value: i
|
|
25
|
+
}
|
|
26
|
+
] : r : r ?? void 0;
|
|
27
|
+
function R(t) {
|
|
28
|
+
if (!s) return;
|
|
29
|
+
if (o) {
|
|
30
|
+
const e = s, h = (Array.isArray(t) ? t : []).filter(
|
|
31
|
+
(u) => u.value !== i
|
|
32
|
+
);
|
|
33
|
+
e(h);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const n = s;
|
|
37
|
+
!t || Array.isArray(t) || t.value !== i && n(t);
|
|
38
|
+
}
|
|
39
|
+
const P = (t) => t.value === i ? null : (v ?? F)(t);
|
|
40
|
+
function _() {
|
|
41
|
+
if (!o || !s) return;
|
|
42
|
+
s(f ? [] : g ?? []);
|
|
43
|
+
}
|
|
44
|
+
function d() {
|
|
45
|
+
const t = p.current, n = t?.list ?? t?.querySelector("[popover]"), e = t?.control ?? t?.querySelector(
|
|
46
|
+
"input.ds-input, input"
|
|
47
|
+
);
|
|
48
|
+
return { list: n, input: e };
|
|
49
|
+
}
|
|
50
|
+
w(() => {
|
|
51
|
+
const { list: t } = d();
|
|
52
|
+
if (!t) return;
|
|
53
|
+
const n = (e) => {
|
|
54
|
+
const u = e.newState === "open";
|
|
55
|
+
if (u && !c.current) {
|
|
56
|
+
t.togglePopover?.(!1);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
c.current = u;
|
|
60
|
+
};
|
|
61
|
+
return t.addEventListener("toggle", n), () => t.removeEventListener("toggle", n);
|
|
62
|
+
}, []);
|
|
63
|
+
function b(t) {
|
|
64
|
+
return (t.nativeEvent.composedPath?.() ?? []).some(
|
|
65
|
+
(e) => e instanceof HTMLElement && (e.hasAttribute("popovertarget") || e.hasAttribute("popoverTarget") || e.hasAttribute("commandfor") || e.hasAttribute("commandFor"))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function T() {
|
|
69
|
+
const { list: t, input: n } = d();
|
|
70
|
+
if (t && typeof t.togglePopover == "function") {
|
|
71
|
+
const e = !c.current;
|
|
72
|
+
t.togglePopover(e), t.hidden = !e, c.current = e, n?.focus();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
n?.focus(), n?.click();
|
|
76
|
+
}
|
|
77
|
+
return /* @__PURE__ */ l(
|
|
78
|
+
I,
|
|
79
|
+
{
|
|
80
|
+
ref: p,
|
|
81
|
+
multiple: o,
|
|
82
|
+
selected: L,
|
|
83
|
+
onSelectedChange: R,
|
|
84
|
+
renderSelected: P,
|
|
85
|
+
onClickCapture: (t) => {
|
|
86
|
+
S?.(t), !t.defaultPrevented && b(t) && (t.preventDefault(), t.stopPropagation(), T());
|
|
87
|
+
},
|
|
88
|
+
...y,
|
|
89
|
+
children: /* @__PURE__ */ l(
|
|
90
|
+
C.Provider,
|
|
91
|
+
{
|
|
92
|
+
value: { isAllSelected: f, showToggleAll: E, toggleSelectAll: _ },
|
|
93
|
+
children: a
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
i as INTERNAL_SELECT_ALL_MARKER_VALUE,
|
|
101
|
+
q as SmudiSuggestion
|
|
102
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SuggestionProps, SuggestionItem, EXPERIMENTAL_Suggestion as SuggestionRoot } from '@digdir/designsystemet-react';
|
|
3
|
+
import { SuggestionComponentProps } from '../smudi-suggestion/smudi-suggestion';
|
|
4
|
+
import { SmudiSuggestionList } from '../smudi-suggestion/smudi-suggestion-list';
|
|
5
|
+
type SuggestionNoChipsProps = Omit<SuggestionComponentProps, "multiple" | "selected" | "defaultSelected" | "onSelectedChange"> & {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
items?: SuggestionItem[];
|
|
8
|
+
"data-size"?: "sm" | "md" | "lg";
|
|
9
|
+
selected?: (string | SuggestionItem)[] | null;
|
|
10
|
+
defaultSelected?: (string | SuggestionItem)[];
|
|
11
|
+
onSelectedChange?: (value: SuggestionItem[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const SuggestionNoChips: React.FC<SuggestionNoChipsProps> & {
|
|
14
|
+
Input: typeof SuggestionRoot.Input;
|
|
15
|
+
Clear: typeof SuggestionRoot.Clear;
|
|
16
|
+
List: typeof SmudiSuggestionList;
|
|
17
|
+
Option: typeof SuggestionRoot.Option;
|
|
18
|
+
Empty: typeof SuggestionRoot.Empty;
|
|
19
|
+
};
|
|
20
|
+
export type { SuggestionProps, SuggestionNoChipsProps };
|
|
21
|
+
//# sourceMappingURL=suggestion-no-chips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion-no-chips.d.ts","sourceRoot":"","sources":["../../../../components/suggestion/suggestion-no-chips/suggestion-no-chips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAEL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,EACxB,UAAU,GAAG,UAAU,GAAG,iBAAiB,GAAG,kBAAkB,CACjE,GAAG;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAsFF,eAAO,MAAM,iBAAiB,EAyEzB,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,GAAG;IACtC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;IACnC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,OAAO,mBAAmB,CAAC;IACjC,MAAM,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;CACpC,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsxs as f, jsx as s, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
|
+
import { EXPERIMENTAL_Suggestion as d, Badge as b } from "@digdir/designsystemet-react";
|
|
4
|
+
import { SmudiSuggestion as E } from "../smudi-suggestion/smudi-suggestion.js";
|
|
5
|
+
import { SmudiSuggestionList as L } from "../smudi-suggestion/smudi-suggestion-list.js";
|
|
6
|
+
function h(n) {
|
|
7
|
+
return n ? n.map(
|
|
8
|
+
(e) => typeof e == "string" ? { value: e, label: e } : e
|
|
9
|
+
) : [];
|
|
10
|
+
}
|
|
11
|
+
function z(n, e, t) {
|
|
12
|
+
const [i, p] = S(!1), g = n !== void 0, [u, o] = S(
|
|
13
|
+
() => h(e)
|
|
14
|
+
), l = g ? h(n) : u, a = l.length, r = t.length > 0 && a === t.length, m = a === 1 ? l[0]?.label ?? String(l[0]?.value ?? "") : null;
|
|
15
|
+
return {
|
|
16
|
+
isTyping: i,
|
|
17
|
+
setIsTyping: p,
|
|
18
|
+
count: a,
|
|
19
|
+
allSelected: r,
|
|
20
|
+
singleLabel: m,
|
|
21
|
+
isControlled: g,
|
|
22
|
+
setInternalSelected: o
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function O({
|
|
26
|
+
count: n,
|
|
27
|
+
allSelected: e,
|
|
28
|
+
isTyping: t,
|
|
29
|
+
size: i
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ f(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
className: `smudi-suggestion-badge-wrapper${t ? " smudi-suggestion-badge-wrapper--typing" : ""}`,
|
|
35
|
+
children: [
|
|
36
|
+
!t && /* @__PURE__ */ s("span", { children: e ? "Alle valgt" : "Antall valgt" }),
|
|
37
|
+
!e && /* @__PURE__ */ s(b, { "data-color": "accent", "data-size": i, count: n })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function T({
|
|
43
|
+
singleLabel: n,
|
|
44
|
+
placeholder: e
|
|
45
|
+
}) {
|
|
46
|
+
return /* @__PURE__ */ s("span", { className: "smudi-suggestion-no-chips-overlay", children: n ?? e });
|
|
47
|
+
}
|
|
48
|
+
const B = Object.assign(
|
|
49
|
+
function({
|
|
50
|
+
className: e,
|
|
51
|
+
placeholder: t,
|
|
52
|
+
items: i,
|
|
53
|
+
onSelectedChange: p,
|
|
54
|
+
showToggleAll: g,
|
|
55
|
+
"data-size": u = "md",
|
|
56
|
+
...o
|
|
57
|
+
}) {
|
|
58
|
+
const {
|
|
59
|
+
isTyping: l,
|
|
60
|
+
setIsTyping: a,
|
|
61
|
+
count: r,
|
|
62
|
+
allSelected: m,
|
|
63
|
+
singleLabel: y,
|
|
64
|
+
isControlled: C,
|
|
65
|
+
setInternalSelected: I
|
|
66
|
+
} = z(
|
|
67
|
+
o.selected,
|
|
68
|
+
o.defaultSelected,
|
|
69
|
+
i ?? []
|
|
70
|
+
);
|
|
71
|
+
function N(c) {
|
|
72
|
+
C || I(c), p?.(c);
|
|
73
|
+
}
|
|
74
|
+
return /* @__PURE__ */ f(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: "smudi-suggestion-no-chips-wrapper",
|
|
78
|
+
onInput: (c) => {
|
|
79
|
+
a(c.target.value.length > 0);
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
r >= 2 && /* @__PURE__ */ s(
|
|
83
|
+
O,
|
|
84
|
+
{
|
|
85
|
+
count: r,
|
|
86
|
+
allSelected: m,
|
|
87
|
+
isTyping: l,
|
|
88
|
+
size: u
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ s(
|
|
92
|
+
E,
|
|
93
|
+
{
|
|
94
|
+
multiple: !0,
|
|
95
|
+
items: i,
|
|
96
|
+
showToggleAll: g,
|
|
97
|
+
renderSelected: () => /* @__PURE__ */ s(v, {}),
|
|
98
|
+
"data-size": u,
|
|
99
|
+
className: `smudi-suggestion-no-chips${e ? ` ${e}` : ""}`,
|
|
100
|
+
...o,
|
|
101
|
+
onSelectedChange: N
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
r < 2 && !l && /* @__PURE__ */ s(
|
|
105
|
+
T,
|
|
106
|
+
{
|
|
107
|
+
singleLabel: y,
|
|
108
|
+
placeholder: t
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: "Suggestion.NoChips",
|
|
117
|
+
Input: d.Input,
|
|
118
|
+
Clear: d.Clear,
|
|
119
|
+
List: L,
|
|
120
|
+
Option: d.Option,
|
|
121
|
+
Empty: d.Empty
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
export {
|
|
125
|
+
B as SuggestionNoChips
|
|
126
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EXPERIMENTAL_Suggestion as SuggestionRoot } from '@digdir/designsystemet-react';
|
|
3
|
+
import { SuggestionComponentProps } from './smudi-suggestion/smudi-suggestion';
|
|
4
|
+
import { SmudiSuggestionList } from './smudi-suggestion/smudi-suggestion-list';
|
|
5
|
+
import { SuggestionNoChips, SuggestionNoChipsProps } from './suggestion-no-chips/suggestion-no-chips';
|
|
6
|
+
declare const SuggestionComponent: React.FC<SuggestionComponentProps> & {
|
|
7
|
+
NoChips: typeof SuggestionNoChips;
|
|
8
|
+
List: typeof SmudiSuggestionList;
|
|
9
|
+
Input: typeof SuggestionRoot.Input;
|
|
10
|
+
Clear: typeof SuggestionRoot.Clear;
|
|
11
|
+
Option: typeof SuggestionRoot.Option;
|
|
12
|
+
Empty: typeof SuggestionRoot.Empty;
|
|
13
|
+
};
|
|
14
|
+
export type { SuggestionComponentProps as SuggestionProps, SuggestionNoChipsProps, };
|
|
15
|
+
export { SuggestionComponent as Suggestion };
|
|
16
|
+
//# sourceMappingURL=suggestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../components/suggestion/suggestion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC5B,MAAM,2CAA2C,CAAC;AAEnD,QAAA,MAAM,mBAAmB,EAKnB,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,GAAG;IACzC,OAAO,EAAE,OAAO,iBAAiB,CAAC;IAClC,IAAI,EAAE,OAAO,mBAAmB,CAAC;IACjC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;IACnC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;IACnC,MAAM,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,OAAO,cAAc,CAAC,KAAK,CAAC;CACpC,CAAC;AAEF,YAAY,EACV,wBAAwB,IAAI,eAAe,EAC3C,sBAAsB,GACvB,CAAC;AACF,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC"}
|