@volkanic/components 0.0.0-stage → 0.1.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/NOTICE +4 -0
- package/README.md +30 -2
- package/dist/Badge/Badge.d.ts +9 -0
- package/dist/Banner/Banner.d.ts +14 -0
- package/dist/Button/Button.d.ts +12 -0
- package/dist/Checkbox/Checkbox.d.ts +10 -0
- package/dist/Modal/Modal.d.ts +21 -0
- package/dist/Select/Select.d.ts +22 -0
- package/dist/Spinner/Spinner.d.ts +7 -0
- package/dist/Tabs/Tabs.d.ts +39 -0
- package/dist/TextField/TextField.d.ts +22 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +473 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +56 -3
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/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @volkanic/components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Accessible React components for Volkanic products: Button, TextField, Select, Checkbox, Badge, Banner,
|
|
4
|
+
Spinner, Modal and Tabs, plus the layout primitives. Styled only through `--vk-*` tokens, so any theme works.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm i @volkanic/components @volkanic/themes @volkanic/theme-provider
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import '@volkanic/components/styles.css';
|
|
12
|
+
import '@volkanic/themes/volkanic-light.css';
|
|
13
|
+
import { ThemeProvider } from '@volkanic/theme-provider';
|
|
14
|
+
import { Button, Stack, Heading } from '@volkanic/components';
|
|
15
|
+
|
|
16
|
+
export function App() {
|
|
17
|
+
return (
|
|
18
|
+
<ThemeProvider theme="volkanic-light">
|
|
19
|
+
<Stack space="200">
|
|
20
|
+
<Heading level={1}>Orders</Heading>
|
|
21
|
+
<Button appearance="primary">Create order</Button>
|
|
22
|
+
</Stack>
|
|
23
|
+
</ThemeProvider>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Requires React 18+. Components target WCAG 2.1 AA; the active theme must provide every token
|
|
29
|
+
(`npx volkanic-validate-theme` checks this).
|
|
30
|
+
|
|
31
|
+
Part of the [Volkanic Design System](https://github.com/volkanic-tech/volkanic-design-system). Licensed under Apache-2.0.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type BadgeAppearance = 'neutral' | 'brand' | 'danger' | 'success' | 'warning' | 'information';
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Meaning of the badge. Color alone is never the only signal: always include text. */
|
|
5
|
+
appearance?: BadgeAppearance;
|
|
6
|
+
/** Solid fill for higher emphasis. Neutral has no bold variant. */
|
|
7
|
+
isBold?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function Badge({ appearance, isBold, className, ...rest }: BadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BannerAppearance = 'information' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
appearance?: BannerAppearance;
|
|
5
|
+
/** Short heading. */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** Optional actions, such as a Button, shown under the message. */
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
/** When provided, a dismiss button is shown and calls this handler. */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
/** Accessible name for the dismiss button. Translate it for non-English UIs. */
|
|
12
|
+
dismissLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Banner({ appearance, title, actions, onDismiss, dismissLabel, className, children, ...rest }: BannerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type ButtonAppearance = 'primary' | 'secondary' | 'subtle' | 'danger';
|
|
3
|
+
export type ButtonSize = 'small' | 'medium' | 'large';
|
|
4
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/** Visual emphasis. Use one primary button per view. */
|
|
6
|
+
appearance?: ButtonAppearance;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
/** Icon rendered before the label. Decorative: it is hidden from assistive tech. */
|
|
9
|
+
iconBefore?: ReactNode;
|
|
10
|
+
iconAfter?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
3
|
+
/** Visible label. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Optional helper text under the label. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Mixed state for a parent checkbox. Cleared by the browser when the user toggles it. */
|
|
8
|
+
isIndeterminate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type ModalSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Called on Esc, backdrop click and the close button. You own the open state. */
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** Required: it names the dialog for assistive technology. */
|
|
8
|
+
title: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** Action area, usually a primary and a secondary Button. */
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
size?: ModalSize;
|
|
13
|
+
/** Accessible name for the close button. Translate it for non-English UIs. */
|
|
14
|
+
closeLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Built on the native <dialog> element, so the browser provides the focus trap,
|
|
18
|
+
* Esc handling, inert background and focus restoration. It stays inside the
|
|
19
|
+
* ThemeProvider's DOM subtree, so theme tokens apply without a portal.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Modal({ isOpen, onClose, title, children, footer, size, closeLabel }: ModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type SelectHTMLAttributes } from 'react';
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'children'> {
|
|
8
|
+
/** Visible label. Required: every field needs an accessible name. */
|
|
9
|
+
label: string;
|
|
10
|
+
options: SelectOption[];
|
|
11
|
+
/** Shown, and not selectable, until the user chooses. */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Error message. When set, the field is announced as invalid. */
|
|
15
|
+
error?: string;
|
|
16
|
+
isRequired?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A styled native <select>: full keyboard, screen-reader and mobile support
|
|
20
|
+
* with no custom listbox to maintain. Visual states match TextField.
|
|
21
|
+
*/
|
|
22
|
+
export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type SpinnerSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
size?: SpinnerSize;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Spinner({ size, label, className, ...rest }: Readonly<SpinnerProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Decides which tab receives focus for a key press inside the tab list.
|
|
4
|
+
* `current` and the result are indexes among the ENABLED tabs, in DOM order.
|
|
5
|
+
* Arrows wrap around the ends, flip in right-to-left layouts, and Home/End jump to the first/last tab.
|
|
6
|
+
* Returns `current` for keys that should not move focus.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getNextTabIndex({ current, count, key, isRtl, }: {
|
|
9
|
+
current: number;
|
|
10
|
+
count: number;
|
|
11
|
+
key: string;
|
|
12
|
+
isRtl: boolean;
|
|
13
|
+
}): number;
|
|
14
|
+
export type TabsProps = {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
} & ({
|
|
17
|
+
value: string;
|
|
18
|
+
onValueChange: (value: string) => void;
|
|
19
|
+
defaultValue?: never;
|
|
20
|
+
} | {
|
|
21
|
+
defaultValue: string;
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
value?: never;
|
|
24
|
+
});
|
|
25
|
+
export declare function Tabs({ value, defaultValue, onValueChange, children }: TabsProps): import("react").JSX.Element;
|
|
26
|
+
export interface TabListProps extends HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
/** Required: names the group of tabs, e.g. "Order sections". */
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function TabList({ label, className, onKeyDown, ...rest }: TabListProps): import("react").JSX.Element;
|
|
31
|
+
export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
32
|
+
/** Identifies the tab and the TabPanel it controls. Use an id-safe string. */
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function Tab({ value, className, onClick, ...rest }: TabProps): import("react").JSX.Element;
|
|
36
|
+
export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function TabPanel({ value, className, children, ...rest }: TabPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
export type FieldState = 'default' | 'invalid' | 'readonly' | 'disabled';
|
|
3
|
+
/**
|
|
4
|
+
* Decides which single visual state a field shows when several apply at once.
|
|
5
|
+
* Returns exactly one state, which maps to one class in TextField.module.css.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFieldState({ error, disabled, readOnly, }: {
|
|
8
|
+
error?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
}): FieldState;
|
|
12
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
13
|
+
/** Visible label. Required: every field needs an accessible name. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Helper text shown under the input. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Error message. When set, the field is announced as invalid. */
|
|
18
|
+
error?: string;
|
|
19
|
+
/** Marks the field as required and shows an asterisk. */
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");var n={button:`vk_Button-module_button`,small:`vk_Button-module_small`,large:`vk_Button-module_large`,primary:`vk_Button-module_primary`,secondary:`vk_Button-module_secondary`,subtle:`vk_Button-module_subtle`,danger:`vk_Button-module_danger`},r=(0,e.forwardRef)(function({appearance:e=`secondary`,size:r=`medium`,iconBefore:i,iconAfter:a,className:o,children:s,type:c=`button`,...l},u){let d=[n.button,n[e],r!==`medium`&&n[r],o].filter(Boolean).join(` `);return(0,t.jsxs)(`button`,{ref:u,type:c,className:d,...l,children:[i&&(0,t.jsx)(`span`,{"aria-hidden":`true`,children:i}),s,a&&(0,t.jsx)(`span`,{"aria-hidden":`true`,children:a})]})}),i={field:`vk_TextField-module_field`,label:`vk_TextField-module_label`,required:`vk_TextField-module_required`,description:`vk_TextField-module_description`,input:`vk_TextField-module_input`,invalid:`vk_TextField-module_invalid`,readonly:`vk_TextField-module_readonly`,disabled:`vk_TextField-module_disabled`,error:`vk_TextField-module_error`};function a({error:e,disabled:t,readOnly:n}){switch(!0){case!!e:return`invalid`;case!!t:return`disabled`;case!!n:return`readonly`;default:return`default`}}var o=(0,e.forwardRef)(function({label:n,description:r,error:o,isRequired:s,id:c,className:l,disabled:u,readOnly:d,...f},p){let m=(0,e.useId)(),h=c??m,g=r?`${h}-description`:void 0,_=o?`${h}-error`:void 0,v=[g,_].filter(Boolean).join(` `)||void 0,y=a({error:o,disabled:u,readOnly:d});return(0,t.jsxs)(`div`,{className:i.field,children:[(0,t.jsxs)(`label`,{className:i.label,htmlFor:h,children:[n,s&&(0,t.jsx)(`span`,{className:i.required,"aria-hidden":`true`,children:`*`})]}),r&&(0,t.jsx)(`p`,{id:g,className:i.description,children:r}),(0,t.jsx)(`input`,{ref:p,id:h,className:[i.input,y!=="default"&&i[y],l].filter(Boolean).join(` `),required:s,disabled:u,readOnly:d,"aria-invalid":o?!0:void 0,"aria-describedby":v,...f}),o&&(0,t.jsx)(`p`,{id:_,className:i.error,children:o})]})}),s={wrapper:`vk_Select-module_wrapper`,select:`vk_Select-module_select`,chevron:`vk_Select-module_chevron`},c=(0,e.forwardRef)(function({label:n,options:r,placeholder:o,description:c,error:l,isRequired:u,id:d,className:f,disabled:p,value:m,defaultValue:h,...g},_){let v=(0,e.useId)(),y=d??v,b=c?`${y}-description`:void 0,x=l?`${y}-error`:void 0,S=[b,x].filter(Boolean).join(` `)||void 0,C=a({error:l,disabled:p}),w=m===void 0?{defaultValue:h??(o?``:void 0)}:{value:m};return(0,t.jsxs)(`div`,{className:i.field,children:[(0,t.jsxs)(`label`,{className:i.label,htmlFor:y,children:[n,u&&(0,t.jsx)(`span`,{className:i.required,"aria-hidden":`true`,children:`*`})]}),c&&(0,t.jsx)(`p`,{id:b,className:i.description,children:c}),(0,t.jsxs)(`div`,{className:s.wrapper,children:[(0,t.jsxs)(`select`,{ref:_,id:y,className:[i.input,s.select,C!=="default"&&i[C],f].filter(Boolean).join(` `),required:u,disabled:p,"aria-invalid":l?!0:void 0,"aria-describedby":S,...w,...g,children:[o&&(0,t.jsx)(`option`,{value:``,disabled:!0,hidden:!0,children:o}),r.map(e=>(0,t.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,t.jsx)(`span`,{className:s.chevron,"aria-hidden":`true`})]}),l&&(0,t.jsx)(`p`,{id:x,className:i.error,children:l})]})}),l={root:`vk_Checkbox-module_root`,box:`vk_Checkbox-module_box`,text:`vk_Checkbox-module_text`,description:`vk_Checkbox-module_description`,disabled:`vk_Checkbox-module_disabled`},u=(0,e.forwardRef)(function({label:n,description:r,isIndeterminate:i=!1,id:a,className:o,disabled:s,...c},u){let d=(0,e.useId)(),f=a??d,p=r?`${f}-description`:void 0,m=(0,e.useRef)(null);return(0,e.useImperativeHandle)(u,()=>m.current),(0,e.useEffect)(()=>{m.current&&(m.current.indeterminate=i)},[i]),(0,t.jsxs)(`label`,{htmlFor:f,className:[l.root,s&&l.disabled,o].filter(Boolean).join(` `),children:[(0,t.jsx)(`input`,{ref:m,id:f,type:`checkbox`,className:l.box,disabled:s,"aria-describedby":p,...c}),(0,t.jsxs)(`span`,{className:l.text,children:[n,r&&(0,t.jsx)(`span`,{id:p,className:l.description,children:r})]})]})}),d={badge:`vk_Badge-module_badge`,neutral:`vk_Badge-module_neutral`,brand:`vk_Badge-module_brand`,danger:`vk_Badge-module_danger`,success:`vk_Badge-module_success`,warning:`vk_Badge-module_warning`,information:`vk_Badge-module_information`,bold:`vk_Badge-module_bold`},f={banner:`vk_Banner-module_banner`,information:`vk_Banner-module_information`,success:`vk_Banner-module_success`,warning:`vk_Banner-module_warning`,danger:`vk_Banner-module_danger`,icon:`vk_Banner-module_icon`,content:`vk_Banner-module_content`,title:`vk_Banner-module_title`,body:`vk_Banner-module_body`,actions:`vk_Banner-module_actions`,dismiss:`vk_Banner-module_dismiss`},p={information:(0,t.jsx)(`path`,{d:`M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`}),success:(0,t.jsx)(`path`,{d:`M12 2a10 10 0 100 20 10 10 0 000-20zm-2 15l-5-5 1.4-1.4L10 14.2l7.6-7.6L19 8l-9 9z`}),warning:(0,t.jsx)(`path`,{d:`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`}),danger:(0,t.jsx)(`path`,{d:`M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})},m={spinner:`vk_Spinner-module_spinner`,spin:`vk_Spinner-module_spin`,small:`vk_Spinner-module_small`,large:`vk_Spinner-module_large`,label:`vk_Spinner-module_label`},h={dialog:`vk_Modal-module_dialog`,small:`vk_Modal-module_small`,large:`vk_Modal-module_large`,surface:`vk_Modal-module_surface`,header:`vk_Modal-module_header`,title:`vk_Modal-module_title`,close:`vk_Modal-module_close`,body:`vk_Modal-module_body`,footer:`vk_Modal-module_footer`},g={list:`vk_Tabs-module_list`,tab:`vk_Tabs-module_tab`,panel:`vk_Tabs-module_panel`};function _({current:e,count:t,key:n,isRtl:r}){if(t<=0)return e;switch(n){case`Home`:return 0;case`End`:return t-1;case`ArrowRight`:return(e+(r?-1:1)+t)%t;case`ArrowLeft`:return(e+(r?1:-1)+t)%t;default:return e}}var v=(0,e.createContext)(null),y=()=>{let t=(0,e.useContext)(v);if(!t)throw Error(`Tab components must be used inside <Tabs>`);return t};exports.Badge=function({appearance:e=`neutral`,isBold:n=!1,className:r,...i}){let a=n&&e!==`neutral`,o=[d.badge,d[e],a&&d.bold,r].filter(Boolean).join(` `);return(0,t.jsx)(`span`,{className:o,...i})},exports.Banner=function({appearance:e=`information`,title:n,actions:r,onDismiss:i,dismissLabel:a=`Dismiss`,className:o,children:s,...c}){return(0,t.jsxs)(`div`,{role:e===`danger`||e===`warning`?`alert`:`status`,className:[f.banner,f[e],o].filter(Boolean).join(` `),...c,children:[(0,t.jsx)(`svg`,{className:f.icon,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:p[e]}),(0,t.jsxs)(`div`,{className:f.content,children:[n&&(0,t.jsx)(`p`,{className:f.title,children:n}),s&&(0,t.jsx)(`p`,{className:f.body,children:s}),r&&(0,t.jsx)(`div`,{className:f.actions,children:r})]}),i&&(0,t.jsx)(`button`,{type:`button`,className:f.dismiss,"aria-label":a,onClick:i,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M18.3 5.7L12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7 2.9 18.3 9.2 12 2.9 5.7 4.3 4.3l6.3 6.3 6.3-6.3 1.4 1.4z`,transform:`translate(1 0)`})})})]})},exports.Button=r,exports.Checkbox=u,exports.Modal=function({isOpen:n,onClose:r,title:i,children:a,footer:o,size:s=`medium`,closeLabel:c=`Close`}){let l=(0,e.useRef)(null),u=(0,e.useId)();return(0,e.useEffect)(()=>{let e=l.current;e&&(n&&!e.open&&e.showModal(),!n&&e.open&&e.close())},[n]),(0,t.jsx)(`dialog`,{ref:l,"aria-labelledby":u,className:[h.dialog,s!==`medium`&&h[s]].filter(Boolean).join(` `),onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},children:n&&(0,t.jsxs)(`div`,{className:h.surface,children:[(0,t.jsxs)(`div`,{className:h.header,children:[(0,t.jsx)(`h2`,{id:u,className:h.title,children:i}),(0,t.jsx)(`button`,{type:`button`,className:h.close,"aria-label":c,onClick:r,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z`})})})]}),(0,t.jsx)(`div`,{className:h.body,children:a}),o&&(0,t.jsx)(`div`,{className:h.footer,children:o})]})})},exports.Select=c,exports.Spinner=function({size:e=`medium`,label:n=`Loading`,className:r,...i}){return(0,t.jsx)(`span`,{role:`status`,className:[m.spinner,e!==`medium`&&m[e],r].filter(Boolean).join(` `),...i,children:(0,t.jsx)(`span`,{className:m.label,children:n})})},exports.Tab=function({value:e,className:n,onClick:r,...i}){let{value:a,select:o,baseId:s}=y(),c=a===e;return(0,t.jsx)(`button`,{type:`button`,role:`tab`,id:`${s}-tab-${e}`,"aria-selected":c,"aria-controls":`${s}-panel-${e}`,tabIndex:c?0:-1,className:[g.tab,n].filter(Boolean).join(` `),onClick:t=>{r?.(t),t.defaultPrevented||o(e)},...i})},exports.TabList=function({label:n,className:r,onKeyDown:i,...a}){let o=(0,e.useRef)(null);return(0,t.jsx)(`div`,{ref:o,role:`tablist`,"aria-label":n,className:[g.list,r].filter(Boolean).join(` `),onKeyDown:e=>{i?.(e);let t=o.current;if(!t||e.defaultPrevented)return;let n=Array.from(t.querySelectorAll(`[role="tab"]:not(:disabled)`)),r=n.indexOf(document.activeElement);if(r<0)return;let a=_({current:r,count:n.length,key:e.key,isRtl:getComputedStyle(t).direction===`rtl`});a!==r&&n[a]&&(e.preventDefault(),n[a].focus(),n[a].click())},...a})},exports.TabPanel=function({value:e,className:n,children:r,...i}){let{value:a,baseId:o}=y(),s=a===e;return(0,t.jsx)(`div`,{role:`tabpanel`,id:`${o}-panel-${e}`,"aria-labelledby":`${o}-tab-${e}`,hidden:!s,tabIndex:0,className:[g.panel,n].filter(Boolean).join(` `),...i,children:s&&r})},exports.Tabs=function({value:n,defaultValue:r,onValueChange:i,children:a}){let o=(0,e.useId)(),[s,c]=(0,e.useState)(r??``),l=n!==void 0,u=l?n:s;return(0,t.jsx)(v.Provider,{value:{value:u,select:e=>{l||c(e),i?.(e)},baseId:o},children:a})},exports.TextField=o,exports.getFieldState=a,exports.getNextTabIndex=_;var b=require("@volkanic/primitives");Object.keys(b).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})});
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","styles","_jsxs","_jsx","forwardRef","useId","_jsxs","styles","_jsx","forwardRef","useId","_jsxs","fieldStyles","_jsx","styles","forwardRef","useId","useRef","useImperativeHandle","useEffect","_jsxs","styles","_jsx","styles","_jsx","_jsx","_jsxs","styles","_jsx","styles","useRef","useId","useEffect","_jsx","styles","_jsxs","createContext","useContext","useId","useState","_jsx","useRef","styles","react","react_jsx_runtime","Button_module_default","Button","appearance","size","iconBefore","iconAfter","className","children","type","rest","ref","classes","TextField_module_default","getFieldState","error","disabled","readOnly","TextField","label","description","isRequired","id","generatedId","inputId","descriptionId","errorId","describedBy","state","Select_module_default","Select","options","placeholder","value","defaultValue","selectId","valueProps","o","Checkbox_module_default","Checkbox","isIndeterminate","innerRef","Badge_module_default","Banner_module_default","icons","Spinner_module_default","Modal_module_default","Tabs_module_default","getNextTabIndex","current","count","key","isRtl","TabsContext","useTabs","ctx","isBold","bold","title","actions","onDismiss","dismissLabel","isOpen","onClose","footer","closeLabel","titleId","dialog","event","onClick","selected","select","baseId","isSelected","onKeyDown","list","tabs","next","onValueChange","inner","setInner","isControlled","_volkanic_primitives","k"],"sources":["../src/Button/Button.tsx","../src/TextField/TextField.tsx","../src/Select/Select.tsx","../src/Checkbox/Checkbox.tsx","../src/Badge/Badge.tsx","../src/Banner/Banner.tsx","../src/Spinner/Spinner.tsx","../src/Modal/Modal.tsx","../src/Tabs/Tabs.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport styles from './Button.module.css';\n\nexport type ButtonAppearance = 'primary' | 'secondary' | 'subtle' | 'danger';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual emphasis. Use one primary button per view. */\n appearance?: ButtonAppearance;\n size?: ButtonSize;\n /** Icon rendered before the label. Decorative: it is hidden from assistive tech. */\n iconBefore?: ReactNode;\n iconAfter?: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { appearance = 'secondary', size = 'medium', iconBefore, iconAfter, className, children, type = 'button', ...rest },\n ref,\n) {\n const classes = [styles.button, styles[appearance], size !== 'medium' && styles[size], className]\n .filter(Boolean)\n .join(' ');\n return (\n <button ref={ref} type={type} className={classes} {...rest}>\n {iconBefore && <span aria-hidden=\"true\">{iconBefore}</span>}\n {children}\n {iconAfter && <span aria-hidden=\"true\">{iconAfter}</span>}\n </button>\n );\n});\n","import { forwardRef, useId, type InputHTMLAttributes } from 'react';\nimport styles from './TextField.module.css';\n\nexport type FieldState = 'default' | 'invalid' | 'readonly' | 'disabled';\n\n/**\n * Decides which single visual state a field shows when several apply at once.\n * Returns exactly one state, which maps to one class in TextField.module.css.\n */\nexport function getFieldState({\n error,\n disabled,\n readOnly,\n}: {\n error?: string;\n disabled?: boolean;\n readOnly?: boolean;\n}): FieldState {\n switch (true) {\n case Boolean(error):\n return 'invalid';\n case Boolean(disabled):\n return 'disabled';\n case Boolean(readOnly):\n return 'readonly';\n default:\n return 'default';\n }\n}\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Visible label. Required: every field needs an accessible name. */\n label: string;\n /** Helper text shown under the input. */\n description?: string;\n /** Error message. When set, the field is announced as invalid. */\n error?: string;\n /** Marks the field as required and shows an asterisk. */\n isRequired?: boolean;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n { label, description, error, isRequired, id, className, disabled, readOnly, ...rest },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = description ? `${inputId}-description` : undefined;\n const errorId = error ? `${inputId}-error` : undefined;\n const describedBy = [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n const state = getFieldState({ error, disabled, readOnly });\n\n return (\n <div className={styles.field}>\n <label className={styles.label} htmlFor={inputId}>\n {label}\n {isRequired && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n {description && (\n <p id={descriptionId} className={styles.description}>\n {description}\n </p>\n )}\n <input\n ref={ref}\n id={inputId}\n className={[styles.input, state !== 'default' && styles[state], className].filter(Boolean).join(' ')}\n required={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n {...rest}\n />\n {error && (\n <p id={errorId} className={styles.error}>\n {error}\n </p>\n )}\n </div>\n );\n});\n","import { forwardRef, useId, type SelectHTMLAttributes } from 'react';\nimport fieldStyles from '../TextField/TextField.module.css';\nimport { getFieldState } from '../TextField/TextField';\nimport styles from './Select.module.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'children'> {\n /** Visible label. Required: every field needs an accessible name. */\n label: string;\n options: SelectOption[];\n /** Shown, and not selectable, until the user chooses. */\n placeholder?: string;\n description?: string;\n /** Error message. When set, the field is announced as invalid. */\n error?: string;\n isRequired?: boolean;\n}\n\n/**\n * A styled native <select>: full keyboard, screen-reader and mobile support\n * with no custom listbox to maintain. Visual states match TextField.\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, options, placeholder, description, error, isRequired, id, className, disabled, value, defaultValue, ...rest },\n ref,\n) {\n const generatedId = useId();\n const selectId = id ?? generatedId;\n const descriptionId = description ? `${selectId}-description` : undefined;\n const errorId = error ? `${selectId}-error` : undefined;\n const describedBy = [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n const state = getFieldState({ error, disabled });\n\n // With a placeholder and no chosen value, start on the empty placeholder option.\n const valueProps =\n value !== undefined ? { value } : { defaultValue: defaultValue ?? (placeholder ? '' : undefined) };\n\n return (\n <div className={fieldStyles.field}>\n <label className={fieldStyles.label} htmlFor={selectId}>\n {label}\n {isRequired && (\n <span className={fieldStyles.required} aria-hidden=\"true\">*</span>\n )}\n </label>\n {description && <p id={descriptionId} className={fieldStyles.description}>{description}</p>}\n <div className={styles.wrapper}>\n <select\n ref={ref}\n id={selectId}\n className={[fieldStyles.input, styles.select, state !== 'default' && fieldStyles[state], className].filter(Boolean).join(' ')}\n required={isRequired}\n disabled={disabled}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n {...valueProps}\n {...rest}\n >\n {placeholder && <option value=\"\" disabled hidden>{placeholder}</option>}\n {options.map((o) => (\n <option key={o.value} value={o.value} disabled={o.disabled}>{o.label}</option>\n ))}\n </select>\n <span className={styles.chevron} aria-hidden=\"true\" />\n </div>\n {error && <p id={errorId} className={fieldStyles.error}>{error}</p>}\n </div>\n );\n});\n","import { forwardRef, useEffect, useId, useImperativeHandle, useRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport styles from './Checkbox.module.css';\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Visible label. */\n label: ReactNode;\n /** Optional helper text under the label. */\n description?: string;\n /** Mixed state for a parent checkbox. Cleared by the browser when the user toggles it. */\n isIndeterminate?: boolean;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, isIndeterminate = false, id, className, disabled, ...rest },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = description ? `${inputId}-description` : undefined;\n const innerRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLInputElement);\n\n // `indeterminate` is a DOM property with no HTML attribute, so it is set imperatively.\n useEffect(() => {\n if (innerRef.current) innerRef.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n return (\n <label\n htmlFor={inputId}\n className={[styles.root, disabled && styles.disabled, className].filter(Boolean).join(' ')}\n >\n <input\n ref={innerRef}\n id={inputId}\n type=\"checkbox\"\n className={styles.box}\n disabled={disabled}\n aria-describedby={descriptionId}\n {...rest}\n />\n <span className={styles.text}>\n {label}\n {description && (\n <span id={descriptionId} className={styles.description}>\n {description}\n </span>\n )}\n </span>\n </label>\n );\n});\n","import type { HTMLAttributes } from 'react';\nimport styles from './Badge.module.css';\n\nexport type BadgeAppearance = 'neutral' | 'brand' | 'danger' | 'success' | 'warning' | 'information';\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Meaning of the badge. Color alone is never the only signal: always include text. */\n appearance?: BadgeAppearance;\n /** Solid fill for higher emphasis. Neutral has no bold variant. */\n isBold?: boolean;\n}\n\nexport function Badge({ appearance = 'neutral', isBold = false, className, ...rest }: BadgeProps) {\n const bold = isBold && appearance !== 'neutral';\n const classes = [styles.badge, styles[appearance], bold && styles.bold, className].filter(Boolean).join(' ');\n return <span className={classes} {...rest} />;\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport styles from './Banner.module.css';\n\nexport type BannerAppearance = 'information' | 'success' | 'warning' | 'danger';\n\nexport interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n appearance?: BannerAppearance;\n /** Short heading. */\n title?: ReactNode;\n /** Optional actions, such as a Button, shown under the message. */\n actions?: ReactNode;\n /** When provided, a dismiss button is shown and calls this handler. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Translate it for non-English UIs. */\n dismissLabel?: string;\n}\n\nconst icons: Record<BannerAppearance, ReactNode> = {\n information: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\" />,\n success: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm-2 15l-5-5 1.4-1.4L10 14.2l7.6-7.6L19 8l-9 9z\" />,\n warning: <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" />,\n danger: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" />,\n};\n\nexport function Banner({\n appearance = 'information',\n title,\n actions,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n children,\n ...rest\n}: BannerProps) {\n // Urgent messages interrupt assistive tech; the rest are announced politely.\n const role = appearance === 'danger' || appearance === 'warning' ? 'alert' : 'status';\n return (\n <div role={role} className={[styles.banner, styles[appearance], className].filter(Boolean).join(' ')} {...rest}>\n <svg className={styles.icon} viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n {icons[appearance]}\n </svg>\n <div className={styles.content}>\n {title && <p className={styles.title}>{title}</p>}\n {children && <p className={styles.body}>{children}</p>}\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {onDismiss && (\n <button type=\"button\" className={styles.dismiss} aria-label={dismissLabel} onClick={onDismiss}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M18.3 5.7L12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7 2.9 18.3 9.2 12 2.9 5.7 4.3 4.3l6.3 6.3 6.3-6.3 1.4 1.4z\" transform=\"translate(1 0)\" />\n </svg>\n </button>\n )}\n </div>\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport styles from './Spinner.module.css';\n\nexport type SpinnerSize = 'small' | 'medium' | 'large';\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n size?: SpinnerSize;\n label?: string;\n}\n\nexport function Spinner({ size = 'medium', label = 'Loading', className, ...rest }: Readonly<SpinnerProps>) {\n return (\n <span role=\"status\" className={[styles.spinner, size !== 'medium' && styles[size], className].filter(Boolean).join(' ')} {...rest}>\n <span className={styles.label}>{label}</span>\n </span>\n );\n}\n","import { useEffect, useId, useRef, type ReactNode } from 'react';\nimport styles from './Modal.module.css';\n\nexport type ModalSize = 'small' | 'medium' | 'large';\n\nexport interface ModalProps {\n isOpen: boolean;\n /** Called on Esc, backdrop click and the close button. You own the open state. */\n onClose: () => void;\n /** Required: it names the dialog for assistive technology. */\n title: string;\n children?: ReactNode;\n /** Action area, usually a primary and a secondary Button. */\n footer?: ReactNode;\n size?: ModalSize;\n /** Accessible name for the close button. Translate it for non-English UIs. */\n closeLabel?: string;\n}\n\n/**\n * Built on the native <dialog> element, so the browser provides the focus trap,\n * Esc handling, inert background and focus restoration. It stays inside the\n * ThemeProvider's DOM subtree, so theme tokens apply without a portal.\n */\nexport function Modal({ isOpen, onClose, title, children, footer, size = 'medium', closeLabel = 'Close' }: ModalProps) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId();\n\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog) return;\n if (isOpen && !dialog.open) dialog.showModal();\n if (!isOpen && dialog.open) dialog.close();\n }, [isOpen]);\n\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n className={[styles.dialog, size !== 'medium' && styles[size]].filter(Boolean).join(' ')}\n onCancel={(event) => {\n // Keep the open state in the parent's hands instead of letting the browser close it.\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n // Clicks on the backdrop are dispatched to the <dialog> itself; the surface fills the rest.\n if (event.target === event.currentTarget) onClose();\n }}\n >\n {isOpen && (\n <div className={styles.surface}>\n <div className={styles.header}>\n <h2 id={titleId} className={styles.title}>{title}</h2>\n <button type=\"button\" className={styles.close} aria-label={closeLabel} onClick={onClose}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z\" />\n </svg>\n </button>\n </div>\n <div className={styles.body}>{children}</div>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n )}\n </dialog>\n );\n}\n","import {\n createContext,\n useContext,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport styles from './Tabs.module.css';\n\n/**\n * Decides which tab receives focus for a key press inside the tab list.\n * `current` and the result are indexes among the ENABLED tabs, in DOM order.\n * Arrows wrap around the ends, flip in right-to-left layouts, and Home/End jump to the first/last tab.\n * Returns `current` for keys that should not move focus.\n */\nexport function getNextTabIndex({\n current,\n count,\n key,\n isRtl,\n}: {\n current: number;\n count: number;\n key: string;\n isRtl: boolean;\n}): number {\n if (count <= 0) return current;\n\n switch (key) {\n case 'Home':\n return 0;\n case 'End':\n return count - 1;\n case 'ArrowRight':\n return (current + (isRtl ? -1 : 1) + count) % count;\n case 'ArrowLeft':\n return (current + (isRtl ? 1 : -1) + count) % count;\n default:\n return current;\n }\n}\n\ninterface TabsContextValue {\n value: string;\n select: (value: string) => void;\n baseId: string;\n}\nconst TabsContext = createContext<TabsContextValue | null>(null);\nconst useTabs = () => {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('Tab components must be used inside <Tabs>');\n return ctx;\n};\n\nexport type TabsProps = { children: ReactNode } & (\n | { value: string; onValueChange: (value: string) => void; defaultValue?: never }\n | { defaultValue: string; onValueChange?: (value: string) => void; value?: never }\n);\n\n\nexport function Tabs({ value, defaultValue, onValueChange, children }: TabsProps) {\n const baseId = useId();\n const [inner, setInner] = useState(defaultValue ?? '');\n const isControlled = value !== undefined;\n const current = isControlled ? value : inner;\n const select = (next: string) => {\n if (!isControlled) setInner(next);\n onValueChange?.(next);\n };\n return <TabsContext.Provider value={{ value: current, select, baseId }}>{children}</TabsContext.Provider>;\n}\n\nexport interface TabListProps extends HTMLAttributes<HTMLDivElement> {\n /** Required: names the group of tabs, e.g. \"Order sections\". */\n label: string;\n}\n\nexport function TabList({ label, className, onKeyDown, ...rest }: TabListProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n const list = ref.current;\n if (!list || event.defaultPrevented) return;\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]:not(:disabled)'));\n const current = tabs.indexOf(document.activeElement as HTMLElement);\n if (current < 0) return;\n const next = getNextTabIndex({\n current,\n count: tabs.length,\n key: event.key,\n isRtl: getComputedStyle(list).direction === 'rtl',\n });\n if (next !== current && tabs[next]) {\n event.preventDefault();\n tabs[next].focus();\n tabs[next].click(); // automatic activation: focus moves the selection\n }\n };\n\n return (\n <div\n ref={ref}\n role=\"tablist\"\n aria-label={label}\n className={[styles.list, className].filter(Boolean).join(' ')}\n onKeyDown={handleKeyDown}\n {...rest}\n />\n );\n}\n\nexport interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n /** Identifies the tab and the TabPanel it controls. Use an id-safe string. */\n value: string;\n}\n\nexport function Tab({ value, className, onClick, ...rest }: TabProps) {\n const { value: selected, select, baseId } = useTabs();\n const isSelected = selected === value;\n return (\n <button\n type=\"button\"\n role=\"tab\"\n id={`${baseId}-tab-${value}`}\n aria-selected={isSelected}\n aria-controls={`${baseId}-panel-${value}`}\n // Roving tabindex: only the selected tab is in the page's tab order.\n tabIndex={isSelected ? 0 : -1}\n className={[styles.tab, className].filter(Boolean).join(' ')}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) select(value);\n }}\n {...rest}\n />\n );\n}\n\nexport interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {\n value: string;\n}\n\nexport function TabPanel({ value, className, children, ...rest }: TabPanelProps) {\n const { value: selected, baseId } = useTabs();\n const isSelected = selected === value;\n return (\n <div\n role=\"tabpanel\"\n id={`${baseId}-panel-${value}`}\n aria-labelledby={`${baseId}-tab-${value}`}\n hidden={!isSelected}\n tabIndex={0}\n className={[styles.panel, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {isSelected && children}\n </div>\n );\n}\n"],"mappings":"A,4WAea8C,GAAA,EAAS9C,EAAAA,WAAAA,CAA2C,SAC/D,CAAE+C,aAAa,YAAaC,OAAO,SAAUC,aAAYC,YAAWC,YAAWC,WAAUC,OAAO,SAAU,GAAGC,GAC7GC,EACA,CACA,IAAMC,EAAU,CAACvD,EAAO,OAAQA,EAAO8C,GAAaC,IAAS,UAAY/C,EAAO+C,GAAOG,CAAS,CAAC,CAC9F,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,EACX,OACEjD,EAAAA,EAAAA,KAAAA,CAAC,SAAD,CAAaqD,MAAWF,OAAM,UAAWG,EAAS,GAAIF,EAAtD,SAAA,CACGL,IAAc9C,EAAAA,EAAAA,IAAAA,CAAC,OAAD,CAAM,cAAY,OAAQ,SAAA8C,CAAiB,CAAA,EACzDG,EACAF,IAAa/C,EAAAA,EAAAA,IAAAA,CAAC,OAAD,CAAM,cAAY,OAAQ,SAAA+C,CAA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,GAAInE,CACL,CAAA,CAEL,E,iBAiCA,SAAyB,CAAEuB,QAAO1B,YAAWC,WAAU,GAAGE,GAAuB,CAC/E,GAAM,CAAE,MAAO4D,EAAUE,UAAWlB,EAAQ,EACtCmB,EAAaH,IAAarC,EAChC,OACErC,EAAAA,EAAAA,IAAAA,CAAC,MAAD,CACE,KAAK,WACL,GAAI,GAAG4E,EAAO,SAASvC,IACvB,kBAAiB,GAAGuC,EAAO,OAAOvC,IAClC,OAAQ,CAACwC,EACT,SAAU,EACV,UAAW,CAAC3E,EAAO,MAAOS,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC7D,GAAIG,EAEH,SAAA+D,GAAcjE,CACZ,CAAA,CAET,E,aAnGA,SAAqB,CAAEyB,QAAOC,eAAc4C,gBAAetE,YAAuB,CAChF,IAAMgE,GAAA,EAAS9E,EAAAA,MAAAA,CAAM,EACf,CAACqF,EAAOC,IAAA,EAAYrF,EAAAA,SAAAA,CAASuC,GAAgB,EAAE,EAC/C+C,EAAehD,IAAU,IAAA,GACzBgB,EAAUgC,EAAehD,EAAQ8C,EAKvC,OAAOnF,EAAAA,EAAAA,IAAAA,CAACyD,EAAY,SAAb,CAAsB,MAAO,CAAE,MAAOJ,EAAS,OAJtC4B,GAAiB,CAC1BI,GAAcD,EAASH,CAAI,EAChCC,IAAgBD,CAAI,CACtB,EAC8DL,QAAO,EAAIhE,UAA+B,CAAA,CAC1G,E"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Button, type ButtonProps, type ButtonAppearance, type ButtonSize } from './Button/Button';
|
|
2
|
+
export { TextField, getFieldState, type TextFieldProps, type FieldState } from './TextField/TextField';
|
|
3
|
+
export { Select, type SelectProps, type SelectOption } from './Select/Select';
|
|
4
|
+
export { Checkbox, type CheckboxProps } from './Checkbox/Checkbox';
|
|
5
|
+
export { Badge, type BadgeProps, type BadgeAppearance } from './Badge/Badge';
|
|
6
|
+
export { Banner, type BannerProps, type BannerAppearance } from './Banner/Banner';
|
|
7
|
+
export { Spinner, type SpinnerProps, type SpinnerSize } from './Spinner/Spinner';
|
|
8
|
+
export { Modal, type ModalProps, type ModalSize } from './Modal/Modal';
|
|
9
|
+
export { Tabs, TabList, Tab, TabPanel, getNextTabIndex, type TabsProps, type TabListProps, type TabProps, type TabPanelProps } from './Tabs/Tabs';
|
|
10
|
+
export * from '@volkanic/primitives';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useImperativeHandle as a, useRef as o, useState as s } from "react";
|
|
2
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
export * from "@volkanic/primitives";
|
|
4
|
+
var u = {
|
|
5
|
+
button: "vk_Button-module_button",
|
|
6
|
+
small: "vk_Button-module_small",
|
|
7
|
+
large: "vk_Button-module_large",
|
|
8
|
+
primary: "vk_Button-module_primary",
|
|
9
|
+
secondary: "vk_Button-module_secondary",
|
|
10
|
+
subtle: "vk_Button-module_subtle",
|
|
11
|
+
danger: "vk_Button-module_danger"
|
|
12
|
+
}, d = t(function({ appearance: e = "secondary", size: t = "medium", iconBefore: n, iconAfter: r, className: i, children: a, type: o = "button", ...s }, d) {
|
|
13
|
+
let f = [
|
|
14
|
+
u.button,
|
|
15
|
+
u[e],
|
|
16
|
+
t !== "medium" && u[t],
|
|
17
|
+
i
|
|
18
|
+
].filter(Boolean).join(" ");
|
|
19
|
+
return /* @__PURE__ */ l("button", {
|
|
20
|
+
ref: d,
|
|
21
|
+
type: o,
|
|
22
|
+
className: f,
|
|
23
|
+
...s,
|
|
24
|
+
children: [
|
|
25
|
+
n && /* @__PURE__ */ c("span", {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: n
|
|
28
|
+
}),
|
|
29
|
+
a,
|
|
30
|
+
r && /* @__PURE__ */ c("span", {
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: r
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}), f = {
|
|
37
|
+
field: "vk_TextField-module_field",
|
|
38
|
+
label: "vk_TextField-module_label",
|
|
39
|
+
required: "vk_TextField-module_required",
|
|
40
|
+
description: "vk_TextField-module_description",
|
|
41
|
+
input: "vk_TextField-module_input",
|
|
42
|
+
invalid: "vk_TextField-module_invalid",
|
|
43
|
+
readonly: "vk_TextField-module_readonly",
|
|
44
|
+
disabled: "vk_TextField-module_disabled",
|
|
45
|
+
error: "vk_TextField-module_error"
|
|
46
|
+
};
|
|
47
|
+
// src/TextField/TextField.tsx
|
|
48
|
+
function p({ error: e, disabled: t, readOnly: n }) {
|
|
49
|
+
switch (!0) {
|
|
50
|
+
case !!e: return "invalid";
|
|
51
|
+
case !!t: return "disabled";
|
|
52
|
+
case !!n: return "readonly";
|
|
53
|
+
default: return "default";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var m = t(function({ label: e, description: t, error: n, isRequired: r, id: a, className: o, disabled: s, readOnly: u, ...d }, m) {
|
|
57
|
+
let h = i(), g = a ?? h, _ = t ? `${g}-description` : void 0, v = n ? `${g}-error` : void 0, y = [_, v].filter(Boolean).join(" ") || void 0, b = p({
|
|
58
|
+
error: n,
|
|
59
|
+
disabled: s,
|
|
60
|
+
readOnly: u
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ l("div", {
|
|
63
|
+
className: f.field,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ l("label", {
|
|
66
|
+
className: f.label,
|
|
67
|
+
htmlFor: g,
|
|
68
|
+
children: [e, r && /* @__PURE__ */ c("span", {
|
|
69
|
+
className: f.required,
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
children: "*"
|
|
72
|
+
})]
|
|
73
|
+
}),
|
|
74
|
+
t && /* @__PURE__ */ c("p", {
|
|
75
|
+
id: _,
|
|
76
|
+
className: f.description,
|
|
77
|
+
children: t
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ c("input", {
|
|
80
|
+
ref: m,
|
|
81
|
+
id: g,
|
|
82
|
+
className: [
|
|
83
|
+
f.input,
|
|
84
|
+
b !== "default" && f[b],
|
|
85
|
+
o
|
|
86
|
+
].filter(Boolean).join(" "),
|
|
87
|
+
required: r,
|
|
88
|
+
disabled: s,
|
|
89
|
+
readOnly: u,
|
|
90
|
+
"aria-invalid": n ? !0 : void 0,
|
|
91
|
+
"aria-describedby": y,
|
|
92
|
+
...d
|
|
93
|
+
}),
|
|
94
|
+
n && /* @__PURE__ */ c("p", {
|
|
95
|
+
id: v,
|
|
96
|
+
className: f.error,
|
|
97
|
+
children: n
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
}), h = {
|
|
102
|
+
wrapper: "vk_Select-module_wrapper",
|
|
103
|
+
select: "vk_Select-module_select",
|
|
104
|
+
chevron: "vk_Select-module_chevron"
|
|
105
|
+
}, g = t(function({ label: e, options: t, placeholder: n, description: r, error: a, isRequired: o, id: s, className: u, disabled: d, value: m, defaultValue: g, ..._ }, v) {
|
|
106
|
+
let y = i(), b = s ?? y, x = r ? `${b}-description` : void 0, S = a ? `${b}-error` : void 0, C = [x, S].filter(Boolean).join(" ") || void 0, w = p({
|
|
107
|
+
error: a,
|
|
108
|
+
disabled: d
|
|
109
|
+
}), T = m === void 0 ? { defaultValue: g ?? (n ? "" : void 0) } : { value: m };
|
|
110
|
+
return /* @__PURE__ */ l("div", {
|
|
111
|
+
className: f.field,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ l("label", {
|
|
114
|
+
className: f.label,
|
|
115
|
+
htmlFor: b,
|
|
116
|
+
children: [e, o && /* @__PURE__ */ c("span", {
|
|
117
|
+
className: f.required,
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
children: "*"
|
|
120
|
+
})]
|
|
121
|
+
}),
|
|
122
|
+
r && /* @__PURE__ */ c("p", {
|
|
123
|
+
id: x,
|
|
124
|
+
className: f.description,
|
|
125
|
+
children: r
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ l("div", {
|
|
128
|
+
className: h.wrapper,
|
|
129
|
+
children: [/* @__PURE__ */ l("select", {
|
|
130
|
+
ref: v,
|
|
131
|
+
id: b,
|
|
132
|
+
className: [
|
|
133
|
+
f.input,
|
|
134
|
+
h.select,
|
|
135
|
+
w !== "default" && f[w],
|
|
136
|
+
u
|
|
137
|
+
].filter(Boolean).join(" "),
|
|
138
|
+
required: o,
|
|
139
|
+
disabled: d,
|
|
140
|
+
"aria-invalid": a ? !0 : void 0,
|
|
141
|
+
"aria-describedby": C,
|
|
142
|
+
...T,
|
|
143
|
+
..._,
|
|
144
|
+
children: [n && /* @__PURE__ */ c("option", {
|
|
145
|
+
value: "",
|
|
146
|
+
disabled: !0,
|
|
147
|
+
hidden: !0,
|
|
148
|
+
children: n
|
|
149
|
+
}), t.map((e) => /* @__PURE__ */ c("option", {
|
|
150
|
+
value: e.value,
|
|
151
|
+
disabled: e.disabled,
|
|
152
|
+
children: e.label
|
|
153
|
+
}, e.value))]
|
|
154
|
+
}), /* @__PURE__ */ c("span", {
|
|
155
|
+
className: h.chevron,
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
})]
|
|
158
|
+
}),
|
|
159
|
+
a && /* @__PURE__ */ c("p", {
|
|
160
|
+
id: S,
|
|
161
|
+
className: f.error,
|
|
162
|
+
children: a
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
});
|
|
166
|
+
}), _ = {
|
|
167
|
+
root: "vk_Checkbox-module_root",
|
|
168
|
+
box: "vk_Checkbox-module_box",
|
|
169
|
+
text: "vk_Checkbox-module_text",
|
|
170
|
+
description: "vk_Checkbox-module_description",
|
|
171
|
+
disabled: "vk_Checkbox-module_disabled"
|
|
172
|
+
}, v = t(function({ label: e, description: t, isIndeterminate: n = !1, id: s, className: u, disabled: d, ...f }, p) {
|
|
173
|
+
let m = i(), h = s ?? m, g = t ? `${h}-description` : void 0, v = o(null);
|
|
174
|
+
return a(p, () => v.current), r(() => {
|
|
175
|
+
v.current && (v.current.indeterminate = n);
|
|
176
|
+
}, [n]), /* @__PURE__ */ l("label", {
|
|
177
|
+
htmlFor: h,
|
|
178
|
+
className: [
|
|
179
|
+
_.root,
|
|
180
|
+
d && _.disabled,
|
|
181
|
+
u
|
|
182
|
+
].filter(Boolean).join(" "),
|
|
183
|
+
children: [/* @__PURE__ */ c("input", {
|
|
184
|
+
ref: v,
|
|
185
|
+
id: h,
|
|
186
|
+
type: "checkbox",
|
|
187
|
+
className: _.box,
|
|
188
|
+
disabled: d,
|
|
189
|
+
"aria-describedby": g,
|
|
190
|
+
...f
|
|
191
|
+
}), /* @__PURE__ */ l("span", {
|
|
192
|
+
className: _.text,
|
|
193
|
+
children: [e, t && /* @__PURE__ */ c("span", {
|
|
194
|
+
id: g,
|
|
195
|
+
className: _.description,
|
|
196
|
+
children: t
|
|
197
|
+
})]
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
200
|
+
}), y = {
|
|
201
|
+
badge: "vk_Badge-module_badge",
|
|
202
|
+
neutral: "vk_Badge-module_neutral",
|
|
203
|
+
brand: "vk_Badge-module_brand",
|
|
204
|
+
danger: "vk_Badge-module_danger",
|
|
205
|
+
success: "vk_Badge-module_success",
|
|
206
|
+
warning: "vk_Badge-module_warning",
|
|
207
|
+
information: "vk_Badge-module_information",
|
|
208
|
+
bold: "vk_Badge-module_bold"
|
|
209
|
+
};
|
|
210
|
+
// src/Badge/Badge.tsx
|
|
211
|
+
function b({ appearance: e = "neutral", isBold: t = !1, className: n, ...r }) {
|
|
212
|
+
let i = t && e !== "neutral", a = [
|
|
213
|
+
y.badge,
|
|
214
|
+
y[e],
|
|
215
|
+
i && y.bold,
|
|
216
|
+
n
|
|
217
|
+
].filter(Boolean).join(" ");
|
|
218
|
+
return /* @__PURE__ */ c("span", {
|
|
219
|
+
className: a,
|
|
220
|
+
...r
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
var x = {
|
|
224
|
+
banner: "vk_Banner-module_banner",
|
|
225
|
+
information: "vk_Banner-module_information",
|
|
226
|
+
success: "vk_Banner-module_success",
|
|
227
|
+
warning: "vk_Banner-module_warning",
|
|
228
|
+
danger: "vk_Banner-module_danger",
|
|
229
|
+
icon: "vk_Banner-module_icon",
|
|
230
|
+
content: "vk_Banner-module_content",
|
|
231
|
+
title: "vk_Banner-module_title",
|
|
232
|
+
body: "vk_Banner-module_body",
|
|
233
|
+
actions: "vk_Banner-module_actions",
|
|
234
|
+
dismiss: "vk_Banner-module_dismiss"
|
|
235
|
+
}, S = {
|
|
236
|
+
information: /* @__PURE__ */ c("path", { d: "M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }),
|
|
237
|
+
success: /* @__PURE__ */ c("path", { d: "M12 2a10 10 0 100 20 10 10 0 000-20zm-2 15l-5-5 1.4-1.4L10 14.2l7.6-7.6L19 8l-9 9z" }),
|
|
238
|
+
warning: /* @__PURE__ */ c("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }),
|
|
239
|
+
danger: /* @__PURE__ */ c("path", { d: "M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" })
|
|
240
|
+
};
|
|
241
|
+
function C({ appearance: e = "information", title: t, actions: n, onDismiss: r, dismissLabel: i = "Dismiss", className: a, children: o, ...s }) {
|
|
242
|
+
return /* @__PURE__ */ l("div", {
|
|
243
|
+
role: e === "danger" || e === "warning" ? "alert" : "status",
|
|
244
|
+
className: [
|
|
245
|
+
x.banner,
|
|
246
|
+
x[e],
|
|
247
|
+
a
|
|
248
|
+
].filter(Boolean).join(" "),
|
|
249
|
+
...s,
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ c("svg", {
|
|
252
|
+
className: x.icon,
|
|
253
|
+
viewBox: "0 0 24 24",
|
|
254
|
+
fill: "currentColor",
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
focusable: "false",
|
|
257
|
+
children: S[e]
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ l("div", {
|
|
260
|
+
className: x.content,
|
|
261
|
+
children: [
|
|
262
|
+
t && /* @__PURE__ */ c("p", {
|
|
263
|
+
className: x.title,
|
|
264
|
+
children: t
|
|
265
|
+
}),
|
|
266
|
+
o && /* @__PURE__ */ c("p", {
|
|
267
|
+
className: x.body,
|
|
268
|
+
children: o
|
|
269
|
+
}),
|
|
270
|
+
n && /* @__PURE__ */ c("div", {
|
|
271
|
+
className: x.actions,
|
|
272
|
+
children: n
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
}),
|
|
276
|
+
r && /* @__PURE__ */ c("button", {
|
|
277
|
+
type: "button",
|
|
278
|
+
className: x.dismiss,
|
|
279
|
+
"aria-label": i,
|
|
280
|
+
onClick: r,
|
|
281
|
+
children: /* @__PURE__ */ c("svg", {
|
|
282
|
+
viewBox: "0 0 24 24",
|
|
283
|
+
width: "16",
|
|
284
|
+
height: "16",
|
|
285
|
+
fill: "currentColor",
|
|
286
|
+
"aria-hidden": "true",
|
|
287
|
+
focusable: "false",
|
|
288
|
+
children: /* @__PURE__ */ c("path", {
|
|
289
|
+
d: "M18.3 5.7L12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7 2.9 18.3 9.2 12 2.9 5.7 4.3 4.3l6.3 6.3 6.3-6.3 1.4 1.4z",
|
|
290
|
+
transform: "translate(1 0)"
|
|
291
|
+
})
|
|
292
|
+
})
|
|
293
|
+
})
|
|
294
|
+
]
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
var w = {
|
|
298
|
+
spinner: "vk_Spinner-module_spinner",
|
|
299
|
+
spin: "vk_Spinner-module_spin",
|
|
300
|
+
small: "vk_Spinner-module_small",
|
|
301
|
+
large: "vk_Spinner-module_large",
|
|
302
|
+
label: "vk_Spinner-module_label"
|
|
303
|
+
};
|
|
304
|
+
// src/Spinner/Spinner.tsx
|
|
305
|
+
function T({ size: e = "medium", label: t = "Loading", className: n, ...r }) {
|
|
306
|
+
return /* @__PURE__ */ c("span", {
|
|
307
|
+
role: "status",
|
|
308
|
+
className: [
|
|
309
|
+
w.spinner,
|
|
310
|
+
e !== "medium" && w[e],
|
|
311
|
+
n
|
|
312
|
+
].filter(Boolean).join(" "),
|
|
313
|
+
...r,
|
|
314
|
+
children: /* @__PURE__ */ c("span", {
|
|
315
|
+
className: w.label,
|
|
316
|
+
children: t
|
|
317
|
+
})
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
var E = {
|
|
321
|
+
dialog: "vk_Modal-module_dialog",
|
|
322
|
+
small: "vk_Modal-module_small",
|
|
323
|
+
large: "vk_Modal-module_large",
|
|
324
|
+
surface: "vk_Modal-module_surface",
|
|
325
|
+
header: "vk_Modal-module_header",
|
|
326
|
+
title: "vk_Modal-module_title",
|
|
327
|
+
close: "vk_Modal-module_close",
|
|
328
|
+
body: "vk_Modal-module_body",
|
|
329
|
+
footer: "vk_Modal-module_footer"
|
|
330
|
+
};
|
|
331
|
+
// src/Modal/Modal.tsx
|
|
332
|
+
function D({ isOpen: e, onClose: t, title: n, children: a, footer: s, size: u = "medium", closeLabel: d = "Close" }) {
|
|
333
|
+
let f = o(null), p = i();
|
|
334
|
+
return r(() => {
|
|
335
|
+
let t = f.current;
|
|
336
|
+
t && (e && !t.open && t.showModal(), !e && t.open && t.close());
|
|
337
|
+
}, [e]), /* @__PURE__ */ c("dialog", {
|
|
338
|
+
ref: f,
|
|
339
|
+
"aria-labelledby": p,
|
|
340
|
+
className: [E.dialog, u !== "medium" && E[u]].filter(Boolean).join(" "),
|
|
341
|
+
onCancel: (e) => {
|
|
342
|
+
e.preventDefault(), t();
|
|
343
|
+
},
|
|
344
|
+
onClick: (e) => {
|
|
345
|
+
e.target === e.currentTarget && t();
|
|
346
|
+
},
|
|
347
|
+
children: e && /* @__PURE__ */ l("div", {
|
|
348
|
+
className: E.surface,
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ l("div", {
|
|
351
|
+
className: E.header,
|
|
352
|
+
children: [/* @__PURE__ */ c("h2", {
|
|
353
|
+
id: p,
|
|
354
|
+
className: E.title,
|
|
355
|
+
children: n
|
|
356
|
+
}), /* @__PURE__ */ c("button", {
|
|
357
|
+
type: "button",
|
|
358
|
+
className: E.close,
|
|
359
|
+
"aria-label": d,
|
|
360
|
+
onClick: t,
|
|
361
|
+
children: /* @__PURE__ */ c("svg", {
|
|
362
|
+
viewBox: "0 0 24 24",
|
|
363
|
+
width: "16",
|
|
364
|
+
height: "16",
|
|
365
|
+
fill: "currentColor",
|
|
366
|
+
"aria-hidden": "true",
|
|
367
|
+
focusable: "false",
|
|
368
|
+
children: /* @__PURE__ */ c("path", { d: "M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z" })
|
|
369
|
+
})
|
|
370
|
+
})]
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ c("div", {
|
|
373
|
+
className: E.body,
|
|
374
|
+
children: a
|
|
375
|
+
}),
|
|
376
|
+
s && /* @__PURE__ */ c("div", {
|
|
377
|
+
className: E.footer,
|
|
378
|
+
children: s
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
var O = {
|
|
385
|
+
list: "vk_Tabs-module_list",
|
|
386
|
+
tab: "vk_Tabs-module_tab",
|
|
387
|
+
panel: "vk_Tabs-module_panel"
|
|
388
|
+
};
|
|
389
|
+
// src/Tabs/Tabs.tsx
|
|
390
|
+
function k({ current: e, count: t, key: n, isRtl: r }) {
|
|
391
|
+
if (t <= 0) return e;
|
|
392
|
+
switch (n) {
|
|
393
|
+
case "Home": return 0;
|
|
394
|
+
case "End": return t - 1;
|
|
395
|
+
case "ArrowRight": return (e + (r ? -1 : 1) + t) % t;
|
|
396
|
+
case "ArrowLeft": return (e + (r ? 1 : -1) + t) % t;
|
|
397
|
+
default: return e;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
var A = e(null), j = () => {
|
|
401
|
+
let e = n(A);
|
|
402
|
+
if (!e) throw Error("Tab components must be used inside <Tabs>");
|
|
403
|
+
return e;
|
|
404
|
+
};
|
|
405
|
+
function M({ value: e, defaultValue: t, onValueChange: n, children: r }) {
|
|
406
|
+
let a = i(), [o, l] = s(t ?? ""), u = e !== void 0, d = u ? e : o;
|
|
407
|
+
return /* @__PURE__ */ c(A.Provider, {
|
|
408
|
+
value: {
|
|
409
|
+
value: d,
|
|
410
|
+
select: (e) => {
|
|
411
|
+
u || l(e), n?.(e);
|
|
412
|
+
},
|
|
413
|
+
baseId: a
|
|
414
|
+
},
|
|
415
|
+
children: r
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function N({ label: e, className: t, onKeyDown: n, ...r }) {
|
|
419
|
+
let i = o(null);
|
|
420
|
+
return /* @__PURE__ */ c("div", {
|
|
421
|
+
ref: i,
|
|
422
|
+
role: "tablist",
|
|
423
|
+
"aria-label": e,
|
|
424
|
+
className: [O.list, t].filter(Boolean).join(" "),
|
|
425
|
+
onKeyDown: (e) => {
|
|
426
|
+
n?.(e);
|
|
427
|
+
let t = i.current;
|
|
428
|
+
if (!t || e.defaultPrevented) return;
|
|
429
|
+
let r = Array.from(t.querySelectorAll("[role=\"tab\"]:not(:disabled)")), a = r.indexOf(document.activeElement);
|
|
430
|
+
if (a < 0) return;
|
|
431
|
+
let o = k({
|
|
432
|
+
current: a,
|
|
433
|
+
count: r.length,
|
|
434
|
+
key: e.key,
|
|
435
|
+
isRtl: getComputedStyle(t).direction === "rtl"
|
|
436
|
+
});
|
|
437
|
+
o !== a && r[o] && (e.preventDefault(), r[o].focus(), r[o].click());
|
|
438
|
+
},
|
|
439
|
+
...r
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
function P({ value: e, className: t, onClick: n, ...r }) {
|
|
443
|
+
let { value: i, select: a, baseId: o } = j(), s = i === e;
|
|
444
|
+
return /* @__PURE__ */ c("button", {
|
|
445
|
+
type: "button",
|
|
446
|
+
role: "tab",
|
|
447
|
+
id: `${o}-tab-${e}`,
|
|
448
|
+
"aria-selected": s,
|
|
449
|
+
"aria-controls": `${o}-panel-${e}`,
|
|
450
|
+
tabIndex: s ? 0 : -1,
|
|
451
|
+
className: [O.tab, t].filter(Boolean).join(" "),
|
|
452
|
+
onClick: (t) => {
|
|
453
|
+
n?.(t), t.defaultPrevented || a(e);
|
|
454
|
+
},
|
|
455
|
+
...r
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
function F({ value: e, className: t, children: n, ...r }) {
|
|
459
|
+
let { value: i, baseId: a } = j(), o = i === e;
|
|
460
|
+
return /* @__PURE__ */ c("div", {
|
|
461
|
+
role: "tabpanel",
|
|
462
|
+
id: `${a}-panel-${e}`,
|
|
463
|
+
"aria-labelledby": `${a}-tab-${e}`,
|
|
464
|
+
hidden: !o,
|
|
465
|
+
tabIndex: 0,
|
|
466
|
+
className: [O.panel, t].filter(Boolean).join(" "),
|
|
467
|
+
...r,
|
|
468
|
+
children: o && n
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
export { b as Badge, C as Banner, d as Button, v as Checkbox, D as Modal, g as Select, T as Spinner, P as Tab, N as TabList, F as TabPanel, M as Tabs, m as TextField, p as getFieldState, k as getNextTabIndex };
|
|
472
|
+
|
|
473
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["styles","_jsxs","_jsx","_jsxs","styles","_jsx","_jsxs","fieldStyles","_jsx","styles","_jsxs","styles","_jsx","styles","_jsx","_jsx","_jsxs","styles","_jsx","styles","_jsx","styles","_jsxs","_jsx","styles","createContext","forwardRef","useContext","useEffect","useId","useImperativeHandle","useRef","useState","jsx","jsxs","Button_module_default","Button","appearance","size","iconBefore","iconAfter","className","children","type","rest","ref","classes","TextField_module_default","getFieldState","error","disabled","readOnly","TextField","label","description","isRequired","id","generatedId","inputId","descriptionId","errorId","describedBy","state","Select_module_default","Select","options","placeholder","value","defaultValue","selectId","valueProps","o","Checkbox_module_default","Checkbox","isIndeterminate","innerRef","Badge_module_default","Badge","isBold","bold","Banner_module_default","icons","Banner","title","actions","onDismiss","dismissLabel","Spinner_module_default","Spinner","Modal_module_default","Modal","isOpen","onClose","footer","closeLabel","titleId","dialog","event","Tabs_module_default","getNextTabIndex","current","count","key","isRtl","TabsContext","useTabs","ctx","Tabs","onValueChange","baseId","inner","setInner","isControlled","next","TabList","onKeyDown","list","tabs","Tab","onClick","selected","select","isSelected","TabPanel"],"sources":["../src/Button/Button.tsx","../src/TextField/TextField.tsx","../src/Select/Select.tsx","../src/Checkbox/Checkbox.tsx","../src/Badge/Badge.tsx","../src/Banner/Banner.tsx","../src/Spinner/Spinner.tsx","../src/Modal/Modal.tsx","../src/Tabs/Tabs.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport styles from './Button.module.css';\n\nexport type ButtonAppearance = 'primary' | 'secondary' | 'subtle' | 'danger';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual emphasis. Use one primary button per view. */\n appearance?: ButtonAppearance;\n size?: ButtonSize;\n /** Icon rendered before the label. Decorative: it is hidden from assistive tech. */\n iconBefore?: ReactNode;\n iconAfter?: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { appearance = 'secondary', size = 'medium', iconBefore, iconAfter, className, children, type = 'button', ...rest },\n ref,\n) {\n const classes = [styles.button, styles[appearance], size !== 'medium' && styles[size], className]\n .filter(Boolean)\n .join(' ');\n return (\n <button ref={ref} type={type} className={classes} {...rest}>\n {iconBefore && <span aria-hidden=\"true\">{iconBefore}</span>}\n {children}\n {iconAfter && <span aria-hidden=\"true\">{iconAfter}</span>}\n </button>\n );\n});\n","import { forwardRef, useId, type InputHTMLAttributes } from 'react';\nimport styles from './TextField.module.css';\n\nexport type FieldState = 'default' | 'invalid' | 'readonly' | 'disabled';\n\n/**\n * Decides which single visual state a field shows when several apply at once.\n * Returns exactly one state, which maps to one class in TextField.module.css.\n */\nexport function getFieldState({\n error,\n disabled,\n readOnly,\n}: {\n error?: string;\n disabled?: boolean;\n readOnly?: boolean;\n}): FieldState {\n switch (true) {\n case Boolean(error):\n return 'invalid';\n case Boolean(disabled):\n return 'disabled';\n case Boolean(readOnly):\n return 'readonly';\n default:\n return 'default';\n }\n}\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Visible label. Required: every field needs an accessible name. */\n label: string;\n /** Helper text shown under the input. */\n description?: string;\n /** Error message. When set, the field is announced as invalid. */\n error?: string;\n /** Marks the field as required and shows an asterisk. */\n isRequired?: boolean;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n { label, description, error, isRequired, id, className, disabled, readOnly, ...rest },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = description ? `${inputId}-description` : undefined;\n const errorId = error ? `${inputId}-error` : undefined;\n const describedBy = [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n const state = getFieldState({ error, disabled, readOnly });\n\n return (\n <div className={styles.field}>\n <label className={styles.label} htmlFor={inputId}>\n {label}\n {isRequired && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n {description && (\n <p id={descriptionId} className={styles.description}>\n {description}\n </p>\n )}\n <input\n ref={ref}\n id={inputId}\n className={[styles.input, state !== 'default' && styles[state], className].filter(Boolean).join(' ')}\n required={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n {...rest}\n />\n {error && (\n <p id={errorId} className={styles.error}>\n {error}\n </p>\n )}\n </div>\n );\n});\n","import { forwardRef, useId, type SelectHTMLAttributes } from 'react';\nimport fieldStyles from '../TextField/TextField.module.css';\nimport { getFieldState } from '../TextField/TextField';\nimport styles from './Select.module.css';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'children'> {\n /** Visible label. Required: every field needs an accessible name. */\n label: string;\n options: SelectOption[];\n /** Shown, and not selectable, until the user chooses. */\n placeholder?: string;\n description?: string;\n /** Error message. When set, the field is announced as invalid. */\n error?: string;\n isRequired?: boolean;\n}\n\n/**\n * A styled native <select>: full keyboard, screen-reader and mobile support\n * with no custom listbox to maintain. Visual states match TextField.\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, options, placeholder, description, error, isRequired, id, className, disabled, value, defaultValue, ...rest },\n ref,\n) {\n const generatedId = useId();\n const selectId = id ?? generatedId;\n const descriptionId = description ? `${selectId}-description` : undefined;\n const errorId = error ? `${selectId}-error` : undefined;\n const describedBy = [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n const state = getFieldState({ error, disabled });\n\n // With a placeholder and no chosen value, start on the empty placeholder option.\n const valueProps =\n value !== undefined ? { value } : { defaultValue: defaultValue ?? (placeholder ? '' : undefined) };\n\n return (\n <div className={fieldStyles.field}>\n <label className={fieldStyles.label} htmlFor={selectId}>\n {label}\n {isRequired && (\n <span className={fieldStyles.required} aria-hidden=\"true\">*</span>\n )}\n </label>\n {description && <p id={descriptionId} className={fieldStyles.description}>{description}</p>}\n <div className={styles.wrapper}>\n <select\n ref={ref}\n id={selectId}\n className={[fieldStyles.input, styles.select, state !== 'default' && fieldStyles[state], className].filter(Boolean).join(' ')}\n required={isRequired}\n disabled={disabled}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n {...valueProps}\n {...rest}\n >\n {placeholder && <option value=\"\" disabled hidden>{placeholder}</option>}\n {options.map((o) => (\n <option key={o.value} value={o.value} disabled={o.disabled}>{o.label}</option>\n ))}\n </select>\n <span className={styles.chevron} aria-hidden=\"true\" />\n </div>\n {error && <p id={errorId} className={fieldStyles.error}>{error}</p>}\n </div>\n );\n});\n","import { forwardRef, useEffect, useId, useImperativeHandle, useRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport styles from './Checkbox.module.css';\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Visible label. */\n label: ReactNode;\n /** Optional helper text under the label. */\n description?: string;\n /** Mixed state for a parent checkbox. Cleared by the browser when the user toggles it. */\n isIndeterminate?: boolean;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, isIndeterminate = false, id, className, disabled, ...rest },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = description ? `${inputId}-description` : undefined;\n const innerRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLInputElement);\n\n // `indeterminate` is a DOM property with no HTML attribute, so it is set imperatively.\n useEffect(() => {\n if (innerRef.current) innerRef.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n return (\n <label\n htmlFor={inputId}\n className={[styles.root, disabled && styles.disabled, className].filter(Boolean).join(' ')}\n >\n <input\n ref={innerRef}\n id={inputId}\n type=\"checkbox\"\n className={styles.box}\n disabled={disabled}\n aria-describedby={descriptionId}\n {...rest}\n />\n <span className={styles.text}>\n {label}\n {description && (\n <span id={descriptionId} className={styles.description}>\n {description}\n </span>\n )}\n </span>\n </label>\n );\n});\n","import type { HTMLAttributes } from 'react';\nimport styles from './Badge.module.css';\n\nexport type BadgeAppearance = 'neutral' | 'brand' | 'danger' | 'success' | 'warning' | 'information';\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Meaning of the badge. Color alone is never the only signal: always include text. */\n appearance?: BadgeAppearance;\n /** Solid fill for higher emphasis. Neutral has no bold variant. */\n isBold?: boolean;\n}\n\nexport function Badge({ appearance = 'neutral', isBold = false, className, ...rest }: BadgeProps) {\n const bold = isBold && appearance !== 'neutral';\n const classes = [styles.badge, styles[appearance], bold && styles.bold, className].filter(Boolean).join(' ');\n return <span className={classes} {...rest} />;\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport styles from './Banner.module.css';\n\nexport type BannerAppearance = 'information' | 'success' | 'warning' | 'danger';\n\nexport interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n appearance?: BannerAppearance;\n /** Short heading. */\n title?: ReactNode;\n /** Optional actions, such as a Button, shown under the message. */\n actions?: ReactNode;\n /** When provided, a dismiss button is shown and calls this handler. */\n onDismiss?: () => void;\n /** Accessible name for the dismiss button. Translate it for non-English UIs. */\n dismissLabel?: string;\n}\n\nconst icons: Record<BannerAppearance, ReactNode> = {\n information: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\" />,\n success: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm-2 15l-5-5 1.4-1.4L10 14.2l7.6-7.6L19 8l-9 9z\" />,\n warning: <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" />,\n danger: <path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" />,\n};\n\nexport function Banner({\n appearance = 'information',\n title,\n actions,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n children,\n ...rest\n}: BannerProps) {\n // Urgent messages interrupt assistive tech; the rest are announced politely.\n const role = appearance === 'danger' || appearance === 'warning' ? 'alert' : 'status';\n return (\n <div role={role} className={[styles.banner, styles[appearance], className].filter(Boolean).join(' ')} {...rest}>\n <svg className={styles.icon} viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n {icons[appearance]}\n </svg>\n <div className={styles.content}>\n {title && <p className={styles.title}>{title}</p>}\n {children && <p className={styles.body}>{children}</p>}\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {onDismiss && (\n <button type=\"button\" className={styles.dismiss} aria-label={dismissLabel} onClick={onDismiss}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M18.3 5.7L12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7 2.9 18.3 9.2 12 2.9 5.7 4.3 4.3l6.3 6.3 6.3-6.3 1.4 1.4z\" transform=\"translate(1 0)\" />\n </svg>\n </button>\n )}\n </div>\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport styles from './Spinner.module.css';\n\nexport type SpinnerSize = 'small' | 'medium' | 'large';\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n size?: SpinnerSize;\n label?: string;\n}\n\nexport function Spinner({ size = 'medium', label = 'Loading', className, ...rest }: Readonly<SpinnerProps>) {\n return (\n <span role=\"status\" className={[styles.spinner, size !== 'medium' && styles[size], className].filter(Boolean).join(' ')} {...rest}>\n <span className={styles.label}>{label}</span>\n </span>\n );\n}\n","import { useEffect, useId, useRef, type ReactNode } from 'react';\nimport styles from './Modal.module.css';\n\nexport type ModalSize = 'small' | 'medium' | 'large';\n\nexport interface ModalProps {\n isOpen: boolean;\n /** Called on Esc, backdrop click and the close button. You own the open state. */\n onClose: () => void;\n /** Required: it names the dialog for assistive technology. */\n title: string;\n children?: ReactNode;\n /** Action area, usually a primary and a secondary Button. */\n footer?: ReactNode;\n size?: ModalSize;\n /** Accessible name for the close button. Translate it for non-English UIs. */\n closeLabel?: string;\n}\n\n/**\n * Built on the native <dialog> element, so the browser provides the focus trap,\n * Esc handling, inert background and focus restoration. It stays inside the\n * ThemeProvider's DOM subtree, so theme tokens apply without a portal.\n */\nexport function Modal({ isOpen, onClose, title, children, footer, size = 'medium', closeLabel = 'Close' }: ModalProps) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId();\n\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog) return;\n if (isOpen && !dialog.open) dialog.showModal();\n if (!isOpen && dialog.open) dialog.close();\n }, [isOpen]);\n\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n className={[styles.dialog, size !== 'medium' && styles[size]].filter(Boolean).join(' ')}\n onCancel={(event) => {\n // Keep the open state in the parent's hands instead of letting the browser close it.\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n // Clicks on the backdrop are dispatched to the <dialog> itself; the surface fills the rest.\n if (event.target === event.currentTarget) onClose();\n }}\n >\n {isOpen && (\n <div className={styles.surface}>\n <div className={styles.header}>\n <h2 id={titleId} className={styles.title}>{title}</h2>\n <button type=\"button\" className={styles.close} aria-label={closeLabel} onClick={onClose}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z\" />\n </svg>\n </button>\n </div>\n <div className={styles.body}>{children}</div>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n )}\n </dialog>\n );\n}\n","import {\n createContext,\n useContext,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport styles from './Tabs.module.css';\n\n/**\n * Decides which tab receives focus for a key press inside the tab list.\n * `current` and the result are indexes among the ENABLED tabs, in DOM order.\n * Arrows wrap around the ends, flip in right-to-left layouts, and Home/End jump to the first/last tab.\n * Returns `current` for keys that should not move focus.\n */\nexport function getNextTabIndex({\n current,\n count,\n key,\n isRtl,\n}: {\n current: number;\n count: number;\n key: string;\n isRtl: boolean;\n}): number {\n if (count <= 0) return current;\n\n switch (key) {\n case 'Home':\n return 0;\n case 'End':\n return count - 1;\n case 'ArrowRight':\n return (current + (isRtl ? -1 : 1) + count) % count;\n case 'ArrowLeft':\n return (current + (isRtl ? 1 : -1) + count) % count;\n default:\n return current;\n }\n}\n\ninterface TabsContextValue {\n value: string;\n select: (value: string) => void;\n baseId: string;\n}\nconst TabsContext = createContext<TabsContextValue | null>(null);\nconst useTabs = () => {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('Tab components must be used inside <Tabs>');\n return ctx;\n};\n\nexport type TabsProps = { children: ReactNode } & (\n | { value: string; onValueChange: (value: string) => void; defaultValue?: never }\n | { defaultValue: string; onValueChange?: (value: string) => void; value?: never }\n);\n\n\nexport function Tabs({ value, defaultValue, onValueChange, children }: TabsProps) {\n const baseId = useId();\n const [inner, setInner] = useState(defaultValue ?? '');\n const isControlled = value !== undefined;\n const current = isControlled ? value : inner;\n const select = (next: string) => {\n if (!isControlled) setInner(next);\n onValueChange?.(next);\n };\n return <TabsContext.Provider value={{ value: current, select, baseId }}>{children}</TabsContext.Provider>;\n}\n\nexport interface TabListProps extends HTMLAttributes<HTMLDivElement> {\n /** Required: names the group of tabs, e.g. \"Order sections\". */\n label: string;\n}\n\nexport function TabList({ label, className, onKeyDown, ...rest }: TabListProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n const list = ref.current;\n if (!list || event.defaultPrevented) return;\n const tabs = Array.from(list.querySelectorAll<HTMLElement>('[role=\"tab\"]:not(:disabled)'));\n const current = tabs.indexOf(document.activeElement as HTMLElement);\n if (current < 0) return;\n const next = getNextTabIndex({\n current,\n count: tabs.length,\n key: event.key,\n isRtl: getComputedStyle(list).direction === 'rtl',\n });\n if (next !== current && tabs[next]) {\n event.preventDefault();\n tabs[next].focus();\n tabs[next].click(); // automatic activation: focus moves the selection\n }\n };\n\n return (\n <div\n ref={ref}\n role=\"tablist\"\n aria-label={label}\n className={[styles.list, className].filter(Boolean).join(' ')}\n onKeyDown={handleKeyDown}\n {...rest}\n />\n );\n}\n\nexport interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n /** Identifies the tab and the TabPanel it controls. Use an id-safe string. */\n value: string;\n}\n\nexport function Tab({ value, className, onClick, ...rest }: TabProps) {\n const { value: selected, select, baseId } = useTabs();\n const isSelected = selected === value;\n return (\n <button\n type=\"button\"\n role=\"tab\"\n id={`${baseId}-tab-${value}`}\n aria-selected={isSelected}\n aria-controls={`${baseId}-panel-${value}`}\n // Roving tabindex: only the selected tab is in the page's tab order.\n tabIndex={isSelected ? 0 : -1}\n className={[styles.tab, className].filter(Boolean).join(' ')}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) select(value);\n }}\n {...rest}\n />\n );\n}\n\nexport interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {\n value: string;\n}\n\nexport function TabPanel({ value, className, children, ...rest }: TabPanelProps) {\n const { value: selected, baseId } = useTabs();\n const isSelected = selected === value;\n return (\n <div\n role=\"tabpanel\"\n id={`${baseId}-panel-${value}`}\n aria-labelledby={`${baseId}-tab-${value}`}\n hidden={!isSelected}\n tabIndex={0}\n className={[styles.panel, className].filter(Boolean).join(' ')}\n {...rest}\n >\n {isSelected && children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;A,GAeaoC,IAASV,EAA2C,SAC/D,EAAEW,gBAAa,aAAaC,UAAO,UAAUC,eAAYC,cAAWC,cAAWC,aAAUC,UAAO,UAAU,GAAGC,KAC7GC,GACA;CACA,IAAMC,IAAU;EAAC9C,EAAO;EAAQA,EAAOqC;EAAaC,MAAS,YAAYtC,EAAOsC;EAAOG;CAAS,CAAC,CAC9F,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CACX,OACExC,kBAAC,UAAD;EAAa4C;EAAWF;EAAM,WAAWG;EAAS,GAAIF;EAAtD,UAAA;GACGL,KAAcrC,kBAAC,QAAD;IAAM,eAAY;IAAQ,UAAAqC;GAAiB,CAAA;GACzDG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MAAM;EAErB;EASI,GAAIrE;CACL,CAAA;AAEL;AAOA,SAAgB0E,EAAI,EAAEnD,UAAO1B,cAAW8E,YAAS,GAAG3E,KAAkB;CACpE,IAAM,EAAE,OAAO4E,GAAUC,WAAQZ,cAAWJ,EAAQ,GAC9CiB,IAAaF,MAAarD;CAChC,OACE5C,kBAAC,UAAD;EACE,MAAK;EACL,MAAK;EACL,IAAI,GAAGsF,EAAO,OAAO1C;EACrB,iBAAeuD;EACf,iBAAe,GAAGb,EAAO,SAAS1C;EAElC,UAAUuD,IAAa,IAAI;EAC3B,WAAW,CAAClG,EAAO,KAAKiB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3D,UAAUwD,MAAU;GAClBsB,IAAUtB,CAAK,GACVA,EAAM,oBAAkBwB,EAAOtD,CAAK;EAC3C;EACA,GAAIvB;CACL,CAAA;AAEL;AAMA,SAAgB+E,EAAS,EAAExD,UAAO1B,cAAWC,aAAU,GAAGE,KAAuB;CAC/E,IAAM,EAAE,OAAO4E,GAAUX,cAAWJ,EAAQ,GACtCiB,IAAaF,MAAarD;CAChC,OACE5C,kBAAC,OAAD;EACE,MAAK;EACL,IAAI,GAAGsF,EAAO,SAAS1C;EACvB,mBAAiB,GAAG0C,EAAO,OAAO1C;EAClC,QAAQ,CAACuD;EACT,UAAU;EACV,WAAW,CAAClG,EAAO,OAAOiB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC7D,GAAIG;EAEH,UAAA8E,KAAchF;CACZ,CAAA;AAET"}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.vk_Button-module_button{justify-content:center;align-items:center;gap:var(--vk-space-100);box-sizing:border-box;height:var(--vk-size-control-medium);padding-inline:var(--vk-space-150);border:var(--vk-border-width-default) solid transparent;border-radius:var(--vk-radius-medium);font-family:var(--vk-font-family-body);font-size:var(--vk-font-size-200);font-weight:var(--vk-font-weight-medium);white-space:nowrap;cursor:pointer;transition:background-color var(--vk-motion-duration-fast) var(--vk-motion-easing-standard);line-height:1;display:inline-flex}.vk_Button-module_button:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}.vk_Button-module_small{height:var(--vk-size-control-small);padding-inline:var(--vk-space-100)}.vk_Button-module_large{height:var(--vk-size-control-large);padding-inline:var(--vk-space-200);font-size:var(--vk-font-size-300)}.vk_Button-module_primary{background:var(--vk-color-background-brand-bold);color:var(--vk-color-text-on-brand)}.vk_Button-module_primary:hover{background:var(--vk-color-background-brand-bold-hovered)}.vk_Button-module_primary:active{background:var(--vk-color-background-brand-bold-pressed)}.vk_Button-module_secondary{background:var(--vk-color-background-neutral);color:var(--vk-color-text-default)}.vk_Button-module_secondary:hover{background:var(--vk-color-background-neutral-hovered)}.vk_Button-module_secondary:active{background:var(--vk-color-background-neutral-pressed)}.vk_Button-module_subtle{background:var(--vk-color-background-neutral-subtle);color:var(--vk-color-text-default)}.vk_Button-module_subtle:hover{background:var(--vk-color-background-neutral-subtle-hovered)}.vk_Button-module_subtle:active{background:var(--vk-color-background-neutral-subtle-pressed)}.vk_Button-module_danger{background:var(--vk-color-background-danger-bold);color:var(--vk-color-text-on-bold)}.vk_Button-module_danger:hover{background:var(--vk-color-background-danger-bold-hovered)}.vk_Button-module_danger:active{background:var(--vk-color-background-danger-bold-pressed)}.vk_Button-module_button:disabled,.vk_Button-module_button:disabled:hover,.vk_Button-module_button:disabled:active{background:var(--vk-color-background-disabled);color:var(--vk-color-text-disabled);border-color:var(--vk-color-border-disabled);cursor:not-allowed}.vk_TextField-module_field{gap:var(--vk-space-050);font-family:var(--vk-font-family-body);flex-direction:column;display:flex}.vk_TextField-module_label{font-size:var(--vk-font-size-200);font-weight:var(--vk-font-weight-semibold);line-height:var(--vk-font-lineheight-normal);color:var(--vk-color-text-default)}.vk_TextField-module_required{color:var(--vk-color-text-danger);margin-inline-start:var(--vk-space-025)}.vk_TextField-module_description{font-size:var(--vk-font-size-100);line-height:var(--vk-font-lineheight-normal);color:var(--vk-color-text-subtle);margin:0}.vk_TextField-module_input{box-sizing:border-box;width:100%;height:var(--vk-size-control-medium);padding-inline:var(--vk-space-150);border:var(--vk-border-width-default) solid var(--vk-color-border-input);border-radius:var(--vk-radius-small);background:var(--vk-color-background-input);color:var(--vk-color-text-default);font-family:inherit;font-size:var(--vk-font-size-200);transition:background-color var(--vk-motion-duration-fast) var(--vk-motion-easing-standard)}.vk_TextField-module_input::placeholder{color:var(--vk-color-text-subtlest)}.vk_TextField-module_input:hover{background:var(--vk-color-background-input-hovered)}.vk_TextField-module_input:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}.vk_TextField-module_invalid{border-color:var(--vk-color-border-danger)}.vk_TextField-module_readonly{background:var(--vk-elevation-surface-sunken)}.vk_TextField-module_disabled,.vk_TextField-module_disabled:hover{background:var(--vk-color-background-disabled);border-color:var(--vk-color-border-disabled);color:var(--vk-color-text-disabled);cursor:not-allowed}.vk_TextField-module_error{font-size:var(--vk-font-size-100);line-height:var(--vk-font-lineheight-normal);color:var(--vk-color-text-danger);margin:0}.vk_Select-module_wrapper{display:flex;position:relative}.vk_Select-module_select{appearance:none;cursor:pointer;padding-inline-end:var(--vk-space-500)}.vk_Select-module_chevron{top:50%;width:var(--vk-space-150);height:var(--vk-space-100);background:var(--vk-color-text-subtle);clip-path:polygon(0 0,100% 0,50% 100%);pointer-events:none;position:absolute;inset-inline-end:var(--vk-space-150);transform:translateY(-50%)}.vk_Select-module_select:disabled+.vk_Select-module_chevron{background:var(--vk-color-text-disabled)}.vk_Checkbox-module_root{align-items:flex-start;gap:var(--vk-space-100);font-family:var(--vk-font-family-body);font-size:var(--vk-font-size-200);line-height:var(--vk-font-lineheight-normal);color:var(--vk-color-text-default);cursor:pointer;display:inline-flex}.vk_Checkbox-module_box{box-sizing:border-box;width:var(--vk-space-200);height:var(--vk-space-200);margin:var(--vk-space-025) 0 0;appearance:none;border:var(--vk-border-width-default) solid var(--vk-color-border-input);border-radius:var(--vk-radius-small);background:var(--vk-color-background-input);cursor:inherit;transition:background-color var(--vk-motion-duration-fast) var(--vk-motion-easing-standard);flex:none;position:relative}.vk_Checkbox-module_box:hover{background:var(--vk-color-background-input-hovered)}.vk_Checkbox-module_box:checked,.vk_Checkbox-module_box:indeterminate{background:var(--vk-color-background-brand-bold)}.vk_Checkbox-module_box:checked:hover,.vk_Checkbox-module_box:indeterminate:hover{background:var(--vk-color-background-brand-bold-hovered)}.vk_Checkbox-module_box:after{content:"";background:var(--vk-color-text-on-brand);opacity:0;clip-path:polygon(20% 52%,30% 42%,43% 55%,72% 24%,82% 34%,43% 75%);position:absolute;inset:0}.vk_Checkbox-module_box:checked:after{opacity:1}.vk_Checkbox-module_box:indeterminate:after{opacity:1;clip-path:polygon(22% 44%,78% 44%,78% 56%,22% 56%)}.vk_Checkbox-module_box:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}.vk_Checkbox-module_text{flex-direction:column;display:flex}.vk_Checkbox-module_description{font-size:var(--vk-font-size-100);color:var(--vk-color-text-subtle)}.vk_Checkbox-module_disabled{color:var(--vk-color-text-disabled);cursor:not-allowed}.vk_Checkbox-module_disabled .vk_Checkbox-module_box,.vk_Checkbox-module_disabled .vk_Checkbox-module_box:hover{background:var(--vk-color-background-disabled);border-color:var(--vk-color-border-disabled)}.vk_Checkbox-module_disabled .vk_Checkbox-module_box:after{background:var(--vk-color-text-disabled)}.vk_Checkbox-module_disabled .vk_Checkbox-module_description{color:var(--vk-color-text-disabled)}.vk_Badge-module_badge{box-sizing:border-box;padding-inline:var(--vk-space-100);padding-block:var(--vk-space-025);border-radius:var(--vk-radius-small);font-family:var(--vk-font-family-body);font-size:var(--vk-font-size-100);font-weight:var(--vk-font-weight-bold);line-height:var(--vk-font-lineheight-normal);text-transform:uppercase;white-space:nowrap;align-items:center;display:inline-flex}.vk_Badge-module_neutral{background:var(--vk-color-background-neutral);color:var(--vk-color-text-default)}.vk_Badge-module_brand{background:var(--vk-color-background-brand-subtle);color:var(--vk-color-text-default)}.vk_Badge-module_danger{background:var(--vk-color-background-danger-subtle);color:var(--vk-color-text-danger)}.vk_Badge-module_success{background:var(--vk-color-background-success-subtle);color:var(--vk-color-text-success)}.vk_Badge-module_warning{background:var(--vk-color-background-warning-subtle);color:var(--vk-color-text-warning)}.vk_Badge-module_information{background:var(--vk-color-background-information-subtle);color:var(--vk-color-text-information)}.vk_Badge-module_bold.vk_Badge-module_brand{background:var(--vk-color-background-brand-bold);color:var(--vk-color-text-on-brand)}.vk_Badge-module_bold.vk_Badge-module_danger{background:var(--vk-color-background-danger-bold);color:var(--vk-color-text-on-bold)}.vk_Badge-module_bold.vk_Badge-module_success{background:var(--vk-color-background-success-bold);color:var(--vk-color-text-on-bold)}.vk_Badge-module_bold.vk_Badge-module_warning{background:var(--vk-color-background-warning-bold);color:var(--vk-color-text-on-warning)}.vk_Badge-module_bold.vk_Badge-module_information{background:var(--vk-color-background-information-bold);color:var(--vk-color-text-on-bold)}.vk_Banner-module_banner{align-items:flex-start;gap:var(--vk-space-150);box-sizing:border-box;padding:var(--vk-space-150) var(--vk-space-200);border:var(--vk-border-width-default) solid transparent;border-inline-start-width:var(--vk-space-050);border-radius:var(--vk-radius-medium);color:var(--vk-color-text-default);font-family:var(--vk-font-family-body);font-size:var(--vk-font-size-200);line-height:var(--vk-font-lineheight-normal);display:flex}.vk_Banner-module_information{background:var(--vk-color-background-information-subtle);border-color:var(--vk-color-border-information)}.vk_Banner-module_success{background:var(--vk-color-background-success-subtle);border-color:var(--vk-color-border-success)}.vk_Banner-module_warning{background:var(--vk-color-background-warning-subtle);border-color:var(--vk-color-border-warning)}.vk_Banner-module_danger{background:var(--vk-color-background-danger-subtle);border-color:var(--vk-color-border-danger)}.vk_Banner-module_icon{width:var(--vk-space-250);height:var(--vk-space-250);flex:none}.vk_Banner-module_information .vk_Banner-module_icon{color:var(--vk-color-text-information)}.vk_Banner-module_success .vk_Banner-module_icon{color:var(--vk-color-text-success)}.vk_Banner-module_warning .vk_Banner-module_icon{color:var(--vk-color-text-warning)}.vk_Banner-module_danger .vk_Banner-module_icon{color:var(--vk-color-text-danger)}.vk_Banner-module_content{gap:var(--vk-space-050);flex-direction:column;flex:1;min-width:0;display:flex}.vk_Banner-module_title{font-weight:var(--vk-font-weight-semibold);margin:0}.vk_Banner-module_body{margin:0}.vk_Banner-module_actions{margin-block-start:var(--vk-space-050)}.vk_Banner-module_dismiss{width:var(--vk-size-control-small);height:var(--vk-size-control-small);margin:calc(var(--vk-space-050) * -1);border-radius:var(--vk-radius-small);background:var(--vk-color-background-neutral-subtle);color:var(--vk-color-text-default);cursor:pointer;border:0;flex:none;place-items:center;padding:0;display:grid}.vk_Banner-module_dismiss:hover{background:var(--vk-color-background-neutral-subtle-hovered)}.vk_Banner-module_dismiss:active{background:var(--vk-color-background-neutral-subtle-pressed)}.vk_Banner-module_dismiss:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}.vk_Spinner-module_spinner{box-sizing:border-box;width:var(--vk-space-300);height:var(--vk-space-300);border:var(--vk-border-width-focus) solid var(--vk-color-border-default);border-top-color:var(--vk-color-text-brand);border-radius:var(--vk-radius-full);animation:.8s linear infinite vk_Spinner-module_spin;display:inline-block}.vk_Spinner-module_small{width:var(--vk-space-200);height:var(--vk-space-200)}.vk_Spinner-module_large{width:var(--vk-space-500);height:var(--vk-space-500)}@keyframes vk_Spinner-module_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.vk_Spinner-module_spinner{animation-duration:3s}}.vk_Spinner-module_label{clip-path:inset(50%);white-space:nowrap;width:0;height:0;position:absolute;overflow:hidden}.vk_Modal-module_dialog{box-sizing:border-box;width:100%;max-width:calc(var(--vk-space-800) * 8);max-height:none;color:var(--vk-color-text-default);font-family:var(--vk-font-family-body);background:0 0;border:0;margin:auto;padding:0;overflow:visible}.vk_Modal-module_dialog::backdrop{background:var(--vk-color-blanket)}.vk_Modal-module_small{max-width:calc(var(--vk-space-800) * 6)}.vk_Modal-module_large{max-width:calc(var(--vk-space-800) * 10)}.vk_Modal-module_surface{max-height:calc(100vh - var(--vk-space-600));background:var(--vk-elevation-surface-overlay);box-shadow:var(--vk-elevation-shadow-overlay);border-radius:var(--vk-radius-large);flex-direction:column;display:flex}.vk_Modal-module_header{justify-content:space-between;align-items:flex-start;gap:var(--vk-space-200);padding:var(--vk-space-300) var(--vk-space-300) var(--vk-space-150);display:flex}.vk_Modal-module_title{font-family:var(--vk-font-family-heading);font-size:var(--vk-font-size-500);font-weight:var(--vk-font-weight-semibold);line-height:var(--vk-font-lineheight-tight);margin:0}.vk_Modal-module_close{width:var(--vk-size-control-medium);height:var(--vk-size-control-medium);margin:calc(var(--vk-space-075) * -1);border-radius:var(--vk-radius-medium);background:var(--vk-color-background-neutral-subtle);color:var(--vk-color-text-default);cursor:pointer;border:0;flex:none;place-items:center;padding:0;display:grid}.vk_Modal-module_close:hover{background:var(--vk-color-background-neutral-subtle-hovered)}.vk_Modal-module_close:active{background:var(--vk-color-background-neutral-subtle-pressed)}.vk_Modal-module_close:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}.vk_Modal-module_body{min-height:0;padding:var(--vk-space-050) var(--vk-space-300);font-size:var(--vk-font-size-200);line-height:var(--vk-font-lineheight-normal);flex:1;overflow-y:auto}.vk_Modal-module_footer{justify-content:flex-end;gap:var(--vk-space-100);padding:var(--vk-space-200) var(--vk-space-300) var(--vk-space-300);flex-wrap:wrap;display:flex}.vk_Tabs-module_list{gap:var(--vk-space-050);border-bottom:var(--vk-border-width-default) solid var(--vk-color-border-default);font-family:var(--vk-font-family-body);display:flex}.vk_Tabs-module_tab{padding:var(--vk-space-100) var(--vk-space-200);border-radius:var(--vk-radius-small) var(--vk-radius-small) 0 0;background:var(--vk-color-background-neutral-subtle);color:var(--vk-color-text-subtle);font-family:inherit;font-size:var(--vk-font-size-200);font-weight:var(--vk-font-weight-medium);line-height:var(--vk-font-lineheight-normal);cursor:pointer;transition:background-color var(--vk-motion-duration-fast) var(--vk-motion-easing-standard);border:0;margin:0;position:relative}.vk_Tabs-module_tab:hover{background:var(--vk-color-background-neutral-subtle-hovered);color:var(--vk-color-text-default)}.vk_Tabs-module_tab:active{background:var(--vk-color-background-neutral-subtle-pressed)}.vk_Tabs-module_tab[aria-selected=true]{color:var(--vk-color-text-default);font-weight:var(--vk-font-weight-semibold)}.vk_Tabs-module_tab[aria-selected=true]:after{content:"";inset-inline:var(--vk-space-100);bottom:calc(var(--vk-border-width-default) * -1);height:var(--vk-space-050);border-radius:var(--vk-radius-small) var(--vk-radius-small) 0 0;background:var(--vk-color-background-brand-bold);position:absolute}.vk_Tabs-module_tab:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:calc(var(--vk-space-025) * -1)}.vk_Tabs-module_tab:disabled{background:var(--vk-color-background-neutral-subtle);color:var(--vk-color-text-disabled);cursor:not-allowed}.vk_Tabs-module_panel{padding-block:var(--vk-space-200);color:var(--vk-color-text-default);font-family:var(--vk-font-family-body);font-size:var(--vk-font-size-200);line-height:var(--vk-font-lineheight-normal)}.vk_Tabs-module_panel:focus-visible{outline:var(--vk-border-width-focus) solid var(--vk-color-border-focused);outline-offset:var(--vk-space-025)}
|
|
2
|
+
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volkanic/components",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Volkanic React components. Styled only through --vk-* tokens; supply a theme from @volkanic/themes or your own.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"volkanic",
|
|
8
|
+
"design-system",
|
|
9
|
+
"react",
|
|
10
|
+
"components",
|
|
11
|
+
"ui",
|
|
12
|
+
"accessibility"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/volkanic-tech/volkanic-design-system#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/volkanic-tech/volkanic-design-system/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/volkanic-tech/volkanic-design-system.git",
|
|
21
|
+
"directory": "packages/components"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./dist/index.cjs",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"require": "./dist/index.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./styles.css": "./dist/styles.css"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"NOTICE"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": [
|
|
40
|
+
"*.css"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@volkanic/primitives": "^0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": ">=18",
|
|
50
|
+
"react-dom": ">=18"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@storybook/react-vite": "^11.0.2"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
57
|
+
"lint": "echo no lint"
|
|
58
|
+
}
|
|
6
59
|
}
|