@obosbbl/grunnmuren-react 3.4.4 → 3.4.6
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/dist/__stories__/form-validation.stories.cjs +28 -16
- package/dist/__stories__/form-validation.stories.js +14 -2
- package/dist/__stories__/layout.stories.cjs +14 -22
- package/dist/__stories__/layout.stories.js +7 -15
- package/dist/index.d.mts +52 -13
- package/dist/index.mjs +253 -156
- package/package.json +7 -12
|
@@ -2,10 +2,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
|
-
var
|
|
5
|
+
var Form$1 = require('react-aria-components/Form');
|
|
6
6
|
var grunnmurenIconsReact = require('@obosbbl/grunnmuren-icons-react');
|
|
7
7
|
var cva = require('cva');
|
|
8
|
-
var
|
|
8
|
+
var Button$1 = require('react-aria-components/Button');
|
|
9
|
+
var Link = require('react-aria-components/Link');
|
|
10
|
+
var slots = require('react-aria-components/slots');
|
|
11
|
+
var useProgressBar = require('react-aria/useProgressBar');
|
|
12
|
+
var I18nProvider = require('react-aria-components/I18nProvider');
|
|
13
|
+
var Group = require('react-aria-components/Group');
|
|
14
|
+
var Input = require('react-aria-components/Input');
|
|
15
|
+
var TextField$1 = require('react-aria-components/TextField');
|
|
16
|
+
require('react-aria-components/Header');
|
|
17
|
+
require('react-aria-components/ListBox');
|
|
18
|
+
var Text = require('react-aria-components/Text');
|
|
19
|
+
var FieldError = require('react-aria-components/FieldError');
|
|
20
|
+
var Label$1 = require('react-aria-components/Label');
|
|
9
21
|
|
|
10
22
|
const formField = cva.cx('group flex flex-col gap-2');
|
|
11
23
|
const formFieldError = cva.cx('bg-red-light text-red w-fit px-2 py-1 text-sm/6', 'group-data-[slot=file-upload]:rounded-lg');
|
|
@@ -73,7 +85,7 @@ const translations = {
|
|
|
73
85
|
* Returns the locale set in `<GrunnmurenProvider />`
|
|
74
86
|
*/ function _useLocale() {
|
|
75
87
|
// a small wrapper around react-arias useLocale with a simpler return type with only the locales that we actually support
|
|
76
|
-
const locale =
|
|
88
|
+
const locale = I18nProvider.useLocale();
|
|
77
89
|
return locale.locale;
|
|
78
90
|
}
|
|
79
91
|
|
|
@@ -175,7 +187,7 @@ function isLinkProps(props) {
|
|
|
175
187
|
return !!props.href;
|
|
176
188
|
}
|
|
177
189
|
function Button({ ref = null, ...props }) {
|
|
178
|
-
[props, ref] =
|
|
190
|
+
[props, ref] = slots.useContextProps(props, ref, ButtonContext);
|
|
179
191
|
const { animateIcon, children: _children, color, isIconOnly, variant, isPending, ...restProps } = props;
|
|
180
192
|
const className = buttonVariants({
|
|
181
193
|
// Don't animate the icon when we're pending, as it affects the loading spinner
|
|
@@ -187,7 +199,7 @@ function Button({ ref = null, ...props }) {
|
|
|
187
199
|
isPending
|
|
188
200
|
});
|
|
189
201
|
const locale = _useLocale();
|
|
190
|
-
const { progressBarProps } =
|
|
202
|
+
const { progressBarProps } = useProgressBar.useProgressBar({
|
|
191
203
|
isIndeterminate: true,
|
|
192
204
|
'aria-label': translations.pending[locale]
|
|
193
205
|
});
|
|
@@ -200,12 +212,12 @@ function Button({ ref = null, ...props }) {
|
|
|
200
212
|
})
|
|
201
213
|
]
|
|
202
214
|
}) : _children;
|
|
203
|
-
return isLinkProps(restProps) ? /*#__PURE__*/ jsxRuntime.jsx(
|
|
215
|
+
return isLinkProps(restProps) ? /*#__PURE__*/ jsxRuntime.jsx(Link.Link, {
|
|
204
216
|
...restProps,
|
|
205
217
|
className: className,
|
|
206
218
|
ref: ref,
|
|
207
219
|
children: children
|
|
208
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(
|
|
220
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(Button$1.Button, {
|
|
209
221
|
...restProps,
|
|
210
222
|
className: className,
|
|
211
223
|
isPending: isPending,
|
|
@@ -222,7 +234,7 @@ function InputAddonDivider() {
|
|
|
222
234
|
|
|
223
235
|
function Description(props) {
|
|
224
236
|
const { className, ...restProps } = props;
|
|
225
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
237
|
+
return /*#__PURE__*/ jsxRuntime.jsx(Text.Text, {
|
|
226
238
|
...restProps,
|
|
227
239
|
className: cva.cx(className, 'description'),
|
|
228
240
|
slot: "description"
|
|
@@ -231,7 +243,7 @@ function Description(props) {
|
|
|
231
243
|
|
|
232
244
|
function ErrorMessage(props) {
|
|
233
245
|
const { children, className, ...restProps } = props;
|
|
234
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
246
|
+
return /*#__PURE__*/ jsxRuntime.jsx(Text.Text, {
|
|
235
247
|
...restProps,
|
|
236
248
|
className: cva.cx(className, formFieldError),
|
|
237
249
|
slot: "errorMessage",
|
|
@@ -245,14 +257,14 @@ function ErrorMessage(props) {
|
|
|
245
257
|
*/ function ErrorMessageOrFieldError({ errorMessage }) {
|
|
246
258
|
return errorMessage ? /*#__PURE__*/ jsxRuntime.jsx(ErrorMessage, {
|
|
247
259
|
children: errorMessage
|
|
248
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(
|
|
260
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(FieldError.FieldError, {
|
|
249
261
|
className: formFieldError
|
|
250
262
|
});
|
|
251
263
|
}
|
|
252
264
|
|
|
253
265
|
function Label(props) {
|
|
254
266
|
const { children, className, ...restProps } = props;
|
|
255
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
267
|
+
return /*#__PURE__*/ jsxRuntime.jsx(Label$1.Label, {
|
|
256
268
|
className: cva.cx(className, 'leading-7 font-medium'),
|
|
257
269
|
...restProps,
|
|
258
270
|
children: children
|
|
@@ -277,7 +289,7 @@ function TextField(props) {
|
|
|
277
289
|
// the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
|
|
278
290
|
// which will override any built in validation
|
|
279
291
|
const isInvalid = !!errorMessage || _isInvalid;
|
|
280
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(
|
|
292
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(TextField$1.TextField, {
|
|
281
293
|
...restProps,
|
|
282
294
|
className: cva.cx(className, formField),
|
|
283
295
|
isInvalid: isInvalid,
|
|
@@ -288,14 +300,14 @@ function TextField(props) {
|
|
|
288
300
|
description && /*#__PURE__*/ jsxRuntime.jsx(Description, {
|
|
289
301
|
children: description
|
|
290
302
|
}),
|
|
291
|
-
leftAddon || rightAddon ? /*#__PURE__*/ jsxRuntime.jsxs(
|
|
303
|
+
leftAddon || rightAddon ? /*#__PURE__*/ jsxRuntime.jsxs(Group.Group, {
|
|
292
304
|
className: cva.cx(inputGroup, {
|
|
293
305
|
'w-fit': !!size
|
|
294
306
|
}),
|
|
295
307
|
children: [
|
|
296
308
|
leftAddon,
|
|
297
309
|
withAddonDivider && leftAddon && /*#__PURE__*/ jsxRuntime.jsx(InputAddonDivider, {}),
|
|
298
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
310
|
+
/*#__PURE__*/ jsxRuntime.jsx(Input.Input, {
|
|
299
311
|
className: inputVariants({
|
|
300
312
|
textAlign,
|
|
301
313
|
isGrouped: true,
|
|
@@ -307,7 +319,7 @@ function TextField(props) {
|
|
|
307
319
|
withAddonDivider && rightAddon && /*#__PURE__*/ jsxRuntime.jsx(InputAddonDivider, {}),
|
|
308
320
|
rightAddon
|
|
309
321
|
]
|
|
310
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(
|
|
322
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(Input.Input, {
|
|
311
323
|
className: inputVariants({
|
|
312
324
|
textAlign,
|
|
313
325
|
autoWidth: !!size
|
|
@@ -353,7 +365,7 @@ const Form = (props)=>{
|
|
|
353
365
|
}, 0);
|
|
354
366
|
}
|
|
355
367
|
};
|
|
356
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(
|
|
368
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Form$1.Form, {
|
|
357
369
|
onSubmit: handleSubmit,
|
|
358
370
|
className: "container-prose flex flex-col items-start gap-4",
|
|
359
371
|
validationErrors: errors,
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Form as Form$1 } from 'react-aria-components/Form';
|
|
4
4
|
import { LoadingSpinner } from '@obosbbl/grunnmuren-icons-react';
|
|
5
5
|
import { cx, cva, compose } from 'cva';
|
|
6
|
-
import {
|
|
6
|
+
import { Button as Button$1 } from 'react-aria-components/Button';
|
|
7
|
+
import { Link } from 'react-aria-components/Link';
|
|
8
|
+
import { useContextProps } from 'react-aria-components/slots';
|
|
9
|
+
import { useProgressBar } from 'react-aria/useProgressBar';
|
|
10
|
+
import { useLocale } from 'react-aria-components/I18nProvider';
|
|
11
|
+
import { Group } from 'react-aria-components/Group';
|
|
12
|
+
import { Input } from 'react-aria-components/Input';
|
|
13
|
+
import { TextField as TextField$1 } from 'react-aria-components/TextField';
|
|
14
|
+
import 'react-aria-components/Header';
|
|
15
|
+
import 'react-aria-components/ListBox';
|
|
16
|
+
import { Text } from 'react-aria-components/Text';
|
|
17
|
+
import { FieldError } from 'react-aria-components/FieldError';
|
|
18
|
+
import { Label as Label$1 } from 'react-aria-components/Label';
|
|
7
19
|
|
|
8
20
|
const formField = cx('group flex flex-col gap-2');
|
|
9
21
|
const formFieldError = cx('bg-red-light text-red w-fit px-2 py-1 text-sm/6', 'group-data-[slot=file-upload]:rounded-lg');
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var grunnmurenIconsReact = require('@obosbbl/grunnmuren-icons-react');
|
|
5
5
|
var cva = require('cva');
|
|
6
|
-
var
|
|
6
|
+
var Link = require('react-aria-components/Link');
|
|
7
|
+
var slots = require('react-aria-components/slots');
|
|
7
8
|
var react = require('react');
|
|
9
|
+
var Group = require('react-aria-components/Group');
|
|
8
10
|
|
|
9
11
|
const HeadingContext = /*#__PURE__*/ react.createContext({});
|
|
10
12
|
const headingVariants = cva.cva({
|
|
@@ -19,7 +21,7 @@ const headingVariants = cva.cva({
|
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
const Heading = ({ ref = null, ...props })=>{
|
|
22
|
-
[props, ref] =
|
|
24
|
+
[props, ref] = slots.useContextProps(props, ref, HeadingContext);
|
|
23
25
|
const { children, level, size, className, _innerWrapper: innerWrapper, _outerWrapper: outerWrapper, ...restProps } = props;
|
|
24
26
|
const _className = headingVariants({
|
|
25
27
|
size
|
|
@@ -35,7 +37,7 @@ const Heading = ({ ref = null, ...props })=>{
|
|
|
35
37
|
};
|
|
36
38
|
const ContentContext = /*#__PURE__*/ react.createContext({});
|
|
37
39
|
const Content = ({ ref = null, ...props })=>{
|
|
38
|
-
[props, ref] =
|
|
40
|
+
[props, ref] = slots.useContextProps(props, ref, ContentContext);
|
|
39
41
|
const { _outerWrapper: outerWrapper, ...restProps } = props;
|
|
40
42
|
const content = /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
41
43
|
...restProps,
|
|
@@ -57,7 +59,7 @@ const mediaVariant = cva.cva({
|
|
|
57
59
|
});
|
|
58
60
|
const MediaContext = /*#__PURE__*/ react.createContext({});
|
|
59
61
|
const Media = ({ ref = null, ...props })=>{
|
|
60
|
-
[props, ref] =
|
|
62
|
+
[props, ref] = slots.useContextProps(props, ref, MediaContext);
|
|
61
63
|
const { className, fit, ...restProps } = props;
|
|
62
64
|
const _className = mediaVariant({
|
|
63
65
|
fit
|
|
@@ -107,21 +109,11 @@ const cardVariants = cva.cva({
|
|
|
107
109
|
// by setting a higher z-index than the pseudo-element (which implicitly z-index 0)
|
|
108
110
|
'[&_a:not([data-slot="card-link"])]:z-[1] [&_button]:z-[1] [&_input]:z-[1]',
|
|
109
111
|
// **** Badge ****
|
|
110
|
-
'
|
|
112
|
+
'*:data-[slot=media]:*:data-[slot=badge]:absolute',
|
|
113
|
+
'*:data-[slot=media]:*:data-[slot=badge]:first:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:first:left-3.5',
|
|
111
114
|
// Increasing z-index Preserves badge position when media content is hovered (the transform scale effect might otherwise move the badge behind the other media content)
|
|
112
|
-
'
|
|
113
|
-
|
|
114
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tl-2xl',
|
|
115
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-br-2xl',
|
|
116
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tr-none',
|
|
117
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-bl-none',
|
|
118
|
-
// Right aligned - override default corner radius of the badge
|
|
119
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tl-none',
|
|
120
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-br-none',
|
|
121
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tr-2xl',
|
|
122
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-bl-2xl',
|
|
123
|
-
// ... and position the badge at the right edge of the media content
|
|
124
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:right-0'
|
|
115
|
+
'*:data-[slot=media]:*:data-[slot=badge]:z-[1]',
|
|
116
|
+
'*:data-[slot=media]:*:data-[slot=badge]:last:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:last:right-3.5'
|
|
125
117
|
],
|
|
126
118
|
variants: {
|
|
127
119
|
/**
|
|
@@ -203,7 +195,7 @@ const Card = ({ children, className, variant, layout, ...restProps })=>{
|
|
|
203
195
|
className: cva.cx(className, '@container rounded-2xl'),
|
|
204
196
|
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
205
197
|
className: cardClassName,
|
|
206
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
198
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(slots.Provider, {
|
|
207
199
|
values: [
|
|
208
200
|
[
|
|
209
201
|
HeadingContext,
|
|
@@ -283,7 +275,7 @@ const cardLinkVariants = cva.cva({
|
|
|
283
275
|
className: _className,
|
|
284
276
|
withHref: !!href
|
|
285
277
|
});
|
|
286
|
-
return href ? /*#__PURE__*/ jsxRuntime.jsx(
|
|
278
|
+
return href ? /*#__PURE__*/ jsxRuntime.jsx(Link.Link, {
|
|
287
279
|
"data-slot": "card-link",
|
|
288
280
|
...restProps,
|
|
289
281
|
href: href,
|
|
@@ -394,7 +386,7 @@ const Hero = ({ variant, className, children, ...rest })=>{
|
|
|
394
386
|
variant,
|
|
395
387
|
className
|
|
396
388
|
});
|
|
397
|
-
return /*#__PURE__*/ jsxRuntime.jsx(
|
|
389
|
+
return /*#__PURE__*/ jsxRuntime.jsx(slots.Provider, {
|
|
398
390
|
values: [
|
|
399
391
|
[
|
|
400
392
|
HeroContext,
|
|
@@ -412,7 +404,7 @@ const Hero = ({ variant, className, children, ...rest })=>{
|
|
|
412
404
|
}
|
|
413
405
|
],
|
|
414
406
|
[
|
|
415
|
-
|
|
407
|
+
Group.GroupContext,
|
|
416
408
|
{
|
|
417
409
|
// Prevents the group from being announced as a group by screen readers
|
|
418
410
|
// The Group component is used to group the Hero's CTA buttons together visually, and has no semantic meaning
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { ArrowRight } from '@obosbbl/grunnmuren-icons-react';
|
|
3
3
|
import { cva, cx } from 'cva';
|
|
4
|
-
import {
|
|
4
|
+
import { Link } from 'react-aria-components/Link';
|
|
5
|
+
import { useContextProps, Provider } from 'react-aria-components/slots';
|
|
5
6
|
import { createContext } from 'react';
|
|
7
|
+
import { GroupContext } from 'react-aria-components/Group';
|
|
6
8
|
|
|
7
9
|
const HeadingContext = /*#__PURE__*/ createContext({});
|
|
8
10
|
const headingVariants = cva({
|
|
@@ -105,21 +107,11 @@ const cardVariants = cva({
|
|
|
105
107
|
// by setting a higher z-index than the pseudo-element (which implicitly z-index 0)
|
|
106
108
|
'[&_a:not([data-slot="card-link"])]:z-[1] [&_button]:z-[1] [&_input]:z-[1]',
|
|
107
109
|
// **** Badge ****
|
|
108
|
-
'
|
|
110
|
+
'*:data-[slot=media]:*:data-[slot=badge]:absolute',
|
|
111
|
+
'*:data-[slot=media]:*:data-[slot=badge]:first:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:first:left-3.5',
|
|
109
112
|
// Increasing z-index Preserves badge position when media content is hovered (the transform scale effect might otherwise move the badge behind the other media content)
|
|
110
|
-
'
|
|
111
|
-
|
|
112
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tl-2xl',
|
|
113
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-br-2xl',
|
|
114
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tr-none',
|
|
115
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-bl-none',
|
|
116
|
-
// Right aligned - override default corner radius of the badge
|
|
117
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tl-none',
|
|
118
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-br-none',
|
|
119
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tr-2xl',
|
|
120
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-bl-2xl',
|
|
121
|
-
// ... and position the badge at the right edge of the media content
|
|
122
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:right-0'
|
|
113
|
+
'*:data-[slot=media]:*:data-[slot=badge]:z-[1]',
|
|
114
|
+
'*:data-[slot=media]:*:data-[slot=badge]:last:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:last:right-3.5'
|
|
123
115
|
],
|
|
124
116
|
variants: {
|
|
125
117
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { RouterProvider } from 'react-aria-components';
|
|
2
|
+
export { Form, Group } from 'react-aria-components';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { RefAttributes, HTMLAttributes, HTMLProps, ComponentProps, Ref, ReactNode, RefObject, Dispatch, SetStateAction, JSX } from 'react';
|
|
6
6
|
import * as cva from 'cva';
|
|
7
7
|
import { VariantProps } from 'cva';
|
|
8
|
-
import {
|
|
8
|
+
import { ButtonProps as ButtonProps$1 } from 'react-aria-components/Button';
|
|
9
|
+
import { DisclosureProps as DisclosureProps$1 } from 'react-aria-components/DisclosureGroup';
|
|
10
|
+
export { DisclosureGroup, DisclosureGroupProps } from 'react-aria-components/DisclosureGroup';
|
|
11
|
+
import { DisclosureState } from 'react-stately/useDisclosureState';
|
|
12
|
+
import { LinkProps as LinkProps$1 } from 'react-aria-components/Link';
|
|
13
|
+
import { BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1 } from 'react-aria-components/Breadcrumbs';
|
|
14
|
+
import { ContextValue } from 'react-aria-components/slots';
|
|
9
15
|
import { EmblaViewportRefType } from 'embla-carousel-react';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
16
|
+
import { CheckboxProps as CheckboxProps$1 } from 'react-aria-components/Checkbox';
|
|
17
|
+
import { CheckboxGroupProps as CheckboxGroupProps$1 } from 'react-aria-components/CheckboxGroup';
|
|
18
|
+
import { ComboBoxProps } from 'react-aria-components/ComboBox';
|
|
19
|
+
import { DateFormatterOptions } from 'react-aria/useDateFormatter';
|
|
20
|
+
import { FileTriggerProps as FileTriggerProps$1 } from 'react-aria-components/FileTrigger';
|
|
21
|
+
import { useFormValidationState } from 'react-stately/private/form/useFormValidationState';
|
|
22
|
+
import { TextProps } from 'react-aria-components/Text';
|
|
23
|
+
import { LabelProps } from 'react-aria-components/Label';
|
|
24
|
+
export { LabelProps } from 'react-aria-components/Label';
|
|
25
|
+
import { DialogProps as DialogProps$1, DialogTriggerProps as DialogTriggerProps$1 } from 'react-aria-components/Dialog';
|
|
26
|
+
import { ModalOverlayProps as ModalOverlayProps$1 } from 'react-aria-components/Modal';
|
|
27
|
+
import { NumberFieldProps as NumberFieldProps$1 } from 'react-aria-components/NumberField';
|
|
28
|
+
import { RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1 } from 'react-aria-components/RadioGroup';
|
|
29
|
+
import { SelectProps as SelectProps$1 } from 'react-aria-components/Select';
|
|
30
|
+
import { ColumnResizerProps, TableProps as TableProps$1, TableBodyProps as TableBodyProps$1, CellProps, ColumnProps, ResizableTableContainerProps, TableHeaderProps as TableHeaderProps$1, RowProps } from 'react-aria-components/Table';
|
|
31
|
+
import { TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabsProps as TabsProps$1 } from 'react-aria-components/Tabs';
|
|
32
|
+
import { TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TagProps as TagProps$1 } from 'react-aria-components/TagGroup';
|
|
33
|
+
import { TextFieldProps as TextFieldProps$1 } from 'react-aria-components/TextField';
|
|
34
|
+
import { HeaderProps } from 'react-aria-components/Header';
|
|
35
|
+
import { ListBoxItemProps, ListBoxSectionProps } from 'react-aria-components/ListBox';
|
|
36
|
+
export { ListBoxItemProps as ComboboxItemProps, ListBoxItemProps as SelectItemProps } from 'react-aria-components/ListBox';
|
|
12
37
|
|
|
13
38
|
declare const disclosureButtonVariants: (props?: ({
|
|
14
39
|
withChevron?: boolean | undefined;
|
|
@@ -228,7 +253,7 @@ type CardProps = VariantProps<typeof cardVariants> & HTMLAttributes<HTMLDivEleme
|
|
|
228
253
|
};
|
|
229
254
|
declare const cardVariants: (props?: ({
|
|
230
255
|
variant?: "subtle" | "outlined" | undefined;
|
|
231
|
-
layout?: "
|
|
256
|
+
layout?: "vertical" | "horizontal" | undefined;
|
|
232
257
|
} & ({
|
|
233
258
|
class?: cva.ClassValue;
|
|
234
259
|
className?: never;
|
|
@@ -250,8 +275,18 @@ type CardLinkProps = (Omit<LinkProps$1, 'href'> & Required<Pick<LinkProps$1, 'hr
|
|
|
250
275
|
*/
|
|
251
276
|
declare const CardLink: ({ className: _className, href, ...restProps }: CardLinkProps) => react_jsx_runtime.JSX.Element;
|
|
252
277
|
|
|
253
|
-
type
|
|
278
|
+
type CarouselMethods = {
|
|
279
|
+
/** Navigate to a specific slide by index. */
|
|
280
|
+
goToSlide: (index: number) => void;
|
|
281
|
+
/** Navigate to the next slide. */
|
|
282
|
+
goToNextSlide: () => void;
|
|
283
|
+
/** Navigate to the previous slide. */
|
|
284
|
+
goToPrevSlide: () => void;
|
|
285
|
+
};
|
|
286
|
+
type CarouselElement = HTMLDivElement & CarouselMethods;
|
|
287
|
+
type CarouselProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'onSelect' | 'ref'> & {
|
|
254
288
|
children?: React.ReactNode;
|
|
289
|
+
ref?: React.Ref<CarouselElement>;
|
|
255
290
|
/**
|
|
256
291
|
* Alignment of the items relative to the carousel viewport.
|
|
257
292
|
* @default 'center'
|
|
@@ -292,6 +327,7 @@ declare const Carousel: ({ autoPlayDelay, align, children, initialIndex, orienta
|
|
|
292
327
|
type CarouselContextValue = {
|
|
293
328
|
slidesInView: number[];
|
|
294
329
|
orientation: 'horizontal' | 'vertical';
|
|
330
|
+
'~shouldUseAriaCarouselPattern': boolean;
|
|
295
331
|
/**
|
|
296
332
|
* @private
|
|
297
333
|
*/
|
|
@@ -306,7 +342,7 @@ type CarouselItemsProps = HTMLProps<HTMLDivElement> & {
|
|
|
306
342
|
/** The <CarouselItem/> components to be displayed within the carousel. */
|
|
307
343
|
children: React.ReactNode;
|
|
308
344
|
};
|
|
309
|
-
declare const CarouselItems: ({ className, children }: CarouselItemsProps) => react_jsx_runtime.JSX.Element;
|
|
345
|
+
declare const CarouselItems: ({ className, children, ...restProps }: CarouselItemsProps) => react_jsx_runtime.JSX.Element;
|
|
310
346
|
type CarouselControlsProps = HTMLProps<HTMLDivElement> & {
|
|
311
347
|
/** The <CarouselItem/> components to be displayed within the carousel. */
|
|
312
348
|
children: React.ReactNode;
|
|
@@ -366,7 +402,7 @@ declare const ListBoxSection: <T extends object>({ className, ...restProps }: Li
|
|
|
366
402
|
/**
|
|
367
403
|
* This component can be used to label grouped items in a `ListBoxSection` with a heading
|
|
368
404
|
*/
|
|
369
|
-
declare const ListBoxHeader: (props:
|
|
405
|
+
declare const ListBoxHeader: (props: HeaderProps) => react_jsx_runtime.JSX.Element;
|
|
370
406
|
|
|
371
407
|
type ComboboxProps<T extends object> = {
|
|
372
408
|
children: React.ReactNode;
|
|
@@ -405,7 +441,7 @@ type HeadingProps = Omit<HTMLProps<HTMLHeadingElement>, 'size'> & VariantProps<t
|
|
|
405
441
|
};
|
|
406
442
|
declare const HeadingContext: react.Context<ContextValue<Partial<HeadingProps>, HTMLHeadingElement>>;
|
|
407
443
|
declare const headingVariants: (props?: ({
|
|
408
|
-
size?: "
|
|
444
|
+
size?: "xl" | "l" | "m" | "s" | "xs" | undefined;
|
|
409
445
|
} & ({
|
|
410
446
|
class?: cva.ClassValue;
|
|
411
447
|
className?: never;
|
|
@@ -461,7 +497,8 @@ type DateFormatterProps = {
|
|
|
461
497
|
*/
|
|
462
498
|
declare const DateFormatter: ({ options: _options, value, children: render }: DateFormatterProps) => ReactNode;
|
|
463
499
|
|
|
464
|
-
type
|
|
500
|
+
type FormValidationProps<T> = Parameters<typeof useFormValidationState<T>>[0];
|
|
501
|
+
type FileTriggerProps = Partial<Omit<FormValidationProps<File>, 'value'>> & FileTriggerProps$1 & Omit<HTMLAttributes<HTMLInputElement>, 'onSelect' | 'onChange' | 'required' | 'className'> & {
|
|
465
502
|
ref?: RefObject<HTMLInputElement | null>;
|
|
466
503
|
isInvalid?: boolean;
|
|
467
504
|
isRequired?: boolean;
|
|
@@ -556,9 +593,11 @@ type ModalOverlayProps = Omit<ModalOverlayProps$1, 'isDismissable' | 'style'> &
|
|
|
556
593
|
zIndex?: number;
|
|
557
594
|
/** @default true Makes the modal dismissable */
|
|
558
595
|
isDismissable?: boolean;
|
|
596
|
+
/** @default false When true, the modal takes up the full screen */
|
|
597
|
+
fullscreen?: boolean;
|
|
559
598
|
};
|
|
560
599
|
type ModalProps = ModalOverlayProps;
|
|
561
|
-
declare const Modal: ({ isDismissable, isOpen, onOpenChange, defaultOpen, className, zIndex, ...restProps }: ModalProps) => react_jsx_runtime.JSX.Element;
|
|
600
|
+
declare const Modal: ({ isDismissable, isOpen, onOpenChange, defaultOpen, className, zIndex, fullscreen, ...restProps }: ModalProps) => react_jsx_runtime.JSX.Element;
|
|
562
601
|
type DialogProps = DialogProps$1 & {
|
|
563
602
|
children: React.ReactNode;
|
|
564
603
|
};
|
|
@@ -872,4 +911,4 @@ type VideoLoopProps = {
|
|
|
872
911
|
declare const VideoLoop: ({ src, format, alt, className }: VideoLoopProps) => react_jsx_runtime.JSX.Element;
|
|
873
912
|
|
|
874
913
|
export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, Disclosure, DisclosureButton, DisclosurePanel, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, LinkList, LinkListContainer, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, CarouselItemsContainer as UNSAFE_CarouselItemsContainerProps, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, HeroContext as UNSAFE_HeroContext, Link as UNSAFE_Link, Modal as UNSAFE_Modal, Step as UNSAFE_Step, Stepper as UNSAFE_Stepper, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, TableContainer as UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _useLocale as useLocale };
|
|
875
|
-
export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, DisclosureButtonProps, DisclosurePanelProps, DisclosureProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, LinkListContainerProps, LinkListItemProps, LinkListProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselButtonProps as UNSAFE_CarouselButtonProps, CarouselContextValue as UNSAFE_CarouselContextValue, CarouselControlsProps as UNSAFE_CarouselControlsProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, FileUploadProps as UNSAFE_FileUploadProps, HeroContextValue as UNSAFE_HeroContextValue, HeroProps as UNSAFE_HeroProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, StepProps as UNSAFE_StepProps, StepperProps as UNSAFE_StepperProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, TableContainerProps as UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
|
|
914
|
+
export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, DisclosureButtonProps, DisclosurePanelProps, DisclosureProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, LinkListContainerProps, LinkListItemProps, LinkListProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselButtonProps as UNSAFE_CarouselButtonProps, CarouselContextValue as UNSAFE_CarouselContextValue, CarouselControlsProps as UNSAFE_CarouselControlsProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, CarouselElement as UNSAFE_CarouselRef, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, FileUploadProps as UNSAFE_FileUploadProps, HeroContextValue as UNSAFE_HeroContextValue, HeroProps as UNSAFE_HeroProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, StepProps as UNSAFE_StepProps, StepperProps as UNSAFE_StepperProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, TableContainerProps as UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,60 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { RouterProvider } from 'react-aria-components';
|
|
3
|
+
export { Form, Group } from 'react-aria-components';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { cva, cx, compose } from 'cva';
|
|
6
|
-
import { createContext, useContext, useId, useRef, Children, useState, useEffect, useMemo, useCallback, isValidElement, cloneElement, use } from 'react';
|
|
6
|
+
import { createContext, useContext, useId, useRef, Children, useState, useEffect, useMemo, useCallback, useImperativeHandle, isValidElement, cloneElement, use } from 'react';
|
|
7
|
+
import { useContextProps, Provider, DEFAULT_SLOT, useSlottedContext } from 'react-aria-components/slots';
|
|
7
8
|
import { ChevronDown, Error, Warning, CheckCircle, InfoCircle, Close, User, ChevronLeft, ChevronRight, LoadingSpinner, Check, Trash, Download, LinkExternal, ArrowRight, Edit, PlayerPause, PlayerPlay } from '@obosbbl/grunnmuren-icons-react';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { ButtonContext as ButtonContext$1, Button as Button$1 } from 'react-aria-components/Button';
|
|
10
|
+
import { DisclosureContext, DisclosureGroupStateContext } from 'react-aria-components/DisclosureGroup';
|
|
11
|
+
export { DisclosureGroup } from 'react-aria-components/DisclosureGroup';
|
|
12
|
+
import { filterDOMProps } from 'react-aria/filterDOMProps';
|
|
13
|
+
import { mergeProps } from 'react-aria/mergeProps';
|
|
14
|
+
import { mergeRefs } from 'react-aria/mergeRefs';
|
|
15
|
+
import { useDisclosure } from 'react-aria/useDisclosure';
|
|
16
|
+
import { useFocusRing } from 'react-aria/useFocusRing';
|
|
17
|
+
import { useDisclosureState } from 'react-stately/useDisclosureState';
|
|
18
|
+
import { useLocale, I18nProvider } from 'react-aria-components/I18nProvider';
|
|
19
|
+
import { Link as Link$1, LinkContext } from 'react-aria-components/Link';
|
|
20
|
+
import { Breadcrumb as Breadcrumb$1, Breadcrumbs as Breadcrumbs$1 } from 'react-aria-components/Breadcrumbs';
|
|
21
|
+
import { useProgressBar } from 'react-aria/useProgressBar';
|
|
11
22
|
import Autoplay from 'embla-carousel-autoplay';
|
|
12
23
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
13
24
|
import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
25
|
+
import { GroupContext, Group } from 'react-aria-components/Group';
|
|
26
|
+
import { Dialog as Dialog$1, DialogTrigger as DialogTrigger$1, OverlayTriggerStateContext } from 'react-aria-components/Dialog';
|
|
27
|
+
import { Modal as Modal$1, ModalOverlay } from 'react-aria-components/Modal';
|
|
28
|
+
import { CheckboxContext, Checkbox as Checkbox$1 } from 'react-aria-components/Checkbox';
|
|
29
|
+
import { Text } from 'react-aria-components/Text';
|
|
30
|
+
import { CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components/CheckboxGroup';
|
|
31
|
+
import { FieldError, FieldErrorContext } from 'react-aria-components/FieldError';
|
|
32
|
+
import { Label as Label$1, LabelContext } from 'react-aria-components/Label';
|
|
33
|
+
import { ComboBox } from 'react-aria-components/ComboBox';
|
|
34
|
+
import { Input, InputContext } from 'react-aria-components/Input';
|
|
35
|
+
import { Popover } from 'react-aria-components/Popover';
|
|
36
|
+
import { Header } from 'react-aria-components/Header';
|
|
37
|
+
import { ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, ListBox as ListBox$1 } from 'react-aria-components/ListBox';
|
|
38
|
+
import { useDateFormatter } from 'react-aria/useDateFormatter';
|
|
39
|
+
import { FormContext } from 'react-aria-components/Form';
|
|
40
|
+
import { useFormValidation } from 'react-aria/private/form/useFormValidation';
|
|
41
|
+
import { useFormReset } from 'react-aria/private/utils/useFormReset';
|
|
42
|
+
import { useUpdateEffect } from 'react-aria/private/utils/useUpdateEffect';
|
|
43
|
+
import { useField } from 'react-aria/useField';
|
|
44
|
+
import { useFormValidationState } from 'react-stately/private/form/useFormValidationState';
|
|
45
|
+
import { useControlledState } from 'react-stately/useControlledState';
|
|
46
|
+
import { PressResponder } from 'react-aria/private/interactions/PressResponder';
|
|
47
|
+
import { useObjectRef } from 'react-aria/useObjectRef';
|
|
48
|
+
import { NumberField as NumberField$1 } from 'react-aria-components/NumberField';
|
|
49
|
+
import { Radio as Radio$1, RadioGroup as RadioGroup$1 } from 'react-aria-components/RadioGroup';
|
|
50
|
+
import { Select as Select$1, SelectValue } from 'react-aria-components/Select';
|
|
51
|
+
import { ProgressBar as ProgressBar$1 } from 'react-aria-components/ProgressBar';
|
|
18
52
|
import { useDebouncedCallback } from 'use-debounce';
|
|
53
|
+
import { ColumnResizer, Table as Table$1, TableBody as TableBody$1, Cell, Column, ResizableTableContainer, TableHeader as TableHeader$1, Row } from 'react-aria-components/Table';
|
|
54
|
+
import { Tab as Tab$1, TabListStateContext, TabList as TabList$1, TabPanel as TabPanel$1, Tabs as Tabs$1 } from 'react-aria-components/Tabs';
|
|
55
|
+
import { TagGroup as TagGroup$1, TagList as TagList$1, Tag as Tag$1 } from 'react-aria-components/TagGroup';
|
|
56
|
+
import { TextArea as TextArea$1 } from 'react-aria-components/TextArea';
|
|
57
|
+
import { TextField as TextField$1 } from 'react-aria-components/TextField';
|
|
19
58
|
|
|
20
59
|
const HeadingContext = /*#__PURE__*/ createContext({});
|
|
21
60
|
const headingVariants = cva({
|
|
@@ -599,9 +638,9 @@ const badgeVariants = cva({
|
|
|
599
638
|
variants: {
|
|
600
639
|
color: {
|
|
601
640
|
'gray-dark': 'bg-gray-dark text-white',
|
|
602
|
-
mint: 'bg-mint',
|
|
603
|
-
sky: 'bg-sky',
|
|
604
|
-
white: 'bg-white',
|
|
641
|
+
mint: 'bg-mint text-black',
|
|
642
|
+
sky: 'bg-sky text-black',
|
|
643
|
+
white: 'bg-white text-black',
|
|
605
644
|
'blue-dark': 'bg-blue-dark text-white',
|
|
606
645
|
'green-dark': 'bg-green-dark text-white'
|
|
607
646
|
},
|
|
@@ -852,21 +891,11 @@ const cardVariants = cva({
|
|
|
852
891
|
// by setting a higher z-index than the pseudo-element (which implicitly z-index 0)
|
|
853
892
|
'[&_a:not([data-slot="card-link"])]:z-[1] [&_button]:z-[1] [&_input]:z-[1]',
|
|
854
893
|
// **** Badge ****
|
|
855
|
-
'
|
|
894
|
+
'*:data-[slot=media]:*:data-[slot=badge]:absolute',
|
|
895
|
+
'*:data-[slot=media]:*:data-[slot=badge]:first:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:first:left-3.5',
|
|
856
896
|
// Increasing z-index Preserves badge position when media content is hovered (the transform scale effect might otherwise move the badge behind the other media content)
|
|
857
|
-
'
|
|
858
|
-
|
|
859
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tl-2xl',
|
|
860
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-br-2xl',
|
|
861
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-tr-none',
|
|
862
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:first-child]:rounded-bl-none',
|
|
863
|
-
// Right aligned - override default corner radius of the badge
|
|
864
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tl-none',
|
|
865
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-br-none',
|
|
866
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-tr-2xl',
|
|
867
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:rounded-bl-2xl',
|
|
868
|
-
// ... and position the badge at the right edge of the media content
|
|
869
|
-
'[&_[data-slot="media"]_[data-slot="badge"]:last-child]:right-0'
|
|
897
|
+
'*:data-[slot=media]:*:data-[slot=badge]:z-[1]',
|
|
898
|
+
'*:data-[slot=media]:*:data-[slot=badge]:last:top-3.5 *:data-[slot=media]:*:data-[slot=badge]:last:right-3.5'
|
|
870
899
|
],
|
|
871
900
|
variants: {
|
|
872
901
|
/**
|
|
@@ -1174,6 +1203,106 @@ const Hero = ({ variant, className, children, ...rest })=>{
|
|
|
1174
1203
|
});
|
|
1175
1204
|
};
|
|
1176
1205
|
|
|
1206
|
+
const DialogTrigger = (props)=>/*#__PURE__*/ jsx(DialogTrigger$1, {
|
|
1207
|
+
...props
|
|
1208
|
+
});
|
|
1209
|
+
const _ModalOverlay = ({ style = {}, zIndex = 10, fullscreen, ...restProps })=>/*#__PURE__*/ jsx(ModalOverlay, {
|
|
1210
|
+
...restProps,
|
|
1211
|
+
className: ({ isEntering, isExiting })=>cx('fixed inset-0 flex min-h-full items-center justify-center overflow-y-auto bg-black/25 text-center backdrop-blur-sm', !fullscreen && 'p-4', isEntering && 'fade-in animate-in duration-300 ease-out', isExiting && 'fade-out animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
|
|
1212
|
+
'motion-reduce:animate-none'),
|
|
1213
|
+
style: {
|
|
1214
|
+
zIndex,
|
|
1215
|
+
...style
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex, fullscreen = false, ...restProps })=>{
|
|
1219
|
+
const locale = _useLocale();
|
|
1220
|
+
return /*#__PURE__*/ jsx(Provider, {
|
|
1221
|
+
values: [
|
|
1222
|
+
[
|
|
1223
|
+
HeadingContext,
|
|
1224
|
+
{
|
|
1225
|
+
slots: {
|
|
1226
|
+
[DEFAULT_SLOT]: {},
|
|
1227
|
+
title: {
|
|
1228
|
+
className: 'heading-s',
|
|
1229
|
+
_outerWrapper: (children)=>/*#__PURE__*/ jsxs("div", {
|
|
1230
|
+
className: "flex items-center justify-between gap-x-2",
|
|
1231
|
+
children: [
|
|
1232
|
+
children,
|
|
1233
|
+
isDismissable && /*#__PURE__*/ jsx(Button, {
|
|
1234
|
+
slot: "close",
|
|
1235
|
+
variant: "tertiary",
|
|
1236
|
+
className: "data-focus-visible:outline-focus-inset px-2.5!",
|
|
1237
|
+
"aria-label": translations$1.close[locale],
|
|
1238
|
+
onPress: ()=>onOpenChange?.(false),
|
|
1239
|
+
children: /*#__PURE__*/ jsx(Close, {})
|
|
1240
|
+
})
|
|
1241
|
+
]
|
|
1242
|
+
})
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
]
|
|
1247
|
+
],
|
|
1248
|
+
children: /*#__PURE__*/ jsx(_ModalOverlay, {
|
|
1249
|
+
isOpen: isOpen,
|
|
1250
|
+
onOpenChange: onOpenChange,
|
|
1251
|
+
defaultOpen: defaultOpen,
|
|
1252
|
+
isDismissable: isDismissable,
|
|
1253
|
+
zIndex: zIndex,
|
|
1254
|
+
fullscreen: fullscreen,
|
|
1255
|
+
children: /*#__PURE__*/ jsx(Modal$1, {
|
|
1256
|
+
...restProps,
|
|
1257
|
+
className: ({ isEntering, isExiting })=>cx(className, 'overflow-auto bg-white text-left shadow-xl', fullscreen ? 'fixed inset-0' : 'w-full max-w-md rounded-2xl p-4 align-middle', isEntering && 'zoom-in-95 animate-in duration-300 ease-out', isExiting && 'zoom-out-95 animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
|
|
1258
|
+
'motion-reduce:animate-none')
|
|
1259
|
+
})
|
|
1260
|
+
})
|
|
1261
|
+
});
|
|
1262
|
+
};
|
|
1263
|
+
const Dialog = ({ className, children, ...restProps })=>/*#__PURE__*/ jsx(Dialog$1, {
|
|
1264
|
+
...restProps,
|
|
1265
|
+
className: cx(className, 'relative flex flex-col gap-y-5 outline-none', // Footer
|
|
1266
|
+
'**:data-[slot="footer"]:flex **:data-[slot="footer"]:gap-x-2'),
|
|
1267
|
+
children: ({ close })=>/*#__PURE__*/ jsx(Provider, {
|
|
1268
|
+
values: [
|
|
1269
|
+
[
|
|
1270
|
+
ButtonContext$1,
|
|
1271
|
+
{
|
|
1272
|
+
// This is necessary to support multiple close buttons
|
|
1273
|
+
slots: {
|
|
1274
|
+
// We need to define default slot in order to also support non-slotted buttons (i.e. buttons without slot prop)
|
|
1275
|
+
[DEFAULT_SLOT]: {
|
|
1276
|
+
className: 'w-fit'
|
|
1277
|
+
},
|
|
1278
|
+
close: {
|
|
1279
|
+
onPress: close,
|
|
1280
|
+
className: 'w-fit'
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
]
|
|
1285
|
+
],
|
|
1286
|
+
children: children
|
|
1287
|
+
})
|
|
1288
|
+
});
|
|
1289
|
+
/**
|
|
1290
|
+
* Reset the ButtonContext from react-aria-components that Dialog provides
|
|
1291
|
+
* (only allows "close" slot) so nested components can set up their own
|
|
1292
|
+
* button slots (e.g. Carousel's "prev" / "next").
|
|
1293
|
+
*/ const _ModalButtonContextReset = ({ children })=>{
|
|
1294
|
+
const isInsideOverlay = !!useContext(OverlayTriggerStateContext);
|
|
1295
|
+
return isInsideOverlay ? /*#__PURE__*/ jsx(Provider, {
|
|
1296
|
+
values: [
|
|
1297
|
+
[
|
|
1298
|
+
ButtonContext$1,
|
|
1299
|
+
null
|
|
1300
|
+
]
|
|
1301
|
+
],
|
|
1302
|
+
children: children
|
|
1303
|
+
}) : children;
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1177
1306
|
/**
|
|
1178
1307
|
* Hook that detects the user's preference for reduced motion.
|
|
1179
1308
|
*
|
|
@@ -1245,13 +1374,18 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1245
1374
|
loop,
|
|
1246
1375
|
prefersReducedMotion
|
|
1247
1376
|
]);
|
|
1248
|
-
const
|
|
1377
|
+
const emblaOptions = useMemo(()=>({
|
|
1378
|
+
align,
|
|
1379
|
+
loop,
|
|
1380
|
+
startIndex: initialIndex,
|
|
1381
|
+
axis: orientation === 'horizontal' ? 'x' : 'y'
|
|
1382
|
+
}), [
|
|
1249
1383
|
align,
|
|
1250
1384
|
loop,
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1385
|
+
initialIndex,
|
|
1386
|
+
orientation
|
|
1387
|
+
]);
|
|
1388
|
+
const [emblaRef, emblaApi] = useEmblaCarousel(emblaOptions, emblaPlugins);
|
|
1255
1389
|
const [slidesInView, setSlidesInView] = useState([
|
|
1256
1390
|
initialIndex
|
|
1257
1391
|
]);
|
|
@@ -1269,6 +1403,7 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1269
1403
|
switch(type){
|
|
1270
1404
|
case 'select':
|
|
1271
1405
|
onSelect?.(scrollSnapIndex);
|
|
1406
|
+
setSlidesInView(emblaApi.slidesInView());
|
|
1272
1407
|
setCanScrollNext(emblaApi.canScrollNext());
|
|
1273
1408
|
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
1274
1409
|
break;
|
|
@@ -1289,6 +1424,7 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1289
1424
|
}
|
|
1290
1425
|
case 'init':
|
|
1291
1426
|
{
|
|
1427
|
+
setSlidesInView(emblaApi.slidesInView());
|
|
1292
1428
|
setCanScrollNext(emblaApi.canScrollNext());
|
|
1293
1429
|
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
1294
1430
|
break;
|
|
@@ -1362,6 +1498,19 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1362
1498
|
handlePrevPress,
|
|
1363
1499
|
emblaApi
|
|
1364
1500
|
]);
|
|
1501
|
+
useImperativeHandle(ref, ()=>{
|
|
1502
|
+
const el = carouselRef.current;
|
|
1503
|
+
if (!el) {
|
|
1504
|
+
return el; // Just to satisfy the return type, this case should never actually happen
|
|
1505
|
+
}
|
|
1506
|
+
el.goToSlide = (index)=>emblaApi?.scrollTo(index, prefersReducedMotion);
|
|
1507
|
+
el.goToNextSlide = ()=>emblaApi?.scrollNext(prefersReducedMotion);
|
|
1508
|
+
el.goToPrevSlide = ()=>emblaApi?.scrollPrev(prefersReducedMotion);
|
|
1509
|
+
return el;
|
|
1510
|
+
}, [
|
|
1511
|
+
emblaApi,
|
|
1512
|
+
prefersReducedMotion
|
|
1513
|
+
]);
|
|
1365
1514
|
const hasHeroContext = !!useContext(HeroContext);
|
|
1366
1515
|
const nextPrevStyles = hasHeroContext ? {
|
|
1367
1516
|
color: 'white',
|
|
@@ -1369,82 +1518,107 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1369
1518
|
} : {
|
|
1370
1519
|
variant: 'tertiary'
|
|
1371
1520
|
};
|
|
1521
|
+
const shouldUseAriaCarouselPattern = !autoPlayDelay;
|
|
1372
1522
|
return(// oxlint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
1373
1523
|
/*#__PURE__*/ jsx("div", {
|
|
1374
1524
|
...rest,
|
|
1525
|
+
role: shouldUseAriaCarouselPattern ? 'region' : undefined,
|
|
1526
|
+
"aria-roledescription": shouldUseAriaCarouselPattern ? 'carousel' : undefined,
|
|
1375
1527
|
"data-orientation": orientation,
|
|
1376
1528
|
"data-slot": "carousel",
|
|
1377
|
-
ref:
|
|
1529
|
+
ref: carouselRef,
|
|
1378
1530
|
onKeyDown: handleKeyDown,
|
|
1379
|
-
children: /*#__PURE__*/ jsx(
|
|
1380
|
-
|
|
1381
|
-
[
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1531
|
+
children: /*#__PURE__*/ jsx(_ModalButtonContextReset, {
|
|
1532
|
+
children: /*#__PURE__*/ jsx(Provider, {
|
|
1533
|
+
values: [
|
|
1534
|
+
[
|
|
1535
|
+
CarouselContext,
|
|
1536
|
+
{
|
|
1537
|
+
slidesInView,
|
|
1538
|
+
'~emblaRef': emblaRef,
|
|
1539
|
+
orientation,
|
|
1540
|
+
'~shouldUseAriaCarouselPattern': shouldUseAriaCarouselPattern
|
|
1541
|
+
}
|
|
1542
|
+
],
|
|
1543
|
+
[
|
|
1544
|
+
ButtonContext,
|
|
1545
|
+
{
|
|
1546
|
+
slots: {
|
|
1547
|
+
[DEFAULT_SLOT]: {},
|
|
1548
|
+
prev: {
|
|
1549
|
+
'aria-label': translations$1.previous[locale],
|
|
1550
|
+
isDisabled: !canScrollPrev,
|
|
1551
|
+
onPress: handlePrevPress,
|
|
1552
|
+
...nextPrevStyles
|
|
1553
|
+
},
|
|
1554
|
+
next: {
|
|
1555
|
+
'aria-label': translations$1.next[locale],
|
|
1556
|
+
isDisabled: !canScrollNext,
|
|
1557
|
+
onPress: handleNextPress,
|
|
1558
|
+
...nextPrevStyles
|
|
1559
|
+
}
|
|
1405
1560
|
}
|
|
1406
1561
|
}
|
|
1407
|
-
|
|
1408
|
-
]
|
|
1409
|
-
|
|
1410
|
-
|
|
1562
|
+
]
|
|
1563
|
+
],
|
|
1564
|
+
children: children
|
|
1565
|
+
})
|
|
1411
1566
|
})
|
|
1412
1567
|
}));
|
|
1413
1568
|
};
|
|
1569
|
+
const CarouselItemIndexContext = /*#__PURE__*/ createContext(0);
|
|
1414
1570
|
const CarouselContext = /*#__PURE__*/ createContext({
|
|
1415
1571
|
'~emblaRef': null,
|
|
1416
1572
|
orientation: 'horizontal',
|
|
1417
|
-
slidesInView: []
|
|
1573
|
+
slidesInView: [],
|
|
1574
|
+
'~shouldUseAriaCarouselPattern': true
|
|
1418
1575
|
});
|
|
1419
1576
|
const CarouselItemsContainer = ({ children, className, ...rest })=>{
|
|
1420
|
-
const { '~emblaRef': emblaRef } = useContext(CarouselContext);
|
|
1577
|
+
const { '~emblaRef': emblaRef, '~shouldUseAriaCarouselPattern': shouldUseAriaCarouselPattern } = useContext(CarouselContext);
|
|
1421
1578
|
return /*#__PURE__*/ jsx("div", {
|
|
1422
1579
|
className: cx(className, 'overflow-hidden'),
|
|
1423
1580
|
ref: emblaRef,
|
|
1424
1581
|
"data-slot": "carousel-items-container",
|
|
1425
1582
|
...rest,
|
|
1583
|
+
"aria-live": shouldUseAriaCarouselPattern ? 'polite' : undefined,
|
|
1584
|
+
"aria-atomic": shouldUseAriaCarouselPattern ? false : undefined,
|
|
1426
1585
|
children: children
|
|
1427
1586
|
});
|
|
1428
1587
|
};
|
|
1429
|
-
const CarouselItems = ({ className, children })=>{
|
|
1588
|
+
const CarouselItems = ({ className, children, ...restProps })=>{
|
|
1430
1589
|
const { orientation } = useContext(CarouselContext);
|
|
1590
|
+
let itemIndex = 0;
|
|
1431
1591
|
return /*#__PURE__*/ jsx("div", {
|
|
1432
1592
|
className: cx(className, 'flex', orientation === 'vertical' && 'flex-col'),
|
|
1433
1593
|
"data-slot": "carousel-items",
|
|
1434
|
-
|
|
1594
|
+
...restProps,
|
|
1595
|
+
children: Children.map(children, (child)=>{
|
|
1596
|
+
if (/*#__PURE__*/ isValidElement(child)) {
|
|
1597
|
+
const currentIndex = itemIndex++;
|
|
1598
|
+
return /*#__PURE__*/ jsx(CarouselItemIndexContext.Provider, {
|
|
1599
|
+
value: currentIndex,
|
|
1600
|
+
children: child
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
return child;
|
|
1604
|
+
})
|
|
1435
1605
|
});
|
|
1436
1606
|
};
|
|
1437
1607
|
/**
|
|
1438
1608
|
* This is internal for now, but we will expose it in the future when we support more flexible positioning of prev/next and other actions.
|
|
1439
1609
|
* It is used to render the prev/next buttons in the carousel for now.
|
|
1440
|
-
*/ const CarouselControls = ({ children, className, ...rest })
|
|
1610
|
+
*/ const CarouselControls = ({ children, className, ...rest })=>{
|
|
1611
|
+
const { '~shouldUseAriaCarouselPattern': shouldUseAriaCarouselPattern } = useContext(CarouselContext);
|
|
1612
|
+
return /*#__PURE__*/ jsx("div", {
|
|
1441
1613
|
className: cx(className, 'flex justify-end gap-x-2'),
|
|
1442
1614
|
"data-slot": "carousel-controls",
|
|
1443
1615
|
...rest,
|
|
1444
|
-
//
|
|
1445
|
-
|
|
1616
|
+
// When not using the aria carousel pattern, all items are accessible to the screen reader at all times,
|
|
1617
|
+
// so these controls will only confuse screen reader users
|
|
1618
|
+
"aria-hidden": !shouldUseAriaCarouselPattern,
|
|
1446
1619
|
children: children
|
|
1447
1620
|
});
|
|
1621
|
+
};
|
|
1448
1622
|
const carouselButtonVariants = cva({
|
|
1449
1623
|
base: 'group data-disabled:invisible'
|
|
1450
1624
|
});
|
|
@@ -1503,10 +1677,15 @@ const CarouselButton = ({ className, isIconOnly = true, slot, ...rest })=>{
|
|
|
1503
1677
|
});
|
|
1504
1678
|
};
|
|
1505
1679
|
const CarouselItem = ({ className, children, ...rest })=>{
|
|
1680
|
+
const itemIndex = useContext(CarouselItemIndexContext);
|
|
1681
|
+
const { slidesInView, '~shouldUseAriaCarouselPattern': shouldUseAriaCarouselPattern } = useContext(CarouselContext);
|
|
1506
1682
|
return /*#__PURE__*/ jsx("div", {
|
|
1507
1683
|
...rest,
|
|
1684
|
+
inert: shouldUseAriaCarouselPattern && !slidesInView.includes(itemIndex) ? true : undefined,
|
|
1508
1685
|
className: cx(className, 'min-w-0 shrink-0 grow-0', '*:data-[slot=media]:aspect-square', '*:data-[slot=media]:max-sm:data-[fit="contain"]:*:object-cover', '*:data-[slot=media]:sm:aspect-4/3', '*:data-[slot=media]:md:aspect-3/2', '*:data-[slot=media]:lg:aspect-2/1', '*:data-[slot=media]:*:h-full', '*:data-[slot=media]:*:w-full', '*:data-[slot=media]:data-[fit="contain"]:bg-blue-dark'),
|
|
1509
1686
|
"data-slot": "carousel-item",
|
|
1687
|
+
role: shouldUseAriaCarouselPattern ? 'group' : undefined,
|
|
1688
|
+
"aria-roledescription": shouldUseAriaCarouselPattern ? 'slide' : undefined,
|
|
1510
1689
|
children: /*#__PURE__*/ jsx(Provider, {
|
|
1511
1690
|
values: [
|
|
1512
1691
|
[
|
|
@@ -1802,8 +1981,9 @@ function Combobox(props) {
|
|
|
1802
1981
|
onChange: (e)=>onSelect?.(e.target.files),
|
|
1803
1982
|
capture: defaultCamera,
|
|
1804
1983
|
multiple: allowsMultiple,
|
|
1805
|
-
|
|
1806
|
-
|
|
1984
|
+
...acceptDirectory ? {
|
|
1985
|
+
webkitdirectory: ''
|
|
1986
|
+
} : {},
|
|
1807
1987
|
// This is a work around to prevent error in the console when attempting to submit a form with a required and empty file input
|
|
1808
1988
|
// RAC uses display: none, which prevents the file input from being focused.
|
|
1809
1989
|
// What we do instead is to hide it visually using custom CSS, so that the native HTML validation messages are still hidden. Which is why
|
|
@@ -2182,89 +2362,6 @@ const LinkListItem = ({ children, className, ...props })=>{
|
|
|
2182
2362
|
});
|
|
2183
2363
|
};
|
|
2184
2364
|
|
|
2185
|
-
const DialogTrigger = (props)=>/*#__PURE__*/ jsx(DialogTrigger$1, {
|
|
2186
|
-
...props
|
|
2187
|
-
});
|
|
2188
|
-
const _ModalOverlay = ({ style = {}, zIndex = 10, ...restProps })=>/*#__PURE__*/ jsx(ModalOverlay, {
|
|
2189
|
-
...restProps,
|
|
2190
|
-
className: ({ isEntering, isExiting })=>cx('fixed inset-0 flex min-h-full items-center justify-center overflow-y-auto bg-black/25 p-4 text-center backdrop-blur-sm', isEntering && 'fade-in animate-in duration-300 ease-out', isExiting && 'fade-out animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
|
|
2191
|
-
'motion-reduce:animate-none'),
|
|
2192
|
-
style: {
|
|
2193
|
-
zIndex,
|
|
2194
|
-
...style
|
|
2195
|
-
}
|
|
2196
|
-
});
|
|
2197
|
-
const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex, ...restProps })=>{
|
|
2198
|
-
const locale = _useLocale();
|
|
2199
|
-
return /*#__PURE__*/ jsx(Provider, {
|
|
2200
|
-
values: [
|
|
2201
|
-
[
|
|
2202
|
-
HeadingContext,
|
|
2203
|
-
{
|
|
2204
|
-
slots: {
|
|
2205
|
-
[DEFAULT_SLOT]: {},
|
|
2206
|
-
title: {
|
|
2207
|
-
className: 'heading-s',
|
|
2208
|
-
_outerWrapper: (children)=>/*#__PURE__*/ jsxs("div", {
|
|
2209
|
-
className: "flex items-center justify-between gap-x-2",
|
|
2210
|
-
children: [
|
|
2211
|
-
children,
|
|
2212
|
-
isDismissable && /*#__PURE__*/ jsx(Button, {
|
|
2213
|
-
slot: "close",
|
|
2214
|
-
variant: "tertiary",
|
|
2215
|
-
className: "data-focus-visible:outline-focus-inset px-2.5!",
|
|
2216
|
-
"aria-label": translations$1.close[locale],
|
|
2217
|
-
onPress: ()=>onOpenChange?.(false),
|
|
2218
|
-
children: /*#__PURE__*/ jsx(Close, {})
|
|
2219
|
-
})
|
|
2220
|
-
]
|
|
2221
|
-
})
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
]
|
|
2226
|
-
],
|
|
2227
|
-
children: /*#__PURE__*/ jsx(_ModalOverlay, {
|
|
2228
|
-
isOpen: isOpen,
|
|
2229
|
-
onOpenChange: onOpenChange,
|
|
2230
|
-
defaultOpen: defaultOpen,
|
|
2231
|
-
isDismissable: isDismissable,
|
|
2232
|
-
zIndex: zIndex,
|
|
2233
|
-
children: /*#__PURE__*/ jsx(Modal$1, {
|
|
2234
|
-
...restProps,
|
|
2235
|
-
className: ({ isEntering, isExiting })=>cx(className, 'w-full max-w-md overflow-hidden rounded-2xl bg-white p-4 text-left align-middle shadow-xl', isEntering && 'zoom-in-95 animate-in duration-300 ease-out', isExiting && 'zoom-out-95 animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
|
|
2236
|
-
'motion-reduce:animate-none')
|
|
2237
|
-
})
|
|
2238
|
-
})
|
|
2239
|
-
});
|
|
2240
|
-
};
|
|
2241
|
-
const Dialog = ({ className, children, ...restProps })=>/*#__PURE__*/ jsx(Dialog$1, {
|
|
2242
|
-
...restProps,
|
|
2243
|
-
className: cx(className, 'relative grid gap-y-5 outline-none', // Footer
|
|
2244
|
-
'**:data-[slot="footer"]:flex **:data-[slot="footer"]:gap-x-2'),
|
|
2245
|
-
children: ({ close })=>/*#__PURE__*/ jsx(Provider, {
|
|
2246
|
-
values: [
|
|
2247
|
-
[
|
|
2248
|
-
ButtonContext$1,
|
|
2249
|
-
{
|
|
2250
|
-
// This is necessary to support multiple close buttons
|
|
2251
|
-
slots: {
|
|
2252
|
-
// We need to define default slot in order to also support non-slotted buttons (i.e. buttons without slot prop)
|
|
2253
|
-
[DEFAULT_SLOT]: {
|
|
2254
|
-
className: 'w-fit'
|
|
2255
|
-
},
|
|
2256
|
-
close: {
|
|
2257
|
-
onPress: close,
|
|
2258
|
-
className: 'w-fit'
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
}
|
|
2262
|
-
]
|
|
2263
|
-
],
|
|
2264
|
-
children: children
|
|
2265
|
-
})
|
|
2266
|
-
});
|
|
2267
|
-
|
|
2268
2365
|
// This component is based on a copy of ../textfield/TextField, refactoring is TBD: https://github.com/code-obos/grunnmuren/pull/722#issuecomment-1931478786
|
|
2269
2366
|
const inputVariants$1 = compose(input, cva({
|
|
2270
2367
|
base: '',
|
|
@@ -2346,7 +2443,7 @@ const defaultClasses = cx([
|
|
|
2346
2443
|
'data-focus-visible:before:ring-focus-offset',
|
|
2347
2444
|
// invalid - The border is 1 px thicker when invalid. We don't actually want to change the border width, as that causes the element's size to change
|
|
2348
2445
|
// so we use an inner outline to artifically pad the border
|
|
2349
|
-
'data-invalid:data-selected:before:bg-red! data-invalid:before:border-red data-invalid:before:outline-red data-invalid:before:outline
|
|
2446
|
+
'data-invalid:data-selected:before:bg-red! data-invalid:before:border-red data-invalid:before:outline-red data-invalid:before:outline-3 data-invalid:before:outline-offset-[-3px] data-invalid:before:outline-solid'
|
|
2350
2447
|
]);
|
|
2351
2448
|
function Radio(props) {
|
|
2352
2449
|
const { children, className, description, ...restProps } = props;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"description": "Grunnmuren components in React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,24 +18,19 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@obosbbl/grunnmuren-icons-react": "^2.1.2",
|
|
22
|
-
"@react-aria/form": "^3.0.18",
|
|
23
|
-
"@react-aria/interactions": "^3.25.3",
|
|
24
|
-
"@react-aria/utils": "^3.29.1",
|
|
25
|
-
"@react-stately/form": "^3.1.5",
|
|
26
|
-
"@react-stately/utils": "^3.10.7",
|
|
27
21
|
"cva": "^1.0.0-0",
|
|
28
22
|
"embla-carousel-autoplay": "^8.6.0",
|
|
29
23
|
"embla-carousel-react": "^8.6.0",
|
|
30
24
|
"embla-carousel-wheel-gestures": "^8.1.0",
|
|
31
|
-
"react-aria": "^3.
|
|
32
|
-
"react-aria-components": "^1.
|
|
33
|
-
"react-stately": "^3.
|
|
34
|
-
"use-debounce": "^10.0.4"
|
|
25
|
+
"react-aria": "^3.48.0",
|
|
26
|
+
"react-aria-components": "^1.17.0",
|
|
27
|
+
"react-stately": "^3.46.0",
|
|
28
|
+
"use-debounce": "^10.0.4",
|
|
29
|
+
"@obosbbl/grunnmuren-icons-react": "^2.2.0"
|
|
35
30
|
},
|
|
36
31
|
"devDependencies": {
|
|
37
32
|
"@types/node": "^24.0.0",
|
|
38
|
-
"tailwindcss": "4.2.
|
|
33
|
+
"tailwindcss": "4.2.2"
|
|
39
34
|
},
|
|
40
35
|
"peerDependencies": {
|
|
41
36
|
"react": "^19"
|