@vygruppen/spor-react 12.22.2 → 12.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-postinstall.log +2 -2
- package/CHANGELOG.md +21 -0
- package/dist/index.cjs +151 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.mjs +151 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/input/CountryCodeSelect.tsx +1 -0
- package/src/input/Input.tsx +5 -1
- package/src/input/Textarea.tsx +12 -20
- package/src/table/Table.tsx +156 -16
- package/src/table/index.tsx +0 -6
- package/src/table/sort-utils.ts +51 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, PropsWithChildren, ComponentProps } from 'react';
|
|
3
3
|
import * as _chakra_ui_react from '@chakra-ui/react';
|
|
4
|
-
import { Accordion as Accordion$1, Alert as Alert$1, ConditionalValue, Breadcrumb as Breadcrumb$1, RecipeVariantProps, ButtonProps as ButtonProps$1, GroupProps, Clipboard as Clipboard$1, IconButtonProps as IconButtonProps$1, BoxProps, RadioCard as RadioCard$1, SeparatorProps, Field as Field$1, PopoverRootProps, Dialog, Drawer as Drawer$1, ComboboxRootProps, Combobox as Combobox$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCardRootProps, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, ListRootProps, NativeSelectFieldProps, NativeSelect as NativeSelect$1, RadioGroup as RadioGroup$1, SelectRootProps, SelectLabelProps, Select as Select$1, CollectionItem, Switch as Switch$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, List as List$1, UseProgressProps, SkeletonProps as SkeletonProps$1, CircleProps, Popover as Popover$1, Pagination as Pagination$1, ChakraProviderProps, SystemContext, TabsRootProps, Tabs as Tabs$1, TableRootProps, Table as Table$1, Tooltip as Tooltip$1, BadgeProps as BadgeProps$1, CodeProps, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
|
|
5
|
-
export { AspectRatio, Box, BoxProps, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, CenterProps, ClientOnly, Collapsible, CollapsibleRootProps, Container, ContainerProps, Em, Flex, FlexProps, For, FormatByte, FormatNumber, Grid, GridItem, GridItemProps, GridProps, HStack, Icon, Image, ImageProps, Kbd, LocaleProvider, Portal, PortalProps, Show, SimpleGrid, SimpleGridProps, Spacer, SpacerProps, Span, Stack,
|
|
4
|
+
import { Accordion as Accordion$1, Alert as Alert$1, ConditionalValue, Breadcrumb as Breadcrumb$1, RecipeVariantProps, ButtonProps as ButtonProps$1, GroupProps, Clipboard as Clipboard$1, IconButtonProps as IconButtonProps$1, BoxProps, RadioCard as RadioCard$1, SeparatorProps, Field as Field$1, PopoverRootProps, Dialog, Drawer as Drawer$1, ComboboxRootProps, Combobox as Combobox$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCardRootProps, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, ListRootProps, NativeSelectFieldProps, NativeSelect as NativeSelect$1, RadioGroup as RadioGroup$1, SelectRootProps, SelectLabelProps, Select as Select$1, CollectionItem, Switch as Switch$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, List as List$1, UseProgressProps, SkeletonProps as SkeletonProps$1, CircleProps, Popover as Popover$1, Pagination as Pagination$1, ChakraProviderProps, SystemContext, TabsRootProps, Tabs as Tabs$1, TableRootProps, Table as Table$1, TableColumnHeaderProps as TableColumnHeaderProps$1, TableRowProps as TableRowProps$1, TableBodyProps as TableBodyProps$1, Tooltip as Tooltip$1, BadgeProps as BadgeProps$1, CodeProps, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
|
|
5
|
+
export { AspectRatio, Box, BoxProps, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, CenterProps, ClientOnly, Collapsible, CollapsibleRootProps, Container, ContainerProps, Em, Flex, FlexProps, For, FormatByte, FormatNumber, Grid, GridItem, GridItemProps, GridProps, HStack, Icon, Image, ImageProps, Kbd, LocaleProvider, Portal, PortalProps, Show, SimpleGrid, SimpleGridProps, Spacer, SpacerProps, Span, Stack, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableColumn, TableColumnGroup, TableColumnProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableRoot, TableRootProps, UseDisclosureProps, VStack, VisuallyHidden, Wrap, createIcon, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, chakra as spor, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useRecipe, useSlotRecipe, useToken } from '@chakra-ui/react';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { IconComponent } from '@vygruppen/spor-icon-react';
|
|
8
8
|
import { CalendarDate, DateDuration, DateValue as DateValue$1 } from '@internationalized/date';
|
|
@@ -3577,10 +3577,23 @@ declare const tableSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "b
|
|
|
3577
3577
|
};
|
|
3578
3578
|
}>;
|
|
3579
3579
|
|
|
3580
|
+
type SortDirection = "asc" | "desc";
|
|
3581
|
+
type SortState = {
|
|
3582
|
+
key: string | null;
|
|
3583
|
+
direction: SortDirection;
|
|
3584
|
+
columnIndex: number | null;
|
|
3585
|
+
};
|
|
3586
|
+
|
|
3580
3587
|
type TableVariantProps = RecipeVariantProps<typeof tableSlotRecipe>;
|
|
3588
|
+
declare const useTableSort: () => {
|
|
3589
|
+
enabled: boolean;
|
|
3590
|
+
sortState: SortState;
|
|
3591
|
+
onSort: (key: string, columnIndex: number) => void;
|
|
3592
|
+
};
|
|
3581
3593
|
type TableProps = Exclude<TableRootProps, "variant" | "colorPalette"> & PropsWithChildren<TableVariantProps> & {
|
|
3582
3594
|
variant?: "ghost" | "core";
|
|
3583
3595
|
colorPalette?: "grey" | "green" | "white";
|
|
3596
|
+
sortable?: boolean;
|
|
3584
3597
|
};
|
|
3585
3598
|
/**
|
|
3586
3599
|
* The `Table` component has support for two different variants - `ghost` and `core`. The `ghost` variant has basic lines between rows, while the `core` variant has borders for each cell.
|
|
@@ -3607,7 +3620,14 @@ declare const Table: React$1.ForwardRefExoticComponent<Table$1.RootProps & {
|
|
|
3607
3620
|
} & {
|
|
3608
3621
|
variant?: "ghost" | "core";
|
|
3609
3622
|
colorPalette?: "grey" | "green" | "white";
|
|
3623
|
+
sortable?: boolean;
|
|
3610
3624
|
} & React$1.RefAttributes<HTMLTableElement>>;
|
|
3625
|
+
type TableColumnHeaderProps = TableColumnHeaderProps$1;
|
|
3626
|
+
declare const TableColumnHeader: React$1.ForwardRefExoticComponent<Table$1.ColumnHeaderProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
3627
|
+
type TableRowProps = TableRowProps$1;
|
|
3628
|
+
declare const TableRow: React$1.ForwardRefExoticComponent<Table$1.RowProps & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
3629
|
+
type TableBodyProps = TableBodyProps$1;
|
|
3630
|
+
declare const TableBody: React$1.ForwardRefExoticComponent<Table$1.BodyProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
3611
3631
|
|
|
3612
3632
|
declare const themes: {
|
|
3613
3633
|
VyDigital: _chakra_ui_react.SystemContext;
|
|
@@ -3723,4 +3743,4 @@ declare const Text: React$1.ForwardRefExoticComponent<Omit<TextProps$1, "textSty
|
|
|
3723
3743
|
**/
|
|
3724
3744
|
declare function slugify(text: string | string[], maxLength?: number): string;
|
|
3725
3745
|
|
|
3726
|
-
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, type AlertProps, AttachedInputs, type AttachedInputsProps, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, type BadgeProps, Brand, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariantProps, Calendar, CalendarCell, CalendarGrid, CalendarHeader, type CalendarMode, CalendarProvider, type CalendarValue, CardSelect, CardSelectContent, CardSelectTrigger, type CardSelectTriggerProps, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, ChoiceChip, type ChoiceChipProps, Clipboard, ClipboardButton, CloseButton, type CloseButtonProps, CloseDrawerLine, Code, ColorInlineLoader, type ColorInlineLoaderProps, type ColorMode, ColorModeButton, ColorModeIcon, ColorModeProvider, type ColorModeProviderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, type DatePickerVariantProps, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field, type FieldBaseProps, FieldErrorText, FieldLabel, type FieldProps, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, type GroupVariantProps, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoTag, type InfoTagProps, Input, type InputProps, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, type LinkProps, List, ListBox, ListIndicator, ListItem, type MediaControllerVariantProps, NativeSelect, type NativeSelectdProps, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, type NudgeProps, NudgeTrigger, NudgeWizardStep, NumericStepper, type NumericStepperProps, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, type PasswordInputProps, type PasswordVisibilityProps, PhoneNumberInput, PlayPauseButton, Popover, PopoverContent, type PopoverProps, PopoverTrigger, PressableCard, ProgressBar, type ProgressBarProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorVariantProps, ProgressLoader, type ProgressLoaderProps, type ProgressLoaderVariantProps, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, type RadioProps, RangeCalendar, ScrollCalendar, SearchInput, type SearchInputProps, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, type SelectProps, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, StaticCard, type StaticCardProps, Stepper, StepperStep, type StepperVariantProps, SvgBox, Switch, type SwitchProps, Table, type TableProps, Tabs, TabsContent, TabsIndicator, TabsList, type TabsProps, TabsTrigger, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, Tooltip, TooltipContent, type TooltipProps, TooltipTrigger, type TranslationObject, type Translations, TravelTag, type TravelTagProps, type UseColorModeReturn, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTranslation };
|
|
3746
|
+
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, type AlertProps, AttachedInputs, type AttachedInputsProps, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, type BadgeProps, Brand, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariantProps, Calendar, CalendarCell, CalendarGrid, CalendarHeader, type CalendarMode, CalendarProvider, type CalendarValue, CardSelect, CardSelectContent, CardSelectTrigger, type CardSelectTriggerProps, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, ChoiceChip, type ChoiceChipProps, Clipboard, ClipboardButton, CloseButton, type CloseButtonProps, CloseDrawerLine, Code, ColorInlineLoader, type ColorInlineLoaderProps, type ColorMode, ColorModeButton, ColorModeIcon, ColorModeProvider, type ColorModeProviderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, type DatePickerVariantProps, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field, type FieldBaseProps, FieldErrorText, FieldLabel, type FieldProps, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, type GroupVariantProps, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoTag, type InfoTagProps, Input, type InputProps, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, type LinkProps, List, ListBox, ListIndicator, ListItem, type MediaControllerVariantProps, NativeSelect, type NativeSelectdProps, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, type NudgeProps, NudgeTrigger, NudgeWizardStep, NumericStepper, type NumericStepperProps, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, type PasswordInputProps, type PasswordVisibilityProps, PhoneNumberInput, PlayPauseButton, Popover, PopoverContent, type PopoverProps, PopoverTrigger, PressableCard, ProgressBar, type ProgressBarProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorVariantProps, ProgressLoader, type ProgressLoaderProps, type ProgressLoaderVariantProps, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, type RadioProps, RangeCalendar, ScrollCalendar, SearchInput, type SearchInputProps, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, type SelectProps, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, StaticCard, type StaticCardProps, Stepper, StepperStep, type StepperVariantProps, SvgBox, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableColumnHeader, type TableColumnHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsIndicator, TabsList, type TabsProps, TabsTrigger, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, Tooltip, TooltipContent, type TooltipProps, TooltipTrigger, type TranslationObject, type Translations, TravelTag, type TravelTagProps, type UseColorModeReturn, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTableSort, useTranslation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, PropsWithChildren, ComponentProps } from 'react';
|
|
3
3
|
import * as _chakra_ui_react from '@chakra-ui/react';
|
|
4
|
-
import { Accordion as Accordion$1, Alert as Alert$1, ConditionalValue, Breadcrumb as Breadcrumb$1, RecipeVariantProps, ButtonProps as ButtonProps$1, GroupProps, Clipboard as Clipboard$1, IconButtonProps as IconButtonProps$1, BoxProps, RadioCard as RadioCard$1, SeparatorProps, Field as Field$1, PopoverRootProps, Dialog, Drawer as Drawer$1, ComboboxRootProps, Combobox as Combobox$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCardRootProps, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, ListRootProps, NativeSelectFieldProps, NativeSelect as NativeSelect$1, RadioGroup as RadioGroup$1, SelectRootProps, SelectLabelProps, Select as Select$1, CollectionItem, Switch as Switch$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, List as List$1, UseProgressProps, SkeletonProps as SkeletonProps$1, CircleProps, Popover as Popover$1, Pagination as Pagination$1, ChakraProviderProps, SystemContext, TabsRootProps, Tabs as Tabs$1, TableRootProps, Table as Table$1, Tooltip as Tooltip$1, BadgeProps as BadgeProps$1, CodeProps, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
|
|
5
|
-
export { AspectRatio, Box, BoxProps, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, CenterProps, ClientOnly, Collapsible, CollapsibleRootProps, Container, ContainerProps, Em, Flex, FlexProps, For, FormatByte, FormatNumber, Grid, GridItem, GridItemProps, GridProps, HStack, Icon, Image, ImageProps, Kbd, LocaleProvider, Portal, PortalProps, Show, SimpleGrid, SimpleGridProps, Spacer, SpacerProps, Span, Stack,
|
|
4
|
+
import { Accordion as Accordion$1, Alert as Alert$1, ConditionalValue, Breadcrumb as Breadcrumb$1, RecipeVariantProps, ButtonProps as ButtonProps$1, GroupProps, Clipboard as Clipboard$1, IconButtonProps as IconButtonProps$1, BoxProps, RadioCard as RadioCard$1, SeparatorProps, Field as Field$1, PopoverRootProps, Dialog, Drawer as Drawer$1, ComboboxRootProps, Combobox as Combobox$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCardRootProps, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, ListRootProps, NativeSelectFieldProps, NativeSelect as NativeSelect$1, RadioGroup as RadioGroup$1, SelectRootProps, SelectLabelProps, Select as Select$1, CollectionItem, Switch as Switch$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, List as List$1, UseProgressProps, SkeletonProps as SkeletonProps$1, CircleProps, Popover as Popover$1, Pagination as Pagination$1, ChakraProviderProps, SystemContext, TabsRootProps, Tabs as Tabs$1, TableRootProps, Table as Table$1, TableColumnHeaderProps as TableColumnHeaderProps$1, TableRowProps as TableRowProps$1, TableBodyProps as TableBodyProps$1, Tooltip as Tooltip$1, BadgeProps as BadgeProps$1, CodeProps, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
|
|
5
|
+
export { AspectRatio, Box, BoxProps, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, CenterProps, ClientOnly, Collapsible, CollapsibleRootProps, Container, ContainerProps, Em, Flex, FlexProps, For, FormatByte, FormatNumber, Grid, GridItem, GridItemProps, GridProps, HStack, Icon, Image, ImageProps, Kbd, LocaleProvider, Portal, PortalProps, Show, SimpleGrid, SimpleGridProps, Spacer, SpacerProps, Span, Stack, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableColumn, TableColumnGroup, TableColumnProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableRoot, TableRootProps, UseDisclosureProps, VStack, VisuallyHidden, Wrap, createIcon, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, chakra as spor, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useRecipe, useSlotRecipe, useToken } from '@chakra-ui/react';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { IconComponent } from '@vygruppen/spor-icon-react';
|
|
8
8
|
import { CalendarDate, DateDuration, DateValue as DateValue$1 } from '@internationalized/date';
|
|
@@ -3577,10 +3577,23 @@ declare const tableSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "b
|
|
|
3577
3577
|
};
|
|
3578
3578
|
}>;
|
|
3579
3579
|
|
|
3580
|
+
type SortDirection = "asc" | "desc";
|
|
3581
|
+
type SortState = {
|
|
3582
|
+
key: string | null;
|
|
3583
|
+
direction: SortDirection;
|
|
3584
|
+
columnIndex: number | null;
|
|
3585
|
+
};
|
|
3586
|
+
|
|
3580
3587
|
type TableVariantProps = RecipeVariantProps<typeof tableSlotRecipe>;
|
|
3588
|
+
declare const useTableSort: () => {
|
|
3589
|
+
enabled: boolean;
|
|
3590
|
+
sortState: SortState;
|
|
3591
|
+
onSort: (key: string, columnIndex: number) => void;
|
|
3592
|
+
};
|
|
3581
3593
|
type TableProps = Exclude<TableRootProps, "variant" | "colorPalette"> & PropsWithChildren<TableVariantProps> & {
|
|
3582
3594
|
variant?: "ghost" | "core";
|
|
3583
3595
|
colorPalette?: "grey" | "green" | "white";
|
|
3596
|
+
sortable?: boolean;
|
|
3584
3597
|
};
|
|
3585
3598
|
/**
|
|
3586
3599
|
* The `Table` component has support for two different variants - `ghost` and `core`. The `ghost` variant has basic lines between rows, while the `core` variant has borders for each cell.
|
|
@@ -3607,7 +3620,14 @@ declare const Table: React$1.ForwardRefExoticComponent<Table$1.RootProps & {
|
|
|
3607
3620
|
} & {
|
|
3608
3621
|
variant?: "ghost" | "core";
|
|
3609
3622
|
colorPalette?: "grey" | "green" | "white";
|
|
3623
|
+
sortable?: boolean;
|
|
3610
3624
|
} & React$1.RefAttributes<HTMLTableElement>>;
|
|
3625
|
+
type TableColumnHeaderProps = TableColumnHeaderProps$1;
|
|
3626
|
+
declare const TableColumnHeader: React$1.ForwardRefExoticComponent<Table$1.ColumnHeaderProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
3627
|
+
type TableRowProps = TableRowProps$1;
|
|
3628
|
+
declare const TableRow: React$1.ForwardRefExoticComponent<Table$1.RowProps & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
3629
|
+
type TableBodyProps = TableBodyProps$1;
|
|
3630
|
+
declare const TableBody: React$1.ForwardRefExoticComponent<Table$1.BodyProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
3611
3631
|
|
|
3612
3632
|
declare const themes: {
|
|
3613
3633
|
VyDigital: _chakra_ui_react.SystemContext;
|
|
@@ -3723,4 +3743,4 @@ declare const Text: React$1.ForwardRefExoticComponent<Omit<TextProps$1, "textSty
|
|
|
3723
3743
|
**/
|
|
3724
3744
|
declare function slugify(text: string | string[], maxLength?: number): string;
|
|
3725
3745
|
|
|
3726
|
-
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, type AlertProps, AttachedInputs, type AttachedInputsProps, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, type BadgeProps, Brand, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariantProps, Calendar, CalendarCell, CalendarGrid, CalendarHeader, type CalendarMode, CalendarProvider, type CalendarValue, CardSelect, CardSelectContent, CardSelectTrigger, type CardSelectTriggerProps, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, ChoiceChip, type ChoiceChipProps, Clipboard, ClipboardButton, CloseButton, type CloseButtonProps, CloseDrawerLine, Code, ColorInlineLoader, type ColorInlineLoaderProps, type ColorMode, ColorModeButton, ColorModeIcon, ColorModeProvider, type ColorModeProviderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, type DatePickerVariantProps, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field, type FieldBaseProps, FieldErrorText, FieldLabel, type FieldProps, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, type GroupVariantProps, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoTag, type InfoTagProps, Input, type InputProps, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, type LinkProps, List, ListBox, ListIndicator, ListItem, type MediaControllerVariantProps, NativeSelect, type NativeSelectdProps, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, type NudgeProps, NudgeTrigger, NudgeWizardStep, NumericStepper, type NumericStepperProps, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, type PasswordInputProps, type PasswordVisibilityProps, PhoneNumberInput, PlayPauseButton, Popover, PopoverContent, type PopoverProps, PopoverTrigger, PressableCard, ProgressBar, type ProgressBarProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorVariantProps, ProgressLoader, type ProgressLoaderProps, type ProgressLoaderVariantProps, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, type RadioProps, RangeCalendar, ScrollCalendar, SearchInput, type SearchInputProps, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, type SelectProps, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, StaticCard, type StaticCardProps, Stepper, StepperStep, type StepperVariantProps, SvgBox, Switch, type SwitchProps, Table, type TableProps, Tabs, TabsContent, TabsIndicator, TabsList, type TabsProps, TabsTrigger, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, Tooltip, TooltipContent, type TooltipProps, TooltipTrigger, type TranslationObject, type Translations, TravelTag, type TravelTagProps, type UseColorModeReturn, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTranslation };
|
|
3746
|
+
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, type AlertProps, AttachedInputs, type AttachedInputsProps, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, type BadgeProps, Brand, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariantProps, Calendar, CalendarCell, CalendarGrid, CalendarHeader, type CalendarMode, CalendarProvider, type CalendarValue, CardSelect, CardSelectContent, CardSelectTrigger, type CardSelectTriggerProps, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, ChoiceChip, type ChoiceChipProps, Clipboard, ClipboardButton, CloseButton, type CloseButtonProps, CloseDrawerLine, Code, ColorInlineLoader, type ColorInlineLoaderProps, type ColorMode, ColorModeButton, ColorModeIcon, ColorModeProvider, type ColorModeProviderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, type DatePickerVariantProps, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field, type FieldBaseProps, FieldErrorText, FieldLabel, type FieldProps, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, type GroupVariantProps, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoTag, type InfoTagProps, Input, type InputProps, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, type LinkProps, List, ListBox, ListIndicator, ListItem, type MediaControllerVariantProps, NativeSelect, type NativeSelectdProps, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, type NudgeProps, NudgeTrigger, NudgeWizardStep, NumericStepper, type NumericStepperProps, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, type PasswordInputProps, type PasswordVisibilityProps, PhoneNumberInput, PlayPauseButton, Popover, PopoverContent, type PopoverProps, PopoverTrigger, PressableCard, ProgressBar, type ProgressBarProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorVariantProps, ProgressLoader, type ProgressLoaderProps, type ProgressLoaderVariantProps, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, type RadioProps, RangeCalendar, ScrollCalendar, SearchInput, type SearchInputProps, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, type SelectProps, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, StaticCard, type StaticCardProps, Stepper, StepperStep, type StepperVariantProps, SvgBox, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableColumnHeader, type TableColumnHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsIndicator, TabsList, type TabsProps, TabsTrigger, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, Tooltip, TooltipContent, type TooltipProps, TooltipTrigger, type TranslationObject, type Translations, TravelTag, type TravelTagProps, type UseColorModeReturn, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTableSort, useTranslation };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSlotRecipe, Accordion as Accordion$1, Stack, Box, HStack, Progress, defineRecipe, chakra, Text, useRecipe, Circle, Skeleton as Skeleton$1, Button as Button$1, Group, Badge as Badge$1, Code as Code$1, Clipboard as Clipboard$1, IconButton as IconButton$1, useDisclosure, Alert as Alert$1, Span, Flex, Breadcrumb as Breadcrumb$1, RadioCard as RadioCard$1, Separator as Separator$1, ClientOnly, Field, defineStyle, PopoverAnchor, useFieldContext, Popover as Popover$1, Portal, Dialog, createContext as createContext$1, useDialogContext, Drawer as Drawer$1, InputElement, Input as Input$1, Combobox, useComboboxContext, usePopoverContext, Checkbox as Checkbox$1, CheckboxCard, Fieldset as Fieldset$1, NativeSelect as NativeSelect$1, useControllableState, createListCollection, RadioGroup as RadioGroup$1, Select as Select$1, useSelectContext, Switch as Switch$1, Textarea as Textarea$1, Link, List as List$1, Center, PopoverCloseTrigger, Pagination as Pagination$1, usePaginationContext, createToaster, Tabs as Tabs$1, Table as Table$1, defineSemanticTokens, defineSlotRecipe, defineTokens, defineAnimationStyles, defineGlobalStyles, defineTextStyles, createSystem, defaultBaseConfig, Tooltip as Tooltip$1, VisuallyHidden as VisuallyHidden$1, defineConfig, useFilter, useListCollection, useCombobox, CheckboxGroup as CheckboxGroup$1, ListItem, ChakraProvider, Toaster as Toaster$1, Toast } from '@chakra-ui/react';
|
|
2
|
-
export { AspectRatio, Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, ClientOnly, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Icon, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack,
|
|
2
|
+
export { AspectRatio, Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, ClientOnly, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Icon, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack, TableCaption, TableCell, TableColumn, TableColumnGroup, TableFooter, TableHeader, TableRoot, VStack, VisuallyHidden, Wrap, createIcon, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, chakra as spor, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useRecipe, useSlotRecipe, useToken } from '@chakra-ui/react';
|
|
3
3
|
import * as spor_icon_react_star from '@vygruppen/spor-icon-react';
|
|
4
|
-
import { DropdownDownFill24Icon, CopyOutline18Icon, CheckmarkFill18Icon, CloseFill18Icon, CloseFill30Icon, CloseFill24Icon, InformationFill24Icon, ServiceFill24Icon, QuestionFill24Icon, ErrorOutline24Icon, ErrorFill24Icon, AltTransportFill24Icon, WarningFill24Icon, SuccessFill24Icon, DropdownDownFill18Icon, DropdownRightFill18Icon, CalendarOutline24Icon, ArrowLeftFill24Icon, ChangeDirectionOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, Forward15MediaControllerFill30Icon, Backward15MediaControllerFill30Icon, PauseMediaControllerFill24Icon, PlayMediaControllerFill24Icon, NextMediaControllerFill30Icon, PreviousMediaControllerFill30Icon, ArrowRightFill18Icon, DropdownLeftOutline18Icon, DropdownRightOutline18Icon, WalkFill30Icon, WalkFill24Icon, WalkFill18Icon, AltTransportFill30Icon, AltTransportFill18Icon, TramFill30Icon, TramFill24Icon, TramFill18Icon, SubwayFill30Icon, SubwayFill24Icon, SubwayFill18Icon, FerryFill30Icon, FerryFill24Icon, FerryFill18Icon, BusFill30Icon, BusFill24Icon, BusFill18Icon, ExpressBusFill30Icon, ExpressBusFill24Icon, ExpressBusFill18Icon, TrainFill30Icon, TrainFill24Icon, TrainFill18Icon, InformationFill18Icon, WarningFill18Icon, ErrorFill18Icon, LinkOutOutline24Icon, LinkOutOutline18Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, DropdownLeftFill18Icon } from '@vygruppen/spor-icon-react';
|
|
4
|
+
import { DropdownDownFill24Icon, CopyOutline18Icon, CheckmarkFill18Icon, CloseFill18Icon, CloseFill30Icon, CloseFill24Icon, InformationFill24Icon, ServiceFill24Icon, QuestionFill24Icon, ErrorOutline24Icon, ErrorFill24Icon, AltTransportFill24Icon, WarningFill24Icon, SuccessFill24Icon, DropdownDownFill18Icon, DropdownRightFill18Icon, CalendarOutline24Icon, ArrowLeftFill24Icon, ChangeDirectionOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, Forward15MediaControllerFill30Icon, Backward15MediaControllerFill30Icon, PauseMediaControllerFill24Icon, PlayMediaControllerFill24Icon, NextMediaControllerFill30Icon, PreviousMediaControllerFill30Icon, ArrowRightFill18Icon, DropdownLeftOutline18Icon, DropdownRightOutline18Icon, ArrowUpFill18Icon, ArrowDownFill18Icon, ChangeDirectionFill18Icon, WalkFill30Icon, WalkFill24Icon, WalkFill18Icon, AltTransportFill30Icon, AltTransportFill18Icon, TramFill30Icon, TramFill24Icon, TramFill18Icon, SubwayFill30Icon, SubwayFill24Icon, SubwayFill18Icon, FerryFill30Icon, FerryFill24Icon, FerryFill18Icon, BusFill30Icon, BusFill24Icon, BusFill18Icon, ExpressBusFill30Icon, ExpressBusFill24Icon, ExpressBusFill18Icon, TrainFill30Icon, TrainFill24Icon, TrainFill18Icon, InformationFill18Icon, WarningFill18Icon, ErrorFill18Icon, LinkOutOutline24Icon, LinkOutOutline18Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, DropdownLeftFill18Icon } from '@vygruppen/spor-icon-react';
|
|
5
5
|
import * as React20 from 'react';
|
|
6
|
-
import React20__default, { forwardRef, createContext, useId, cloneElement, useRef, useImperativeHandle, useMemo, isValidElement, useState, useEffect,
|
|
6
|
+
import React20__default, { forwardRef, createContext, useId, cloneElement, useRef, useImperativeHandle, useMemo, isValidElement, useState, useEffect, useContext, Children, useLayoutEffect } from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { spinnerColorData, inlineLoaderColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, spinnerLightData, spinnerDarkData, fullScreenLoaderBlackData, inlineLoaderLightData } from '@vygruppen/spor-loader';
|
|
9
9
|
import ReactLottie from 'lottie-react';
|
|
@@ -3217,6 +3217,7 @@ var Input = forwardRef(
|
|
|
3217
3217
|
const recipe = useRecipe({ key: "input" });
|
|
3218
3218
|
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
|
3219
3219
|
const styles = recipe(recipeProps);
|
|
3220
|
+
const labelId = useId();
|
|
3220
3221
|
const inputRef = useRef(null);
|
|
3221
3222
|
useImperativeHandle(ref, () => inputRef.current, []);
|
|
3222
3223
|
const { shouldFloat, handleFocus, handleBlur, handleChange, isControlled } = useFloatingInputState({
|
|
@@ -3237,7 +3238,7 @@ var Input = forwardRef(
|
|
|
3237
3238
|
errorText,
|
|
3238
3239
|
id: props.id,
|
|
3239
3240
|
labelAsChild,
|
|
3240
|
-
label: /* @__PURE__ */ jsxs(Flex, { children: [
|
|
3241
|
+
label: /* @__PURE__ */ jsxs(Flex, { id: labelId, children: [
|
|
3241
3242
|
/* @__PURE__ */ jsx(Box, { visibility: "hidden", children: startElement }),
|
|
3242
3243
|
label
|
|
3243
3244
|
] }),
|
|
@@ -3271,7 +3272,8 @@ var Input = forwardRef(
|
|
|
3271
3272
|
onChange: handleChange,
|
|
3272
3273
|
placeholder: "",
|
|
3273
3274
|
css: styles,
|
|
3274
|
-
fontSize: fontSize ?? "mobile.md"
|
|
3275
|
+
fontSize: fontSize ?? "mobile.md",
|
|
3276
|
+
"aria-labelledby": labelId
|
|
3275
3277
|
}
|
|
3276
3278
|
),
|
|
3277
3279
|
endElement && /* @__PURE__ */ jsx(
|
|
@@ -4289,6 +4291,7 @@ var CountryCodeSelect = forwardRef((props, ref) => {
|
|
|
4289
4291
|
lazyMount: true,
|
|
4290
4292
|
"aria-label": t(texts17.countryCode),
|
|
4291
4293
|
sideRadiusVariant: "rightSideSquare",
|
|
4294
|
+
role: "combobox",
|
|
4292
4295
|
children: filteredCallingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { item: code, children: code.label }, code.label))
|
|
4293
4296
|
}
|
|
4294
4297
|
);
|
|
@@ -4643,7 +4646,7 @@ var Textarea = forwardRef(
|
|
|
4643
4646
|
errorText,
|
|
4644
4647
|
readOnly,
|
|
4645
4648
|
helperText,
|
|
4646
|
-
floatingLabel,
|
|
4649
|
+
floatingLabel = true,
|
|
4647
4650
|
...restProps
|
|
4648
4651
|
} = props;
|
|
4649
4652
|
const recipe = useRecipe({ key: "textarea" });
|
|
@@ -4659,7 +4662,8 @@ var Textarea = forwardRef(
|
|
|
4659
4662
|
onChange: props.onChange,
|
|
4660
4663
|
inputRef
|
|
4661
4664
|
});
|
|
4662
|
-
|
|
4665
|
+
const labelId = useId();
|
|
4666
|
+
return /* @__PURE__ */ jsx(
|
|
4663
4667
|
Field3,
|
|
4664
4668
|
{
|
|
4665
4669
|
errorText,
|
|
@@ -4670,31 +4674,24 @@ var Textarea = forwardRef(
|
|
|
4670
4674
|
floatingLabel,
|
|
4671
4675
|
shouldFloat,
|
|
4672
4676
|
position: "relative",
|
|
4673
|
-
children:
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
{
|
|
4692
|
-
ref: labelRef,
|
|
4693
|
-
"data-float": shouldFloat ? true : void 0,
|
|
4694
|
-
children: label
|
|
4695
|
-
}
|
|
4696
|
-
)
|
|
4697
|
-
]
|
|
4677
|
+
label: /* @__PURE__ */ jsx(Box, { id: labelId, "aria-hidden": true, children: /* @__PURE__ */ jsx("label", { ref: labelRef, children: label }) }),
|
|
4678
|
+
id: restProps.id,
|
|
4679
|
+
children: /* @__PURE__ */ jsx(
|
|
4680
|
+
Textarea$1,
|
|
4681
|
+
{
|
|
4682
|
+
...restProps,
|
|
4683
|
+
css: styles,
|
|
4684
|
+
className: "peer",
|
|
4685
|
+
ref: inputRef,
|
|
4686
|
+
value: isControlled ? props.value : void 0,
|
|
4687
|
+
onFocus: handleFocus,
|
|
4688
|
+
onBlur: handleBlur,
|
|
4689
|
+
onChange: handleChange,
|
|
4690
|
+
style: { "--label-height": `${labelHeight}px` },
|
|
4691
|
+
placeholder: " ",
|
|
4692
|
+
"aria-labelledby": labelId
|
|
4693
|
+
}
|
|
4694
|
+
)
|
|
4698
4695
|
}
|
|
4699
4696
|
);
|
|
4700
4697
|
}
|
|
@@ -6264,24 +6261,130 @@ var TabsList = Tabs$1.List;
|
|
|
6264
6261
|
var TabsTrigger = Tabs$1.Trigger;
|
|
6265
6262
|
var TabsIndicator = Tabs$1.Indicator;
|
|
6266
6263
|
var TabsContent = Tabs$1.Content;
|
|
6267
|
-
var
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6264
|
+
var getNextSortState = (current, key, columnIndex) => {
|
|
6265
|
+
if (current.key !== key)
|
|
6266
|
+
return { key, columnIndex, direction: "asc" };
|
|
6267
|
+
if (current.direction === "asc")
|
|
6268
|
+
return { key, columnIndex, direction: "desc" };
|
|
6269
|
+
return { key: null, direction: "asc", columnIndex: null };
|
|
6270
|
+
};
|
|
6271
|
+
var getSortKey = (children) => typeof children === "string" ? children.trim() : null;
|
|
6272
|
+
var getColumnIndex = (element) => {
|
|
6273
|
+
var _a5;
|
|
6274
|
+
return Array.prototype.indexOf.call((_a5 = element.parentElement) == null ? void 0 : _a5.children, element);
|
|
6275
|
+
};
|
|
6276
|
+
var getCellText = (row, columnIndex) => {
|
|
6277
|
+
const cell = Children.toArray(
|
|
6278
|
+
row.props.children
|
|
6279
|
+
)[columnIndex];
|
|
6280
|
+
if (!isValidElement(cell))
|
|
6281
|
+
return "";
|
|
6282
|
+
const props = cell.props;
|
|
6283
|
+
return typeof props["data-sort"] === "string" && props["data-sort"] || typeof props.children === "string" && props.children.trim() || "";
|
|
6284
|
+
};
|
|
6285
|
+
var sortRows = (children, columnIndex, direction) => Children.toArray(children).toSorted((a, b) => {
|
|
6286
|
+
if (!isValidElement(a) || !isValidElement(b))
|
|
6287
|
+
return 0;
|
|
6288
|
+
const cmp = getCellText(a, columnIndex).localeCompare(
|
|
6289
|
+
getCellText(b, columnIndex)
|
|
6282
6290
|
);
|
|
6291
|
+
return direction === "asc" ? cmp : -cmp;
|
|
6292
|
+
});
|
|
6293
|
+
var SortContext = createContext({
|
|
6294
|
+
enabled: false,
|
|
6295
|
+
sortState: { key: null, direction: "asc", columnIndex: null },
|
|
6296
|
+
onSort: () => {
|
|
6297
|
+
}
|
|
6283
6298
|
});
|
|
6299
|
+
var useTableSort = () => useContext(SortContext);
|
|
6300
|
+
var Table = forwardRef(
|
|
6301
|
+
({
|
|
6302
|
+
variant = "ghost",
|
|
6303
|
+
size,
|
|
6304
|
+
colorPalette = "green",
|
|
6305
|
+
children,
|
|
6306
|
+
sortable = false,
|
|
6307
|
+
...rest
|
|
6308
|
+
}, ref) => {
|
|
6309
|
+
const [sortState, setSortState] = useState({
|
|
6310
|
+
key: null,
|
|
6311
|
+
direction: "asc",
|
|
6312
|
+
columnIndex: null
|
|
6313
|
+
});
|
|
6314
|
+
const handleSort = (key, columnIndex) => {
|
|
6315
|
+
if (!sortable)
|
|
6316
|
+
return;
|
|
6317
|
+
setSortState(getNextSortState(sortState, key, columnIndex));
|
|
6318
|
+
};
|
|
6319
|
+
const recipe = useSlotRecipe({ key: "table" });
|
|
6320
|
+
const styles = recipe({ variant, size });
|
|
6321
|
+
return /* @__PURE__ */ jsx(
|
|
6322
|
+
Table$1.Root,
|
|
6323
|
+
{
|
|
6324
|
+
variant,
|
|
6325
|
+
size,
|
|
6326
|
+
colorPalette,
|
|
6327
|
+
css: styles,
|
|
6328
|
+
ref,
|
|
6329
|
+
...rest,
|
|
6330
|
+
children: /* @__PURE__ */ jsx(
|
|
6331
|
+
SortContext.Provider,
|
|
6332
|
+
{
|
|
6333
|
+
value: { enabled: sortable, sortState, onSort: handleSort },
|
|
6334
|
+
children
|
|
6335
|
+
}
|
|
6336
|
+
)
|
|
6337
|
+
}
|
|
6338
|
+
);
|
|
6339
|
+
}
|
|
6340
|
+
);
|
|
6284
6341
|
Table.displayName = "Table";
|
|
6342
|
+
var TableColumnHeader = forwardRef(({ children, ...rest }, ref) => {
|
|
6343
|
+
const { enabled, sortState, onSort } = useTableSort();
|
|
6344
|
+
const key = getSortKey(children);
|
|
6345
|
+
const props = rest;
|
|
6346
|
+
const columnSortable = enabled && key != null && !("data-nosort" in props);
|
|
6347
|
+
const isActive = columnSortable && key === sortState.key;
|
|
6348
|
+
return /* @__PURE__ */ jsx(Table$1.ColumnHeader, { ref, ...rest, children: /* @__PURE__ */ jsxs(HStack, { children: [
|
|
6349
|
+
children,
|
|
6350
|
+
columnSortable && /* @__PURE__ */ jsx(
|
|
6351
|
+
Button$1,
|
|
6352
|
+
{
|
|
6353
|
+
variant: "ghost",
|
|
6354
|
+
onClick: (event) => {
|
|
6355
|
+
const th = event.currentTarget.closest("th");
|
|
6356
|
+
if (th)
|
|
6357
|
+
onSort(key, getColumnIndex(th));
|
|
6358
|
+
},
|
|
6359
|
+
p: "0px !important",
|
|
6360
|
+
size: "xs",
|
|
6361
|
+
children: isActive ? sortState.direction === "asc" ? /* @__PURE__ */ jsx(ArrowUpFill18Icon, { color: "outline.focus" }) : /* @__PURE__ */ jsx(ArrowDownFill18Icon, { color: "outline.focus" }) : /* @__PURE__ */ jsx(
|
|
6362
|
+
ChangeDirectionFill18Icon,
|
|
6363
|
+
{
|
|
6364
|
+
transform: "rotate(90deg)",
|
|
6365
|
+
color: "icon.disabled"
|
|
6366
|
+
}
|
|
6367
|
+
)
|
|
6368
|
+
}
|
|
6369
|
+
)
|
|
6370
|
+
] }) });
|
|
6371
|
+
});
|
|
6372
|
+
TableColumnHeader.displayName = "ColumnHeader";
|
|
6373
|
+
var TableRow = forwardRef(
|
|
6374
|
+
(props, ref) => /* @__PURE__ */ jsx(Table$1.Row, { ref, ...props })
|
|
6375
|
+
);
|
|
6376
|
+
TableRow.displayName = "TableRow";
|
|
6377
|
+
var TableBody = forwardRef(
|
|
6378
|
+
({ children, ...rest }, ref) => {
|
|
6379
|
+
const { sortState } = useTableSort();
|
|
6380
|
+
const sorted = useMemo(
|
|
6381
|
+
() => sortState.columnIndex == null ? children : sortRows(children, sortState.columnIndex, sortState.direction),
|
|
6382
|
+
[children, sortState]
|
|
6383
|
+
);
|
|
6384
|
+
return /* @__PURE__ */ jsx(Table$1.Body, { ref, ...rest, children: sorted });
|
|
6385
|
+
}
|
|
6386
|
+
);
|
|
6387
|
+
TableBody.displayName = "TableBody";
|
|
6285
6388
|
var attachedInputsRecipe = defineRecipe({
|
|
6286
6389
|
base: {
|
|
6287
6390
|
display: "flex",
|
|
@@ -11741,6 +11844,6 @@ var TooltipContent = forwardRef(
|
|
|
11741
11844
|
);
|
|
11742
11845
|
TooltipContent.displayName = "TooltipContent";
|
|
11743
11846
|
|
|
11744
|
-
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, AttachedInputs, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, Brand, Breadcrumb, Button, ButtonGroup, Calendar, CalendarCell, CalendarGrid, CalendarHeader, CalendarProvider, CardSelect, CardSelectContent, CardSelectTrigger, CargonetLogo, Checkbox, CheckboxGroup, ChoiceChip, Clipboard, ClipboardButton, CloseButton, CloseDrawerLine, Code, ColorInlineLoader, ColorModeButton, ColorModeIcon, ColorModeProvider, ColorSpinner, Combobox2 as Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field3 as Field, FieldErrorText, FieldLabel, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, Heading, IconButton, InfoTag, Input, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, List, ListBox, ListIndicator, ListItem2 as ListItem, NativeSelect, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, NudgeTrigger, NudgeWizardStep, NumericStepper, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover2 as Popover, PopoverContent, PopoverTrigger, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, RangeCalendar, ScrollCalendar, SearchInput, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, StaticCard, Stepper, StepperStep, SvgBox, Switch, Table, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Text3 as Text, TextLink, Textarea, TimePicker, Tooltip, TooltipContent, TooltipTrigger, TravelTag, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTranslation };
|
|
11847
|
+
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, AttachedInputs, Autocomplete, AutocompleteItem, AutocompleteItemGroup, AutocompleteItemGroupLabel, Badge, Brand, Breadcrumb, Button, ButtonGroup, Calendar, CalendarCell, CalendarGrid, CalendarHeader, CalendarProvider, CardSelect, CardSelectContent, CardSelectTrigger, CargonetLogo, Checkbox, CheckboxGroup, ChoiceChip, Clipboard, ClipboardButton, CloseButton, CloseDrawerLine, Code, ColorInlineLoader, ColorModeButton, ColorModeIcon, ColorModeProvider, ColorSpinner, Combobox2 as Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field3 as Field, FieldErrorText, FieldLabel, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, Heading, IconButton, InfoTag, Input, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, List, ListBox, ListIndicator, ListItem2 as ListItem, NativeSelect, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, NudgeTrigger, NudgeWizardStep, NumericStepper, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover2 as Popover, PopoverContent, PopoverTrigger, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, RangeCalendar, ScrollCalendar, SearchInput, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, StaticCard, Stepper, StepperStep, SvgBox, Switch, Table, TableBody, TableColumnHeader, TableRow, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Text3 as Text, TextLink, Textarea, TimePicker, Tooltip, TooltipContent, TooltipTrigger, TravelTag, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useCalendar, useColorMode, useColorModeValue, useTableSort, useTranslation };
|
|
11745
11848
|
//# sourceMappingURL=out.js.map
|
|
11746
11849
|
//# sourceMappingURL=index.mjs.map
|