@smudi/designsystem 2.0.1 → 2.2.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/JetBrainsMono-Medium.woff2 +0 -0
- package/@smudi/assets/JetBrainsMono-OFL.txt +93 -0
- package/@smudi/assets/JetBrainsMono-Regular.woff2 +0 -0
- package/@smudi/assets/JetBrainsMono-SemiBold.woff2 +0 -0
- package/@smudi/components/actionbar/actionbar-button.js +52 -0
- package/@smudi/components/actionbar/actionbar-context.js +23 -0
- package/@smudi/components/actionbar/actionbar-divider.js +24 -0
- package/@smudi/components/actionbar/actionbar-host.js +102 -0
- package/@smudi/components/actionbar/actionbar.js +134 -0
- package/@smudi/components/actionbar/use-actionbar-button-count-warning.js +21 -0
- package/@smudi/components/actionbar/use-actionbar-missing-focusable-content-warning.js +38 -0
- package/@smudi/components/divider/divider.js +18 -4
- package/@smudi/components/file-upload/file-upload.js +6 -4
- package/@smudi/components/header/header-divider.js +13 -11
- package/@smudi/components/select/select.js +28 -13
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.js +9 -9
- package/@smudi/components/typography/heading/heading.js +10 -4
- package/@smudi/components/utils/is-dev-environment.js +8 -0
- package/@smudi/icons/generated/index.d.ts +64 -0
- package/@smudi/react.d.ts +1671 -0
- package/@smudi/react.js +133 -130
- package/@smudi/styles.css +1 -1
- package/README.md +7 -6
- package/package.json +42 -30
- package/@smudi/components/alert/alert.d.ts +0 -6
- package/@smudi/components/alert/alert.d.ts.map +0 -1
- package/@smudi/components/avatar/avatar.d.ts +0 -6
- package/@smudi/components/avatar/avatar.d.ts.map +0 -1
- package/@smudi/components/avatar-stack/avatar-stack.d.ts +0 -6
- package/@smudi/components/avatar-stack/avatar-stack.d.ts.map +0 -1
- package/@smudi/components/badge/badge.d.ts +0 -6
- package/@smudi/components/badge/badge.d.ts.map +0 -1
- package/@smudi/components/breadcrumbs/breadcrumbs.d.ts +0 -6
- package/@smudi/components/breadcrumbs/breadcrumbs.d.ts.map +0 -1
- package/@smudi/components/button/button.d.ts +0 -26
- package/@smudi/components/button/button.d.ts.map +0 -1
- package/@smudi/components/card/card-icon-block.d.ts +0 -24
- package/@smudi/components/card/card-icon-block.d.ts.map +0 -1
- package/@smudi/components/card/card.d.ts +0 -22
- package/@smudi/components/card/card.d.ts.map +0 -1
- package/@smudi/components/checkbox/checkbox.d.ts +0 -6
- package/@smudi/components/checkbox/checkbox.d.ts.map +0 -1
- package/@smudi/components/chip/chip.d.ts +0 -5
- package/@smudi/components/chip/chip.d.ts.map +0 -1
- package/@smudi/components/details/details.d.ts +0 -6
- package/@smudi/components/details/details.d.ts.map +0 -1
- package/@smudi/components/dialog/dialog-section.d.ts +0 -22
- package/@smudi/components/dialog/dialog-section.d.ts.map +0 -1
- package/@smudi/components/dialog/dialog.d.ts +0 -21
- package/@smudi/components/dialog/dialog.d.ts.map +0 -1
- package/@smudi/components/divider/divider.d.ts +0 -6
- package/@smudi/components/divider/divider.d.ts.map +0 -1
- package/@smudi/components/dropdown/dropdown-button.d.ts +0 -39
- package/@smudi/components/dropdown/dropdown-button.d.ts.map +0 -1
- package/@smudi/components/dropdown/dropdown-context.d.ts +0 -7
- package/@smudi/components/dropdown/dropdown-context.d.ts.map +0 -1
- package/@smudi/components/dropdown/dropdown-item.d.ts +0 -20
- package/@smudi/components/dropdown/dropdown-item.d.ts.map +0 -1
- package/@smudi/components/dropdown/dropdown-list.d.ts +0 -20
- package/@smudi/components/dropdown/dropdown-list.d.ts.map +0 -1
- package/@smudi/components/dropdown/dropdown.d.ts +0 -35
- package/@smudi/components/dropdown/dropdown.d.ts.map +0 -1
- package/@smudi/components/error-summary/error-summary.d.ts +0 -6
- package/@smudi/components/error-summary/error-summary.d.ts.map +0 -1
- package/@smudi/components/field/field.d.ts +0 -6
- package/@smudi/components/field/field.d.ts.map +0 -1
- package/@smudi/components/fieldset/fieldset.d.ts +0 -6
- package/@smudi/components/fieldset/fieldset.d.ts.map +0 -1
- package/@smudi/components/file-upload/file-upload.d.ts +0 -6
- package/@smudi/components/file-upload/file-upload.d.ts.map +0 -1
- package/@smudi/components/header/header-content.d.ts +0 -15
- package/@smudi/components/header/header-content.d.ts.map +0 -1
- package/@smudi/components/header/header-divider.d.ts +0 -18
- package/@smudi/components/header/header-divider.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/header-menu-button.d.ts +0 -13
- package/@smudi/components/header/header-menu/header-menu-button.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/header-menu-content.d.ts +0 -17
- package/@smudi/components/header/header-menu/header-menu-content.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/header-menu-group.d.ts +0 -14
- package/@smudi/components/header/header-menu/header-menu-group.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/header-menu-item.d.ts +0 -28
- package/@smudi/components/header/header-menu/header-menu-item.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/header-menu.d.ts +0 -20
- package/@smudi/components/header/header-menu/header-menu.d.ts.map +0 -1
- package/@smudi/components/header/header-menu/index.d.ts +0 -11
- package/@smudi/components/header/header-menu/index.d.ts.map +0 -1
- package/@smudi/components/header/header-search/header-search-button.d.ts +0 -26
- package/@smudi/components/header/header-search/header-search-button.d.ts.map +0 -1
- package/@smudi/components/header/header-search/header-search.d.ts +0 -35
- package/@smudi/components/header/header-search/header-search.d.ts.map +0 -1
- package/@smudi/components/header/header-search/index.d.ts +0 -5
- package/@smudi/components/header/header-search/index.d.ts.map +0 -1
- package/@smudi/components/header/header.d.ts +0 -97
- package/@smudi/components/header/header.d.ts.map +0 -1
- package/@smudi/components/header/index.d.ts +0 -36
- package/@smudi/components/header/index.d.ts.map +0 -1
- package/@smudi/components/input/input.d.ts +0 -6
- package/@smudi/components/input/input.d.ts.map +0 -1
- package/@smudi/components/layout-components/box-layouts/box-layout.d.ts +0 -37
- package/@smudi/components/layout-components/box-layouts/box-layout.d.ts.map +0 -1
- package/@smudi/components/layout-components/center-layouts/center-layout.d.ts +0 -30
- package/@smudi/components/layout-components/center-layouts/center-layout.d.ts.map +0 -1
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.d.ts +0 -33
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.d.ts.map +0 -1
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-align-css.d.ts +0 -2
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-align-css.d.ts.map +0 -1
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-justify-css.d.ts +0 -2
- package/@smudi/components/layout-components/cluster-layouts/constants/cluster-justify-css.d.ts.map +0 -1
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-align.type.d.ts +0 -2
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-align.type.d.ts.map +0 -1
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-justify.type.d.ts +0 -2
- package/@smudi/components/layout-components/cluster-layouts/types/cluster-justify.type.d.ts.map +0 -1
- package/@smudi/components/layout-components/grid-layouts/grid-layout.d.ts +0 -39
- package/@smudi/components/layout-components/grid-layouts/grid-layout.d.ts.map +0 -1
- package/@smudi/components/layout-components/split-view/index.d.ts +0 -8
- package/@smudi/components/layout-components/split-view/index.d.ts.map +0 -1
- package/@smudi/components/layout-components/split-view/split-view-divider.d.ts +0 -8
- package/@smudi/components/layout-components/split-view/split-view-divider.d.ts.map +0 -1
- package/@smudi/components/layout-components/split-view/split-view-panel.d.ts +0 -23
- package/@smudi/components/layout-components/split-view/split-view-panel.d.ts.map +0 -1
- package/@smudi/components/layout-components/split-view/split-view.d.ts +0 -14
- package/@smudi/components/layout-components/split-view/split-view.d.ts.map +0 -1
- package/@smudi/components/layout-components/split-view/use-resize.d.ts +0 -34
- package/@smudi/components/layout-components/split-view/use-resize.d.ts.map +0 -1
- package/@smudi/components/layout-components/stack-layouts/stack-layout.d.ts +0 -31
- package/@smudi/components/layout-components/stack-layouts/stack-layout.d.ts.map +0 -1
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.d.ts +0 -34
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.d.ts.map +0 -1
- package/@smudi/components/link/link.d.ts +0 -6
- package/@smudi/components/link/link.d.ts.map +0 -1
- package/@smudi/components/list/list.d.ts +0 -5
- package/@smudi/components/list/list.d.ts.map +0 -1
- package/@smudi/components/pagination/pagination.d.ts +0 -6
- package/@smudi/components/pagination/pagination.d.ts.map +0 -1
- package/@smudi/components/popover/popover.d.ts +0 -6
- package/@smudi/components/popover/popover.d.ts.map +0 -1
- package/@smudi/components/radio/radio.d.ts +0 -6
- package/@smudi/components/radio/radio.d.ts.map +0 -1
- package/@smudi/components/search/search.d.ts +0 -6
- package/@smudi/components/search/search.d.ts.map +0 -1
- package/@smudi/components/select/select.d.ts +0 -13
- package/@smudi/components/select/select.d.ts.map +0 -1
- package/@smudi/components/skeleton/skeleton.d.ts +0 -6
- package/@smudi/components/skeleton/skeleton.d.ts.map +0 -1
- package/@smudi/components/skip-link/skip-link.d.ts +0 -6
- package/@smudi/components/skip-link/skip-link.d.ts.map +0 -1
- package/@smudi/components/spinner/spinner.d.ts +0 -6
- package/@smudi/components/spinner/spinner.d.ts.map +0 -1
- package/@smudi/components/stepper/index.d.ts +0 -15
- package/@smudi/components/stepper/index.d.ts.map +0 -1
- package/@smudi/components/stepper/step/step-list.d.ts +0 -7
- package/@smudi/components/stepper/step/step-list.d.ts.map +0 -1
- package/@smudi/components/stepper/step/step.d.ts +0 -22
- package/@smudi/components/stepper/step/step.d.ts.map +0 -1
- package/@smudi/components/stepper/step-content/step-content-list.d.ts +0 -2
- package/@smudi/components/stepper/step-content/step-content-list.d.ts.map +0 -1
- package/@smudi/components/stepper/step-content/step-content.d.ts +0 -13
- package/@smudi/components/stepper/step-content/step-content.d.ts.map +0 -1
- package/@smudi/components/stepper/stepper-context.d.ts +0 -49
- package/@smudi/components/stepper/stepper-context.d.ts.map +0 -1
- package/@smudi/components/stepper/stepper.d.ts +0 -42
- package/@smudi/components/stepper/stepper.d.ts.map +0 -1
- package/@smudi/components/stepper/use-stepper-state.d.ts +0 -43
- package/@smudi/components/stepper/use-stepper-state.d.ts.map +0 -1
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.d.ts +0 -9
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.d.ts.map +0 -1
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.d.ts +0 -8
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.d.ts.map +0 -1
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.d.ts +0 -54
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.d.ts.map +0 -1
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.d.ts +0 -31
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.d.ts.map +0 -1
- package/@smudi/components/suggestion/suggestion.d.ts +0 -17
- package/@smudi/components/suggestion/suggestion.d.ts.map +0 -1
- package/@smudi/components/switch/switch.d.ts +0 -6
- package/@smudi/components/switch/switch.d.ts.map +0 -1
- package/@smudi/components/table/table.d.ts +0 -28
- package/@smudi/components/table/table.d.ts.map +0 -1
- package/@smudi/components/tabs/tabs-content.d.ts +0 -6
- package/@smudi/components/tabs/tabs-content.d.ts.map +0 -1
- package/@smudi/components/tabs/tabs-list.d.ts +0 -6
- package/@smudi/components/tabs/tabs-list.d.ts.map +0 -1
- package/@smudi/components/tabs/tabs-trigger.d.ts +0 -6
- package/@smudi/components/tabs/tabs-trigger.d.ts.map +0 -1
- package/@smudi/components/tabs/tabs.d.ts +0 -6
- package/@smudi/components/tabs/tabs.d.ts.map +0 -1
- package/@smudi/components/tag/tag.d.ts +0 -6
- package/@smudi/components/tag/tag.d.ts.map +0 -1
- package/@smudi/components/textarea/text-area.d.ts +0 -6
- package/@smudi/components/textarea/text-area.d.ts.map +0 -1
- package/@smudi/components/textfield/textfield.d.ts +0 -6
- package/@smudi/components/textfield/textfield.d.ts.map +0 -1
- package/@smudi/components/toast/toast.d.ts +0 -84
- package/@smudi/components/toast/toast.d.ts.map +0 -1
- package/@smudi/components/toggle-group/toggle-group.d.ts +0 -6
- package/@smudi/components/toggle-group/toggle-group.d.ts.map +0 -1
- package/@smudi/components/tooltip/tooltip.d.ts +0 -6
- package/@smudi/components/tooltip/tooltip.d.ts.map +0 -1
- package/@smudi/components/typography/heading/heading.d.ts +0 -6
- package/@smudi/components/typography/heading/heading.d.ts.map +0 -1
- package/@smudi/components/typography/paragraph/paragraph.d.ts +0 -6
- package/@smudi/components/typography/paragraph/paragraph.d.ts.map +0 -1
- package/@smudi/components/utils/apply-inert-outside.d.ts +0 -17
- package/@smudi/components/utils/apply-inert-outside.d.ts.map +0 -1
- package/@smudi/components/utils/class-names.d.ts +0 -2
- package/@smudi/components/utils/class-names.d.ts.map +0 -1
- package/@smudi/smudi/icons/generated/SmudiBiometryIcon.d.ts +0 -8
- package/@smudi/smudi/icons/generated/SmudiBiometryIcon.d.ts.map +0 -1
- package/@smudi/smudi/icons/generated/SmudiFingerprintIcon.d.ts +0 -8
- package/@smudi/smudi/icons/generated/SmudiFingerprintIcon.d.ts.map +0 -1
- package/@smudi/smudi/icons/generated/SmudiFlagIcon.d.ts +0 -8
- package/@smudi/smudi/icons/generated/SmudiFlagIcon.d.ts.map +0 -1
- package/@smudi/smudi/icons/generated/SmudiScanIcon.d.ts +0 -8
- package/@smudi/smudi/icons/generated/SmudiScanIcon.d.ts.map +0 -1
- package/@smudi/smudi/icons/generated/index.d.ts +0 -5
- package/@smudi/smudi/icons/generated/index.d.ts.map +0 -1
- package/@smudi/smudi/icons/metadata.d.ts +0 -32
- package/@smudi/smudi/icons/metadata.d.ts.map +0 -1
- package/@smudi/smudi/react.d.ts +0 -59
- package/@smudi/smudi/react.d.ts.map +0 -1
- package/@smudi/types/modular-scale.type.d.ts +0 -18
- package/@smudi/types/modular-scale.type.d.ts.map +0 -1
- package/@smudi/types/polymorphic-component.type.d.ts +0 -35
- package/@smudi/types/polymorphic-component.type.d.ts.map +0 -1
- package/@smudi/types/utils/coerce-string-to-number.d.ts +0 -4
- package/@smudi/types/utils/coerce-string-to-number.d.ts.map +0 -1
- package/@smudi/types/utils/exclude-strict.d.ts +0 -2
- package/@smudi/types/utils/exclude-strict.d.ts.map +0 -1
- package/@smudi/types/utils/omit-strict.d.ts +0 -2
- package/@smudi/types/utils/omit-strict.d.ts.map +0 -1
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as I, useId as x } from "react";
|
|
4
|
+
import { Button as h } from "../button/button.js";
|
|
5
|
+
import { Tooltip as z } from "../tooltip/tooltip.js";
|
|
6
|
+
import { classNames as v } from "../utils/class-names.js";
|
|
7
|
+
import { useActionbarHostContext as y, useActionbarContext as N } from "./actionbar-context.js";
|
|
8
|
+
const k = I(function({
|
|
9
|
+
children: u,
|
|
10
|
+
onClick: d,
|
|
11
|
+
onFocus: e,
|
|
12
|
+
tooltip: r,
|
|
13
|
+
className: m,
|
|
14
|
+
"data-size": b,
|
|
15
|
+
variant: l = "secondary-tinted",
|
|
16
|
+
...o
|
|
17
|
+
}, f) {
|
|
18
|
+
const p = y(), t = N(), n = x(), A = b ?? t.size, a = o["aria-disabled"] === !0 || o["aria-disabled"] === "true";
|
|
19
|
+
function B(i) {
|
|
20
|
+
if (a) {
|
|
21
|
+
e?.(i);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
t.setActiveButtonId(n), e?.(i);
|
|
25
|
+
}
|
|
26
|
+
function C(i) {
|
|
27
|
+
a || (t.setActiveButtonId(n), d?.({ itemId: p.itemId, event: i }));
|
|
28
|
+
}
|
|
29
|
+
const s = /* @__PURE__ */ c(
|
|
30
|
+
h,
|
|
31
|
+
{
|
|
32
|
+
...o,
|
|
33
|
+
ref: f,
|
|
34
|
+
icon: !0,
|
|
35
|
+
type: "button",
|
|
36
|
+
variant: l,
|
|
37
|
+
className: v("smudi-actionbar-button", m),
|
|
38
|
+
"data-size": A,
|
|
39
|
+
"data-smudi-actionbar-button": "true",
|
|
40
|
+
"data-smudi-actionbar-button-id": n,
|
|
41
|
+
tabIndex: t.isVisible && t.activeButtonId === n && !o.disabled && !a ? 0 : -1,
|
|
42
|
+
onClick: C,
|
|
43
|
+
onFocus: B,
|
|
44
|
+
children: u
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return r ? /* @__PURE__ */ c(z, { content: r, children: s }) : s;
|
|
48
|
+
});
|
|
49
|
+
k.displayName = "Actionbar.Button";
|
|
50
|
+
export {
|
|
51
|
+
k as ActionbarButton
|
|
52
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as n, useContext as o } from "react";
|
|
3
|
+
const e = n(null), r = n(
|
|
4
|
+
null
|
|
5
|
+
);
|
|
6
|
+
function i() {
|
|
7
|
+
const t = o(e);
|
|
8
|
+
if (!t)
|
|
9
|
+
throw new Error("Actionbar must be used inside Actionbar.Host.");
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function s() {
|
|
13
|
+
const t = o(r);
|
|
14
|
+
if (!t)
|
|
15
|
+
throw new Error("Actionbar.Button must be used inside Actionbar.");
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
r as ActionbarContext,
|
|
20
|
+
e as ActionbarHostContext,
|
|
21
|
+
s as useActionbarContext,
|
|
22
|
+
i as useActionbarHostContext
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { Divider as d } from "../divider/divider.js";
|
|
5
|
+
import { classNames as m } from "../utils/class-names.js";
|
|
6
|
+
const c = n(function({ className: a, role: i, "aria-hidden": t, ...r }, o) {
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
d,
|
|
9
|
+
{
|
|
10
|
+
...r,
|
|
11
|
+
ref: o,
|
|
12
|
+
orientation: "vertical",
|
|
13
|
+
role: i,
|
|
14
|
+
"aria-hidden": i ? !1 : t ?? "true",
|
|
15
|
+
"aria-orientation": i ? r["aria-orientation"] ?? "vertical" : void 0,
|
|
16
|
+
tabIndex: -1,
|
|
17
|
+
className: m("smudi-actionbar-divider", a)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
c.displayName = "Actionbar.Divider";
|
|
22
|
+
export {
|
|
23
|
+
c as ActionbarDivider
|
|
24
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as W, useRef as y, useState as E, useEffect as g, useMemo as Q } from "react";
|
|
4
|
+
import { classNames as S } from "../utils/class-names.js";
|
|
5
|
+
import { isDevEnvironment as _ } from "../utils/is-dev-environment.js";
|
|
6
|
+
import { combineRefs as j } from "../../utils/combine-refs.js";
|
|
7
|
+
import { ActionbarHostContext as D } from "./actionbar-context.js";
|
|
8
|
+
import { useActionbarMissingFocusableContentWarning as U } from "./use-actionbar-missing-focusable-content-warning.js";
|
|
9
|
+
const Y = "(hover: hover) and (pointer: fine)", k = W(
|
|
10
|
+
function({
|
|
11
|
+
itemId: l,
|
|
12
|
+
visibility: t = "hover-focus",
|
|
13
|
+
nonHoverBehavior: r = "show",
|
|
14
|
+
open: m,
|
|
15
|
+
defaultOpen: s,
|
|
16
|
+
onOpenChange: R,
|
|
17
|
+
className: C,
|
|
18
|
+
children: h,
|
|
19
|
+
onBlurCapture: L,
|
|
20
|
+
onFocusCapture: V,
|
|
21
|
+
onPointerEnter: b,
|
|
22
|
+
onPointerLeave: A,
|
|
23
|
+
...F
|
|
24
|
+
}, H) {
|
|
25
|
+
const p = y(null), o = m !== void 0, [a, w] = E(
|
|
26
|
+
t !== "always"
|
|
27
|
+
), [N, i] = E(() => t === "always" ? !0 : s ?? !1);
|
|
28
|
+
g(() => {
|
|
29
|
+
!_() || !o || (s !== void 0 || r === "hide") && console.warn(
|
|
30
|
+
"[Actionbar.Host] `open` controls visibility state. `defaultOpen` and `nonHoverBehavior` are ignored while `open` is provided."
|
|
31
|
+
);
|
|
32
|
+
}, [s, o, r]);
|
|
33
|
+
function u(e) {
|
|
34
|
+
o || i(e), R?.(e);
|
|
35
|
+
}
|
|
36
|
+
g(() => {
|
|
37
|
+
if (t !== "hover-focus" || typeof window > "u") {
|
|
38
|
+
w(!1), o || i(t === "always");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const e = window.matchMedia(Y), n = (f) => {
|
|
42
|
+
if (w(f), !o) {
|
|
43
|
+
if (f) {
|
|
44
|
+
i(s ?? !1);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
i(r === "show");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
n(e.matches);
|
|
51
|
+
const c = (f) => {
|
|
52
|
+
n(f.matches);
|
|
53
|
+
};
|
|
54
|
+
return typeof e.addEventListener == "function" ? (e.addEventListener("change", c), () => e.removeEventListener("change", c)) : (e.addListener(c), () => e.removeListener(c));
|
|
55
|
+
}, [s, o, r, t]), U({
|
|
56
|
+
children: h,
|
|
57
|
+
hostRef: p,
|
|
58
|
+
supportsHoverReveal: a,
|
|
59
|
+
visibility: t
|
|
60
|
+
});
|
|
61
|
+
const d = o ? !!m : t === "always" ? !0 : a ? N : r === "show", P = Q(
|
|
62
|
+
() => ({ itemId: l, isVisible: d }),
|
|
63
|
+
[l, d]
|
|
64
|
+
);
|
|
65
|
+
function T(e) {
|
|
66
|
+
t === "hover-focus" && a && u(!0), b?.(e);
|
|
67
|
+
}
|
|
68
|
+
function x(e) {
|
|
69
|
+
if (t === "hover-focus" && a) {
|
|
70
|
+
const n = typeof document > "u" ? null : document.activeElement;
|
|
71
|
+
n instanceof Node && e.currentTarget.contains(n) || u(!1);
|
|
72
|
+
}
|
|
73
|
+
A?.(e);
|
|
74
|
+
}
|
|
75
|
+
function M(e) {
|
|
76
|
+
t === "hover-focus" && u(!0), V?.(e);
|
|
77
|
+
}
|
|
78
|
+
function I(e) {
|
|
79
|
+
const n = e.relatedTarget;
|
|
80
|
+
t === "hover-focus" && a && !e.currentTarget.contains(n) && u(!1), L?.(e);
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ v(D.Provider, { value: P, children: /* @__PURE__ */ v(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
...F,
|
|
86
|
+
ref: j(H, p),
|
|
87
|
+
className: S("smudi-actionbar-host", C),
|
|
88
|
+
"data-visible": d ? "true" : "false",
|
|
89
|
+
"data-visibility": t,
|
|
90
|
+
onBlurCapture: I,
|
|
91
|
+
onFocusCapture: M,
|
|
92
|
+
onPointerEnter: T,
|
|
93
|
+
onPointerLeave: x,
|
|
94
|
+
children: h
|
|
95
|
+
}
|
|
96
|
+
) });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
k.displayName = "Actionbar.Host";
|
|
100
|
+
export {
|
|
101
|
+
k as ActionbarHost
|
|
102
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as V, useRef as y, useState as R, useEffect as k, useMemo as C } from "react";
|
|
4
|
+
import { classNames as E } from "../utils/class-names.js";
|
|
5
|
+
import { combineRefs as H } from "../../utils/combine-refs.js";
|
|
6
|
+
import { ActionbarHost as F } from "./actionbar-host.js";
|
|
7
|
+
import { ActionbarButton as N } from "./actionbar-button.js";
|
|
8
|
+
import { ActionbarDivider as j } from "./actionbar-divider.js";
|
|
9
|
+
import { useActionbarHostContext as M, ActionbarContext as q } from "./actionbar-context.js";
|
|
10
|
+
import { useActionbarButtonCountWarning as z } from "./use-actionbar-button-count-warning.js";
|
|
11
|
+
function I(a) {
|
|
12
|
+
return a ? Array.from(
|
|
13
|
+
a.querySelectorAll(
|
|
14
|
+
'[data-smudi-actionbar-button="true"]'
|
|
15
|
+
)
|
|
16
|
+
).filter(
|
|
17
|
+
(e) => !e.disabled && e.getAttribute("aria-disabled") !== "true"
|
|
18
|
+
) : [];
|
|
19
|
+
}
|
|
20
|
+
function l(a, e) {
|
|
21
|
+
const c = a[e];
|
|
22
|
+
c && c.focus();
|
|
23
|
+
}
|
|
24
|
+
const B = V(function({
|
|
25
|
+
children: e,
|
|
26
|
+
className: c,
|
|
27
|
+
onFocusCapture: x,
|
|
28
|
+
onKeyDown: f,
|
|
29
|
+
"data-color": b = "primary",
|
|
30
|
+
"data-size": m = "md",
|
|
31
|
+
...g
|
|
32
|
+
}, h) {
|
|
33
|
+
const s = M(), u = y(null), [i, r] = R(null);
|
|
34
|
+
z({ children: e, rootRef: u }), k(() => {
|
|
35
|
+
if (!s.isVisible)
|
|
36
|
+
return;
|
|
37
|
+
const o = I(u.current);
|
|
38
|
+
if (o.length === 0) {
|
|
39
|
+
r(null);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
i && o.some(
|
|
43
|
+
(t) => t.dataset.smudiActionbarButtonId === i
|
|
44
|
+
) || r(o[0].dataset.smudiActionbarButtonId ?? null);
|
|
45
|
+
}, [i, e, s.isVisible]);
|
|
46
|
+
const w = C(
|
|
47
|
+
() => ({
|
|
48
|
+
activeButtonId: i,
|
|
49
|
+
setActiveButtonId: r,
|
|
50
|
+
isVisible: s.isVisible,
|
|
51
|
+
size: m,
|
|
52
|
+
color: b,
|
|
53
|
+
rootRef: u
|
|
54
|
+
}),
|
|
55
|
+
[i, b, m, s.isVisible]
|
|
56
|
+
);
|
|
57
|
+
function D(o) {
|
|
58
|
+
const d = o.target.dataset.smudiActionbarButtonId;
|
|
59
|
+
d && r(d), x?.(o);
|
|
60
|
+
}
|
|
61
|
+
function v(o) {
|
|
62
|
+
const t = I(u.current);
|
|
63
|
+
if (t.length === 0) {
|
|
64
|
+
f?.(o);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const d = document.activeElement?.dataset?.smudiActionbarButtonId ?? i, A = Math.max(
|
|
68
|
+
t.findIndex(
|
|
69
|
+
(n) => n.dataset.smudiActionbarButtonId === d
|
|
70
|
+
),
|
|
71
|
+
0
|
|
72
|
+
);
|
|
73
|
+
switch (o.key) {
|
|
74
|
+
case "ArrowRight":
|
|
75
|
+
case "ArrowDown": {
|
|
76
|
+
o.preventDefault();
|
|
77
|
+
const n = (A + 1) % t.length;
|
|
78
|
+
r(
|
|
79
|
+
t[n].dataset.smudiActionbarButtonId ?? null
|
|
80
|
+
), l(t, n);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "ArrowLeft":
|
|
84
|
+
case "ArrowUp": {
|
|
85
|
+
o.preventDefault();
|
|
86
|
+
const n = (A - 1 + t.length) % t.length;
|
|
87
|
+
r(
|
|
88
|
+
t[n].dataset.smudiActionbarButtonId ?? null
|
|
89
|
+
), l(t, n);
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "Home": {
|
|
93
|
+
o.preventDefault(), r(t[0].dataset.smudiActionbarButtonId ?? null), l(t, 0);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case "End": {
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const n = t.length - 1;
|
|
99
|
+
r(
|
|
100
|
+
t[n].dataset.smudiActionbarButtonId ?? null
|
|
101
|
+
), l(t, n);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
f?.(o);
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ p(q.Provider, { value: w, children: /* @__PURE__ */ p(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
...g,
|
|
111
|
+
ref: H(u, h),
|
|
112
|
+
role: "toolbar",
|
|
113
|
+
className: E("smudi-actionbar", c),
|
|
114
|
+
"data-color": b,
|
|
115
|
+
"data-size": m,
|
|
116
|
+
"data-visible": s.isVisible ? "true" : "false",
|
|
117
|
+
onFocusCapture: D,
|
|
118
|
+
onKeyDown: v,
|
|
119
|
+
children: e
|
|
120
|
+
}
|
|
121
|
+
) });
|
|
122
|
+
});
|
|
123
|
+
B.displayName = "Actionbar";
|
|
124
|
+
const S = Object.assign(B, {
|
|
125
|
+
Host: F,
|
|
126
|
+
Button: N,
|
|
127
|
+
Divider: j
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
S as Actionbar,
|
|
131
|
+
N as ActionbarButton,
|
|
132
|
+
j as ActionbarDivider,
|
|
133
|
+
F as ActionbarHost
|
|
134
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as i, useEffect as s } from "react";
|
|
3
|
+
import { isDevEnvironment as c } from "../utils/is-dev-environment.js";
|
|
4
|
+
const e = 2, r = 5;
|
|
5
|
+
function d({
|
|
6
|
+
children: o,
|
|
7
|
+
rootRef: u
|
|
8
|
+
}) {
|
|
9
|
+
const n = i(/* @__PURE__ */ new Set());
|
|
10
|
+
s(() => {
|
|
11
|
+
if (!c())
|
|
12
|
+
return;
|
|
13
|
+
const t = u.current?.querySelectorAll('[data-smudi-actionbar-button="true"]').length ?? 0;
|
|
14
|
+
t >= e && t <= r || n.current.has(t) || (n.current.add(t), console.warn(
|
|
15
|
+
`[Actionbar] Expected between ${e} and ${r} buttons, but received ${t}. Consider using another pattern when the number of actions falls outside this range.`
|
|
16
|
+
));
|
|
17
|
+
}, [o]);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
d as useActionbarButtonCountWarning
|
|
21
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as u, useEffect as i } from "react";
|
|
3
|
+
import { isDevEnvironment as s } from "../utils/is-dev-environment.js";
|
|
4
|
+
const c = 'a[href], button, input:not([type="hidden"]), select, textarea, [tabindex], [contenteditable="true"]';
|
|
5
|
+
function l(e) {
|
|
6
|
+
return e.matches('[data-smudi-actionbar-button="true"]');
|
|
7
|
+
}
|
|
8
|
+
function f(e) {
|
|
9
|
+
return "disabled" in e && e.disabled === !0 || e.getAttribute("aria-disabled") === "true";
|
|
10
|
+
}
|
|
11
|
+
function b(e) {
|
|
12
|
+
return e.tabIndex < 0;
|
|
13
|
+
}
|
|
14
|
+
function d(e) {
|
|
15
|
+
return Array.from(
|
|
16
|
+
e.querySelectorAll(c)
|
|
17
|
+
).filter((t) => l(t) || f(t) ? !1 : !b(t)).length > 0;
|
|
18
|
+
}
|
|
19
|
+
function E({
|
|
20
|
+
children: e,
|
|
21
|
+
hostRef: r,
|
|
22
|
+
supportsHoverReveal: t,
|
|
23
|
+
visibility: n
|
|
24
|
+
}) {
|
|
25
|
+
const o = u(!1);
|
|
26
|
+
i(() => {
|
|
27
|
+
if (!s() || n !== "hover-focus" || !t || o.current)
|
|
28
|
+
return;
|
|
29
|
+
const a = r.current;
|
|
30
|
+
if (!(!a || d(a)))
|
|
31
|
+
throw o.current = !0, new Error(
|
|
32
|
+
"[Actionbar.Host] visibility='hover-focus' requires at least one focusable element in the host content. Add tabIndex={0} to the host root element (for example Card) when there are no naturally focusable children."
|
|
33
|
+
);
|
|
34
|
+
}, [e, r, t, n]);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
E as useActionbarMissingFocusableContentWarning
|
|
38
|
+
};
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Divider as t } from "@digdir/designsystemet-react";
|
|
4
|
+
import { forwardRef as m } from "react";
|
|
5
|
+
import { classNames as d } from "../utils/class-names.js";
|
|
6
|
+
const n = m(function({ orientation: i = "horizontal", className: o, ...r }, a) {
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
t,
|
|
9
|
+
{
|
|
10
|
+
...r,
|
|
11
|
+
ref: a,
|
|
12
|
+
className: d("smudi-divider", o),
|
|
13
|
+
"data-orientation": i,
|
|
14
|
+
"aria-orientation": r["aria-orientation"] ?? i
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
n.displayName = "Divider";
|
|
5
19
|
export {
|
|
6
|
-
|
|
20
|
+
n as Divider
|
|
7
21
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { EXPERIMENTAL_FileUpload as
|
|
3
|
-
const
|
|
4
|
-
|
|
2
|
+
import { EXPERIMENTAL_FileUpload as o } from "@digdir/designsystemet-react";
|
|
3
|
+
const l = o;
|
|
4
|
+
l.displayName = "FileUpload";
|
|
5
|
+
const a = l;
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
a as EXPERIMENTAL_FileUpload,
|
|
8
|
+
l as FileUpload
|
|
7
9
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { classNames as m } from "../utils/class-names.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { Divider as s } from "../divider/divider.js";
|
|
6
|
+
const v = n(
|
|
7
|
+
function({ className: a, role: i, "aria-hidden": d, ...r }, o) {
|
|
8
|
+
const t = i ? r["aria-orientation"] ?? "vertical" : void 0;
|
|
9
|
+
return /* @__PURE__ */ e(
|
|
9
10
|
"div",
|
|
10
11
|
{
|
|
11
12
|
...r,
|
|
12
|
-
ref:
|
|
13
|
+
ref: o,
|
|
13
14
|
role: i,
|
|
14
|
-
"aria-orientation":
|
|
15
|
-
"aria-hidden": i ? void 0 :
|
|
16
|
-
className: m("smudi-header__divider", a)
|
|
15
|
+
"aria-orientation": t,
|
|
16
|
+
"aria-hidden": i ? void 0 : d ?? "true",
|
|
17
|
+
className: m("smudi-header__divider", a),
|
|
18
|
+
children: /* @__PURE__ */ e(s, { orientation: "vertical" })
|
|
17
19
|
}
|
|
18
20
|
);
|
|
19
21
|
}
|
|
20
22
|
);
|
|
21
|
-
|
|
23
|
+
v.displayName = "Header.Divider";
|
|
22
24
|
export {
|
|
23
|
-
|
|
25
|
+
v as HeaderDivider
|
|
24
26
|
};
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as p } from "react";
|
|
4
|
-
import { Select as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as p, useRef as u, useEffect as i } from "react";
|
|
4
|
+
import { Select as c } from "@digdir/designsystemet-react";
|
|
5
|
+
const a = p(function({ children: o, ...l }, n) {
|
|
6
|
+
const r = u(null);
|
|
7
|
+
return i(() => {
|
|
8
|
+
const e = r.current;
|
|
9
|
+
if (!e || typeof CSS > "u" || !CSS.supports("appearance", "base-select") || e.querySelector("[data-smudi-select-trigger]"))
|
|
10
|
+
return;
|
|
11
|
+
const t = document.createElement("button");
|
|
12
|
+
t.type = "button", t.tabIndex = -1, t.dataset.smudiSelectTrigger = "", t.appendChild(document.createElement("selectedcontent")), e.insertBefore(t, e.firstChild);
|
|
13
|
+
}, []), /* @__PURE__ */ s("span", { className: "smudi-select-wrapper", children: /* @__PURE__ */ s(
|
|
14
|
+
c,
|
|
15
|
+
{
|
|
16
|
+
...l,
|
|
17
|
+
ref: (e) => {
|
|
18
|
+
if (r.current = e, typeof n == "function")
|
|
19
|
+
return n(e);
|
|
20
|
+
n && (n.current = e);
|
|
21
|
+
},
|
|
22
|
+
children: o
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}), m = Object.assign(a, {
|
|
26
|
+
Option: c.Option,
|
|
27
|
+
Optgroup: c.Optgroup
|
|
13
28
|
});
|
|
14
|
-
|
|
29
|
+
m.displayName = "Select";
|
|
15
30
|
export {
|
|
16
|
-
|
|
31
|
+
m as Select
|
|
17
32
|
};
|