@gnome-ui/react-native 1.5.0 → 1.7.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/README.md +647 -3
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +47 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/AvatarRotator/AvatarRotator.d.ts +65 -0
- package/dist/components/AvatarRotator/index.d.ts +2 -0
- package/dist/components/Bin/Bin.d.ts +18 -0
- package/dist/components/Bin/index.d.ts +2 -0
- package/dist/components/Box/Box.d.ts +87 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Clamp/Clamp.d.ts +61 -0
- package/dist/components/Clamp/index.d.ts +2 -0
- package/dist/components/CoachMark/CoachMark.d.ts +92 -0
- package/dist/components/CoachMark/CoachMarkTour.d.ts +54 -0
- package/dist/components/CoachMark/coachMarkUtils.d.ts +42 -0
- package/dist/components/CoachMark/index.d.ts +5 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +81 -0
- package/dist/components/ColorPicker/ColorSwatch.d.ts +50 -0
- package/dist/components/ColorPicker/index.d.ts +4 -0
- package/dist/components/ComboRow/ComboRow.d.ts +77 -0
- package/dist/components/ComboRow/index.d.ts +2 -0
- package/dist/components/EntryRow/EntryRow.d.ts +77 -0
- package/dist/components/EntryRow/index.d.ts +2 -0
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.d.ts +93 -0
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.d.ts +25 -0
- package/dist/components/InlineViewSwitcher/index.d.ts +4 -0
- package/dist/components/InlineViewSwitcher/variants.d.ts +30 -0
- package/dist/components/PasswordEntryRow/PasswordEntryRow.d.ts +45 -0
- package/dist/components/PasswordEntryRow/index.d.ts +2 -0
- package/dist/components/PreferencesGroup/PreferencesGroup.d.ts +52 -0
- package/dist/components/PreferencesGroup/index.d.ts +2 -0
- package/dist/components/StatusPage/StatusPage.d.ts +79 -0
- package/dist/components/StatusPage/index.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +70 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +49 -0
- package/dist/components/ToggleGroup/index.d.ts +4 -0
- package/dist/components/WrapBox/WrapBox.d.ts +67 -0
- package/dist/components/WrapBox/index.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +2057 -645
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, View, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
export type WrapBoxJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
4
|
+
export type WrapBoxAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
5
|
+
export interface WrapBoxProps extends Omit<ViewProps, 'style'> {
|
|
6
|
+
/** Gap between children on the same line, in dp. Default: `6`. */
|
|
7
|
+
childSpacing?: number;
|
|
8
|
+
/** Gap between lines, in dp. Defaults to `childSpacing`. */
|
|
9
|
+
lineSpacing?: number;
|
|
10
|
+
/** Horizontal distribution of children within each line. Default: `"start"`. */
|
|
11
|
+
justify?: WrapBoxJustify;
|
|
12
|
+
/** Cross-axis alignment of children within each line. Default: `"center"`. */
|
|
13
|
+
align?: WrapBoxAlign;
|
|
14
|
+
/** When true children wrap in the reverse direction (bottom to top). */
|
|
15
|
+
wrapReverse?: boolean;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Flexible wrapping layout container — children flow horizontally and wrap
|
|
21
|
+
* to new lines when they don't fit, like words in a paragraph, without
|
|
22
|
+
* locking them into a grid. Mirrors `AdwWrapBox` (libadwaita 1.7 / GNOME
|
|
23
|
+
* 48) and `@gnome-ui/react`'s own `WrapBox`.
|
|
24
|
+
*
|
|
25
|
+
* Pair with `Chip` for tag lists and filter rows, or use standalone for any
|
|
26
|
+
* collection of variable-width items.
|
|
27
|
+
*
|
|
28
|
+
* The web version ships its values as CSS custom properties consumed by a
|
|
29
|
+
* stylesheet (`--wrapbox-gap`, `--wrapbox-justify`, …) because a CSS module
|
|
30
|
+
* can't take runtime values any other way; RN has no such indirection, so
|
|
31
|
+
* they're written straight onto the style object here. Everything else is a
|
|
32
|
+
* direct translation: `flex-flow: row wrap` becomes
|
|
33
|
+
* `flexDirection: 'row'` + `flexWrap`, and the shorthand
|
|
34
|
+
* `gap: <row> <column>` splits into RN's separate `rowGap`/`columnGap`
|
|
35
|
+
* (the single `gap` property would set both, which is exactly what this
|
|
36
|
+
* component must be able to avoid).
|
|
37
|
+
*
|
|
38
|
+
* As in `Box`, `childSpacing`/`lineSpacing` are numbers only — RN's gap
|
|
39
|
+
* properties take dp, not CSS strings — and `align`/`justify` keep the
|
|
40
|
+
* web's bare `start`/`end` keywords in the public API while mapping
|
|
41
|
+
* internally onto Yoga's `flex-start`/`flex-end`.
|
|
42
|
+
*
|
|
43
|
+
* `alignContent: 'stretch'` is set explicitly even though neither package
|
|
44
|
+
* exposes an `alignContent` prop — **CSS defaults it to `stretch`, Yoga
|
|
45
|
+
* defaults it to `flex-start`**, so without this line `align="stretch"`
|
|
46
|
+
* silently does nothing on RN whenever the children have no cross-size of
|
|
47
|
+
* their own: the line collapses to zero height before `alignItems` ever
|
|
48
|
+
* gets to stretch anything into it. Caught on-device (the stretch row of
|
|
49
|
+
* the example app's demo screen rendered empty); this restores the web
|
|
50
|
+
* version's behaviour exactly. It's a no-op in the ordinary case where the
|
|
51
|
+
* container hugs its content rather than having a fixed height.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Tag list
|
|
55
|
+
* <WrapBox childSpacing={6}>
|
|
56
|
+
* {tags.map((tag) => <Chip key={tag}>{tag}</Chip>)}
|
|
57
|
+
* </WrapBox>
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Looser gap between lines than between items
|
|
61
|
+
* <WrapBox childSpacing={6} lineSpacing={12} justify="center">
|
|
62
|
+
* {filters.map((filter) => <Chip key={filter}>{filter}</Chip>)}
|
|
63
|
+
* </WrapBox>
|
|
64
|
+
*
|
|
65
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.WrapBox.html
|
|
66
|
+
*/
|
|
67
|
+
export declare const WrapBox: import('react').ForwardRefExoticComponent<WrapBoxProps & import('react').RefAttributes<View>>;
|