@aeolus-fleet/ui 0.0.0-stage → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +10 -2
- package/dist/atoms/avatar.d.ts +16 -0
- package/dist/atoms/avatar.js +44 -0
- package/dist/atoms/avatar.js.map +1 -0
- package/dist/atoms/button.d.ts +22 -0
- package/dist/atoms/button.js +48 -0
- package/dist/atoms/button.js.map +1 -0
- package/dist/atoms/dialog-surface.d.ts +19 -0
- package/dist/atoms/dialog-surface.js +32 -0
- package/dist/atoms/dialog-surface.js.map +1 -0
- package/dist/atoms/dialog.d.ts +19 -0
- package/dist/atoms/dialog.js +37 -0
- package/dist/atoms/dialog.js.map +1 -0
- package/dist/atoms/dropdown-menu.d.ts +21 -0
- package/dist/atoms/dropdown-menu.js +42 -0
- package/dist/atoms/dropdown-menu.js.map +1 -0
- package/dist/atoms/kbd.d.ts +7 -0
- package/dist/atoms/kbd.js +11 -0
- package/dist/atoms/kbd.js.map +1 -0
- package/dist/atoms/sheet.d.ts +23 -0
- package/dist/atoms/sheet.js +52 -0
- package/dist/atoms/sheet.js.map +1 -0
- package/dist/atoms/tooltip.d.ts +10 -0
- package/dist/atoms/tooltip.js +24 -0
- package/dist/atoms/tooltip.js.map +1 -0
- package/dist/class-names.d.ts +3 -0
- package/dist/class-names.js +29 -0
- package/dist/class-names.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/molecules/app-switcher.d.ts +20 -0
- package/dist/molecules/app-switcher.js +57 -0
- package/dist/molecules/app-switcher.js.map +1 -0
- package/dist/molecules/avatar-entry.d.ts +21 -0
- package/dist/molecules/avatar-entry.js +6 -0
- package/dist/molecules/avatar-entry.js.map +1 -0
- package/dist/molecules/avatar-menu.d.ts +43 -0
- package/dist/molecules/avatar-menu.js +111 -0
- package/dist/molecules/avatar-menu.js.map +1 -0
- package/dist/molecules/signed-in-as.d.ts +4 -0
- package/dist/molecules/signed-in-as.js +6 -0
- package/dist/molecules/signed-in-as.js.map +1 -0
- package/dist/organisms/app-header.d.ts +27 -0
- package/dist/organisms/app-header.js +18 -0
- package/dist/organisms/app-header.js.map +1 -0
- package/dist/organisms/command-palette.d.ts +44 -0
- package/dist/organisms/command-palette.js +77 -0
- package/dist/organisms/command-palette.js.map +1 -0
- package/dist/organisms/sign-in-background.d.ts +10 -0
- package/dist/organisms/sign-in-background.js +48 -0
- package/dist/organisms/sign-in-background.js.map +1 -0
- package/dist/organisms/sign-in-backgrounds.d.ts +40 -0
- package/dist/organisms/sign-in-backgrounds.js +135 -0
- package/dist/organisms/sign-in-backgrounds.js.map +1 -0
- package/dist/theme.css +168 -0
- package/dist/tokens.css +154 -0
- package/package.json +57 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aeolus-fleet/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The UI parts every [Aeolus](https://github.com/ThomasHendrickx/aeolus-fleet) web app shows, built once: atoms, molecules and organisms in React on Base UI, props only, with no fetching, tRPC, store or zod. Each app reads its data behind its own hooks and hands a part what to show.
|
|
4
|
+
|
|
5
|
+
Before 1.0.0 the API may change between minor releases.
|
|
6
|
+
|
|
7
|
+
- `@aeolus-fleet/ui`: every part, such as the app header, the app switcher, the avatar menu, the command palette and the atoms they stand on.
|
|
8
|
+
- `@aeolus-fleet/ui/tokens.css`: the single copy of the design tokens, light on `:root` and dark on `.dark`.
|
|
9
|
+
- `@aeolus-fleet/ui/theme.css`: the tokens mapped onto Tailwind v4. An app imports Tailwind and `tw-animate-css`, then this file, and scans the package with `@source`.
|
|
10
|
+
|
|
11
|
+
Its peers are React, Base UI, lucide, `class-variance-authority`, `clsx`, `tailwind-merge` and `@aeolus-fleet/common` at the same version, for types. How the parts look and when to use which: [docs/design/conventions.md](../../docs/design/conventions.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* shadcn Avatar on Base UI, used as a mark (docs/design/png/Avatar.png): the
|
|
4
|
+
* app, the operator's account, a ship (two mono letters from its name), argo
|
|
5
|
+
* (the operator mark) and a retired ship (dashed frame). Decorative: the name
|
|
6
|
+
* is always written next to it, so it is hidden from assistive technology.
|
|
7
|
+
*/
|
|
8
|
+
declare const avatarVariants: (props?: ({
|
|
9
|
+
kind?: "app" | "account" | "ship" | "argo" | "retired" | null | undefined;
|
|
10
|
+
size?: 28 | 20 | 36 | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export declare function Avatar({ kind, size, name, className, }: VariantProps<typeof avatarVariants> & {
|
|
13
|
+
name?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { Ship, UserRound } from 'lucide-react';
|
|
6
|
+
import { classNames } from '../class-names.js';
|
|
7
|
+
/**
|
|
8
|
+
* shadcn Avatar on Base UI, used as a mark (docs/design/png/Avatar.png): the
|
|
9
|
+
* app, the operator's account, a ship (two mono letters from its name), argo
|
|
10
|
+
* (the operator mark) and a retired ship (dashed frame). Decorative: the name
|
|
11
|
+
* is always written next to it, so it is hidden from assistive technology.
|
|
12
|
+
*/
|
|
13
|
+
const avatarVariants = cva('inline-flex shrink-0 items-center justify-center overflow-hidden font-semibold uppercase select-none', {
|
|
14
|
+
variants: {
|
|
15
|
+
kind: {
|
|
16
|
+
app: 'rounded-sm bg-primary text-primary-foreground',
|
|
17
|
+
account: 'rounded-full bg-secondary font-sans text-foreground',
|
|
18
|
+
ship: 'rounded-sm bg-secondary font-mono text-foreground',
|
|
19
|
+
argo: 'rounded-sm bg-highlight text-primary',
|
|
20
|
+
retired: 'rounded-sm border border-dashed border-input font-mono font-medium text-muted-foreground',
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
20: 'size-5 text-micro [&_svg]:size-3',
|
|
24
|
+
28: 'size-7 text-micro [&_svg]:size-(--size-icon-sm)',
|
|
25
|
+
36: 'size-9 text-caption [&_svg]:size-(--size-icon)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: { kind: 'ship', size: 28 },
|
|
29
|
+
});
|
|
30
|
+
const LETTERS = 2;
|
|
31
|
+
function markOf(kind, name) {
|
|
32
|
+
if (kind === 'app') {
|
|
33
|
+
return _jsx(Ship, { "aria-hidden": true });
|
|
34
|
+
}
|
|
35
|
+
if (kind === 'argo') {
|
|
36
|
+
return _jsx(UserRound, { "aria-hidden": true });
|
|
37
|
+
}
|
|
38
|
+
return name.replaceAll('-', '').slice(0, LETTERS);
|
|
39
|
+
}
|
|
40
|
+
export function Avatar({ kind = 'ship', size, name = '', className, }) {
|
|
41
|
+
const resolvedKind = kind ?? 'ship';
|
|
42
|
+
return (_jsx(AvatarPrimitive.Root, { "aria-hidden": true, "data-slot": "avatar", className: classNames(avatarVariants({ kind, size }), className), children: _jsx(AvatarPrimitive.Fallback, { children: markOf(resolvedKind, name) }) }));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=avatar.js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,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,SAAS,GACmE;IAC5E,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,CAAC;IACpC,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,sCAET,QAAQ,EAClB,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,YAEhE,KAAC,eAAe,CAAC,QAAQ,cAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,GAA4B,GAC5D,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* shadcn Button on Base UI, themed to docs/design/png/Button.png: primary
|
|
6
|
+
* (shadcn default), secondary (shadcn outline), ghost and destructive, in four
|
|
7
|
+
* sizes. Icons sit spacing-2 from the label.
|
|
8
|
+
*/
|
|
9
|
+
declare const buttonVariants: (props?: ({
|
|
10
|
+
variant?: "primary" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
11
|
+
size?: "touch" | "xs" | "sm" | "md" | null | undefined;
|
|
12
|
+
isIconOnly?: boolean | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants> & {
|
|
15
|
+
/** A Lucide icon before the label. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** Keeps the label, puts a spinner in place of the icon and blocks input, without dimming. */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** A link styled as a button: pass `render={<a href="..." />}` and `nativeButton={false}` (Base UI's asChild). */
|
|
21
|
+
export declare function Button({ className, variant, size, isIconOnly, icon, isLoading, disabled, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { LoaderCircle } from 'lucide-react';
|
|
5
|
+
import { classNames } from '../class-names.js';
|
|
6
|
+
/**
|
|
7
|
+
* shadcn Button on Base UI, themed to docs/design/png/Button.png: primary
|
|
8
|
+
* (shadcn default), secondary (shadcn outline), ghost and destructive, in four
|
|
9
|
+
* sizes. Icons sit spacing-2 from the label.
|
|
10
|
+
*/
|
|
11
|
+
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md border border-transparent font-medium whitespace-nowrap transition-[background-color,border-color,opacity] duration-(--duration-fast) select-none data-disabled:pointer-events-none data-disabled:not-data-loading:opacity-45 data-loading:cursor-progress [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon)", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
primary: 'bg-primary text-primary-foreground hover:bg-primary-hover',
|
|
15
|
+
secondary: 'border-input bg-card text-foreground shadow-sm hover:bg-accent aria-expanded:bg-accent',
|
|
16
|
+
ghost: 'bg-transparent text-foreground hover:bg-accent aria-expanded:bg-accent',
|
|
17
|
+
destructive: 'bg-destructive text-destructive-foreground hover:opacity-90',
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
xs: 'h-(--size-control-xs) gap-1.5 px-2.5 text-meta',
|
|
21
|
+
sm: 'h-(--size-control-sm) px-3 text-meta',
|
|
22
|
+
md: 'h-(--size-control) px-3.5 text-body',
|
|
23
|
+
touch: 'h-(--size-control-touch) rounded-lg px-4 text-body-touch',
|
|
24
|
+
},
|
|
25
|
+
isIconOnly: {
|
|
26
|
+
true: 'px-0',
|
|
27
|
+
false: '',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: [
|
|
31
|
+
{ isIconOnly: true, size: 'xs', className: 'w-(--size-control-xs)' },
|
|
32
|
+
{ isIconOnly: true, size: 'sm', className: 'w-(--size-control-sm)' },
|
|
33
|
+
{ isIconOnly: true, size: 'md', className: 'w-(--size-control)' },
|
|
34
|
+
{ isIconOnly: true, size: 'touch', className: 'w-(--size-control-touch)' },
|
|
35
|
+
],
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: 'secondary',
|
|
38
|
+
size: 'md',
|
|
39
|
+
isIconOnly: false,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
/** A link styled as a button: pass `render={<a href="..." />}` and `nativeButton={false}` (Base UI's asChild). */
|
|
43
|
+
export function Button({ className, variant, size, isIconOnly, icon, isLoading = false, disabled, children, ...props }) {
|
|
44
|
+
return (_jsxs(ButtonPrimitive, { "data-slot": "button", "data-loading": isLoading ? '' : undefined, "aria-busy": isLoading || undefined, disabled: disabled === true || isLoading,
|
|
45
|
+
// A busy button keeps its focus, so a keyboard user does not lose their place.
|
|
46
|
+
focusableWhenDisabled: isLoading, className: classNames(buttonVariants({ variant, size, isIconOnly }), className), ...props, children: [isLoading ? _jsx(LoaderCircle, { "aria-hidden": true, className: "animate-spin motion-reduce:animate-none" }) : icon, children] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/atoms/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,cAAc,GAAG,GAAG,CACx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AqB,EAAE,SAAS,EAChC,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,KAC3E,KAAK,aAER,SAAS,CAAC,CAAC,CAAC,KAAC,YAAY,yBAAa,SAAS,EAAC,yCAAyC,GAAG,CAAC,CAAC,CAAC,IAAI,EACnG,QAAQ,IACO,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What Dialog and AlertDialog share (docs/design/png/Dialog.png): the --overlay
|
|
3
|
+
* scrim, a centred popup 512 or 560 px wide with 24 px padding and
|
|
4
|
+
* --radius-xl, and the header and footer layout. A popup taller than the
|
|
5
|
+
* window scrolls inside it, so its buttons stay in reach. Under reduced motion
|
|
6
|
+
* nothing zooms; it only fades.
|
|
7
|
+
*/
|
|
8
|
+
export declare const dialogSurface: {
|
|
9
|
+
overlay: string;
|
|
10
|
+
popup: (props?: ({
|
|
11
|
+
size?: "sm" | "md" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
header: string;
|
|
14
|
+
footer: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
phoneSheet: string;
|
|
18
|
+
phoneFullScreen: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* What Dialog and AlertDialog share (docs/design/png/Dialog.png): the --overlay
|
|
4
|
+
* scrim, a centred popup 512 or 560 px wide with 24 px padding and
|
|
5
|
+
* --radius-xl, and the header and footer layout. A popup taller than the
|
|
6
|
+
* window scrolls inside it, so its buttons stay in reach. Under reduced motion
|
|
7
|
+
* nothing zooms; it only fades.
|
|
8
|
+
*/
|
|
9
|
+
export const dialogSurface = {
|
|
10
|
+
overlay: 'fixed inset-0 isolate z-50 bg-overlay duration-(--duration-base) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',
|
|
11
|
+
popup: cva('fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-var(--spacing)*8)] w-full max-w-[calc(100%-var(--spacing)*8)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border border-border bg-popover p-6 text-body text-popover-foreground shadow-lg duration-(--duration-base) outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:zoom-in-100 motion-reduce:data-closed:zoom-out-100', {
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
sm: 'sm:max-w-(--size-dialog-sm)',
|
|
15
|
+
md: 'sm:max-w-(--size-dialog-md)',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: { size: 'sm' },
|
|
19
|
+
}),
|
|
20
|
+
header: 'flex flex-col gap-2',
|
|
21
|
+
// Desktop: right-aligned, Cancel left of the action. Phone: stacked full
|
|
22
|
+
// width, action on top, Cancel last (docs/design/conventions.md, "Buttons").
|
|
23
|
+
footer: 'flex flex-col-reverse gap-2 pt-1 sm:flex-row sm:justify-end',
|
|
24
|
+
title: 'text-heading font-semibold text-foreground',
|
|
25
|
+
description: 'text-body text-muted-foreground',
|
|
26
|
+
// On phone a confirm rises as a bottom sheet (docs/design/png/Sheet.png):
|
|
27
|
+
// pinned to the bottom, full width, rounded top, clear of the home bar.
|
|
28
|
+
phoneSheet: 'max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-none max-sm:rounded-t-2xl max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] max-sm:[&_[data-slot=button]]:h-(--size-control-touch) max-sm:[&_[data-slot=button]]:w-full',
|
|
29
|
+
// On phone a dialog that shows a form or a prompt fills the screen.
|
|
30
|
+
phoneFullScreen: 'max-sm:top-0 max-sm:left-0 max-sm:h-dvh max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:content-start max-sm:overflow-y-auto max-sm:rounded-none max-sm:border-0',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=dialog-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-surface.js","sourceRoot":"","sources":["../../src/atoms/dialog-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EACL,0JAA0J;IAC5J,KAAK,EAAE,GAAG,CACR,8fAA8f,EAC9f;QACE,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,EAAE,EAAE,6BAA6B;gBACjC,EAAE,EAAE,6BAA6B;aAClC;SACF;QACD,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KAChC,CACF;IACD,MAAM,EAAE,qBAAqB;IAC7B,yEAAyE;IACzE,6EAA6E;IAC7E,MAAM,EAAE,6DAA6D;IACrE,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,iCAAiC;IAC9C,0EAA0E;IAC1E,wEAAwE;IACxE,UAAU,EACR,oWAAoW;IACtW,oEAAoE;IACpE,eAAe,EACb,qLAAqL;CACxL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
import { dialogSurface } from './dialog-surface.js';
|
|
5
|
+
/**
|
|
6
|
+
* shadcn Dialog on Base UI, for a blocking short form (docs/design/png/Dialog.png):
|
|
7
|
+
* sm (512 px) for confirms, md (560 px) for forms. Escape and Cancel close it;
|
|
8
|
+
* focus moves to the first field and returns to the trigger. While busy, the
|
|
9
|
+
* caller keeps it open and disables everything but the loading action.
|
|
10
|
+
*/
|
|
11
|
+
declare function Dialog(props: DialogPrimitive.Root.Props): import("react").JSX.Element;
|
|
12
|
+
declare function DialogTrigger(props: DialogPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
13
|
+
declare function DialogClose(props: DialogPrimitive.Close.Props): import("react").JSX.Element;
|
|
14
|
+
declare function DialogContent({ className, size, children, ...props }: DialogPrimitive.Popup.Props & VariantProps<typeof dialogSurface.popup>): import("react").JSX.Element;
|
|
15
|
+
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
16
|
+
declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
17
|
+
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): import("react").JSX.Element;
|
|
18
|
+
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react").JSX.Element;
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
4
|
+
import { classNames } from '../class-names.js';
|
|
5
|
+
import { dialogSurface } from './dialog-surface.js';
|
|
6
|
+
/**
|
|
7
|
+
* shadcn Dialog on Base UI, for a blocking short form (docs/design/png/Dialog.png):
|
|
8
|
+
* sm (512 px) for confirms, md (560 px) for forms. Escape and Cancel close it;
|
|
9
|
+
* focus moves to the first field and returns to the trigger. While busy, the
|
|
10
|
+
* caller keeps it open and disables everything but the loading action.
|
|
11
|
+
*/
|
|
12
|
+
function Dialog(props) {
|
|
13
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
14
|
+
}
|
|
15
|
+
function DialogTrigger(props) {
|
|
16
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
17
|
+
}
|
|
18
|
+
function DialogClose(props) {
|
|
19
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
20
|
+
}
|
|
21
|
+
function DialogContent({ className, size, children, ...props }) {
|
|
22
|
+
return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", className: dialogSurface.overlay }), _jsx(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: classNames(dialogSurface.popup({ size }), className), ...props, children: children })] }));
|
|
23
|
+
}
|
|
24
|
+
function DialogHeader({ className, ...props }) {
|
|
25
|
+
return _jsx("div", { "data-slot": "dialog-header", className: classNames(dialogSurface.header, className), ...props });
|
|
26
|
+
}
|
|
27
|
+
function DialogFooter({ className, ...props }) {
|
|
28
|
+
return _jsx("div", { "data-slot": "dialog-footer", className: classNames(dialogSurface.footer, className), ...props });
|
|
29
|
+
}
|
|
30
|
+
function DialogTitle({ className, ...props }) {
|
|
31
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: classNames(dialogSurface.title, className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
function DialogDescription({ className, ...props }) {
|
|
34
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: classNames(dialogSurface.description, className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|
|
37
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/atoms/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EAA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AAC;AAC9G,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,EAAC,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACrH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAqC;IACnF,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB,EAC9B,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
/**
|
|
3
|
+
* shadcn DropdownMenu on Base UI Menu (docs/design/png/DropdownMenu.png).
|
|
4
|
+
* Desktop only; on phone the same items open in a bottom Sheet. Items that
|
|
5
|
+
* open a dialog end with an ellipsis. The destructive item is last, after a
|
|
6
|
+
* separator, in --destructive-text.
|
|
7
|
+
*/
|
|
8
|
+
declare function DropdownMenu(props: MenuPrimitive.Root.Props): import("react").JSX.Element;
|
|
9
|
+
declare function DropdownMenuTrigger(props: MenuPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
10
|
+
declare function DropdownMenuContent({ align, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'side' | 'sideOffset'>): import("react").JSX.Element;
|
|
11
|
+
declare function DropdownMenuGroup(props: MenuPrimitive.Group.Props): import("react").JSX.Element;
|
|
12
|
+
declare function DropdownMenuItem({ className, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** A small heading over a group of items, such as Theme. */
|
|
16
|
+
declare function DropdownMenuLabel({ className, ...props }: MenuPrimitive.GroupLabel.Props): import("react").JSX.Element;
|
|
17
|
+
declare function DropdownMenuRadioGroup(props: MenuPrimitive.RadioGroup.Props): import("react").JSX.Element;
|
|
18
|
+
/** One choice of a radio group: the check sits at the end of the row while it is chosen. */
|
|
19
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props): import("react").JSX.Element;
|
|
20
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): import("react").JSX.Element;
|
|
21
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
4
|
+
import { Check } from 'lucide-react';
|
|
5
|
+
import { classNames } from '../class-names.js';
|
|
6
|
+
/**
|
|
7
|
+
* shadcn DropdownMenu on Base UI Menu (docs/design/png/DropdownMenu.png).
|
|
8
|
+
* Desktop only; on phone the same items open in a bottom Sheet. Items that
|
|
9
|
+
* open a dialog end with an ellipsis. The destructive item is last, after a
|
|
10
|
+
* separator, in --destructive-text.
|
|
11
|
+
*/
|
|
12
|
+
function DropdownMenu(props) {
|
|
13
|
+
return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
14
|
+
}
|
|
15
|
+
function DropdownMenuTrigger(props) {
|
|
16
|
+
return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
17
|
+
}
|
|
18
|
+
function DropdownMenuContent({ align = 'end', side = 'bottom', sideOffset = 4, className, ...props }) {
|
|
19
|
+
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: classNames('max-h-(--available-height) min-w-48 origin-(--transform-origin) overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-lg duration-(--duration-fast) outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }) }) }));
|
|
20
|
+
}
|
|
21
|
+
function DropdownMenuGroup(props) {
|
|
22
|
+
return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
23
|
+
}
|
|
24
|
+
function DropdownMenuItem({ className, variant = 'default', ...props }) {
|
|
25
|
+
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: classNames("relative flex h-8.5 items-center gap-2.5 rounded-sm px-2.5 text-body text-foreground outline-none select-none data-highlighted:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-disabled:pointer-events-none data-disabled:opacity-45 data-[variant=destructive]:text-destructive-text [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon) [&_svg]:text-muted-foreground data-[variant=destructive]:[&_svg]:text-destructive-text", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
/** A small heading over a group of items, such as Theme. */
|
|
28
|
+
function DropdownMenuLabel({ className, ...props }) {
|
|
29
|
+
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", className: classNames('px-2.5 pt-1.5 pb-1 text-caption text-muted-foreground', className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function DropdownMenuRadioGroup(props) {
|
|
32
|
+
return _jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
33
|
+
}
|
|
34
|
+
/** One choice of a radio group: the check sits at the end of the row while it is chosen. */
|
|
35
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
36
|
+
return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: classNames("relative flex h-8.5 items-center gap-2.5 rounded-sm px-2.5 text-body text-foreground outline-none select-none data-highlighted:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-disabled:pointer-events-none data-disabled:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon) [&_svg]:text-muted-foreground", className), ...props, children: [children, _jsx(MenuPrimitive.RadioItemIndicator, { className: "ml-auto flex", children: _jsx(Check, { "aria-hidden": true, className: "text-foreground" }) })] }));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
39
|
+
return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: classNames('-mx-1 my-1 h-px bg-border', className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, };
|
|
42
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/atoms/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;GAKG;AACH,SAAS,YAAY,CAAC,KAA+B;IACnD,OAAO,KAAC,aAAa,CAAC,IAAI,iBAAW,eAAe,KAAK,KAAK,GAAI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E,OAAO,KAAC,aAAa,CAAC,UAAU,iBAAW,2BAA2B,KAAK,KAAK,GAAI,CAAC;AACvF,CAAC;AAED,4FAA4F;AAC5F,SAAS,qBAAqB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiC;IAC7F,OAAO,CACL,MAAC,aAAa,CAAC,SAAS,iBACZ,0BAA0B,EACpC,SAAS,EAAE,UAAU,CACnB,oXAAoX,EACpX,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,aAAa,CAAC,kBAAkB,IAAC,SAAS,EAAC,cAAc,YACxD,KAAC,KAAK,yBAAa,SAAS,EAAC,iBAAiB,GAAG,GAChB,IACX,CAC3B,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC;IACnF,OAAO,CACL,KAAC,aAAa,CAAC,SAAS,iBACZ,yBAAyB,EACnC,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,KACzD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* shadcn Kbd (docs/design/png/Kbd.png): a key or shortcut, beside the action
|
|
4
|
+
* it hints at. Desktop only: hidden on phone, and never the only way to learn
|
|
5
|
+
* an action.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Kbd({ className, ...props }: ComponentProps<'kbd'>): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from '../class-names.js';
|
|
3
|
+
/**
|
|
4
|
+
* shadcn Kbd (docs/design/png/Kbd.png): a key or shortcut, beside the action
|
|
5
|
+
* it hints at. Desktop only: hidden on phone, and never the only way to learn
|
|
6
|
+
* an action.
|
|
7
|
+
*/
|
|
8
|
+
export function Kbd({ className, ...props }) {
|
|
9
|
+
return (_jsx("kbd", { "data-slot": "kbd", className: classNames('inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden', className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=kbd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kbd.js","sourceRoot":"","sources":["../../src/atoms/kbd.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChE,OAAO,CACL,2BACY,KAAK,EACf,SAAS,EAAE,UAAU,CACnB,oLAAoL,EACpL,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* shadcn Sheet on Base UI Dialog (docs/design/png/Sheet.png). Right: the
|
|
6
|
+
* desktop side sheet, 560 px, header with title, context and close, scrolling
|
|
7
|
+
* body, footer. Bottom: the phone sheet for menus, filters and confirms, with a
|
|
8
|
+
* handle, --radius-2xl top corners and full-width 44 px actions, Cancel last.
|
|
9
|
+
* Under reduced motion it fades instead of sliding.
|
|
10
|
+
*/
|
|
11
|
+
declare const sheetPopup: (props?: ({
|
|
12
|
+
side?: "bottom" | "right" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare function Sheet(props: SheetPrimitive.Root.Props): import("react").JSX.Element;
|
|
15
|
+
declare function SheetTrigger(props: SheetPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
16
|
+
declare function SheetClose(props: SheetPrimitive.Close.Props): import("react").JSX.Element;
|
|
17
|
+
declare function SheetContent({ className, children, side, ...props }: SheetPrimitive.Popup.Props & VariantProps<typeof sheetPopup>): import("react").JSX.Element;
|
|
18
|
+
declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
19
|
+
declare function SheetBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
20
|
+
declare function SheetFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
21
|
+
declare function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props): import("react").JSX.Element;
|
|
22
|
+
declare function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): import("react").JSX.Element;
|
|
23
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
|