@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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.
Files changed (123) hide show
  1. package/dist/autocomplete/index.js +39 -0
  2. package/dist/autocomplete/index.js.map +1 -0
  3. package/dist/button/index.d.ts +2 -1
  4. package/dist/button/index.js +35 -2
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/pending.js +1 -1
  7. package/dist/button/slots.d.ts +2 -0
  8. package/dist/button/slots.js.map +1 -1
  9. package/dist/chip/index.js +1 -1
  10. package/dist/components/autocomplete/index.d.ts +49 -0
  11. package/dist/components/autocomplete/index.js +87 -0
  12. package/dist/components/autocomplete/index.js.map +1 -0
  13. package/dist/components/avatar/index.d.ts +1 -1
  14. package/dist/components/button/index.d.ts +2 -2
  15. package/dist/components/button/index.js +196 -150
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/card/index.d.ts +1 -1
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/checkbox/index.d.ts +1 -1
  20. package/dist/components/checkbox/index.js +106 -193
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/chip/index.d.ts +1 -1
  23. package/dist/components/chip-group/index.d.ts +1 -1
  24. package/dist/components/chip-group/index.js +1 -1
  25. package/dist/components/copy-field/index.d.ts +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +1 -1
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/dialog/index.d.ts +3 -2
  30. package/dist/components/dialog/index.js +105 -242
  31. package/dist/components/dialog/index.js.map +1 -1
  32. package/dist/components/icon-button/index.d.ts +2 -2
  33. package/dist/components/icon-button/index.js +205 -159
  34. package/dist/components/icon-button/index.js.map +1 -1
  35. package/dist/components/link/index.d.ts +1 -1
  36. package/dist/components/link/index.js +1 -1
  37. package/dist/components/list/index.d.ts +216 -0
  38. package/dist/components/list/index.js +1118 -0
  39. package/dist/components/list/index.js.map +1 -0
  40. package/dist/components/list-item/index.d.ts +63 -0
  41. package/dist/components/list-item/index.js +275 -0
  42. package/dist/components/list-item/index.js.map +1 -0
  43. package/dist/components/menu/index.d.ts +309 -0
  44. package/dist/components/menu/index.js +1283 -0
  45. package/dist/components/menu/index.js.map +1 -0
  46. package/dist/components/meter/index.d.ts +1 -1
  47. package/dist/components/meter/index.js +1 -1
  48. package/dist/components/number-field/index.d.ts +1 -1
  49. package/dist/components/number-field/index.js +2 -2
  50. package/dist/components/popover/index.d.ts +140 -0
  51. package/dist/components/popover/index.js +704 -0
  52. package/dist/components/popover/index.js.map +1 -0
  53. package/dist/components/product-icon/index.d.ts +1 -1
  54. package/dist/components/progress-indicator/index.d.ts +1 -1
  55. package/dist/components/progress-indicator/index.js +1 -1
  56. package/dist/components/radio-group/index.d.ts +1 -1
  57. package/dist/components/radio-group/index.js +1 -1
  58. package/dist/components/search-field/index.d.ts +12 -4
  59. package/dist/components/search-field/index.js +64 -58
  60. package/dist/components/search-field/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +1 -1
  62. package/dist/components/segmented-button/index.js +1 -1
  63. package/dist/components/separator/index.d.ts +1 -1
  64. package/dist/components/separator/index.js +1 -1
  65. package/dist/components/sheet/index.d.ts +137 -0
  66. package/dist/components/sheet/index.js +1091 -0
  67. package/dist/components/sheet/index.js.map +1 -0
  68. package/dist/components/snackbar/index.d.ts +1 -1
  69. package/dist/components/snackbar/index.js +1 -1
  70. package/dist/components/stack/index.d.ts +1 -1
  71. package/dist/components/stack/index.js +1 -1
  72. package/dist/components/switch/index.d.ts +1 -1
  73. package/dist/components/switch/index.js +1 -1
  74. package/dist/components/switch/index.js.map +1 -1
  75. package/dist/components/text/index.d.ts +1 -1
  76. package/dist/components/text/index.js +1 -1
  77. package/dist/components/text-field/index.d.ts +1 -1
  78. package/dist/components/text-field/index.js +1 -1
  79. package/dist/control/checkbox-box.js +137 -0
  80. package/dist/control/checkbox-box.js.map +1 -0
  81. package/dist/control/index.js +1 -1
  82. package/dist/field/index.d.ts +1 -1
  83. package/dist/field/index.js +1 -1
  84. package/dist/form/index.d.ts +1 -1
  85. package/dist/glyphs/index.js +21 -2
  86. package/dist/glyphs/index.js.map +1 -1
  87. package/dist/i18n/index.js +16 -1
  88. package/dist/i18n/index.js.map +1 -1
  89. package/dist/i18n/messages.js +374 -34
  90. package/dist/i18n/messages.js.map +1 -1
  91. package/dist/index.d.ts +7 -1
  92. package/dist/index.js +8 -2
  93. package/dist/indicator/index.d.ts +1 -1
  94. package/dist/indicator/index.js +2 -2
  95. package/dist/mark/index.d.ts +1 -1
  96. package/dist/mark/index.js +1 -1
  97. package/dist/modal/index.d.ts +16 -0
  98. package/dist/modal/index.js +277 -0
  99. package/dist/modal/index.js.map +1 -0
  100. package/dist/overlay/anchored.d.ts +2 -0
  101. package/dist/overlay/anchored.js +182 -0
  102. package/dist/overlay/anchored.js.map +1 -0
  103. package/dist/overlay/host.d.ts +2 -0
  104. package/dist/overlay/host.js +1 -1
  105. package/dist/overlay/index.d.ts +4 -0
  106. package/dist/overlay/panel.js +215 -0
  107. package/dist/overlay/panel.js.map +1 -0
  108. package/dist/overlay/placement.d.ts +8 -0
  109. package/dist/overlay/placement.js +87 -0
  110. package/dist/overlay/placement.js.map +1 -0
  111. package/dist/press/index.js +1 -1
  112. package/dist/ref/index.js +15 -0
  113. package/dist/ref/index.js.map +1 -0
  114. package/dist/router/index.js +1 -1
  115. package/dist/row/index.js +158 -0
  116. package/dist/row/index.js.map +1 -0
  117. package/dist/row/styles.js +51 -0
  118. package/dist/row/styles.js.map +1 -0
  119. package/dist/theme/scope.js +1 -1
  120. package/dist/theme-scope.d.ts +1 -1
  121. package/dist/theme-scope.js +1 -1
  122. package/dist/typography/fonts.js +1 -1
  123. package/package.json +6 -6
@@ -0,0 +1,137 @@
1
+ import { ModalOpenProps } from "../../modal/index.js";
2
+ import { ComponentRef, ReactNode, Ref } from "react";
3
+ import { HostInstance, ScrollView, ScrollViewProps, StyleProp, TextProps, View, ViewProps, ViewStyle } from "react-native";
4
+ //#region src/components/sheet/index.d.ts
5
+ type SheetBodyProps = ScrollViewProps & {
6
+ readonly ref?: Ref<ComponentRef<typeof ScrollView>>;
7
+ };
8
+ type SheetContentProps = Omit<ViewProps, 'children' | 'style'> & SheetOpenProps & {
9
+ readonly children?: ReactNode;
10
+ /**
11
+ * Whether a press on the scrim, outside the sheet, and a swipe down past
12
+ * its lowest height close it. Android's back gesture is
13
+ * `isKeyboardDismissDisabled`'s, and this says nothing about it.
14
+ * @default true
15
+ */
16
+ readonly isDismissable?: boolean;
17
+ /**
18
+ * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on
19
+ * web, from closing the sheet.
20
+ * @default false
21
+ */
22
+ readonly isKeyboardDismissDisabled?: boolean;
23
+ readonly ref?: Ref<ComponentRef<typeof View>>;
24
+ readonly style?: StyleProp<ViewStyle>;
25
+ };
26
+ type SheetHandleProps = Omit<ViewProps, 'children'> & {
27
+ readonly ref?: Ref<ComponentRef<typeof View>>;
28
+ };
29
+ type SheetOpenProps = ModalOpenProps & {
30
+ /** Whether the sheet starts open, when it keeps its own state. */
31
+ readonly defaultOpen?: boolean;
32
+ /** Whether the sheet is open, when the call site holds the state. */
33
+ readonly isOpen?: boolean;
34
+ /** Called with the new state as the sheet opens or closes. */
35
+ readonly onOpenChange?: (isOpen: boolean) => void;
36
+ };
37
+ type SheetPartProps = ViewProps & {
38
+ readonly ref?: Ref<ComponentRef<typeof View>>;
39
+ };
40
+ type SheetProps = SheetOpenProps & {
41
+ /** The button that opens the sheet, and `Sheet.Content`. */
42
+ readonly children?: ReactNode;
43
+ };
44
+ type SheetTitleProps = Omit<TextProps, 'role'> & {
45
+ readonly ref?: Ref<HostInstance>;
46
+ };
47
+ /**
48
+ * A modal sheet along an edge of the screen, the bottom sheets and side sheets
49
+ * spec pages' modal sheets, paired by window size as kanso-ui's are: a bottom
50
+ * sheet in a compact window, dragged between heights and swiped down to go,
51
+ * and a side sheet along the end edge from the medium window up. Pass
52
+ * `isOpen` with `onOpenChange` to hold the open state, or `defaultOpen` to let
53
+ * it keep its own.
54
+ *
55
+ * ```tsx
56
+ * <Sheet>
57
+ * <Button>Open</Button>
58
+ * <Sheet.Content>
59
+ * <Sheet.Handle />
60
+ * <Sheet.Header>
61
+ * <Sheet.Title>Headline</Sheet.Title>
62
+ * </Sheet.Header>
63
+ * <Sheet.Body>Supporting text</Sheet.Body>
64
+ * <Sheet.Footer>
65
+ * <Button slot="close">Done</Button>
66
+ * </Sheet.Footer>
67
+ * </Sheet.Content>
68
+ * </Sheet>
69
+ * ```
70
+ *
71
+ * Composed rather than configured by props, as web's is. A `Button` or
72
+ * `IconButton` inside `Sheet` and outside its content opens it, and one given
73
+ * `slot="close"` anywhere inside the content closes it. A sheet nothing on the
74
+ * screen opens leaves `Sheet` out and passes `isOpen` and `onOpenChange` to
75
+ * `Sheet.Content` instead.
76
+ */
77
+ declare function Sheet({ children, defaultOpen, isOpen, onOpenChange }: SheetProps): import("react").JSX.Element;
78
+ declare namespace Sheet {
79
+ var Body: typeof SheetBody;
80
+ var Content: typeof SheetContent;
81
+ var Footer: typeof SheetFooter;
82
+ var Handle: typeof SheetHandle;
83
+ var Header: typeof SheetHeader;
84
+ var Title: typeof SheetTitle;
85
+ }
86
+ /**
87
+ * What the sheet shows, as a body that scrolls when its content runs past the
88
+ * room it has. A string is drawn in body medium on on-surface variant;
89
+ * anything else draws itself. `style`, `ref` and `testID` land on the
90
+ * `ScrollView`.
91
+ *
92
+ * A body its content runs past takes focus, as web's is a tab stop, so a
93
+ * keyboard can scroll it when nothing inside it takes focus; a call site's
94
+ * own `focusable` still wins. A bottom sheet's body scrolls only once the
95
+ * sheet is at its whole height, and holds the sheet's drag off while it does.
96
+ */
97
+ declare function SheetBody({ children, contentContainerStyle, onContentSizeChange, onLayout, scrollEnabled, ...props }: SheetBodyProps): import("react").JSX.Element;
98
+ /**
99
+ * The sheet itself, and the scrim behind it. Everything the sheet shows goes
100
+ * in here; the button that opens it stays outside it.
101
+ *
102
+ * Inside `Sheet`, the open state is the trigger's. On its own it is this
103
+ * part's: `isOpen` with `onOpenChange` holds it, and a `slot="close"` button,
104
+ * the scrim, the swipe and the back gesture all report through
105
+ * `onOpenChange`. `style`, `ref` and `testID` land on the container, and
106
+ * `testID` names the drag `<testID>-drag` for Gesture Handler's test helpers.
107
+ */
108
+ declare function SheetContent({ defaultOpen, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, ...props }: SheetContentProps): import("react").JSX.Element | null;
109
+ /**
110
+ * The sheet's actions, leading and wrapping onto another row when they do not
111
+ * fit on one, over a divider. On a bottom sheet at half height they are below
112
+ * the fold until the sheet is raised. `style`, `ref` and `testID` land on its
113
+ * view.
114
+ */
115
+ declare function SheetFooter({ style, ...props }: SheetPartProps): import("react").JSX.Element;
116
+ /**
117
+ * The bottom sheet's drag handle, a 32 by 4dp bar centred along its top edge.
118
+ * Where the sheet has two heights it is a button moving it to the other one,
119
+ * named "Drag handle" in the device's locale unless `aria-label` says
120
+ * otherwise; elsewhere it is a mark a screen reader skips. A side sheet draws
121
+ * none. `style`, `ref` and `testID` land on its view.
122
+ */
123
+ declare function SheetHandle({ 'aria-label': label, style, ...props }: SheetHandleProps): import("react").JSX.Element | null;
124
+ /**
125
+ * The sheet's header: its `Sheet.Title`, and anything beside it, such as a
126
+ * close button, over a divider. `style`, `ref` and `testID` land on its view.
127
+ */
128
+ declare function SheetHeader({ style, ...props }: SheetPartProps): import("react").JSX.Element;
129
+ /**
130
+ * Names the sheet: the container is labelled by it, and a screen reader is
131
+ * sent to it once the sheet shows. In title large on on-surface variant.
132
+ * `style`, `ref` and `testID` land on React Native's own Text.
133
+ */
134
+ declare function SheetTitle({ ref, style, ...props }: SheetTitleProps): import("react").JSX.Element;
135
+ //#endregion
136
+ export { Sheet, SheetBody, type SheetBodyProps, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, type SheetHandleProps, SheetHeader, type SheetPartProps, type SheetProps, SheetTitle, type SheetTitleProps };
137
+ //# sourceMappingURL=index.d.ts.map