@kanso-labs/react-native-kanso-ui 0.10.0 → 0.11.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/dist/collection/index.js +107 -80
- package/dist/collection/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +4 -1
- package/dist/components/chip/index.js +229 -161
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +5 -5
- package/dist/components/dialog/index.js +5 -5
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drop-zone/index.d.ts +3 -3
- package/dist/components/drop-zone/index.js +2 -2
- package/dist/components/drop-zone/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +3 -3
- package/dist/components/menu/index.js +3 -3
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +2 -2
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +3 -2
- package/dist/components/search-view/index.js +3 -2
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +16 -7
- package/dist/components/sheet/index.js +157 -152
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/table/index.d.ts +391 -0
- package/dist/components/table/index.js +1708 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/token-field/index.d.ts +105 -0
- package/dist/components/token-field/index.js +574 -0
- package/dist/components/token-field/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/field/index.js +50 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +9 -1
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js +37 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +17 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +340 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/slider/index.js +1 -1
- package/dist/slider/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ import { SplitButton, SplitButtonAction, SplitButtonActionProps, SplitButtonMenu
|
|
|
74
74
|
import { Stack, StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
|
|
75
75
|
import { SupportingPane, SupportingPaneProps } from "./components/supporting-pane/index.js";
|
|
76
76
|
import { Switch, SwitchProps } from "./components/switch/index.js";
|
|
77
|
+
import { Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableLoadMore, TableLoadMoreProps, TableProps, TableRow, TableRowProps } from "./components/table/index.js";
|
|
77
78
|
import { Tabs, TabsLayout, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsPanels, TabsPanelsProps, TabsProps, TabsTab, TabsTabProps, TabsVariant } from "./components/tabs/index.js";
|
|
78
79
|
import { Tag, TagProps, TagTone, TagVariant } from "./components/tag/index.js";
|
|
79
80
|
import { Text, TextProps } from "./components/text/index.js";
|
|
@@ -81,6 +82,7 @@ import { TextArea, TextAreaProps } from "./components/text-area/index.js";
|
|
|
81
82
|
import { TextField, TextFieldProps } from "./components/text-field/index.js";
|
|
82
83
|
import { TimeField, TimeFieldProps } from "./components/time-field/index.js";
|
|
83
84
|
import { TimePicker, TimePickerMode, TimePickerProps } from "./components/time-picker/index.js";
|
|
85
|
+
import { TokenField, TokenFieldProps, TokenSegment } from "./components/token-field/index.js";
|
|
84
86
|
import { Toolbar, ToolbarProps, ToolbarTone } from "./components/toolbar/index.js";
|
|
85
87
|
import { Tooltip, TooltipAlign, TooltipProps, TooltipSide } from "./components/tooltip/index.js";
|
|
86
88
|
import { Tree, TreeItem, TreeItemProps, TreeLoadMore, TreeLoadMoreProps, TreeProps, TreeSection, TreeSectionProps } from "./components/tree/index.js";
|
|
@@ -90,5 +92,5 @@ import { WindowSizeClass, useWindowSizeClass } from "./hooks/useWindowSizeClass.
|
|
|
90
92
|
import { I18nProvider, I18nProviderProps, Locale, useLocale } from "./i18n/provider.js";
|
|
91
93
|
import { RouterProvider, RouterProviderProps } from "./router/index.js";
|
|
92
94
|
import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
|
|
93
|
-
import { Color, ColorChannel, ColorSpace, Key, Selection, getColorChannels, parseColor } from "react-stately";
|
|
94
|
-
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, type Color, ColorArea, type ColorAreaProps, type ColorChannel, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, type ColorSpace, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerLayout, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerPadding, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, type DragTypes, type DropEnterEvent, type DropEvent, type DropExitEvent, type DropItem, type DropOperation, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, type FileDropItem, FileTrigger, type FileTriggerProps, Form, type FormHandle, type FormProps, I18nProvider, type I18nProviderProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, type Locale, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, type MenuTrigger, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailProps, NavigationTabBar, type NavigationTabBarProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, type PickedFile, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, type SheetBodyProps, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, type SheetHandleProps, SheetHeader, type SheetPartProps, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, type TextDropItem, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, type TypeRole, type WindowSizeClass, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
|
|
95
|
+
import { Color, ColorChannel, ColorSpace, Key, Selection, TokenFieldValue, getColorChannels, parseColor } from "react-stately";
|
|
96
|
+
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, type Color, ColorArea, type ColorAreaProps, type ColorChannel, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, type ColorSpace, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerLayout, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerPadding, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, type DragTypes, type DropEnterEvent, type DropEvent, type DropExitEvent, type DropItem, type DropOperation, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, type FileDropItem, FileTrigger, type FileTriggerProps, Form, type FormHandle, type FormProps, I18nProvider, type I18nProviderProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, type Locale, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, type MenuTrigger, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailProps, NavigationTabBar, type NavigationTabBarProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, type PickedFile, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, type SheetBodyProps, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, type SheetHandleProps, SheetHeader, type SheetPartProps, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, type TextDropItem, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, type TypeRole, type WindowSizeClass, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
|
package/dist/index.js
CHANGED
|
@@ -74,15 +74,17 @@ import { SplitButton, SplitButtonAction, SplitButtonMenu } from "./components/sp
|
|
|
74
74
|
import { Stack } from "./components/stack/index.js";
|
|
75
75
|
import { SupportingPane } from "./components/supporting-pane/index.js";
|
|
76
76
|
import { Switch } from "./components/switch/index.js";
|
|
77
|
+
import { Table, TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow } from "./components/table/index.js";
|
|
77
78
|
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "./components/tabs/index.js";
|
|
78
79
|
import { Tag } from "./components/tag/index.js";
|
|
79
80
|
import { TextArea } from "./components/text-area/index.js";
|
|
80
81
|
import { TextField } from "./components/text-field/index.js";
|
|
81
82
|
import { TimeField } from "./components/time-field/index.js";
|
|
82
83
|
import { TimePicker } from "./components/time-picker/index.js";
|
|
84
|
+
import { TokenField } from "./components/token-field/index.js";
|
|
83
85
|
import { Toolbar } from "./components/toolbar/index.js";
|
|
84
86
|
import { Tooltip } from "./components/tooltip/index.js";
|
|
85
87
|
import { Tree, TreeItem, TreeLoadMore, TreeSection } from "./components/tree/index.js";
|
|
86
88
|
import { ThemeScope } from "./theme-scope.js";
|
|
87
|
-
import { getColorChannels, parseColor } from "react-stately";
|
|
88
|
-
export { AppBar, Autocomplete, Avatar, Badge, Breadcrumbs, BreadcrumbsItem, Button, ButtonGroup, Calendar, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Chip, ChipGroup, ChipGroupChip, Code, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorWheel, ComboBox, Container, CopyField, Currency, DateField, DatePicker, DateRangePicker, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Disclosure, DisclosureGroup, DisclosureHeader, DisclosurePanel, DropZone, Fab, FabMenu, FabMenuItem, Feed, FileTrigger, Form, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection, ListDetail, ListItem, ListLoadMore, ListRow, ListSection, LoadingIndicator, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailItem, NavigationTabBar, NavigationTree, NavigationTreeItem, NavigationTreeSection, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SearchView, SearchViewContent, SegmentedButton, SegmentedButtonSegment, Select, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Slider, Snackbar, SplitButton, SplitButtonAction, SplitButtonMenu, Stack, SupportingPane, Switch, Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, Tag, Text, TextArea, TextField, ThemeScope, TimeField, TimePicker, Toolbar, Tooltip, Tree, TreeItem, TreeLoadMore, TreeSection, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
|
|
89
|
+
import { TokenFieldValue, getColorChannels, parseColor } from "react-stately";
|
|
90
|
+
export { AppBar, Autocomplete, Avatar, Badge, Breadcrumbs, BreadcrumbsItem, Button, ButtonGroup, Calendar, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Chip, ChipGroup, ChipGroupChip, Code, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorWheel, ComboBox, Container, CopyField, Currency, DateField, DatePicker, DateRangePicker, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Disclosure, DisclosureGroup, DisclosureHeader, DisclosurePanel, DropZone, Fab, FabMenu, FabMenuItem, Feed, FileTrigger, Form, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection, ListDetail, ListItem, ListLoadMore, ListRow, ListSection, LoadingIndicator, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailItem, NavigationTabBar, NavigationTree, NavigationTreeItem, NavigationTreeSection, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SearchView, SearchViewContent, SegmentedButton, SegmentedButtonSegment, Select, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Slider, Snackbar, SplitButton, SplitButtonAction, SplitButtonMenu, Stack, SupportingPane, Switch, Table, TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow, Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, Tag, Text, TextArea, TextField, ThemeScope, TimeField, TimePicker, TokenField, TokenFieldValue, Toolbar, Tooltip, Tree, TreeItem, TreeLoadMore, TreeSection, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
|
package/dist/slider/index.js
CHANGED
|
@@ -140,6 +140,6 @@ function useTrackGesture(t0) {
|
|
|
140
140
|
return Gesture.Race(testID === void 0 ? pan : pan.withTestId(`${testID}-pan`), testID === void 0 ? tap : tap.withTestId(`${testID}-tap`));
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
|
-
export { ADJUSTABLE, adjustOf, closestThumb, lengthTo, percentOf, seatPlaceOf, seats, useTrackGesture };
|
|
143
|
+
export { ADJUSTABLE, SLOP_RANGE, adjustOf, closestThumb, lengthTo, percentOf, seatPlaceOf, seats, useTrackGesture };
|
|
144
144
|
|
|
145
145
|
//# sourceMappingURL=index.js.map
|
package/dist/slider/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AccessibilityActionEvent","AccessibilityActionInfo","DimensionValue","LayoutChangeEvent","ViewStyle","SharedValue","SliderState","I18nManager","StyleSheet","Gesture","useSharedValue","SLOP","SLOP_RANGE","TARGET","ADJUSTABLE","name","seats","create","seat","alignItems","bottom","justifyContent","marginStart","position","top","width","seatVertical","end","height","marginBottom","start","adjustOf","state","index","event","actionName","nativeEvent","setThumbDragging","incrementThumb","decrementThumb","closestThumb","values","value","split","findIndex","each","length","lastBefore","firstPast","Math","abs","lengthTo","set","vertical","layout","percentOf","fraction","seatPlaceOf","useTrackGesture","t0","$","_c","isDisabled","testID","dragged","t1","fractionAt","x","y","along","isRTL","grab","x_0","y_0","getPercentValue","setThumbPercent","move","x_1","y_1","index_0","get","fraction_0","release","index_1","t2","jump","x_2","y_2","fraction_1","index_2","drag","Pan","oriented","activeOffsetY","failOffsetX","activeOffsetX","failOffsetY","pan","enabled","runOnJS","onStart","t3","x_3","y_3","onUpdate","t4","x_4","y_4","onFinalize","t5","t6","success","x_5","y_5","tap","Tap","maxDistance","onEnd","Race","undefined","withTestId","_c"],"sources":["../../src/slider/index.ts"],"sourcesContent":["import type {\n AccessibilityActionEvent,\n AccessibilityActionInfo,\n DimensionValue,\n LayoutChangeEvent,\n ViewStyle,\n} from 'react-native'\nimport type { SharedValue } from 'react-native-reanimated'\nimport type { SliderState } from 'react-stately/useSliderState'\n\nimport { I18nManager, StyleSheet } from 'react-native'\nimport { Gesture } from 'react-native-gesture-handler'\nimport { useSharedValue } from 'react-native-reanimated'\n\n// What a slider and a colour slider share: the press and the drag along the\n// track, the frame a screen reader adjusts a handle in and the steps it asks\n// for. Both keep React Stately's slider state, a colour slider's being one\n// over a channel, so each reads and moves its value the same way.\n\n// How far a press moves along the track before it is a drag rather than a\n// tap, and across it before it is someone scrolling past: Gesture Handler's\n// own default distance for a pan.\nconst SLOP = 10\nconst SLOP_RANGE: [number, number] = [-SLOP, SLOP]\n\n// The width a screen reader frames a handle in, the page's 48dp target,\n// centred on the handle. Presses reach the track rather than this frame, so\n// it decides nothing but what a screen reader outlines.\nconst TARGET = 48\n\n// What a screen reader can ask of a handle: a step up, or a step down.\nconst ADJUSTABLE: readonly AccessibilityActionInfo[] = [\n { name: 'increment' },\n { name: 'decrement' },\n]\n\nconst seats = StyleSheet.create({\n // Where a handle sits: a frame the target's width, centred on the value,\n // across the whole strip, with the handle centred in it.\n seat: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n marginStart: -TARGET / 2,\n position: 'absolute',\n top: 0,\n width: TARGET,\n },\n seatVertical: {\n alignItems: 'center',\n end: 0,\n height: TARGET,\n justifyContent: 'center',\n marginBottom: -TARGET / 2,\n position: 'absolute',\n start: 0,\n },\n})\n\n// Runs the step a screen reader asks a handle for, as a move that starts and\n// ends at once, so `onChangeEnd` comes once as it does for a key on web.\nfunction adjustOf(state: SliderState, index: number) {\n return (event: AccessibilityActionEvent) => {\n const { actionName } = event.nativeEvent\n if (actionName !== 'increment' && actionName !== 'decrement') {\n return\n }\n state.setThumbDragging(index, true)\n if (actionName === 'increment') {\n state.incrementThumb(index)\n } else {\n state.decrementThumb(index)\n }\n state.setThumbDragging(index, false)\n }\n}\n\n// The handle nearest a press at `value`, as React Aria picks it on web: the\n// first handle past it or the last before it, whichever is closer, and the\n// one past it when the two are as close.\nfunction closestThumb(values: readonly number[], value: number) {\n const split = values.findIndex((each) => value - each < 0)\n if (split === 0) {\n return 0\n }\n if (split === -1) {\n return values.length - 1\n }\n const lastBefore = values[split - 1] ?? value\n const firstPast = values[split] ?? value\n return Math.abs(lastBefore - value) < Math.abs(firstPast - value)\n ? split - 1\n : split\n}\n\n// Keeps the track's length along its axis as it is laid out.\nfunction lengthTo(set: (length: number) => void, vertical: boolean) {\n return ({ nativeEvent }: LayoutChangeEvent) => {\n set(vertical ? nativeEvent.layout.height : nativeEvent.layout.width)\n }\n}\n\nfunction percentOf(fraction: number): DimensionValue {\n return `${fraction * 100}%`\n}\n\n// Where a handle's frame sits along the track: centred on its value.\nfunction seatPlaceOf(fraction: number, vertical: boolean): ViewStyle {\n return vertical\n ? { bottom: percentOf(fraction) }\n : { start: percentOf(fraction) }\n}\n\n/**\n * The track's pan and tap. Each reads a press's place as a fraction of the\n * track, from the start or, vertical, from the bottom, and moves the handle\n * nearest it there. The pan holds that handle as dragged until it lets go,\n * which is what brings up its indicator and narrows it, and what\n * `onChangeEnd` waits for; the tap moves it and lets it go at once.\n *\n * Both run on the JavaScript thread, since every move sets React state.\n */\nfunction useTrackGesture({\n isDisabled,\n length,\n state,\n testID,\n vertical,\n}: {\n readonly isDisabled: boolean\n readonly length: number\n readonly state: SliderState\n readonly testID: string | undefined\n readonly vertical: boolean\n}) {\n // Which handle the pan holds, or -1. A shared value rather than a ref: the\n // gesture's callbacks are built while rendering, and the React Compiler\n // lets no ref reach them.\n const dragged: SharedValue<number> = useSharedValue(-1)\n\n // A press's place as a fraction of the way along the track, or null\n // before the track has a length to read it against. A press past either\n // end reads past 0 or 1, which React Stately clamps to the slider's ends.\n function fractionAt(x: number, y: number) {\n if (length <= 0) {\n return null\n }\n const along = (vertical ? y : x) / length\n if (vertical) {\n return 1 - along\n }\n return I18nManager.isRTL ? 1 - along : along\n }\n\n function grab(x: number, y: number) {\n const fraction = fractionAt(x, y)\n if (fraction === null) {\n return\n }\n const index = closestThumb(state.values, state.getPercentValue(fraction))\n dragged.set(index)\n state.setThumbDragging(index, true)\n state.setThumbPercent(index, fraction)\n }\n\n function move(x: number, y: number) {\n const index = dragged.get()\n const fraction = fractionAt(x, y)\n if (index >= 0 && fraction !== null) {\n state.setThumbPercent(index, fraction)\n }\n }\n\n function release() {\n const index = dragged.get()\n if (index >= 0) {\n dragged.set(-1)\n state.setThumbDragging(index, false)\n }\n }\n\n function jump(x: number, y: number) {\n const fraction = fractionAt(x, y)\n if (fraction === null) {\n return\n }\n const index = closestThumb(state.values, state.getPercentValue(fraction))\n state.setThumbDragging(index, true)\n state.setThumbPercent(index, fraction)\n state.setThumbDragging(index, false)\n }\n\n // Gesture Handler 3 deprecates these builders for hooks that version 2 does\n // not have, and the peer range admits both, so the builders stay while it\n // does.\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- a builder named after its gesture, not a component; see above\n const drag = Gesture.Pan()\n // Taken once it moves along the track, and let go to a scroll view once\n // it moves across it first.\n const oriented = vertical\n ? drag.activeOffsetY(SLOP_RANGE).failOffsetX(SLOP_RANGE)\n : drag.activeOffsetX(SLOP_RANGE).failOffsetY(SLOP_RANGE)\n const pan = oriented\n .enabled(!isDisabled)\n .runOnJS(true)\n .onStart(({ x, y }) => {\n grab(x, y)\n })\n .onUpdate(({ x, y }) => {\n move(x, y)\n })\n .onFinalize(() => {\n release()\n })\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n const tap = Gesture.Tap()\n .maxDistance(SLOP)\n .enabled(!isDisabled)\n .runOnJS(true)\n .onEnd(({ x, y }, success) => {\n if (success) {\n jump(x, y)\n }\n })\n\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n return Gesture.Race(\n testID === undefined ? pan : pan.withTestId(`${testID}-pan`),\n testID === undefined ? tap : tap.withTestId(`${testID}-tap`),\n )\n}\n\nexport {\n ADJUSTABLE,\n adjustOf,\n closestThumb,\n lengthTo,\n percentOf,\n seatPlaceOf,\n seats,\n useTrackGesture,\n}\n"],"mappings":";;;;;AAsBA,MAAMW,OAAO;AACb,MAAMC,aAA+B,CAAC,KAAOD,IAAI;AAKjD,MAAME,SAAS;AAGf,MAAMC,aAAiD,CACrD,EAAEC,MAAM,YAAY,GACpB,EAAEA,MAAM,YAAY,CAAC;AAGvB,MAAMC,QAAQR,WAAWS,OAAO;CAG9BC,MAAM;EACJC,YAAY;EACZC,QAAQ;EACRC,gBAAgB;EAChBC,aAAa;EACbC,UAAU;EACVC,KAAK;EACLC,OAAOZ;CACT;CACAa,cAAc;EACZP,YAAY;EACZQ,KAAK;EACLC,QAAQf;EACRQ,gBAAgB;EAChBQ,cAAc;EACdN,UAAU;EACVO,OAAO;CACT;AACF,CAAC;AAID,SAASC,SAASC,OAAoBC,OAAe;CACnD,QAAQC,UAAoC;EAC1C,MAAM,EAAEC,eAAeD,MAAME;EAC7B,IAAID,eA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AM,CAC7D;AAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["AccessibilityActionEvent","AccessibilityActionInfo","DimensionValue","LayoutChangeEvent","ViewStyle","SharedValue","SliderState","I18nManager","StyleSheet","Gesture","useSharedValue","SLOP","SLOP_RANGE","TARGET","ADJUSTABLE","name","seats","create","seat","alignItems","bottom","justifyContent","marginStart","position","top","width","seatVertical","end","height","marginBottom","start","adjustOf","state","index","event","actionName","nativeEvent","setThumbDragging","incrementThumb","decrementThumb","closestThumb","values","value","split","findIndex","each","length","lastBefore","firstPast","Math","abs","lengthTo","set","vertical","layout","percentOf","fraction","seatPlaceOf","useTrackGesture","t0","$","_c","isDisabled","testID","dragged","t1","fractionAt","x","y","along","isRTL","grab","x_0","y_0","getPercentValue","setThumbPercent","move","x_1","y_1","index_0","get","fraction_0","release","index_1","t2","jump","x_2","y_2","fraction_1","index_2","drag","Pan","oriented","activeOffsetY","failOffsetX","activeOffsetX","failOffsetY","pan","enabled","runOnJS","onStart","t3","x_3","y_3","onUpdate","t4","x_4","y_4","onFinalize","t5","t6","success","x_5","y_5","tap","Tap","maxDistance","onEnd","Race","undefined","withTestId","_c"],"sources":["../../src/slider/index.ts"],"sourcesContent":["import type {\n AccessibilityActionEvent,\n AccessibilityActionInfo,\n DimensionValue,\n LayoutChangeEvent,\n ViewStyle,\n} from 'react-native'\nimport type { SharedValue } from 'react-native-reanimated'\nimport type { SliderState } from 'react-stately/useSliderState'\n\nimport { I18nManager, StyleSheet } from 'react-native'\nimport { Gesture } from 'react-native-gesture-handler'\nimport { useSharedValue } from 'react-native-reanimated'\n\n// What a slider and a colour slider share: the press and the drag along the\n// track, the frame a screen reader adjusts a handle in and the steps it asks\n// for. Both keep React Stately's slider state, a colour slider's being one\n// over a channel, so each reads and moves its value the same way.\n\n// How far a press moves along the track before it is a drag rather than a\n// tap, and across it before it is someone scrolling past: Gesture Handler's\n// own default distance for a pan.\nconst SLOP = 10\nconst SLOP_RANGE: [number, number] = [-SLOP, SLOP]\n\n// The width a screen reader frames a handle in, the page's 48dp target,\n// centred on the handle. Presses reach the track rather than this frame, so\n// it decides nothing but what a screen reader outlines.\nconst TARGET = 48\n\n// What a screen reader can ask of a handle: a step up, or a step down.\nconst ADJUSTABLE: readonly AccessibilityActionInfo[] = [\n { name: 'increment' },\n { name: 'decrement' },\n]\n\nconst seats = StyleSheet.create({\n // Where a handle sits: a frame the target's width, centred on the value,\n // across the whole strip, with the handle centred in it.\n seat: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n marginStart: -TARGET / 2,\n position: 'absolute',\n top: 0,\n width: TARGET,\n },\n seatVertical: {\n alignItems: 'center',\n end: 0,\n height: TARGET,\n justifyContent: 'center',\n marginBottom: -TARGET / 2,\n position: 'absolute',\n start: 0,\n },\n})\n\n// Runs the step a screen reader asks a handle for, as a move that starts and\n// ends at once, so `onChangeEnd` comes once as it does for a key on web.\nfunction adjustOf(state: SliderState, index: number) {\n return (event: AccessibilityActionEvent) => {\n const { actionName } = event.nativeEvent\n if (actionName !== 'increment' && actionName !== 'decrement') {\n return\n }\n state.setThumbDragging(index, true)\n if (actionName === 'increment') {\n state.incrementThumb(index)\n } else {\n state.decrementThumb(index)\n }\n state.setThumbDragging(index, false)\n }\n}\n\n// The handle nearest a press at `value`, as React Aria picks it on web: the\n// first handle past it or the last before it, whichever is closer, and the\n// one past it when the two are as close.\nfunction closestThumb(values: readonly number[], value: number) {\n const split = values.findIndex((each) => value - each < 0)\n if (split === 0) {\n return 0\n }\n if (split === -1) {\n return values.length - 1\n }\n const lastBefore = values[split - 1] ?? value\n const firstPast = values[split] ?? value\n return Math.abs(lastBefore - value) < Math.abs(firstPast - value)\n ? split - 1\n : split\n}\n\n// Keeps the track's length along its axis as it is laid out.\nfunction lengthTo(set: (length: number) => void, vertical: boolean) {\n return ({ nativeEvent }: LayoutChangeEvent) => {\n set(vertical ? nativeEvent.layout.height : nativeEvent.layout.width)\n }\n}\n\nfunction percentOf(fraction: number): DimensionValue {\n return `${fraction * 100}%`\n}\n\n// Where a handle's frame sits along the track: centred on its value.\nfunction seatPlaceOf(fraction: number, vertical: boolean): ViewStyle {\n return vertical\n ? { bottom: percentOf(fraction) }\n : { start: percentOf(fraction) }\n}\n\n/**\n * The track's pan and tap. Each reads a press's place as a fraction of the\n * track, from the start or, vertical, from the bottom, and moves the handle\n * nearest it there. The pan holds that handle as dragged until it lets go,\n * which is what brings up its indicator and narrows it, and what\n * `onChangeEnd` waits for; the tap moves it and lets it go at once.\n *\n * Both run on the JavaScript thread, since every move sets React state.\n */\nfunction useTrackGesture({\n isDisabled,\n length,\n state,\n testID,\n vertical,\n}: {\n readonly isDisabled: boolean\n readonly length: number\n readonly state: SliderState\n readonly testID: string | undefined\n readonly vertical: boolean\n}) {\n // Which handle the pan holds, or -1. A shared value rather than a ref: the\n // gesture's callbacks are built while rendering, and the React Compiler\n // lets no ref reach them.\n const dragged: SharedValue<number> = useSharedValue(-1)\n\n // A press's place as a fraction of the way along the track, or null\n // before the track has a length to read it against. A press past either\n // end reads past 0 or 1, which React Stately clamps to the slider's ends.\n function fractionAt(x: number, y: number) {\n if (length <= 0) {\n return null\n }\n const along = (vertical ? y : x) / length\n if (vertical) {\n return 1 - along\n }\n return I18nManager.isRTL ? 1 - along : along\n }\n\n function grab(x: number, y: number) {\n const fraction = fractionAt(x, y)\n if (fraction === null) {\n return\n }\n const index = closestThumb(state.values, state.getPercentValue(fraction))\n dragged.set(index)\n state.setThumbDragging(index, true)\n state.setThumbPercent(index, fraction)\n }\n\n function move(x: number, y: number) {\n const index = dragged.get()\n const fraction = fractionAt(x, y)\n if (index >= 0 && fraction !== null) {\n state.setThumbPercent(index, fraction)\n }\n }\n\n function release() {\n const index = dragged.get()\n if (index >= 0) {\n dragged.set(-1)\n state.setThumbDragging(index, false)\n }\n }\n\n function jump(x: number, y: number) {\n const fraction = fractionAt(x, y)\n if (fraction === null) {\n return\n }\n const index = closestThumb(state.values, state.getPercentValue(fraction))\n state.setThumbDragging(index, true)\n state.setThumbPercent(index, fraction)\n state.setThumbDragging(index, false)\n }\n\n // Gesture Handler 3 deprecates these builders for hooks that version 2 does\n // not have, and the peer range admits both, so the builders stay while it\n // does.\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- a builder named after its gesture, not a component; see above\n const drag = Gesture.Pan()\n // Taken once it moves along the track, and let go to a scroll view once\n // it moves across it first.\n const oriented = vertical\n ? drag.activeOffsetY(SLOP_RANGE).failOffsetX(SLOP_RANGE)\n : drag.activeOffsetX(SLOP_RANGE).failOffsetY(SLOP_RANGE)\n const pan = oriented\n .enabled(!isDisabled)\n .runOnJS(true)\n .onStart(({ x, y }) => {\n grab(x, y)\n })\n .onUpdate(({ x, y }) => {\n move(x, y)\n })\n .onFinalize(() => {\n release()\n })\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n const tap = Gesture.Tap()\n .maxDistance(SLOP)\n .enabled(!isDisabled)\n .runOnJS(true)\n .onEnd(({ x, y }, success) => {\n if (success) {\n jump(x, y)\n }\n })\n\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n return Gesture.Race(\n testID === undefined ? pan : pan.withTestId(`${testID}-pan`),\n testID === undefined ? tap : tap.withTestId(`${testID}-tap`),\n )\n}\n\nexport {\n ADJUSTABLE,\n adjustOf,\n closestThumb,\n lengthTo,\n percentOf,\n seatPlaceOf,\n seats,\n SLOP_RANGE,\n useTrackGesture,\n}\n"],"mappings":";;;;;AAsBA,MAAMW,OAAO;AACb,MAAMC,aAA+B,CAAC,KAAOD,IAAI;AAKjD,MAAME,SAAS;AAGf,MAAMC,aAAiD,CACrD,EAAEC,MAAM,YAAY,GACpB,EAAEA,MAAM,YAAY,CAAC;AAGvB,MAAMC,QAAQR,WAAWS,OAAO;CAG9BC,MAAM;EACJC,YAAY;EACZC,QAAQ;EACRC,gBAAgB;EAChBC,aAAa;EACbC,UAAU;EACVC,KAAK;EACLC,OAAOZ;CACT;CACAa,cAAc;EACZ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QACZ,IAAI,CAAC,CAAAkB,MACPR,EAIN;CAAC,OAGGpG,QAAO6G,KACZvD,WAAWwD,KAAAA,IAAXtB,MAA6BA,IAAGuB,WAAY,GAAGzD,OAAM,KAAM,GAC3DA,WAAWwD,KAAAA,IAAXL,MAA6BA,IAAGM,WAAY,GAAGzD,OAAM,KAAM,CAC7D;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanso-labs/react-native-kanso-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Kanso UI's Material Design components for React Native, themed through the same --kui-* design tokens as the web library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|