@obosbbl/grunnmuren-react 2.0.0-canary.10 → 2.0.0-canary.11
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 +4 -4
- package/dist/index.mjs +29 -48
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1,
|
|
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 } from 'react-aria-components';
|
|
2
2
|
export { ListBoxItemProps as ComboboxItemProps, Form, I18nProvider, ListBoxItemProps as SelectItemProps } from 'react-aria-components';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { VariantProps } from 'cva';
|
|
@@ -133,6 +133,8 @@ declare const _CheckboxGroup: react.ForwardRefExoticComponent<{
|
|
|
133
133
|
style?: react.CSSProperties | undefined;
|
|
134
134
|
} & Omit<CheckboxGroupProps$1, "className" | "style" | "children" | "isDisabled" | "isReadOnly" | "orientation"> & react.RefAttributes<HTMLDivElement>>;
|
|
135
135
|
|
|
136
|
+
declare const ListBoxItem: (props: ListBoxItemProps) => react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
136
138
|
type ComboboxProps<T extends object> = {
|
|
137
139
|
children: React.ReactNode;
|
|
138
140
|
/** Additional CSS className for the element. */
|
|
@@ -153,7 +155,6 @@ type ComboboxProps<T extends object> = {
|
|
|
153
155
|
/** Additional style properties for the element. */
|
|
154
156
|
style?: React.CSSProperties;
|
|
155
157
|
} & Omit<ComboBoxProps<T>, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
156
|
-
declare const ComboboxItem: (props: ListBoxItemProps) => react_jsx_runtime.JSX.Element;
|
|
157
158
|
declare const _Combobox: react.ForwardRefExoticComponent<{
|
|
158
159
|
children: React.ReactNode;
|
|
159
160
|
/** Additional CSS className for the element. */
|
|
@@ -236,7 +237,6 @@ type SelectProps<T extends object> = {
|
|
|
236
237
|
/** Additional style properties for the element. */
|
|
237
238
|
style?: React.CSSProperties;
|
|
238
239
|
} & Omit<SelectProps$1<T>, 'className' | 'isReadOnly' | 'isDisabled' | 'children' | 'style'>;
|
|
239
|
-
declare const SelectItem: (props: ListBoxItemProps) => react_jsx_runtime.JSX.Element;
|
|
240
240
|
declare const _Select: react.ForwardRefExoticComponent<{
|
|
241
241
|
children: React.ReactNode;
|
|
242
242
|
/** Additional CSS className for the element. */
|
|
@@ -394,4 +394,4 @@ declare const _NumberField: react.ForwardRefExoticComponent<{
|
|
|
394
394
|
withAddonDivider?: boolean | undefined;
|
|
395
395
|
} & Omit<NumberFieldProps$1, "className" | "style" | "children" | "isDisabled" | "isReadOnly" | "hideStepper"> & react.RefAttributes<HTMLInputElement>>;
|
|
396
396
|
|
|
397
|
-
export { _Button as Button, type ButtonProps, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, _Combobox as Combobox, ComboboxItem, type ComboboxProps, _NumberField as NumberField, type NumberFieldProps, _Radio as Radio, _RadioGroup as RadioGroup, type RadioGroupProps, type RadioProps, _Select as Select, SelectItem, type SelectProps, _TextArea as TextArea, type TextAreaProps, _TextField as TextField, type TextFieldProps };
|
|
397
|
+
export { _Button as Button, type ButtonProps, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, _Combobox as Combobox, ListBoxItem as ComboboxItem, type ComboboxProps, _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,4 +1,4 @@
|
|
|
1
|
-
import { Text, CheckboxContext, Checkbox as Checkbox$1, Label as Label$1, CheckboxGroup as CheckboxGroup$1, FieldError, ListBoxItem, ComboBox, Group, Input, Button, Popover,
|
|
1
|
+
import { Text, CheckboxContext, Checkbox as Checkbox$1, Label as Label$1, CheckboxGroup as CheckboxGroup$1, FieldError, ListBoxItem as ListBoxItem$1, ListBox as ListBox$1, ComboBox, Group, Input, Button, 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 } from 'react-aria-components';
|
|
2
2
|
export { Form, I18nProvider } from 'react-aria-components';
|
|
3
3
|
export { _ as Button } from './Button-client-XmGlKEk4.js';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -175,6 +175,33 @@ const _CheckboxGroup = /*#__PURE__*/ forwardRef(CheckboxGroup);
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
const ListBox = ({ className, ...restProps })=>/*#__PURE__*/ jsx(ListBox$1, {
|
|
179
|
+
...restProps,
|
|
180
|
+
className: cx(dropdown.listbox, className)
|
|
181
|
+
});
|
|
182
|
+
const ListBoxItem = (props)=>{
|
|
183
|
+
let textValue = props.textValue;
|
|
184
|
+
// When the ListBoxItem child isn't a string we have to set textValue for keyboard completion to work.
|
|
185
|
+
// Since we use a render function (to handle the selected state) the child is never a string.
|
|
186
|
+
// This condition adds back that behaviour
|
|
187
|
+
if (textValue == null && typeof props.children === 'string') {
|
|
188
|
+
textValue = props.children;
|
|
189
|
+
}
|
|
190
|
+
return /*#__PURE__*/ jsx(ListBoxItem$1, {
|
|
191
|
+
...props,
|
|
192
|
+
className: cx(props.className, 'flex cursor-pointer px-6 py-3 leading-6 outline-none data-[focused]:bg-sky-lightest'),
|
|
193
|
+
textValue: textValue,
|
|
194
|
+
children: ({ isSelected })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
195
|
+
children: [
|
|
196
|
+
isSelected && /*#__PURE__*/ jsx(Check, {
|
|
197
|
+
className: "-ml-6 text-base"
|
|
198
|
+
}),
|
|
199
|
+
props.children
|
|
200
|
+
]
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
|
|
178
205
|
function Combobox(props, ref) {
|
|
179
206
|
const { className, children, description, errorMessage, isLoading, label, isInvalid: _isInvalid, ...restProps } = props;
|
|
180
207
|
const isInvalid = _isInvalid || errorMessage != null;
|
|
@@ -218,35 +245,12 @@ function Combobox(props, ref) {
|
|
|
218
245
|
className: cx(dropdown.popover, 'min-w-[calc(var(--trigger-width)+26px)]'),
|
|
219
246
|
crossOffset: -13,
|
|
220
247
|
children: /*#__PURE__*/ jsx(ListBox, {
|
|
221
|
-
className: dropdown.listbox,
|
|
222
248
|
children: children
|
|
223
249
|
})
|
|
224
250
|
})
|
|
225
251
|
]
|
|
226
252
|
});
|
|
227
253
|
}
|
|
228
|
-
const ComboboxItem = (props)=>{
|
|
229
|
-
let textValue = props.textValue;
|
|
230
|
-
// When the ListBoxItem child isn't a string we have to set textValue for keyboard completion to work.
|
|
231
|
-
// Since we use a render function (to handle the selected state) the child is never a string.
|
|
232
|
-
// This condition adds back that behaviour
|
|
233
|
-
if (textValue == null && typeof props.children === 'string') {
|
|
234
|
-
textValue = props.children;
|
|
235
|
-
}
|
|
236
|
-
return /*#__PURE__*/ jsx(ListBoxItem, {
|
|
237
|
-
...props,
|
|
238
|
-
className: cx(props.className, 'flex cursor-default px-6 py-2 leading-6 outline-none data-[focused]:bg-sky-lightest'),
|
|
239
|
-
textValue: textValue,
|
|
240
|
-
children: ({ isSelected })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
241
|
-
children: [
|
|
242
|
-
isSelected && /*#__PURE__*/ jsx(Check, {
|
|
243
|
-
className: "-ml-6 text-base"
|
|
244
|
-
}),
|
|
245
|
-
props.children
|
|
246
|
-
]
|
|
247
|
-
})
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
254
|
const _Combobox = /*#__PURE__*/ forwardRef(Combobox);
|
|
251
255
|
|
|
252
256
|
function RadioGroup(props, ref) {
|
|
@@ -353,35 +357,12 @@ function Select(props, ref) {
|
|
|
353
357
|
/*#__PURE__*/ jsx(Popover, {
|
|
354
358
|
className: dropdown.popover,
|
|
355
359
|
children: /*#__PURE__*/ jsx(ListBox, {
|
|
356
|
-
className: dropdown.listbox,
|
|
357
360
|
children: children
|
|
358
361
|
})
|
|
359
362
|
})
|
|
360
363
|
]
|
|
361
364
|
});
|
|
362
365
|
}
|
|
363
|
-
const SelectItem = (props)=>{
|
|
364
|
-
let textValue = props.textValue;
|
|
365
|
-
// When the ListBoxItem child isn't a string we have to set textValue for keyboard completion to work.
|
|
366
|
-
// Since we use a render function (to handle the selected state) the child is never a string.
|
|
367
|
-
// This condition adds back that behaviour
|
|
368
|
-
if (textValue == null && typeof props.children === 'string') {
|
|
369
|
-
textValue = props.children;
|
|
370
|
-
}
|
|
371
|
-
return /*#__PURE__*/ jsx(ListBoxItem, {
|
|
372
|
-
...props,
|
|
373
|
-
className: cx(props.className, 'flex cursor-default px-6 py-2 leading-6 outline-none data-[focused]:bg-sky-lightest'),
|
|
374
|
-
textValue: textValue,
|
|
375
|
-
children: ({ isSelected })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
376
|
-
children: [
|
|
377
|
-
isSelected && /*#__PURE__*/ jsx(Check, {
|
|
378
|
-
className: "-ml-6 text-base"
|
|
379
|
-
}),
|
|
380
|
-
props.children
|
|
381
|
-
]
|
|
382
|
-
})
|
|
383
|
-
});
|
|
384
|
-
};
|
|
385
366
|
const _Select = /*#__PURE__*/ forwardRef(Select);
|
|
386
367
|
|
|
387
368
|
function TextArea(props, ref) {
|
|
@@ -534,4 +515,4 @@ function Divider({ className }) {
|
|
|
534
515
|
}
|
|
535
516
|
const _NumberField = /*#__PURE__*/ forwardRef(NumberField);
|
|
536
517
|
|
|
537
|
-
export { _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, _Combobox as Combobox, ComboboxItem, _NumberField as NumberField, _Radio as Radio, _RadioGroup as RadioGroup, _Select as Select, SelectItem, _TextArea as TextArea, _TextField as TextField };
|
|
518
|
+
export { _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, _Combobox as Combobox, ListBoxItem as ComboboxItem, _NumberField as NumberField, _Radio as Radio, _RadioGroup as RadioGroup, _Select as Select, ListBoxItem as SelectItem, _TextArea as TextArea, _TextField as TextField };
|