@obosbbl/grunnmuren-react 2.0.0-canary.31 → 2.0.0-canary.33
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/index.d.mts +54 -70
- package/dist/index.mjs +55 -55
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, ListBoxItemProps, ComboBoxProps, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, SelectProps as SelectProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, ContextValue, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1
|
|
1
|
+
import { ButtonProps as ButtonProps$1, Link, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, ListBoxItemProps, ComboBoxProps, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, SelectProps as SelectProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, ContextValue, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1 } from 'react-aria-components';
|
|
2
2
|
export { ListBoxItemProps as ComboboxItemProps, Form, ListBoxItemProps as SelectItemProps } from 'react-aria-components';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
@@ -73,9 +73,9 @@ declare const buttonVariants: (props?: ({
|
|
|
73
73
|
} | null | undefined)[] | {
|
|
74
74
|
[x: string]: any;
|
|
75
75
|
} | null | undefined;
|
|
76
|
-
className?:
|
|
76
|
+
className?: never;
|
|
77
77
|
} | {
|
|
78
|
-
class?:
|
|
78
|
+
class?: never;
|
|
79
79
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
80
80
|
[x: string]: any;
|
|
81
81
|
} | null | undefined)[] | {
|
|
@@ -102,21 +102,16 @@ declare const buttonVariants: (props?: ({
|
|
|
102
102
|
[x: string]: any;
|
|
103
103
|
} | null | undefined;
|
|
104
104
|
})) | undefined) => string;
|
|
105
|
-
type ButtonOrLinkProps =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
href: string;
|
|
109
|
-
});
|
|
110
|
-
type ButtonProps = VariantProps<typeof buttonVariants> & {
|
|
111
|
-
className?: string;
|
|
112
|
-
children: React.ReactNode;
|
|
105
|
+
type ButtonOrLinkProps$1 = VariantProps<typeof buttonVariants> & {
|
|
106
|
+
children?: React.ReactNode;
|
|
107
|
+
href?: string;
|
|
113
108
|
/**
|
|
114
109
|
* Display the button in a loading state
|
|
115
110
|
* @default false
|
|
116
111
|
*/
|
|
117
112
|
isLoading?: boolean;
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
};
|
|
114
|
+
type ButtonProps = (ButtonProps$1 | React.ComponentPropsWithoutRef<typeof Link>) & ButtonOrLinkProps$1;
|
|
120
115
|
declare const _Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
121
116
|
|
|
122
117
|
type CheckboxProps = {
|
|
@@ -133,13 +128,13 @@ type CheckboxProps = {
|
|
|
133
128
|
declare const _Checkbox: react.ForwardRefExoticComponent<{
|
|
134
129
|
children: React.ReactNode;
|
|
135
130
|
/** Additional CSS className for the element. */
|
|
136
|
-
className?: string
|
|
131
|
+
className?: string;
|
|
137
132
|
/** Help text for the form control. */
|
|
138
133
|
description?: React.ReactNode;
|
|
139
134
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
140
135
|
errorMessage?: React.ReactNode;
|
|
141
136
|
/** Additional style properties for the element. */
|
|
142
|
-
style?:
|
|
137
|
+
style?: React.CSSProperties;
|
|
143
138
|
} & Omit<CheckboxProps$1, "children" | "style" | "isDisabled" | "isIndeterminate" | "isReadOnly"> & react.RefAttributes<HTMLLabelElement>>;
|
|
144
139
|
|
|
145
140
|
type CheckboxGroupProps = {
|
|
@@ -158,7 +153,7 @@ type CheckboxGroupProps = {
|
|
|
158
153
|
declare const _CheckboxGroup: react.ForwardRefExoticComponent<{
|
|
159
154
|
children: React.ReactNode;
|
|
160
155
|
/** Additional CSS className for the element. */
|
|
161
|
-
className?: string
|
|
156
|
+
className?: string;
|
|
162
157
|
/** Help text for the form control. */
|
|
163
158
|
description?: React.ReactNode;
|
|
164
159
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -166,7 +161,7 @@ declare const _CheckboxGroup: react.ForwardRefExoticComponent<{
|
|
|
166
161
|
/** Label for the form control. */
|
|
167
162
|
label?: React.ReactNode;
|
|
168
163
|
/** Additional style properties for the element. */
|
|
169
|
-
style?:
|
|
164
|
+
style?: React.CSSProperties;
|
|
170
165
|
} & Omit<CheckboxGroupProps$1, "children" | "className" | "style" | "isDisabled" | "isReadOnly" | "orientation"> & react.RefAttributes<HTMLDivElement>>;
|
|
171
166
|
|
|
172
167
|
declare const ListBoxItem: (props: ListBoxItemProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -194,7 +189,7 @@ type ComboboxProps<T extends object> = {
|
|
|
194
189
|
declare const _Combobox: react.ForwardRefExoticComponent<{
|
|
195
190
|
children: React.ReactNode;
|
|
196
191
|
/** Additional CSS className for the element. */
|
|
197
|
-
className?: string
|
|
192
|
+
className?: string;
|
|
198
193
|
/** Help text for the form control. */
|
|
199
194
|
description?: React.ReactNode;
|
|
200
195
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -203,13 +198,13 @@ declare const _Combobox: react.ForwardRefExoticComponent<{
|
|
|
203
198
|
* Display the dropdown button trigger in a loading state
|
|
204
199
|
* @default false
|
|
205
200
|
*/
|
|
206
|
-
isLoading?: boolean
|
|
201
|
+
isLoading?: boolean;
|
|
207
202
|
/** Label for the form control. */
|
|
208
203
|
label?: React.ReactNode;
|
|
209
204
|
/** Placeholder text. Only visible when the input value is empty. */
|
|
210
|
-
placeholder?: string
|
|
205
|
+
placeholder?: string;
|
|
211
206
|
/** Additional style properties for the element. */
|
|
212
|
-
style?:
|
|
207
|
+
style?: React.CSSProperties;
|
|
213
208
|
} & Omit<ComboBoxProps<object>, "children" | "className" | "style" | "isDisabled" | "isReadOnly"> & react.RefAttributes<HTMLInputElement>>;
|
|
214
209
|
|
|
215
210
|
type RadioGroupProps = {
|
|
@@ -228,7 +223,7 @@ type RadioGroupProps = {
|
|
|
228
223
|
declare const _RadioGroup: react.ForwardRefExoticComponent<{
|
|
229
224
|
children: React.ReactNode;
|
|
230
225
|
/** Additional CSS className for the element. */
|
|
231
|
-
className?: string
|
|
226
|
+
className?: string;
|
|
232
227
|
/** Help text for the form control. */
|
|
233
228
|
description?: React.ReactNode;
|
|
234
229
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -236,7 +231,7 @@ declare const _RadioGroup: react.ForwardRefExoticComponent<{
|
|
|
236
231
|
/** Label for the form control. */
|
|
237
232
|
label?: React.ReactNode;
|
|
238
233
|
/** Additional style properties for the element. */
|
|
239
|
-
style?:
|
|
234
|
+
style?: React.CSSProperties;
|
|
240
235
|
} & Omit<RadioGroupProps$1, "children" | "className" | "style" | "isDisabled" | "isReadOnly" | "orientation"> & react.RefAttributes<HTMLDivElement>>;
|
|
241
236
|
|
|
242
237
|
type RadioProps = {
|
|
@@ -251,11 +246,11 @@ type RadioProps = {
|
|
|
251
246
|
declare const _Radio: react.ForwardRefExoticComponent<{
|
|
252
247
|
children: React.ReactNode;
|
|
253
248
|
/** Additional CSS className for the element. */
|
|
254
|
-
className?: string
|
|
249
|
+
className?: string;
|
|
255
250
|
/** Help text for the form control. */
|
|
256
251
|
description?: React.ReactNode;
|
|
257
252
|
/** Additional style properties for the element. */
|
|
258
|
-
style?:
|
|
253
|
+
style?: React.CSSProperties;
|
|
259
254
|
} & Omit<RadioProps$1, "children" | "style" | "isDisabled"> & react.RefAttributes<HTMLLabelElement>>;
|
|
260
255
|
|
|
261
256
|
type SelectProps<T extends object> = {
|
|
@@ -276,7 +271,7 @@ type SelectProps<T extends object> = {
|
|
|
276
271
|
declare const _Select: react.ForwardRefExoticComponent<{
|
|
277
272
|
children: React.ReactNode;
|
|
278
273
|
/** Additional CSS className for the element. */
|
|
279
|
-
className?: string
|
|
274
|
+
className?: string;
|
|
280
275
|
/** Help text for the form control. */
|
|
281
276
|
description?: React.ReactNode;
|
|
282
277
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -284,9 +279,9 @@ declare const _Select: react.ForwardRefExoticComponent<{
|
|
|
284
279
|
/** Label for the form control. */
|
|
285
280
|
label?: React.ReactNode;
|
|
286
281
|
/** Placeholder text. Only visible when the input value is empty. */
|
|
287
|
-
placeholder?: string
|
|
282
|
+
placeholder?: string;
|
|
288
283
|
/** Additional style properties for the element. */
|
|
289
|
-
style?:
|
|
284
|
+
style?: React.CSSProperties;
|
|
290
285
|
} & Omit<SelectProps$1<object>, "children" | "className" | "style" | "isDisabled" | "isReadOnly"> & react.RefAttributes<HTMLButtonElement>>;
|
|
291
286
|
|
|
292
287
|
type TextAreaProps = {
|
|
@@ -310,7 +305,7 @@ type TextAreaProps = {
|
|
|
310
305
|
} & Omit<TextFieldProps$1, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
311
306
|
declare const _TextArea: react.ForwardRefExoticComponent<{
|
|
312
307
|
/** Additional CSS className for the element. */
|
|
313
|
-
className?: string
|
|
308
|
+
className?: string;
|
|
314
309
|
/** Help text for the form control. */
|
|
315
310
|
description?: React.ReactNode;
|
|
316
311
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -318,14 +313,14 @@ declare const _TextArea: react.ForwardRefExoticComponent<{
|
|
|
318
313
|
/** Label for the form control. */
|
|
319
314
|
label?: React.ReactNode;
|
|
320
315
|
/** Placeholder text. Only visible when the input value is empty. */
|
|
321
|
-
placeholder?: string
|
|
316
|
+
placeholder?: string;
|
|
322
317
|
/** Additional style properties for the element. */
|
|
323
|
-
style?:
|
|
318
|
+
style?: React.CSSProperties;
|
|
324
319
|
/**
|
|
325
320
|
* The number of visible text lines for the control.
|
|
326
321
|
* @default 2
|
|
327
322
|
*/
|
|
328
|
-
rows?: number
|
|
323
|
+
rows?: number;
|
|
329
324
|
} & Omit<TextFieldProps$1, "children" | "className" | "style" | "isDisabled" | "isReadOnly"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
330
325
|
|
|
331
326
|
type TextFieldProps = {
|
|
@@ -357,7 +352,7 @@ type TextFieldProps = {
|
|
|
357
352
|
} & Omit<TextFieldProps$1, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
358
353
|
declare const _TextField: react.ForwardRefExoticComponent<{
|
|
359
354
|
/** Additional CSS className for the element. */
|
|
360
|
-
className?: string
|
|
355
|
+
className?: string;
|
|
361
356
|
/** Help text for the form control. */
|
|
362
357
|
description?: React.ReactNode;
|
|
363
358
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -369,18 +364,18 @@ declare const _TextField: react.ForwardRefExoticComponent<{
|
|
|
369
364
|
/** Element to be rendered in the right side of the input. */
|
|
370
365
|
rightAddon?: React.ReactNode;
|
|
371
366
|
/** Placeholder text. Only visible when the input value is empty. */
|
|
372
|
-
placeholder?: string
|
|
367
|
+
placeholder?: string;
|
|
373
368
|
/**
|
|
374
369
|
* Text alignment of the input
|
|
375
370
|
* @default left
|
|
376
371
|
*/
|
|
377
|
-
textAlign?: "left" | "right"
|
|
372
|
+
textAlign?: "left" | "right";
|
|
378
373
|
/** Additional style properties for the element. */
|
|
379
|
-
style?:
|
|
374
|
+
style?: React.CSSProperties;
|
|
380
375
|
/** Add a divider between the left/right addons and the input, a value of 0 will be ignored */
|
|
381
|
-
withAddonDivider?: boolean
|
|
376
|
+
withAddonDivider?: boolean;
|
|
382
377
|
/** Defines the number of characters and determines the width of the input element */
|
|
383
|
-
size?: number
|
|
378
|
+
size?: number;
|
|
384
379
|
} & Omit<TextFieldProps$1, "children" | "className" | "style" | "isDisabled" | "isReadOnly"> & react.RefAttributes<HTMLInputElement>>;
|
|
385
380
|
|
|
386
381
|
type NumberFieldProps = {
|
|
@@ -416,7 +411,7 @@ type NumberFieldProps = {
|
|
|
416
411
|
} & Omit<NumberFieldProps$1, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style' | 'hideStepper'>;
|
|
417
412
|
declare const _NumberField: react.ForwardRefExoticComponent<{
|
|
418
413
|
/** Additional CSS className for the element. */
|
|
419
|
-
className?: string
|
|
414
|
+
className?: string;
|
|
420
415
|
/** Help text for the form control. */
|
|
421
416
|
description?: React.ReactNode;
|
|
422
417
|
/** Error message for the form control. Automatically sets `isInvalid` to true */
|
|
@@ -428,22 +423,22 @@ declare const _NumberField: react.ForwardRefExoticComponent<{
|
|
|
428
423
|
/** Element to be rendered in the right side of the input. */
|
|
429
424
|
rightAddon?: React.ReactNode;
|
|
430
425
|
/** Placeholder text. Only visible when the input value is empty. */
|
|
431
|
-
placeholder?: string
|
|
426
|
+
placeholder?: string;
|
|
432
427
|
/**
|
|
433
428
|
* Text alignment of the input
|
|
434
429
|
* @default left
|
|
435
430
|
*/
|
|
436
|
-
textAlign?: "left" | "right"
|
|
431
|
+
textAlign?: "left" | "right";
|
|
437
432
|
/** Additional style properties for the element. */
|
|
438
|
-
style?:
|
|
433
|
+
style?: React.CSSProperties;
|
|
439
434
|
/** Add a divider between the left/right addons and the input */
|
|
440
|
-
withAddonDivider?: boolean
|
|
435
|
+
withAddonDivider?: boolean;
|
|
441
436
|
/** Defines the number of characters and determines the width of the input element, a value of 0 will be ignored */
|
|
442
|
-
size?: number
|
|
437
|
+
size?: number;
|
|
443
438
|
/** Defines the maximum numeric value */
|
|
444
|
-
maxValue?: number
|
|
439
|
+
maxValue?: number;
|
|
445
440
|
/** Defines the minimum numeric value */
|
|
446
|
-
minValue?: number
|
|
441
|
+
minValue?: number;
|
|
447
442
|
} & Omit<NumberFieldProps$1, "children" | "className" | "style" | "isDisabled" | "isReadOnly" | "hideStepper"> & react.RefAttributes<HTMLInputElement>>;
|
|
448
443
|
|
|
449
444
|
declare const alertVariants: (props?: ({
|
|
@@ -474,9 +469,9 @@ declare const alertVariants: (props?: ({
|
|
|
474
469
|
} | null | undefined)[] | {
|
|
475
470
|
[x: string]: any;
|
|
476
471
|
} | null | undefined;
|
|
477
|
-
className?:
|
|
472
|
+
className?: never;
|
|
478
473
|
} | {
|
|
479
|
-
class?:
|
|
474
|
+
class?: never;
|
|
480
475
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
481
476
|
[x: string]: any;
|
|
482
477
|
} | null | undefined)[] | {
|
|
@@ -566,11 +561,11 @@ type BreadcrumbProps = {
|
|
|
566
561
|
} & Omit<BreadcrumbProps$1, 'className' | 'style'>;
|
|
567
562
|
declare const _Breadcrumb: react.ForwardRefExoticComponent<{
|
|
568
563
|
/** Additional CSS className for the element. */
|
|
569
|
-
className?: string
|
|
564
|
+
className?: string;
|
|
570
565
|
/** Additional style properties for the element. */
|
|
571
|
-
style?:
|
|
566
|
+
style?: React.CSSProperties;
|
|
572
567
|
/** The URL to navigate to when clicking the breadcrumb. */
|
|
573
|
-
href?: string
|
|
568
|
+
href?: string;
|
|
574
569
|
} & Omit<BreadcrumbProps$1, "className" | "style"> & react.RefAttributes<HTMLLIElement>>;
|
|
575
570
|
|
|
576
571
|
type BreadcrumbsProps = {
|
|
@@ -581,34 +576,23 @@ type BreadcrumbsProps = {
|
|
|
581
576
|
} & Omit<BreadcrumbsProps$1<BreadcrumbProps>, 'className' | 'style'>;
|
|
582
577
|
declare const _Breadcrumbs: react.ForwardRefExoticComponent<{
|
|
583
578
|
/** Additional CSS className for the element. */
|
|
584
|
-
className?: string
|
|
579
|
+
className?: string;
|
|
585
580
|
/** Additional style properties for the element. */
|
|
586
|
-
style?:
|
|
581
|
+
style?: React.CSSProperties;
|
|
587
582
|
} & Omit<BreadcrumbsProps$1<BreadcrumbProps>, "className" | "style"> & react.RefAttributes<HTMLOListElement>>;
|
|
588
583
|
|
|
589
|
-
type
|
|
584
|
+
type ButtonOrLinkProps = {
|
|
585
|
+
children?: React.ReactNode;
|
|
590
586
|
/** Additional CSS className for the element. */
|
|
591
587
|
className?: string;
|
|
592
|
-
/**
|
|
588
|
+
/** Determines whether to use an anchor or a button for the Backlink */
|
|
593
589
|
href?: string;
|
|
594
|
-
/** The content of the link */
|
|
595
|
-
children?: React.ReactNode;
|
|
596
590
|
/** To add a permanent underline on the link (not only on hover)
|
|
597
591
|
* @default false
|
|
598
592
|
*/
|
|
599
593
|
withUnderline?: boolean;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
className?: string | undefined;
|
|
604
|
-
/** The URL to navigate to when clicking the backlink. */
|
|
605
|
-
href?: string | undefined;
|
|
606
|
-
/** The content of the link */
|
|
607
|
-
children?: React.ReactNode;
|
|
608
|
-
/** To add a permanent underline on the link (not only on hover)
|
|
609
|
-
* @default false
|
|
610
|
-
*/
|
|
611
|
-
withUnderline?: boolean | undefined;
|
|
612
|
-
} & LinkProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
594
|
+
};
|
|
595
|
+
type BacklinkProps = (ButtonProps$1 | React.ComponentPropsWithoutRef<typeof Link>) & ButtonOrLinkProps;
|
|
596
|
+
declare const _Backlink: react.ForwardRefExoticComponent<BacklinkProps & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
613
597
|
|
|
614
598
|
export { _Accordion as Accordion, _AccordionItem as AccordionItem, type AccordionItemProps, type AccordionProps, Alertbox, type Props as AlertboxProps, _Backlink as Backlink, type BacklinkProps, _Breadcrumb as Breadcrumb, type BreadcrumbProps, _Breadcrumbs as Breadcrumbs, type BreadcrumbsProps, _Button as Button, type ButtonProps, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, _Combobox as Combobox, ListBoxItem as ComboboxItem, type ComboboxProps, Content, ContentContext, type ContentProps, Footer, type FooterProps, GrunnmurenProvider, type GrunnmurenProviderProps, Heading, HeadingContext, type HeadingProps, _NumberField as NumberField, type NumberFieldProps, _Radio as Radio, _RadioGroup as RadioGroup, type RadioGroupProps, type RadioProps, _Select as Select, ListBoxItem as SelectItem, type SelectProps, _TextArea as TextArea, type TextAreaProps, _TextField as TextField, type TextFieldProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { I18nProvider, RouterProvider, useContextProps, Provider, Text, CheckboxContext, Checkbox as Checkbox$1, Label as Label$1, FieldError, CheckboxGroup as CheckboxGroup$1, ListBoxItem as ListBoxItem$1, ListBox as ListBox$1, ComboBox, Group, Input,
|
|
2
|
+
import { I18nProvider, RouterProvider, useContextProps, Provider, Link, Button as Button$1, Text, CheckboxContext, Checkbox as Checkbox$1, Label as Label$1, FieldError, CheckboxGroup as CheckboxGroup$1, ListBoxItem as ListBoxItem$1, ListBox as ListBox$1, ComboBox, Group, Input, Popover, RadioGroup as RadioGroup$1, Radio as Radio$1, Select as Select$1, SelectValue, TextField as TextField$1, TextArea as TextArea$1, NumberField as NumberField$1, useLocale, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1 } from 'react-aria-components';
|
|
3
3
|
export { Form } from 'react-aria-components';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { useLayoutEffect, createContext, forwardRef, Children, useId, useState, useRef } from 'react';
|
|
@@ -156,7 +156,7 @@ const _AccordionItem = /*#__PURE__*/ forwardRef(AccordionItem);
|
|
|
156
156
|
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
157
157
|
*/ const buttonVariants = cva({
|
|
158
158
|
base: [
|
|
159
|
-
'inline-flex min-h-[44px] cursor-pointer items-center justify-center whitespace-nowrap rounded-lg font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2'
|
|
159
|
+
'inline-flex min-h-[44px] cursor-pointer items-center justify-center whitespace-nowrap rounded-lg font-medium transition-all duration-200 focus:outline-none data-[focus-visible]:ring-2 data-[focus-visible]:ring-offset-2'
|
|
160
160
|
],
|
|
161
161
|
variants: {
|
|
162
162
|
/**
|
|
@@ -234,8 +234,11 @@ const _AccordionItem = /*#__PURE__*/ forwardRef(AccordionItem);
|
|
|
234
234
|
isIconOnly: false
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
+
function isLinkProps$1(props) {
|
|
238
|
+
return !!props.href;
|
|
239
|
+
}
|
|
237
240
|
function Button(props, forwardedRef) {
|
|
238
|
-
const { children
|
|
241
|
+
const { children: _children, color, isIconOnly, isLoading, variant, style: _style, ...restProps } = props;
|
|
239
242
|
const [widthOverride, setWidthOverride] = useState();
|
|
240
243
|
const ownRef = useRef(null);
|
|
241
244
|
const ref = mergeRefs(ownRef, forwardedRef);
|
|
@@ -251,34 +254,35 @@ function Button(props, forwardedRef) {
|
|
|
251
254
|
}
|
|
252
255
|
}, [
|
|
253
256
|
isLoading,
|
|
254
|
-
|
|
257
|
+
_children
|
|
255
258
|
]);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/*#__PURE__*/ jsx(
|
|
264
|
-
"
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
259
|
+
const className = buttonVariants({
|
|
260
|
+
className: props.className,
|
|
261
|
+
color,
|
|
262
|
+
isIconOnly,
|
|
263
|
+
variant
|
|
264
|
+
});
|
|
265
|
+
const children = widthOverride ? // remove margin for icon alignment
|
|
266
|
+
/*#__PURE__*/ jsx(LoadingSpinner, {
|
|
267
|
+
className: "!m-0 mx-auto animate-spin"
|
|
268
|
+
}) : _children;
|
|
269
|
+
const style = {
|
|
270
|
+
..._style,
|
|
271
|
+
widthOverride
|
|
272
|
+
};
|
|
273
|
+
return isLinkProps$1(restProps) ? /*#__PURE__*/ jsx(Link, {
|
|
274
|
+
...restProps,
|
|
275
|
+
className: className,
|
|
276
|
+
style: style,
|
|
271
277
|
ref: ref,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
width: widthOverride
|
|
275
|
-
},
|
|
278
|
+
children: children
|
|
279
|
+
}) : /*#__PURE__*/ jsx(Button$1, {
|
|
276
280
|
...restProps,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
})
|
|
281
|
+
className: className,
|
|
282
|
+
style: style,
|
|
283
|
+
ref: ref,
|
|
284
|
+
children: children
|
|
285
|
+
});
|
|
282
286
|
}
|
|
283
287
|
const _Button = /*#__PURE__*/ forwardRef(Button);
|
|
284
288
|
|
|
@@ -286,7 +290,7 @@ const formField = cx('group flex flex-col gap-2');
|
|
|
286
290
|
const formFieldError = cx('w-fit rounded-sm bg-red-light px-2 py-1 text-sm leading-6 text-red');
|
|
287
291
|
const input = cva({
|
|
288
292
|
base: [
|
|
289
|
-
'rounded-md py-2.5 text-base font-normal leading-6 placeholder-[#727070] outline-none ring-1 ring-black',
|
|
293
|
+
'min-h-11 rounded-md py-2.5 text-base font-normal leading-6 placeholder-[#727070] outline-none ring-1 ring-black',
|
|
290
294
|
// invalid styles
|
|
291
295
|
'group-data-[invalid]:ring-2 group-data-[invalid]:ring-red',
|
|
292
296
|
// Fix invisible ring on safari: https://github.com/tailwindlabs/tailwindcss.com/issues/1135
|
|
@@ -313,9 +317,9 @@ const inputGroup = cx([
|
|
|
313
317
|
'group-data-[invalid]:ring-2 group-data-[invalid]:ring-red group-data-[invalid]:focus-within:ring'
|
|
314
318
|
]);
|
|
315
319
|
const dropdown = {
|
|
316
|
-
popover: cx(
|
|
317
|
-
|
|
318
|
-
listbox: cx('max-h-[25rem] text-sm outline-none'),
|
|
320
|
+
popover: cx('min-w-[--trigger-width] overflow-y-auto rounded-md border border-black bg-white shadow data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in data-[exiting]:fade-out'),
|
|
321
|
+
// overflow-x-hidden is needed to prevent visible vertical scrollbars from overflowing the border radius of the popover
|
|
322
|
+
listbox: cx('max-h-[25rem] overflow-x-hidden text-sm outline-none'),
|
|
319
323
|
chevronIcon: cx('text-base transition-transform duration-150 group-data-[open]:rotate-180 motion-reduce:transition-none')
|
|
320
324
|
};
|
|
321
325
|
|
|
@@ -330,7 +334,7 @@ function ErrorMessage(props) {
|
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
const defaultClasses$1 = cx([
|
|
333
|
-
'group relative left-0 inline-flex max-w-fit cursor-pointer items-start gap-4
|
|
337
|
+
'group relative left-0 -mx-2.5 inline-flex max-w-fit cursor-pointer items-start gap-4 p-2.5 leading-7'
|
|
334
338
|
]);
|
|
335
339
|
// Pulling this out into it's own component. Will probably export it in the future
|
|
336
340
|
// so it can be used in other views, outside of an input of type checkbox, like in table rows.
|
|
@@ -377,9 +381,6 @@ function Checkbox(props, ref) {
|
|
|
377
381
|
isInvalid: isInvalid,
|
|
378
382
|
ref: ref,
|
|
379
383
|
children: [
|
|
380
|
-
/*#__PURE__*/ jsx("span", {
|
|
381
|
-
className: "absolute -left-2.5 top-0 z-10 h-11 w-11"
|
|
382
|
-
}),
|
|
383
384
|
/*#__PURE__*/ jsx(CheckmarkBox, {}),
|
|
384
385
|
children
|
|
385
386
|
]
|
|
@@ -573,7 +574,7 @@ function RadioGroup(props, ref) {
|
|
|
573
574
|
const _RadioGroup = /*#__PURE__*/ forwardRef(RadioGroup);
|
|
574
575
|
|
|
575
576
|
const defaultClasses = cx([
|
|
576
|
-
'relative inline-flex max-w-fit cursor-pointer items-start gap-4 py-2 leading-7',
|
|
577
|
+
'relative -ml-2.5 inline-flex max-w-fit cursor-pointer items-start gap-4 py-2.5 pl-2.5 leading-7',
|
|
577
578
|
// the radio button itself
|
|
578
579
|
'before:flex-none before:rounded-full before:border-2 before:border-black',
|
|
579
580
|
// to vertically align the radio we need to calculate the label's height, which is equal to it's font size multiplied by the line height.
|
|
@@ -593,24 +594,19 @@ const defaultClasses = cx([
|
|
|
593
594
|
]);
|
|
594
595
|
function Radio(props, ref) {
|
|
595
596
|
const { children, className, description, ...restProps } = props;
|
|
596
|
-
return /*#__PURE__*/
|
|
597
|
+
return /*#__PURE__*/ jsx(Radio$1, {
|
|
597
598
|
...restProps,
|
|
598
599
|
className: cx(className, defaultClasses),
|
|
599
600
|
ref: ref,
|
|
600
|
-
children:
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
children: description
|
|
610
|
-
})
|
|
611
|
-
]
|
|
612
|
-
})
|
|
613
|
-
]
|
|
601
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
602
|
+
children: [
|
|
603
|
+
children,
|
|
604
|
+
description && /*#__PURE__*/ jsx(Description, {
|
|
605
|
+
className: "mt-2 block",
|
|
606
|
+
children: description
|
|
607
|
+
})
|
|
608
|
+
]
|
|
609
|
+
})
|
|
614
610
|
});
|
|
615
611
|
}
|
|
616
612
|
const _Radio = /*#__PURE__*/ forwardRef(Radio);
|
|
@@ -962,13 +958,17 @@ function Breadcrumb(props, ref) {
|
|
|
962
958
|
}
|
|
963
959
|
const _Breadcrumb = /*#__PURE__*/ forwardRef(Breadcrumb);
|
|
964
960
|
|
|
961
|
+
function isLinkProps(props) {
|
|
962
|
+
return !!props.href;
|
|
963
|
+
}
|
|
965
964
|
function Backlink(props, ref) {
|
|
966
|
-
const { className, children,
|
|
967
|
-
|
|
965
|
+
const { className, children, withUnderline, ...restProps } = props;
|
|
966
|
+
const Component = isLinkProps(props) ? Link : Button$1;
|
|
967
|
+
return /*#__PURE__*/ jsxs(Component, {
|
|
968
968
|
className: cx(className, 'group flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 no-underline focus:outline-none data-[focus-visible]:ring data-[focus-visible]:ring-black'),
|
|
969
969
|
...restProps,
|
|
970
|
+
// @ts-expect-error ignore the type of the ref here
|
|
970
971
|
ref: ref,
|
|
971
|
-
href: href,
|
|
972
972
|
children: [
|
|
973
973
|
/*#__PURE__*/ jsx(ChevronLeft, {
|
|
974
974
|
className: cx('-ml-[0.5em] flex-shrink-0 transition-transform duration-300 group-hover:-translate-x-1')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "2.0.0-canary.
|
|
3
|
+
"version": "2.0.0-canary.33",
|
|
4
4
|
"description": "Grunnmuren components in React",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/code-obos/grunnmuren"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@obosbbl/grunnmuren-icons-react": "^2.0.0-canary.1",
|
|
22
|
-
"@react-aria/utils": "^3.
|
|
22
|
+
"@react-aria/utils": "^3.25.1",
|
|
23
23
|
"@types/node": "^20.11.19",
|
|
24
24
|
"cva": "1.0.0-beta.1",
|
|
25
|
-
"react-aria-components": "^1.
|
|
25
|
+
"react-aria-components": "^1.3.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^18"
|